Obscure the whole screen (status bar included) - android

I try to obscure the entire screen to have a focus on some elements when clicking on a button.
What i'm looking for
I'm looking for the same shadow created when a BottomSheet appear.
I tried to set a layout covering my entire view but obviously the status bar doesn't change. (I animate alpha on click)
I tried to use android:statusBarColor, android:windowTranslucentStatus, android:windowTranslucentNavigation and android:windowDrawsSystemBarBackgrounds but unfortunately my toolbar appear behind the status bar.
What I get

Related

How bottom toolbar will always be pushed up when keypad is used?

I want to place a toolbar at the bottom similar to the below, sample post compose, screenshot highlighted in green.
But the toolbar should be pushed up when the keypad comes up while entering text as below sample screenshot.
I can design the button toolbar, but no idea how to make it always visible when using keypad. Request to provide sample code for achieving this.
There are two modes for how Android can display the screen with the keyboard up- resize or pan. In pan, the application is scrolled up such that the cursor is assured to be on the page. In resize, the app is resized to fill the space left after the keyboard isplays.
You want resize. But that's not sufficient. Your layout for the screen needs to be such that the toolbar is fixed to the bottom of the screen and that the stuff above it is flexible in size. The best way to do this is to use a RelativeLayout or ConstraintLayout for the root, and to put the toolbar to align to the parent on its bottom. Make that top bar with the post button do the same with the top. Then have the stuff between them be fill_parent and have it layout below the top bar and above the bottom bar.
The end result of all that is that the top and bottom bars will be put in a fixed position, and the center part will be laid out inbetween. Note that this could result in some elements not appearing on screen until the keyboard is dismissed, because they won't fit. Putting the contents in a ScrollView can mitigate that problem, so the user could scroll to it.

How to show an overlay when pulled from top similar to the Quick Settings overlay in SystemUI application?

I have an application in which i want to hide the android status bar and make my application fullscreen. I have a set of indicator icons shown at the top row in a horizontal linear layout with a downward arrow at the middle of the view. On dragging the arrow down, i want to resize the view and show some detailed information of the indicators. This overlay should be pulled down above whatever existing content is present in my application till 50% of the height with the bottom background content losing focus and getting blurred. Something similar to the Status bar and Quick Settings overlay of SystemUI aosp application. How can i achieve this??

Navigation bar draw over content when using translucent status

So I'm having a small issue with the theme of my app. I have the android:windowTranslucentStatus set to true in the base theme and also have the android:fitsSystemWindows="true" to allow the background image to draw under the status bar. However this leads to another problem with my ListView. Basically it draws under the navigation bar and when you scroll to the end of the list it stuck under the navbar like this
I'm thinking about giving the listview a margin or padding value to avoid this but it seems ugly and probably not the right way. Anyone has a solution to this?

Android: ActionBar like the stock browser

I want my ActionBar to act like it does in the stock/default Android browser:
It visible at the top of the page, but as the user scrolls down, the bar scrolls out of view, how ever if you scroll the page upward towards the top, the bar comes in to view again, but will hide after some time out, when it does this, it does not affect the underlying view.
I've tried implementing auto-hiding using timers but when the ActionBar hides, it moves up the scrollable view underneath so it looks as is my whole page shifts up instead of the ActionBar floating over the top of the view.
You are looking for the action bar overlay mode in combination with the Quick Return pattern. That is the feature, where a view becomes visible on top again when the user scrolls up a little. See this excellent blog post describing this pattern. Don't miss the example implementation by Roman Nurik from Google.
Enable the overlay mode by requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY) before setContentView() or by setting the theme attribute android:windowActionBarOverlay to true.
Did you try the overlay mode on the ActionBar, getWindow().requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY)?
Then add a marginTop to your main layout.

Customizing Bottom Action Bar in Android

I want to use the split Action Bar - one on top, one on bottom. I know you can call it with this:
uiOptions="splitActionBarWhenNarrow"
My 2 questions are simple concepts:
I would like only two items on the bottom; one on far left, one on far right. Is this possible? It seems to be almost an overflow and pushes everything up top -- down to the bottom. Is there a way to control what items will show up on which bar?
Also, I have holo.light.darkactionbar theme. Yet, for the bottom bar, it keeps the light background AND the white text so you can not see the icons - is it possible to apply dark background like the top bar?
I would like only two items on the bottom; one on far left, one on far right. Is this possible? It seems to be almost an overflow and pushes everything up top -- down to the bottom. Is there a way to control what items will show up on which bar?
Unfortunately not. All action items will be pushed on to the bottom bar when using the split action bar. One way to get around this would be to not use the split action bar, and have a custom view at the bottom holding buttons for all the items you want at the bottom. You'd probably be able to emulate the style of an split action bar fairly well using themes.
Also, I have holo.light.darkactionbar theme. Yet, for the bottom bar, it keeps the light background AND the white text so you can not see the icons - is it possible to apply dark background like the top bar?
This sounds odd and isn't standard behaviour (both bars are dark in my app), are you using a custom theme? If you want to override this manually, define a theme with a custom android:backgroundSplit value as shown on the Android Developers website.

Categories

Resources