I am new to Android development I am building an app but from last three days, I am stuck while making toolbar I am very confused. I want to make toolbar like this
The widget elements in your design are the following from left to right:
Navigation Drawer Indicator
ImageView
SearchView
Toggle
Overflow Menu
These can all be implemented using default widgets. It is not common to put a profile image to the right of the title, but you could do this by putting a custom layout inside the toolbar view.
It is also not common to place a toggle in the action bar, but it is possible using an ActionLayout.
Related
I have used Google's solution for multiple back stacks in Navigation Component. I want to setup a custom AppBar at the activity level(Idea is to have a Toolbar, A FragmentContainerView, and BottomNavigationView)
This works fine except this sets the title of the Toolbar automatically (doesn't call any particular method in the file I have linked as far as I know) .
I want to build a custom toolbar which has a TextView with multiple colors(As in half of the title is black , other half is yellow).
Any solution how to build a custom toolbar in this solution would be greatly appreciated
You can read this document about handle navigation component back stack with appBar configuration
https://developer.android.com/guide/navigation/navigation-ui
and also you can watch this course for make custom toolbar
https://m.youtube.com/watch?v=e5_C9e_gKOM
I'm working with Android TV for the first time and I'm learning to use Leanback.
In my TV App, I need to implement the Header(Navigation Drawer) where the icon should always be visible while collapsing drawer similar to Voot Android TV App
Reference Code https://corochann.com/browsefragment-header-customization-android-tv-application-hands-on-tutorial-17-697.html
When the focus moves to the right side, the header is collapsing fully(including title and icon). In my case, I want to collapse the header into the title and I need to show only icons in the header.
Below I have added the screenshot of Voot app for better understanding of my requirement
Expanded Header/Navigation Drawer ScreenShot
Collapse Header/Navigation Drawer ScreenShot
We cannot achieve this with Leanback only. I have written a custom navigation menu fragment especially to work with RowsSupportFragment and it manages focus & selection as well.
Check out this TVNavigationMenu repository
I have an app, which have an action menu item on the right (2).
I need an ulterior menu in the left(1) or a button in the action bar, is that possible?
I attach a image.
enter image description here
You may create a custom toolbar. The standard height of a toolbar is 89dp.
To create a custom toolbar you should make your activity view container RelativeLayout. Then create a custom toolbar view (it may also be RelativeLayout) which height is 89dp. Then add your toolbar to the main container and set alignParentTop to true. So you have a custom flexible toolbar and you can add any view to it.
This way is very comfortable to use any custom views on your toolbar.
I also faced the same situation of customizing action bar. After a lot of searching I got the solution which is Toolbar.
Checkout: https://developer.android.com/training/appbar/setting-up
I think from now on, you should start using Toolbar as the default action bar for your apps. It provides high level of customization and material design features.
I am following this tutorial. The tutorial basically helps to create a sliding tab menu by using the AppCompat library. It basically creates a custom toolbar using the tabs and then replaces the standard ActionBar with this toolbar.
It works perfectly, but I do not wish to show the title. I only want the tabs at the top of the screen to be my main navigation. On my activity I have set
getSupportActionBar().setTitle(null);
but this only makes the text for the title blank. Space (padding?) is still reserved for the title. How do I remove it?
The picture below shows the problem visually.
I am using the newest AppCompat library and replaced the SupportActionBar with a Toolbar, as suggested by the Android developer's blog. I want to display a second Toolbar at the bottom of the screen, that shows an additional Menu from some xml menu resource, but nothing else.
I have two problems with that:
Although nothing but a Menu is displayed (using Toolbar.inflateMenu()), the Menu occupies only a small space on the right side of the toolbar.
The Overflow Action Menu expands to the bottom of the toolbar and is therefore not shown. It should expand to the top.
Here is a screenshot of the bottom Toolbar:
How can I solve those issues without being forced to create custom views for my Buttons?