android-collapsingtoolbarlayout

Using AppBarLayout.Behavior.DragCallback to control scroll of collapsing toolbar layout

╄→尐↘猪︶ㄣ 提交于 2019-11-29 10:22:53
I want to be able to enable and disable the scroll of collapsing toolbar. Can anyone show me an example how to use AppBarLayout.Behavior.DragCallback? https://developer.android.com/reference/android/support/design/widget/AppBarLayout.Behavior.DragCallback.html In order to enable/disable the scroll of the collapsing toolbar you can provide a custom DragCallback as part of your AppBarLayout's behavior. Here is a sample code: private void setAppBarDragging(final boolean newValue) { AppBarLayout appBarLayout = (AppBarLayout) findViewById(R.id.appbar_layout); CoordinatorLayout.LayoutParams params =

Android RecyclerView with CollapsingToolbarLayout smooth scroll issue

廉价感情. 提交于 2019-11-29 07:57:47
I want to use CollapsingToolbarLayout with RecyclerView , like Whatsapp . Here is the captured video : https://sendvid.com/0oi2lxx5 So when I scroll up it's okay, but when I scroll down it's not smooth. I want to scroll it smoothly with RecyclerView . So here is my profile_activity.xml : <?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:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true">

Error Inflating CollapsingToolbarLayout

狂风中的少年 提交于 2019-11-29 05:32:00
I recently updated the support design library to the latest version and now every activity that has a CollapsingToolbarLayout throws the following exception: java.lang.NoSuchMethodError: No static method setLayoutDirection(Landroid/graphics/drawable/Drawable;I)V in class Landroid/support/v4/graphics/drawable/DrawableCompat; or its super classes (declaration of 'android.support.v4.graphics.drawable.DrawableCompat' appears in /data/data/com.radioafrica.music/files/instant-run/dex/slice-com.android.support-support-v4-24.0.0-beta1_f8cf3ba4c70f87f407a745b9fa14a2205d0b587c-classes.dex) The full

how to pin title in Toolbar inside CollapsingToolbarLayout

不打扰是莪最后的温柔 提交于 2019-11-29 03:46:41
Here is my layout: <android.support.design.widget.AppBarLayout <android.support.design.widget.CollapsingToolbarLayout ... <android.support.v7.widget.Toolbar ... /> </android.support.design.widget.CollapsingToolbarLayout> </android.support.design.widget.AppBarLayout> I want title stays in Toolbar, not in CollapsingToolbarLayout. So I changed my code from: mCollapsingToolbar = ... mCollapsingToolbar.setTitle(title); to: mTitleBar = ... setSupportActionBar(mTitleBar); getSupportActionBar().setTitle(title); But the title is not visible. My device is Nexus 6 5.1.0 Thanks in advance. Update 1: I

CollapsingToolbarLayout doesn't work well with NestedScrollView

懵懂的女人 提交于 2019-11-29 02:39:45
I made an activity where image should collapse with toolbar and only text below would be visible. But When Toolbar being collapsed, there shows up a large gap between Toolbar and NestedScrollView <android.support.design.widget.CoordinatorLayout xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/coordinatorLayout" android:layout_width="match_parent" android:background="@color/white" android:layout_height="match_parent"> <android.support.design.widget.AppBarLayout android:id="@+id/appBarLayout" android:layout_width=

How to expand AppBarLayout when scrolling down reaches at top of the RecyclerView

£可爱£侵袭症+ 提交于 2019-11-29 02:16:43
问题 I am working on one android app in which I am using CoordinatorLayout , AppBarLayout and CollapsingToolbarLayout to use the advance collapse bar functionality. I am using recyclerview to show the number of items in the fragment. When I'm scrolling up recyclerview it smoothly collapse AppBarLayout but when I scroll down and reach at on the first item of the recyclerview it automatically stop scrolling without expanding `AppBarLayout'. Then again I need to scroll down again to make AppBarLayout

Unable to scroll AppBarLayout and collapsing toolbar with NestedScrollView smoothly

拈花ヽ惹草 提交于 2019-11-29 02:02:52
问题 I am working on one android app in which I am using CoordinatorLayout , AppBarLayout and CollapsingToolbarLayout to use the collapse toolbar functionality. I am using NestedScrollView in layout to expand and collapse AppBarLayout in same layout. When I am trying to scroll up from center of the screen then it does not work but when I try to scroll up screen from right corner of the screen then it scrolls smoothly. Below mentioned is my xml file layout.xml <android.support.v4.widget

Click not working on RecyclerView in CoordinatorLayout when scrolling

淺唱寂寞╮ 提交于 2019-11-29 01:20:03
问题 I am facing a strange behaviour with a RecyclerView as a second child of CoordinatorLayout, just after an AppBarLayout (as described in a lot of examples). My problem is when I scroll the recycler view and I want to click on a particular item. Sometimes I need to click 2 times to select that item, it seems to be linked to the fling behaviour. For example, if I scrolled to the bottom of the recycler view, then if I fling my finger from the bottom of the screen to the top (in order to see more

Anchor ImageView to Collapsing Toolbar

做~自己de王妃 提交于 2019-11-29 00:40:47
When a FloatingActionButton is anchored to a CollapsingToolbarLayout, it disappears when you scroll up, reappears when you scroll down after a certain point. I was wondering if you can do that with any type of view. In my app, I'm trying to anchor an ImageView to the CollapsingToolbarLayout but it won't disappear like the FloatingActionButton. Here's the XML code. <android.support.design.widget.AppBarLayout android:id="@+id/bar" android:layout_width="match_parent" android:layout_height="252dp" android:fitsSystemWindows="true"> <android.support.design.widget.CollapsingToolbarLayout android:id="

how to implement collapsing image view like Google IO 2015 App using Design Library

只愿长相守 提交于 2019-11-28 23:19:56
问题 How to implement collapsing toolbar layout design like Google IO 2015 using Design Library In Open Source Code of Google IO 2015, it is not implemented using Design Library (CoordinatorLayout, CollapsingToolbarLayout etc) Note : In this the toolbar is at the bottom in upper section. I need the toolbar to be scrolling like this attached with the textview or any other view of upper section. 回答1: Finally i was able to implement it. <?xml version="1.0" encoding="utf-8"?> <android.support.design