android-toolbar

how to center icons in toolbar in android studio

╄→尐↘猪︶ㄣ 提交于 2019-12-09 05:22:11
问题 I asked a similar question here... I got some tutorials in the answers. But this question is diffrenet. because none of that method do not works in my project. I want center all icons in toolbar I test all availabe ways ...but always icons are floating in left. I want centering icons (I prefer left icon floats left and right icon floats right and other icons floats center) Activity.Main.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas

Toolbar With Horizontal ProgressBar underneath

我只是一个虾纸丫 提交于 2019-12-09 05:02:10
问题 With the new Toolbar API in Android Lollipop and AppCompat-v7, they are removing a lot of the automatic features to make Toolbar/ActionBar more robust. One of those things is the progress bar. Since Toolbar is simply a ViewGroup, I assumed adding a ProgressBar would be simple. However, I cannot seem to get it to work properly. I have done the following (using the SmoothProgressBar library): // I instantiate the toolbar and set it as the actionbar mToolbar = (Toolbar) findViewById(R.id.toolbar

android title won't show in toolbar

痞子三分冷 提交于 2019-12-09 02:07:22
问题 I have an xml that I use with so many activities with fragments file but my problem is that I can't display the text I want in the toolbar, I use that xml that way because I have a navigation drawer and I needed to handle somethings so I had to do it that way. my xml: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/frame_container" android:layout_width="match_parent" android:layout_height="match_parent"

How to change android top toolbar menu item icon size

 ̄綄美尐妖づ 提交于 2019-12-08 17:38:17
问题 How can I change the size of a menu item in the android toolbar? Currently the menus have a very small size and I want to increase the size. If anyone knows please help me to find a solution. app_bar.xml <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/primaryColor" android:minHeight="?attr/actionBarSize"

MenuPopupHelper cannot be used without an anchor

三世轮回 提交于 2019-12-08 17:37:47
问题 I want add PopupMenu to my MenuItem . Menu.xml <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <item android:id="@+id/date" app:showAsAction="ifRoom|withText" android:title="Date" android:visible="true"/> <item android:id="@+id/category" app:showAsAction="ifRoom|withText" android:title="Category" android:visible="true"/> </menu> When I click on MenuItem I call this code: @Override

ActionBarDrawerToggle cannot be applied to Android.support.v7.widget.Toolbar

白昼怎懂夜的黑 提交于 2019-12-08 17:20:40
问题 I keep getting the error saying ActionBarDrawerToggle cannot be applied to v7.widget.Toolbar and because I looked at how others fixed a similar issue they are now both support library files but the error doesn't go away for some reason. The error says ActionBarDrawerToggle() in ActionBarDrawerToggle cannot be applied to android.support.v7.widget.Toolbar then under actual argument R.id.drawable_ic_drawer (int) import android.support.v7.app.ActionBarDrawerToggle; import android.support.v4.view

Why is the back arrow in the toolbar not shown?

◇◆丶佛笑我妖孽 提交于 2019-12-08 13:04:34
问题 My Problem is about the android toolbar. I want to activate the back arrow, to go back to the main menu. I used the expression getSupportActionButton.setDisplayHomeAsUpEnabled(true) . When I tested the app, the arrow was not shown. I couldn't find any solutions to solve my problem. When I used the getSupportActionButton.setDefaultDisplayHomeAsUpEnabled(true) -expression, I got the error ActionBar.setDefaultDisplayHomeAsUpEnabled can only be called from within the same library group (groupId

android create badge on custom toolbar without menu items

房东的猫 提交于 2019-12-08 11:58:35
问题 In my app we have to use custom app-bar/ToolBar. With that now we have to implement badge (add cart with counting). below is my tool-bar xml (toolbar.xml) <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/blue_074A92" android:elevation=

How to Control Menu Position in Toolbar Android

Deadly 提交于 2019-12-08 08:59:36
问题 I want to change the gravity of my inflated menu item in android xml code but i could not find any attribute to solve the problem. i want an item in the left side and another item in right side of corner in Toolbar . Do you have any idea guys? Here's my present state: Here's my menu xml: <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <item android:id="@+id/dismis" android:icon="

Set toolbar for all Activities

天涯浪子 提交于 2019-12-08 06:58:29
问题 In my app I would like to make a unique toolbar for all activities except for mainActivity. I have written this code for set Title and logo, but in toolbar I also have username logged. So I have written in my dashboard activity this code: Toolbar myToolbar = (Toolbar) findViewById(R.id.my_toolbar); setSupportActionBar(myToolbar); getSupportActionBar().setDisplayShowTitleEnabled(false); assert myToolbar != null; myToolbar.setLogo(R.mipmap.logo_big); TextView usernameField = (TextView)