android-toolbar

Android Toolbar “Up” Arrow in custom implementation

99封情书 提交于 2019-12-11 06:03:50
问题 I am making a very custom Toolbar (don't freak, it's for good, not evil, I promise), and I want to put the "Up" arrow (the arrow that appears when there is a parent Activity set or for other reasons and has the nice ripple touch effect on Lollipop) in a custom location. Is there a way to get this arrow as a View or asset to use somewhere else in the Toolbar? I could not even find the image asset for the arrow. Any ideas? For an example, I want top be able to do something like: mToolbar

Hide and show statusBar with Toolbar at the same time in android

徘徊边缘 提交于 2019-12-11 05:53:18
问题 I know this question asked many time and I tested solutions which provide but none of them works. I want to hide StatusBar and Toolbar so I use following code to hide statusBar base on documentation: int flags = View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION; getWindow().getDecorView().setSystemUiVisibility(flags); And this code for showing statusBar : getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE); It's works but When I hide statusBar my

Toolbar - No drawer view found with gravity LEFT

好久不见. 提交于 2019-12-11 05:07:18
问题 I have a problem with my toolbar on one activity with 3 tabs. It works on all other pages of my app, but for some reason crashes when I try to click the menu on this page. Here is the error: java.lang.IllegalArgumentException: No drawer view found with gravity LEFT at android.support.v4.widget.DrawerLayout.openDrawer(DrawerLayout.java:1618) at android.support.v7.app.ActionBarDrawerToggle.toggle(ActionBarDrawerToggle.java:290) at android.support.v7.app.ActionBarDrawerToggle.access$100

Android AppCompat Toolbar does not respond to touching action items

╄→гoц情女王★ 提交于 2019-12-11 04:17:45
问题 I'm following these instructions to implement an AppCompat Toolbar in my Android app. I am using AppCompat version 7:22.0.1 Also, I'm using this toolbar in addition to the actionBar (it's not replacing the ActionBar , as I see in many other examples). The toolbar shows up, and it even shows the icon I specificed, but it does not respond when I touch the icon. Has anyone had a similar problem with the AppCompat Toolbar ? Any suggestions on what to try next? Here's my code from my browse()

Views overlapping with toolbar

拈花ヽ惹草 提交于 2019-12-11 03:34:24
问题 I have a simple app with one Activity . Currently Views are overlapping with my toolbar : I want Views to go under the toolbar , not into it. How do I do this? activity_main.xml : <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawer_layout" android:layout_width="match_parent" android

Android Toolbar Action button height

青春壹個敷衍的年華 提交于 2019-12-11 01:59:33
问题 I have res/layout/toolbar.xml which is: <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?actionBarSize" android:elevation="4dp" style="@style/ToolbarStyle"> </android.support.v7.widget.Toolbar> Here is my usage of toolbar: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas

Dimmed Background of PopupWindow excludes Toolbars / Action Bars

十年热恋 提交于 2019-12-11 01:59:16
问题 I use the following codes to create a PopupWindow with dim background by clicking a menu item in Toolbar : @Override public boolean onOptionsItemSelected(MenuItem item) { switch(item.getItemId()) { case R.id.btn_1: Log.i(TAG, "Clicked Button 1"); LayoutInflater layoutInflater = (LayoutInflater)getBaseContext().getSystemService(LAYOUT_INFLATER_SERVICE); View popupView = layoutInflater.inflate(R.layout.popup_window, null); final PopupWindow popupWindow = new PopupWindow(popupView, Toolbar

Android, Position Menu Items in Toolbar Layout

二次信任 提交于 2019-12-11 01:01:01
问题 I have two toolbars (top and bottom), as shown: The two toolbars are defined in their own xml files, nothing special: top_toolbar.xlm <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/ColorPrimary" android:elevation="4dp" android:theme="@style/ThemeOverlay.AppCompat.Dark"> </android.support.v7.widget.Toolbar> bottom_toolbar.xlm <android.support.v7

Adding backbutton on top of child element of Toolbar

两盒软妹~` 提交于 2019-12-10 21:35:56
问题 I have the following Layout file. How can I add a back button (arrow) on top of (or overlayed on, like a z-index) the Imageview child of Toolbar in my below layout? <LinearLayout android:layout_height="wrap_content" android:layout_width="fill_parent" android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android"> <Toolbar android:layout_width="fill_parent" android:layout_height="600dp" android:id="@+id/toolbar" android:background="#313B45" android:weightSum="1"

Line coming between toolbar and Tabs

梦想的初衷 提交于 2019-12-10 18:58:29
问题 How to remove the deep line between the toolbar and tablayout, I searched on the google someone said , add some elevation to the toolbar and tablayout ,I did but it not worked , after removing the elevation from the toolbar and tablyout ,it's also not working.Please help me out : tablayout_xml: <RelativeLayout android:id="@+id/main_layout" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com