android-collapsingtoolbarlayout

CollapsingToolbarLayout doesn't work well with NestedScrollView

给你一囗甜甜゛ 提交于 2019-11-27 21:57:15
问题 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

Prevent CollapsingToolbarLayout collapse if not needed

假如想象 提交于 2019-11-27 19:45:06
Using: compile 'com.android.support:design:23.0.0' compile 'com.android.support:appcompat-v7:23.0.0' compile 'com.android.support:cardview-v7:23.0.0' compile 'com.android.support:recyclerview-v7:23.0.0' With the project Cheesesquare updated. Into the detail of cheese, I remove 2 cards (to have only one). Is there a way to prevent the collapsing of the toolbar that show a blank space? DmitryArc To implement such behaviour in Cheesesquare example just modify android:layout_height param of the NestedScrollView to wrap_content . It will prevent scrolling by content if it is small enough to fit on

How can i determine that CollapsingToolbar is collapsed?

狂风中的少年 提交于 2019-11-27 18:44:22
I need to know when CollapsingToolbar from material design library is collapsed. Marko UPDATE : Since support versions of 23.1.1+ the issue is no longer there, no need to use the listener and disable the swipe refresh layout, it will work as it should ( link ). Implement AppBarLayout.OnOffsetChangedListener listener on your AppBarLayout AppBarLayout appBarLayout = (AppBarLayout) view.findViewById(R.id.app_bar_layout); appBarLayout.addOnOffsetChangedListener(this); And check if offset is 0, meaning the toolbar is fully expanded. @Override public void onOffsetChanged(AppBarLayout appBarLayout,

how to pin title in Toolbar inside CollapsingToolbarLayout

好久不见. 提交于 2019-11-27 17:50:59
问题 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()

How to change CollapsingToolbarLayout typeface and size?

拈花ヽ惹草 提交于 2019-11-27 17:01:05
I want to change CollapsingToolbarLayout font size and its typeface. How I can achieve that? Update Before we dive into the code let's first decide the textSize for our CollapsingToolbarLayout . Google published a website called material.io , this website also explains the best way on how to deal with Typography . The article mentioned about "Heading" category which also explains the recommended font size to use in sp . Although the article never mentioned the recommended CollapsingToolbarLayout's expanded size but the library com.android.support:design provides a TextAppearance for our case.

How to mimic Google Maps' bottom-sheet 3 phases behavior?

爷,独闯天下 提交于 2019-11-27 16:37:37
Background I'm assigned to make a UI that behaves similar to how Google Maps shows a bottom-sheet for a found result. It has three different phases: Bottom content. The upper area is still touchable and won't scroll anything at the bottom Full screen content, while the upper area has a large header. Full screen content, while the upper area has just the toolbar. Here's what I'm talking about on Google Maps: The problem Thing is, the bottom sheet isn't a part of the design library yet (though it was requested, here ). Not only that, but the UI seems quite complex and need handling of the

Error inflating class CollapsingToolbarLayout

烈酒焚心 提交于 2019-11-27 12:45:21
My CollapsingToolbarLayout crashes because of Error inflating class android.support.design.widget.CollapsingToolbarLayout. I updated the android studio last weekend. Before the updated, it works fine. After I updated it, it crashed. However, I tried to downgrade it to 2.0.0 version and it's not working anymore. My coworker has no problem with the CollapsingToolbarLayout. I am not sure what happened. The error was: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.android/com.test.android.ui.activity.RandomActivity}: android.view.InflateException: Binary XML file line

How to disable scrolling of AppBarLayout in CoordinatorLayout?

心已入冬 提交于 2019-11-27 12:25:06
I have MapFragment with parallax effect inside AppBarLayout : I want to disable scrolling on AppBarLayout , because it is not possible to move across map, since touch evenys on the map are always handled as scroll events. I would like to handle collapsing of AppBarLayout by scrolling RecyclerView only, which is on the bottom of the screen. This is my xml: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.AppBarLayout android:id="@+id/appbar" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" android:theme="@style

Android CollapsingToolbarLayout with custom View

北城余情 提交于 2019-11-27 11:08:38
I'm following the Cheesesquare example project to understand the new design material library. I'm wondering if there's a way to use a custom view (like Telegram) with ImageView, title and subtitle instead of the simple Title provided by CollapsingToolbarLayout widget. Thanks. I had the same problem and spend many hours trying to find a solution. My solution was to add the collapsing Views (ImageView and TextView) inside the CollapsingToolbarLayout and then handle the transition in code. This way it's more flexible and simpler than extending from CollapsingToolbarLayout. First you'll need to

CollapsingToolbarLayout doesn't recognize scroll fling

試著忘記壹切 提交于 2019-11-27 10:32:53
I have created a simple CollapsingToolbarLayout and it works like a charm. My problem is, that if I try to use a fling scroll on the nestedscrollview , it just stops when I release my finger. Normal scrolling works like it should. My activities code is unchanged => auto generated empty activity. (I just clicked on create new empty activity in android studio and edited the XML yet). I read here, that scroll gestures on the imageview itself are buggy, but not, that the scrolling itself is buggy: see here . I tried activating "smooth scrolling" through java code. It seems like if I scroll far