android-appbarlayout

BottomNavigationView does not hide on scrolling inside fragment, if fragment contains AppBarLayout

隐身守侯 提交于 2019-12-07 14:41:05
问题 I'm having a lot of problems with scrolling and detection of it inside fragments using coordinatorLayout in Android. I have a "MainActivity" that contains 3 fragments. In one of those fragments I have an Appbar that collapses when fragment is scrolled. I've managed to do that, but if I set scrolling behavior to allow that, my bottomNavigationView (which is found in mainactivity.xml) does NOT react to scrolling. Codes go something like this: Fragment1.xml <android.support.design.widget

How insert a LinearLayout between AppBarLayout and the scrolling content, when using CollapsingToolbarLayout

三世轮回 提交于 2019-12-07 12:50:04
问题 I'm using a CoordinatorLayout with CollapsingToolbarLayout. I'm trying to put a LinearLayout below AppBarLayout and above the scrolling content, and I want that this LinearLayout stays always fixed on the screen (with AppBarLayout hidden or not), not scrolling with the content. Is this possible? So far, I have the following code: <android.support.design.widget.CoordinatorLayout android:layout_above="@+id/linearLayout" tools:context="..." android:layout_width="wrap_content" android:layout

Custom layout in Toolbar with TabLayout below

可紊 提交于 2019-12-07 07:31:07
问题 Right now, I have a normal looking Toolbar . What I want to do is add a custom layout between the Toolbar and the TabLayout , as shown in the picture below: On the left is what my Toolbar looks like now, and on the right is what I want it to look like. As you can see, I want to add an ImageView and two TextView s to the layout. How can I achieve this? Here is my current layout: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http:/

CoordinatorLayout adds space between AppBarLayout and RecyclerView

杀马特。学长 韩版系。学妹 提交于 2019-12-07 06:14:04
问题 CoordinatorLayout adds space between AppBarLayout and RecyclerView . Not sure whether its the Toolbar or AppBarLayout . Screenshot of the rendered layout on phone: The design rendering on Studio doesn't how this space. Any idea on what's going on? The Code Itself. <?xml version="1.0" encoding="utf-8"?> <FrameLayout 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

Android toolbar show title and subtitle only when AppBarLayout collepsed

夙愿已清 提交于 2019-12-06 03:33:31
问题 I have activity with AppBarLayout ,CollapsingToolbarLayout and toolbar. Setting title and subtitle from code. Initially i want toolbar hidden and show when Appbar layout collapsed, With my code its working (toolbar hide initially) but its showing toolbar title and subtitle always. How do i show title only when appbar layout collapse completely <android.support.design.widget.AppBarLayout android:id="@+id/app_bar" android:layout_width="match_parent" android:layout_height="@dimen/app_bar_height"

CollapsingToolbarLayout in fragments

☆樱花仙子☆ 提交于 2019-12-06 01:41:56
I have an AppCompatActivity that contain fragments and it controls the replacing of many fragments. I want to show differents toolbar depending of fragment to show. This is the code for main_activity.xml: <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" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.inthecheesefactory.lab.designlibrary.activity.MainActivity"> <android.support

How to remove top and bottom padding from android.support.v7.widget.Toolbar?

随声附和 提交于 2019-12-06 00:34:41
问题 I am trying to place a SlidingTabLayout inside my android.support.v7.widget.Toolbar but for some reason there is extra top and bottom padding in portrait layout. As shown in this screenshot: In landscape layout the android.support.v7.widget.Toolbar is shorter and the extra padding is gone: I am aware of the contentInsertStart and contentInsetEnd attributes but there does not appear to be anything for top and bottom. Here is my layout: <android.support.design.widget.AppBarLayout xmlns:android=

How insert a LinearLayout between AppBarLayout and the scrolling content, when using CollapsingToolbarLayout

断了今生、忘了曾经 提交于 2019-12-05 18:48:58
I'm using a CoordinatorLayout with CollapsingToolbarLayout. I'm trying to put a LinearLayout below AppBarLayout and above the scrolling content, and I want that this LinearLayout stays always fixed on the screen (with AppBarLayout hidden or not), not scrolling with the content. Is this possible? So far, I have the following code: <android.support.design.widget.CoordinatorLayout android:layout_above="@+id/linearLayout" tools:context="..." android:layout_width="wrap_content" android:layout_height="match_parent"> <android.support.design.widget.AppBarLayout android:id="@+id/app_bar" android:layout

AppBarLayout CollapsingToolbar how to disable expand on EditText click?

僤鯓⒐⒋嵵緔 提交于 2019-12-05 12:14:09
In my test app I disable expansion of AppBarLayout when it is collapsed (by scrolling RecycleView ). I do that by adding addOnOffsetChangedListener to AppBarLayout . However, when I click EditText it expands again but, I do not want it to expand. How to disable the expansion of AppBarLayout when I click EditText ? I have put the whole code, so that everyone can copy/paste the code, create new project and test this fast. Here is how the .gif looks Here is XML code: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com

Custom layout in Toolbar with TabLayout below

筅森魡賤 提交于 2019-12-05 11:50:47
Right now, I have a normal looking Toolbar . What I want to do is add a custom layout between the Toolbar and the TabLayout , as shown in the picture below: On the left is what my Toolbar looks like now, and on the right is what I want it to look like. As you can see, I want to add an ImageView and two TextView s to the layout. How can I achieve this? Here is my current layout: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id