android-coordinatorlayout

Android Design Support Library FAB in a ViewPager Fragment with Coordinator Layout

旧时模样 提交于 2019-12-22 07:05:18
问题 I'm trying to get a Floating Action Button from the Android Design Support Library inside a Fragment which is inside a ViewPager. I've 4 tabs and I want the FAB in only one of the Tabs. My layout are as follows: main_layout.xml <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" android:layout_height="match_parent">

How to use coordinator layout with fragment as “scrolling view”

余生长醉 提交于 2019-12-22 04:22:12
问题 I'm trying to use a coordinator layout with an appbar layout that hosts a fragment as the "scrolling view". The fragment consists of a recyclerView and a bottom aligned layout holding a button, like so: However, the bottom section is hidden by default: and only shows up after I scroll. From my activity class: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); TestFragment fragment = (TestFragment)

How to use coordinator layout with fragment as “scrolling view”

一笑奈何 提交于 2019-12-22 04:22:07
问题 I'm trying to use a coordinator layout with an appbar layout that hosts a fragment as the "scrolling view". The fragment consists of a recyclerView and a bottom aligned layout holding a button, like so: However, the bottom section is hidden by default: and only shows up after I scroll. From my activity class: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); TestFragment fragment = (TestFragment)

RecyclerView is below toolbar

北城余情 提交于 2019-12-21 19:51:47
问题 Problem: I have a RecyclerView and a Toolbar in a CoordinatorLayout . The RecyclerView is below the Toolbar but it should not. Question: How can I achieve that the RecyclerView and the Toolbar have one border? activity_main.xml <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" xmlns:app="http://schemas.android.com/apk/res

Using CoordinatorLayout in fragments with ActionBar in Activity

孤街浪徒 提交于 2019-12-21 12:16:42
问题 I have problem using Android Design Support Library. I would like to use CoordinatorLayout inside fragment for FAB and ActionBar animations while scroll, but I having ActionBar in activity layout and my CardGridStaggeredView and FAB in fragment. activity layout: <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/tools" xmlns:app1="http://schemas.android.com/apk/res-auto

Snackbar with CoordinatorLayout disable dismiss

荒凉一梦 提交于 2019-12-21 10:17:03
问题 I am using the support FloatingActionButton Snackbar CoordinatorLayout I need the CoordinatorLayout so that if SnackBar is shown the FloatingActionButton moves up to make room for the Snackbar. For better understanding check this video. I am using SnackBar for double-back to exit the application, but the SnackBar can be dismissed. Is there a way to disable the dismiss on the SnackBar? Snackbar snackbar = Snackbar.make(view, R.string.press_back_again_to_exit, Snackbar.LENGTH_SHORT); snackbar

Set layout_anchor at runtime on FloatingActionButton

冷暖自知 提交于 2019-12-21 07:23:21
问题 I am trying to animate a android.support.design.widget.FloatingActionButton that is pinned to my AppBarLayout. I can set it fine within the layout xml and it shows up fine. However i am doing a Shared Element Transition to this layout and the FAB is showing up before the view is set. I tried to set the visibility to GONE and INVISIBLE but they seem to be disregarded if the layout_anchor is set in the layout xml. Is there anyway around this? I would like the activity to load with the shared

CoordinatorLayout + AppbarLayout + Viewpager not resize child layout

冷暖自知 提交于 2019-12-21 06:57:47
问题 I have a problem using CoordinatorLayout in conjunction with ViewPager and the ViewPager: the layout does not resize correctly. Supose that the height solved includes tabs height. So when I scroll to bottom i see this: main layout code: <?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:id="@

android setAlpha on imageView into CollapsingToolbarLayout does not work

家住魔仙堡 提交于 2019-12-21 05:15:39
问题 inside of CollapsingToolbarLayout imageview and i need setAlpha(float) When that scroll up and down: this is method for get Offset and calculate float by offset: AppBarLayout.OnOffsetChangedListener: @Override public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) { float offsetAlpha = (float) (verticalOffset / appBarLayout.getTotalScrollRange()); imageView.setAlpha(offsetAlpha); } xml layout: <android.support.design.widget.CollapsingToolbarLayout android:id="@+id

CoordinatorLayout/AppBarLayout ExpandableListView being rendered off screen

笑着哭i 提交于 2019-12-21 04:43:12
问题 Yet more problem in using CoordinatorLayout and AppBarLayout. I'm trying to achieve the basic functionality of having the Toolbar scroll off screen when scrolling down and coming back on screen when scrolling up. However, my current set up is showing a problem: Not only is the Toolbar not scrolling off, the ListView seems to be rendering off screen at the bottom. It's almost as if it's been offset by the AppBarLayout height. Here is a gif describing the issue, note that the final item is cut