Android – Overflow Menu and Back Button not showing in Collapsing Toolbar

I had the same issue, none from existing answers have helped me, surprising fix of my problem was in question description. Solution for AppCompat Activity So working collapsing toolbar with back button needs those few lines in controller onCreate method: //change id to Your id toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); //this line shows back button … Read more

no resource id found for app:layout_scrollflags from CollapsingToolbarLayout

only importing the design library jar file is not enough. You need to import resource of android-design-library project while the jar file only contains class files. Do as I say: import android-design-library project. The project is at “sdk/extras/android/support/design/“. And set it as a library project if it is not. import the above project into your … Read more

Error text in TextInputLayout is covered by keyboard

Update: looks like this might have been fixed in 1.2.0-alpha03 version of the library. To make sure the error message is visible without the user acting to see it, I subclassed TextInputLayout and placed it inside a ScrollView. This lets me scroll down if needed to reveal the error message, on every occasion the error … Read more

CollapsingToolbarLayout subtitle

If you want the subtitle to go to Toolbar when the AppBar is fully collapsed you should create your custom CoordinatorLayout.Behaviour Like this: Github Guide But if you just want a smaller text behind the title when the AppBar is expanded you can try this layout: <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” android:layout_height=”match_parent” android:fitsSystemWindows=”true”> <android.support.design.widget.AppBarLayout android:id=”@+id/appbar” android:layout_width=”match_parent” … Read more

CoordinatorLayout with RecyclerView And Collapsing header

You can achieve it by having this layout: <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” android:layout_height=”match_parent”> <android.support.design.widget.AppBarLayout android:layout_width=”match_parent” android:layout_height=”wrap_content”> <android.support.design.widget.CollapsingToolbarLayout android:layout_width=”match_parent” android:layout_height=”match_parent” app:layout_scrollFlags=”scroll|exitUntilCollapsed”> <!– HEADER –> <RelativeLayout … app:layout_collapseMode=”parallax”> ….. </RelativeLayout> <android.support.v7.widget.Toolbar android:layout_width=”match_parent” android:layout_height=”?attr/actionBarSize” app:layout_collapseMode=”pin” /> </android.support.design.widget.CollapsingToolbarLayout> <!– IF YOU WANT TO KEEP “Choose Item” always on top of the RecyclerView, put this TextView here <TextView android:layout_width=”match_parent” android:layout_height=”wrap_content” … Read more

Custom TextSize of BottomNavigationView support android

Unfortunately this first version of BottomNavigationView came with a lot of limitations. And for now you can’t change titles size just using the support design API. So to solve this limitation while google doesn’t implement it, you can do: In your dimen.xml you can put: <dimen name=”design_bottom_navigation_text_size” tools:override=”true”>30sp</dimen> <dimen name=”design_bottom_navigation_active_text_size” tools:override=”true”>30sp</dimen> Doing this you are … Read more

Snackbar action text color not changing

The argument of setActionTextColor is the int that represents the color, not the resource ID. Instead of this: .setActionTextColor(R.color.yellow) try: .setActionTextColor(Color.YELLOW) If you want to use resources anyway, try: .setActionTextColor(ContextCompat.getColor(context, R.color.color_name)); Note: To use ContextCompat, I assume you have included Support library to your build.gradle file (It is optional if you have already appcompat (v7) … Read more

TabLayout set spacing or margin each tab

Been fighting this problem for a while too, found the solution on this thread : Android Design Support Library TabLayout using custom tabs layout but layout wrapping the tabs <!– Add the padding to tabPaddingStart and/or tabPaddingEnd –> <android.support.design.widget.TabLayout android:id=”@+id/tabLayout” android:layout_width=”match_parent” android:layout_height=”@dimen/tab_layout_height” app:tabPaddingStart=”10dp” app:tabPaddingEnd=”10dp”>