android-coordinatorlayout

CollapsingToolbarLayout and hide toolbar while scrolling

自作多情 提交于 2019-11-30 11:27:05
问题 I am trying to create some combined layout using CoordinatorLayout and also CollapsingToolbarLayout. In the first state, when we on the most top page, and didn't scrolled yet, I want the toolbar to expend as shown below (yes, i did it): In the second state, when starting to scroll down, the image and toolbar should disappear, as shown below (only tab will show): And in the last state once I am at some point in the list (but not the top of the list) I want to start scrolling up, once I start

CoordinatorLayout crashes app with IndexOutOfBoundsException

百般思念 提交于 2019-11-30 09:44:29
I'm getting a crash (from Crashlytics, unable to reproduce locally) in my app from the onLayout function in the CoordinatorLayout : Fatal Exception: java.lang.IndexOutOfBoundsException: Invalid index 3, size is 3 at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255) at java.util.ArrayList.get(ArrayList.java:308) at android.support.design.widget.CoordinatorLayout.onLayout(SourceFile:848) at android.view.View.layout(View.java:15237) at android.view.ViewGroup.layout(ViewGroup.java:4864) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:515) at android.widget

How to make Recycler View not scroll when appbar snaps

故事扮演 提交于 2019-11-30 08:25:20
问题 I have made the snapping app bar like this: Please note that when the scroll is left in the middle(i.e the title is half visible, then the app bar snaps automatically) In case of google play this is what the snap looks like: Now, I want the snap to work like the one in google play. Which is that when the snap occurs, then only the app bar should snap and the recycler view should not move. It would be better if the solution supported pre lollipop devices too. Thanks! 回答1: I found a solution

CoordinatorLayout with multiple snapping points

时光怂恿深爱的人放手 提交于 2019-11-30 07:52:53
Here I've got quite a complex animation that may be resolved (I believe) in a simple way using the CoordinatorLayout . It has 3 states: Initial (left screen) - Header view is shown fully (orange background): Toolbar, grey roundrect (it's actually a photo there) plus some other views below (TextViews, RatingBar etc) Scrolling the content up (middle screen) - roundrect is zooming up with a changing green foreground alpha level over it, so it becomes green while scrolling (well, it is not obvious with these screens. Green background is actually a zoomed roundrect with a green foreground over it,

How to show Toolbar's logo, icon, title, subtitle when wrapped in a CollapsingToolbarLayout?

断了今生、忘了曾经 提交于 2019-11-30 07:29:26
After Android Support Design Library was released, I wanted to implement an effect like a page of Twitter Profile , in which Toolbar 's title and subtitle could be changed as screen scrolled vertically. So I tried to use CoordinatorLayout , AppBarLayout , CollapsingToolbarLayout and Toolbar from Android Support Design Library to achieve this effect. Everything worked as expected except that Toolbar 's content couldn't be showed or changed as I wanted. I should have been wanting to display collapseIcon , navigationIcon , title , subtitle of Toolbar , but they didn't show up even though I had

Using windowTranslucentStatus with CollapsingToolbarLayout

こ雲淡風輕ζ 提交于 2019-11-30 06:35:09
问题 I'm trying to get a similar effect to what is seen on google play. I've got the below layout to show a transparent toolbar with an image behind it. When the user scrolls there is a parallax effect on the imageview as it scrolls off the screen. The toolbar returns when ever the user scrolls up, with the imageview only returning when the user gets to the lop of the list. This all works great. <android.support.design.widget.CoordinatorLayout android:id="@+id/main" xmlns:android="http://schemas

Prevent RecyclerView from scrolling under AppBarLayout before AppBarLayout is collapsed

牧云@^-^@ 提交于 2019-11-30 05:19:54
问题 I'm creating a RecyclerView with header where the header collapses as you scroll up the RecyclerView . I can achieve this very closely with the layout below, with a transparent AppBarLayout , and MyCoolView which is the header. The parallax effect works great. However, if the header is still visible and I fling the RecyclerView , the RV scrolls slowly to the top and some of the items are under the Toolbar until the RV reaches the top of the view. I've been playing around with the scrollFlags

Scrolling with Collapsing Toolbar and Tabs

谁都会走 提交于 2019-11-30 05:14:19
I'm trying to make a layout with a CollapsingToolbarLayout which has scroll|exitUntilCollapsed flag, and a TabLayout which has scroll|enterAlways scrollFlag property. Basically I want my toolbar to be pinned and show and hide the tabs while scrolling. I've modified the cheesesquare app from https://github.com/chrisbanes/cheesesquare . Here is my layout 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:id="@+id/main_content" android

Android status bar scrolling up with coordinator layout, leaving status icons overlapping toolbar title

跟風遠走 提交于 2019-11-30 01:55:23
I am experiencing an issue when using Coordinator Layout that contains an AppBarLayout (holding a ToolBar and a TabLayout) and a ViewPager (holding fragments) as children. I want the topbar to be hidden when scrolling down, and revealed when scrolling back up. However when I scroll down, the status bar scrolls up as well, leaving the top bar just below the status icons, being overlapped by them. I tried adding android:fitsSystemWindows="true" to both the AppBarLayout and the ViewPager but nothing changed. Below the code used and snapshots showing the two states: <android.support.design.widget

How to make custom CoordinatorLayout.Behavior with parallax scrolling effect for google MapView?

旧街凉风 提交于 2019-11-29 22:52:02
问题 I try to make a parallax scrolling effect for google MapView and RecycleView using CoordinatorLayour . so base on some tutorials found on web I made below code. The 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" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools