coordinator-layout

Android, DrawerLayout + Fragments + CollapsingToolbarLayout

怎甘沉沦 提交于 2019-11-29 03:41:56
问题 Is it possible to have a CoordinatorLayout / CollapsingToolbarLayout in the fragments shown in the main container of a DrawerLayout? An answer to another question suggests that each fragment could have its own Toolbar. But this doesn't work well with the ActionBarDrawerToggle as it requires a Toolbar to link to the open/close drawer behaviour. Has anybody achieved this, or do you have pointers about this? Thanks. EDIT : I've been focusing some efforts in putting a single Toolbar in the

Android CoordinatorLayout + AppbarLayout + Viewpager always scrolling

喜欢而已 提交于 2019-11-29 01:47:10
问题 I have a classic layout with a ToolBar on the top, a TabLayout below it, and a ViewPager switching tabs from the TabLayout. When content in the ViewPager is scrollable, the ToolBar should scroll out of sight, and the TabLayout should follow and stick when it reaches the top. All this is good in my current code, except, the ToolBar is always scrollable, regardless of the size of the ViewPager's content. See my code below. Any brilliant ideas on how to fix this? <?xml version="1.0" encoding=

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

ConstraintLayout vs Coordinator layout?

心已入冬 提交于 2019-11-28 18:25:23
问题 What to implement: ConstraintLayout or CoordinatorLayout for proper material design in android ? 回答1: CoordinatorLayout is intended to be the top-level layout for activity to manage the Behaviors e.g. interactions and animations. ConstraintLayout 's main goal is to provide a convenient way to create a flat layout with multiple children (much more powerful RelativeLayout). So the CoordinatorLayout is to manage the complex behavior (especially animations) of your activity's components, and

Toolbar will not collapse with Scrollview as child of CoordinatorLayout

怎甘沉沦 提交于 2019-11-28 18:14:52
问题 I am trying to follow the Google Docs on using the CoordinatorLayout but i am having an issue with the ScrollView inside the CoordinatorLayout. Basically, the Toolbar normally would collapse with a RecyclerView or a Listview when scrolling down. Now with a ScrollView it will not collapse. <android.support.design.widget.CoordinatorLayout android:layout_width="match_parent" android:layout_height="match_parent"> <ScrollView android:layout_width="match_parent" android:layout_height="match_parent"

Android: CoordinatorLayout and SwipeRefreshLayout

南笙酒味 提交于 2019-11-28 16:50:17
I try to implement auto hiding toolbar feature from the new support library 22.2.0. Without SwipeRefreshLayout is working fine: But when I re add this layout, toolbar overlap the recyclerview: Code: <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true"> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"

CoordinatorLayout and AppBarLayout elevation

痴心易碎 提交于 2019-11-27 22:48:17
I've created an AppBar layout like this <android.support.design.widget.AppBarLayout xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/appbar_layout" android:layout_height="@dimen/app_bar_height" android:layout_width="match_parent" android:fitsSystemWindows="true" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" app:elevation="20dp"> <android.support.design.widget.CollapsingToolbarLayout...> </android.support.design.widget.AppBarLayout> it works and casts a shadow in the LinearLayout: <LinearLayout xmlns

Design lib - CoordinatorLayout/CollapsingToolbarLayout with GridView/listView

时光毁灭记忆、已成空白 提交于 2019-11-27 04:29:25
This might be silly question but I didn't understand Design lib well. I am following this reference to create below layout. The Blue area should work as parallax when I scroll the GridView . But when I scroll grid View nothing happens in AppBarLayout. But This works with NestedScrollView and RecyclerView Below is My Layout file- <?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:layout_width="match_parent"

Need to disable expand on CollapsingToolbarLayout for certain fragments

回眸只為那壹抹淺笑 提交于 2019-11-26 22:09:55
I have a AppCompatActivity that controls replacing many fragments. Here is my layout for it. activity_main.xml <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/drawer_layout" android:layout_height="match_parent" android:layout_width="match_parent" android:fitsSystemWindows="true"> <include layout="@layout/activity_main_frame"/> <android.support.design.widget.NavigationView android:id="@+id/navigation_view" android:layout_width="wrap_content" android:layout_height="match_parent

CoordinatorLayout and AppBarLayout elevation

孤人 提交于 2019-11-26 20:35:09
问题 I've created an AppBar layout like this <android.support.design.widget.AppBarLayout xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/appbar_layout" android:layout_height="@dimen/app_bar_height" android:layout_width="match_parent" android:fitsSystemWindows="true" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" app:elevation="20dp"> <android.support.design.widget.CollapsingToolbarLayout...> </android