android-toolbar

Right Drawer - how to add Toolbar button?

╄→гoц情女王★ 提交于 2020-01-14 05:33:41
问题 I have extended the well-known Google Navigation Drawer Example by adding Toolbar and right-side Drawer in a simple test project at GitHub: How to add a "burger" button to the Toolbar - which would open the right Drawer (currently you can only swipe it with a finger)? The "burger" button for the left Drawer is already there and works well (probably added by ActionBarDrawerToggle?) Here is my current activity_main.xml: <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas

Removing left margin from android navigation drawer icon

纵饮孤独 提交于 2020-01-13 09:45:18
问题 Can anybody help me to find the way to remove the left margin of the navigation drawer icon (mentioned by red rectangle below )? I am using toolbar here. 回答1: This removes the left margin from toolbar. mainToolbar.setContentInsetsAbsolute(0, 0); Or you can set left inset to 0dp in toolbar xml: android:contentInsetLeft="0dp" Other way is to define that padding in the styles.xml: <style name="ToolbarStyle" parent="@style/Widget.AppCompat.Toolbar"> <item name="contentInsetStart">0dp</item> <item

android.view.View$OnUnhandledKeyEventListener

て烟熏妆下的殇ゞ 提交于 2020-01-11 17:12:05
问题 I am new to Android Studio and I don't get why my toolbar isn't shown as described by https://developer.android.com/training/appbar/setting-up I know there are already some other questions like mine on stackoverflow but they don't work at my project. Therefore I would be very thankful for fixing this issue. Screenshot: java.lang.ClassNotFoundException: android.view.View$OnUnhandledKeyEventListener at org.jetbrains.android.uipreview.ModuleClassLoader.load(ModuleClassLoader.java:180) at com

How to fix a view in collapsing toolbar while scrolling?

孤人 提交于 2020-01-11 03:16:06
问题 I want to implement collapsing toolbar with two EditText in it, for the purpose of user input. I'm following this answer. The answer gives perfect solution for adding two EditText into the collapsing toolbar. But the behavior is not as expected. What I've achieved: Expected Behavior: My XML code <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent"

Remove margin in android toolbar icon

蹲街弑〆低调 提交于 2020-01-10 00:59:29
问题 I get this weird margin in my app toolbar between icon and navigation icon in the toolbar (as in the image). I've got no idea about where it comes from and how to remove it. After searching the internet I found this: <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_height="wrap_content" android:layout_width="match_parent" android:fitsSystemWindows="true"

collapsing toolbar layout like google play store

社会主义新天地 提交于 2020-01-09 09:12:11
问题 i want to make a collapsing toolbar layout like google play store. like this: https://sendvid.com/ugjspx8r and here is my layout: http://sendvid.com/s4mx3xem how can i do that with new android support library? here is my layout xml file: <android.support.design.widget.CoordinatorLayout xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android

Remove large padding after hamburger (menu) icon in Android Toolbar?

柔情痞子 提交于 2020-01-09 03:44:05
问题 Here is a picture of the large padding gap after the menu icon: This occurred after not working on my project for a month (summer school). I just came back to it and noticed this larger than normal gap on the toolbar after I updated Android Studio. I can't find any questions/solutions about this on SO. If anyone can help that would be very much appreciated. I am loading the hamburger icon by doing this (each line is properly placed in the app, in either the class declaration, onCreate(), etc.

Different toolbar for each fragment or change Scroll Behaviour in new Coordinator Layout?

不羁的心 提交于 2020-01-07 09:05:35
问题 I implemented the Navigation Drawer by using the template provided by Google in New Android Studio 1.4. Here it automatically created everything including the layout and class. This is my 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=

Toolbar not scrolling when using collapsing toolbar effect

杀马特。学长 韩版系。学妹 提交于 2020-01-06 19:35:10
问题 I am using below layout to use collapsing toolbar effect but not able to expand toolbar.I want to expand the toolbar as given here for collapsing toolbar effect. https://guides.codepath.com/android/Handling-Scrolls-with-CoordinatorLayout <android.support.design.widget.CoordinatorLayout android:id="@+id/coordinatorLayout" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height=

Toolbar isn't in the center of the AppBarLayout

流过昼夜 提交于 2020-01-06 18:52:28
问题 I used this example to build a layout with two NavigationViews: http://v4all123.blogspot.de/2016/03/simple-example-of-navigation-view-on.html It works fine. But also in the demo on this site you can see, that the Toolbar isn't 100% in the middle. The left button has more space to the left than the right button to the right border. Take a look to the screenshot from Android Studio. I've tried to center each view but the only way to get the same space left and right is to add a padding to the