Android 4.0 phones only have virtual buttons, which actually go invisible when playing youtube/video at fullscreen (the video portion takes over where the buttons are).
I want to do this, but haven't found a way.
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"
or
requestWindowFeature(Window.FEATURE_NO_TITLE);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
do not cover the virtual buttons.
Here is an example that shows the type of full screen I'm talking about:
http://www.youtube.com/watch?v=Lw_O1JpmPns
Okay, I added this SYSTEM_UI_FLAG_HIDE_NAVIGATION flag to my video activity and that hid the virtual buttons.
WebView view = new WebView(this);
view.setSystemUiVisibility(WebView.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
Another choice is to use the SYSTEM_UI_FLAG_LOW_PROFILE flag. This doesn't hide the buttons though. Instead it makes the buttons go to "Low Profile" mode (basically turns them into little dots)
This works on my device but not in the emulator. Add this tho your activity in AndroidManifest.xml:
<activity ...
android:theme="#android:style/Theme.DeviceDefault.NoActionBar.Fullscreen" >
Inside the onCreate() of your Activity, add this:
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
this.getWindow().getDecorView()
.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
Worked well for me (but is not Honeycomb-compatible).
To make the buttons completely invisible, you should do
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
this.getWindow().getDecorView()
.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_IMMERSIVE);
The buttons would not use any space on the screen, unless you swipe up from the bottom of the screen. Notice that you need to target at SDK version 19 for this to work.
Related
As you can see in the image below, every time I open a project in Android Studio, the layout decorations option is deselected. How can I have it selected for default?
look on the top left of constraintLayout that you currently open, click on the eye icon and then click Show Layout Decorations. then you will be able to see it. but i don't know how to access it.
I think is not possible. I never see about that the solution
Im learning Android studio now and encounter this problem with Layout Preview. I cant see phone frame.Ok, it's not big deal, but in result I see that the toolbar was not counted in design. For better understanding look at picture Virtual Device and Layout preview comparison. For layout preview and virtual device I picked Nexus 6. Screen sizes should be exactly the same. In the picture you can see the button in the layout preview. But in the virtual device the button is almost completely out of the screen bounds.
This is a link to my app
HelloWorldApp
WORKS!!!
Click that 'eye' icon and select the 'Show layout decorations'. Done.
Try this,
Click on Preview-> Visibility Symbol which named as view options
There is one option, Show Layout Decorations , Select this options.
For reference find below image:
I hope its work for you.
You can try to select device and theme for your preview window see attached image
https://i.stack.imgur.com/RB0QG.png
In the new version, you can see this feature in the 'layout validation' vertical bar on the right.
Am I thick or what? I have a view controller, and within that there is a UIWebView. When I run the app, the WebView covers the UIToolbar at the bottom and the UIButtons there, and so you cannot navigate away from the WebView. I cannot figure out how to change the WebView size or behaviour.
Unfortunately I do not have sufficient rep to post screenshots. The WebView displays an html file with text. The WebView partially covers the status bar at the top and completely covers the taskbar at the bottom. I can touch and drag the view up to see the taskbar and buttons at the bottom, but cannot use them.
I am using storyboard to build the app, and have done similar apps before without issue (in iOS6) but iOS7 appears to have thrown me a curveball.
I cannot see how to change the size in Xcode - or should I be looking at the html code in the file that the WebView is calling?
Oddly enough this is no longer an issue, I have not made any changes to code or config, and the only thing different is I upgraded my version of X-Code
I have an android spinner which I call via the performClick method to show a list of items (the actual control is hidden from the user and is called from a checkbox, too complex to explain why I have done it this way).
If I do not want an item in the list, how can I dismiss the popup by clicking on the black area?
Does this make sense? :/
Edit: Sorry, forgot to mention that the users will not be able to operate the bottom buttons (device is going to be galaxy tab) as they will be covered up with protective layer due as they will be outdoors.
usually such a control is dismissed using the back key in the android applications. So I would suggest that you find a way to do it the same way on your control.
'Esc' button should do the same job..
Usually in landscape mode an EditText will open the IME in full screen mode, but for an textfield inside a webview (loaded as a HTML content) it doesn't and it pushes the existing view upwards. Tried using 'adjustpan' options but to no avail. Is it possible to change the IME in this scenario? Thanks in advance...
'adjustPan' might not work unless you specify the option for all of the views in the tree, not just the activity. Take a look at this answer for more info: https://stackoverflow.com/a/7183626/758458