How create fullscreen in android 4.0? - android

Hello,
I need do fullscreen in android 4.0 (I must hide back button, home...)
I used android:theme="#android:style/Theme.NoTitleBar.Fullscreen"
but it doesn't work.

Homebutton and backbutton cannot be hidden...
Users always need to have access to these buttons, so the black bar will always be on the screen

Like write K_Anas in a relative question, it is not possible hide Homebutton and backbutton in Android 4.0, for security reasons and because is a simply anti-pattern solution.

You can use SYSTEM_UI_FLAG_HIDE_NAVIGATION to hide the system navigation temporarily, but it will always reappear when the user touches the screen. Even the notification bar will reappear when the screen is touched.
You are not allowed to hide the system bar with the home button completely for security reasons.

Related

Android: Lock navigation bar as Keypad lock screen does

I've been trying to lock the navigation bar on Android for 3 weeks so that the user can't send my activity to background. I need to do this to get my lock screen app more secure (I know that writing a custom lock screen is not the best idea but it's a requirement).
I've tried immersive mode, system dialogs, flags on decor view, onKeyDown, onBackPressed (this one works for the back button), reorder_tasks and moving my task to the front (this only works when I click on recent apps) and the usage API.
I've found this app: https://play.google.com/store/apps/details?id=com.wow.keypad.lock.screen which does EXACTLY what I need to do but I don't know how they did it.
Could anyone please help me?
I need a permanent solution like the one these guys from WOW have done.
Thanks!!!
How To Hide Navigation Bar Permanently In Android Activity
It looks like something like this has already been tackled. Your main task would not be to lock the nav bar, as much as just hide it so that the user cannot access it.

Android hiding the navigation bar causes buttons and gestures to not be picked up at first

I recently added the following code to my app to remove the navigation bar (soft buttons) from some phones. This caused some resizing issues with my app so getting rid of the navigation bar was ideal.
getWindow().requestFeature(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
See more: https://developer.android.com/training/system-ui/navigation.html
This does exactly what I wanted. The soft buttons are no longer present on devices such as the Nexus 5. However, this caused the side effect of disabling and touch or gestures until there is at least one touch event first. For example, I have some buttons on the home screen. With the above code, tapping on the button the first time does nothing. From the second time onwards, the app behaves like normal. My app also uses a viewpager, and swiping to other tabs or selecting another tab from the action bar also has no effect until I tap somewhere on the screen first.
Obviously, this behaviour is not wanted. When the user opens the app and selects one of the buttons, they expect the button to be clicked. Instead, they'd have to tap the button twice (and then everything works fine from that point on).
I'm testing this on the Samsung Galaxy S3 (which does not have the navigation bar along the bottom) and the Nexus 5 (which does have the navigation bar along the bottom).
Edit: Further research - Hiding the navigation bar is only temporary. The navigation bar is requesting focus for the first touch event, since the navigation bar is meant to pop back up as soon as there is any kind of ui event. So even on the Galaxy S3, which has no navigation bar in the first place, the touch event is being sucked up by the navigation bar. For devices that really do have a navigation bar, the bar will reappear on every interaction and you must tell the device to hide it again. As far as I can tell, there is no way to permanently hide the navigation bar.
My next question is to find out how it is possible to query the device to see if there is a navigation bar. If I know that the device does not have the navigation bar, then there is no need to try to hide it and have the OS absorb the first touch event.
SYSTEM_UI_FLAG_HIDE_NAVIGATION is designed for passive activities like watching videos and maybe reading books. For your purposes, immersive mode is a better choice. https://developer.android.com/training/system-ui/immersive.html
More specifically you may want to add the SYSTEM_UI_FLAG_IMMERSIVE_STICKY flag together with SYSTEM_UI_FLAG_HIDE_NAVIGATION, so that the navigation bar is hidden and will stay hidden until user swipes from top or bottom.
Note that a "reminder bubble" will appear the first time a user enters this mode in your app.

Android 4 overlay/replace/hide soft buttons

I'm currently working on an app for blind people. What I need is to prevent users from accidentally going outside of my app, so I'm trying to overlay/replace/hide soft buttons in Android 4. I know this must be possible because it is used for example in MXPlayer (you can "lock" screen when playing video).
I've tried to override all three buttons (back,home,recent apps). No problem with back and home, but I couldn't figure out how to override(disable) recent apps. I've tried solution described here without success.
Next idea was to overlay the entire screen. I've successfully created system overlay mentioned in this question, but I didn't find out how to overlay my soft buttons.
Do you have any idea how to solve this problem without rooting the phone and using custom ROM?
edit: I've also tried hiding the buttons with SYSTEM_UI_FLAG_LOW_PROFILE(turns buttons into dots) and SYSTEM_UI_FLAG_HIDE_NAVIGATION(hides buttons till next touch). Unfortunately this also doesn't solve my problem because after touch buttons work as usual. Maybe there's a way how to catch "unhiding" a override showing them again?
From Android docs :
The SYSTEM_UI_FLAG_LOW_PROFILE flag replaces the STATUS_BAR_HIDDEN flag. When set, this flag enables “low profile" mode for the system bar or navigation bar. Navigation buttons dim and other elements in the system bar also hide. Enabling this is useful for creating more immersive games without distraction for the system navigation buttons.
The SYSTEM_UI_FLAG_VISIBLE flag replaces the STATUS_BAR_VISIBLE flag to request the system bar or navigation bar be visible.
The SYSTEM_UI_FLAG_HIDE_NAVIGATION is a new flag that requests the navigation bar hide completely. Be aware that this works only for the navigation bar used by some handsets (it does not hide the system bar on tablets). The navigation bar returns to view as soon as the system receives user input. As such, this mode is useful primarily for video playback or other cases in which the whole screen is needed but user input is not required.

Kindle Fire status bar and soft key bar bug

I am developing a magazine reader application aimed at the Kindle Fire. In landscape mode the built in softkey bar and status bar in the Kindle's operating system leave little room for my content so I have opted to run the activity in fullscreen mode using the following theme for the activity:
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"
This works fine, the status bar is hidden and the softbar is minimized like so:
I can bring up the menu bar by dragging it up like so:
The bug arises when I then click somewhere on screen to dismiss the softkey bar. The bottom bar slides back away, the top one does too but the space that it took up becomes a black void and my app is pushed down underneath it so my tab bar at the bottom of the app is now unusable:
I am using a tabhost activity here and the tab I am on in these screenshots is the actual reader section of the app. This subactivity uses a PDF viewer widget which is written using native code and this bug only happens on this tab. If I switch to one of the other tabs which contain no JNI code this bug does not happen so I'm pretty sure its the combination of the Kindle Fire OS, the fullscreen activity and the use of JNI code.
Has anyone else experience this issue?
Any help much appreciated!
Thanks
There are a couple of fullscreen modes for the Fire (at least the new ICS based ones) - check out https://developer.amazon.com/sdk/fire/cx-guidelines.html#Fullscreen for the options. I suspect the ICS Full Screen mode will be what you need
Also it's probably worth trapping the onOrientationChanged and onSizeChanged events to make sure you re-draw the screen correctly when the menu/toolbars appear and disappear per the screen layout sample at https://developer.amazon.com/sdk/fire/samples.html

android 4.0 FullScreen

i want make Fullscreen in android 4.0, i use android:theme="#android:style/Theme.NoTitleBar.Fullscreen"
the action bar is disappear, but the status bar isn't appear
i use
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
before "setContentView()"
OK, FullScreen!! however, when the dialog or popupwindow show, the status bar appear again,
i read the source code and find the word :
There is a limitation: because navigation controls are so important,
the least user interaction will cause them to reappear immediately.
can i make fullscreen anytime? help me!
There is a limitation: because navigation controls are so important, the least user * interaction will cause them to reappear immediately.
In other words, Android is telling you that the limitation exists because it would be a bad idea to prevent the user from accessing the navigation controls. Doing so would surely disrupt the user experience and would probably piss off a lot of users. That said, unless you have a very good reason for doing so, you should leave it the way it is.

Categories

Resources