sparrowcode / PermissionsKit

Universal API for request permission and get its statuses.
https://x.com/sparrowcode_ios
MIT License
5.64k stars 462 forks source link

Question: Is there a way to keep the status bar displayed? #132

Closed alanpridestar closed 5 years ago

alanpridestar commented 5 years ago

Hi,

Firstly I must say your project is great and extremely handy. Really appreciate your work.

I wanted to ask about the status bar and it's animation in the app. I will provide some screenshots to illustrate what i mean.

IMG_1514

IMG_1512

As you can see in the first screen shot, I show the SPPermissionDialog on top of a Video Recording View Controller i've set up. In the second screen shot, once the dialog has stopped showing, the status bar pushes my top most views down a bit and suddenly my camera preview view is overlapping with my record button.

I have tried to relayout the subviews once the didHide() function is called in the SPPermissionDialogDelegate, and I have tried to set prefersStatusBarHidden to false in the SPPermissionDialogController code, but both of these haven't helped. I've also gone through the Controller code and found where you are operating on or with the status bar and tried to set the value to statically keep the status bar showing, but that also hasn't worked.

I was wondering if you have any suggestions on how I can deal with this scenario.

Thank you, Alan

JCsplash commented 5 years ago

Same issue here. Love all the work you do Ivan. Keep it up man.

ivanvorobei commented 5 years ago

Hi @alanpridestar & @JCsplash! You can create simple project and send here? I am try add fix for it situations

Sorry for delay, I am very busy with a new project.

alanpridestar commented 5 years ago

Hi Ivan,

Sorry I did not notice this until now.

I was able to recreate the issue. I believe that it happens when you have a view directly attached to the top of the safe area, and then other views attached to the bottom of that. I have added a small Demo here and I noticed that if i removed the top most view (the grey one), then the large middle view does not push downwards. But in the case of the demo I've uploaded then the status bar pushes the views downwards. Have a look and let me know your thoughts.

It's probably best to build this on an iPhone 8 sized device/simulator because it will start with a gap between the middle and bottom view, which will then be removed.

Thanks, Alan

SPPermissionStatusBarBug.zip

ivanvorobei commented 5 years ago

@alanpridestar yes, I see it.

There are two solutions: enable the status bar forever, or configure it in delegate.

alanpridestar commented 5 years ago

@ivanvorobei,

Sorry I didn't get what you mean exactly. How can i enable the status bar forever?

Thanks, Alan

ivanvorobei commented 5 years ago

@alanpridestar I prepare two solution

1) set status bar for forever for all users 2) or allow set forever in delegate

maybe 2?

alanpridestar commented 5 years ago

Yes I understand, it works

Thanks again

ivanvorobei commented 5 years ago

Good. I will then soon add a new parameter in the delegate

ivanvorobei commented 5 years ago

I am added new parameter in datasource. Set alwaysVisibleStatusBar to true. Also need update SPPermission to last version.

Thanks and sorry for delay! I am soon full redesign SPPermission and write more clean code.

JCsplash commented 5 years ago

Thanks @alanpridestar for creating the example. And thanks @ivanvorobei for working so quickly!

ivanvorobei commented 5 years ago

Also agree, thanks @alanpridestar )