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.
Related
I wanted to know how to use Bottom Nav View and AppBarLayout as an overlay and animate them (hide/show together on touch) just like apps like Camscanner do when viewing image? I want this behavior so that the canvas beneath it can use fullscreen.
Update
Note: This screenshot is from Gallery Go app by Google, it also hides the ActionBar and BottomNavBar.
Update 2
I used the UiAutomatorViewer to check the app's UI and found that it actually uses a LinearLayout with ImageViews for the AppBar and TextViews for the Bottom Nav View.
How do we achieve animations like the full screen example at this link:
https://material.io/components/dialogs/#full-screen-dialog
What I mean is the toolbar animations (hamburger icon to close icon, menu items), and the content expanding from right bottom to full screen. I also wonder how toolbar stays at the same place whereas content expands.
Are these custom view based animations packed together or is it somehow available to be used?
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??
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.
I am writing an Android app but cannot figure out how to have a layout over another layout that can animate up and down to show and hide its contents, but have the bottom layout's imageview, shrink to fit the new area.
An example of what I am trying to do is in this iPhone app.
http://itunes.apple.com/gb/app/alex-ze-pirate-comic/id526432227?mt=8
Screenshots 2 & 4 show the states that I mean. When the top layout goes down to leave just the toolbar, the imageview gets taller to use the extra space provided.
Hope you understand me.
Thanks,
Ashley
The ImageView in this case will stay the same. Your second View will simply be covering it for some time. You can achieve this effect using a sliding drawer.