Hide AppBar when scrolling down

Actually, that design seems to be wrong.Why? let me explain that to you. Except those xmlns:android=”http://schemas.android.com/apk/res/android” which it wasn’t necessary or using: android:layout_alignParentTop=”true” in the LinearLayout or using that ScrollView under the contents or etc, seems like you don’t have any idea what’s going on.(no problem). Note: the most important thing was, adding: app:layout_behavior=”@string/appbar_scrolling_view_behavior” which … Read more

How to disable scrolling of AppBarLayout in CoordinatorLayout?

I’m not sure I got it, but I think you are looking for a DragCallback. The DragCallback interface allows to choose whether the sibling scrolling view should be controlled by scrolls onto the AppBarLayout. You can define one by calling: CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) appBarLayout.getLayoutParams(); AppBarLayout.Behavior behavior = (AppBarLayout.Behavior) params.getBehavior(); behavior.setDragCallback(new AppBarLayout.Behavior.DragCallback() { @Override public … Read more

CoordinatorLayout inside another CoordinatorLayout

I know it’s an old question. But I searched a long time to include an CoordinatorLayout in a fragment, which is in another CoordinatorLayout. I modified the answer of dev.bmax a little bit to call both coordinator layouts and call the attached behaviors of both layouts. So here is my solution. @SuppressWarnings(“unused”) public class NestedCoordinatorLayout … Read more

Android Layout: Horizontal Recyclerview inside a Vertical Recyclerview inside a Viewpager with Scroll Behaviors

Tested solution: All you need is to call mInnerRecycler.setNestedScrollingEnabled(false); on your inner RecyclerViews Explanation: RecyclerView has support for nested scrolling introduced in API 21 through implementing the NestedScrollingChild interface. This is a valuable feature when you have a scrolling view inside another one that scrolls in the same direction and you want to scroll the … Read more

Theme Error – how to fix?

This is a bug in 28.0.0 and the only fix(workaround) is adding this to your Build.gradle: configurations.all { resolutionStrategy.eachDependency { DependencyResolveDetails details -> def requested = details.requested if (requested.group == “com.android.support”) { if (!requested.name.startsWith(“multidex”)) { details.useVersion “27.1.1” } } } } Which somehow, this bypasses the issue and uses 27 support library for that. Otherwise, … Read more