android-coordinatorlayout

Open bottom sheet when sibling scrolling reaches the end?

自古美人都是妖i 提交于 2020-08-22 12:05:13
问题 Is there any way to "forward" scroll events from one scrolling view to my bottom sheet, so that my bottom sheet begins to expand when I over-scroll the first scrolling view? Consider this tiny app: public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); int peekHeight = getResources().getDimensionPixelSize(R.dimen.bottom_sheet_peek_height); // 96dp View

CollapsingToolbarLayout expand only when at the top

喜夏-厌秋 提交于 2020-08-21 10:49:42
问题 I have some problems with AppBarLayout and CollapsingToolbarLayout. This is what currently happens: https://www.youtube.com/watch?v=z4yD8rmjSjU The downwards scrolling motion is exactly what I want. However when I scroll up again, the orange bar should appear immediately (which it does), but I want the ImageView to start appearing only when the user has scrolled to the very top. Can anyone help me to achieve this effect? This is my layout xml: <android.support.design.widget.AppBarLayout

CollapsingToolbarLayout expand only when at the top

↘锁芯ラ 提交于 2020-08-21 10:43:17
问题 I have some problems with AppBarLayout and CollapsingToolbarLayout. This is what currently happens: https://www.youtube.com/watch?v=z4yD8rmjSjU The downwards scrolling motion is exactly what I want. However when I scroll up again, the orange bar should appear immediately (which it does), but I want the ImageView to start appearing only when the user has scrolled to the very top. Can anyone help me to achieve this effect? This is my layout xml: <android.support.design.widget.AppBarLayout

BottomSheet + ViewPager2 drag to hide not works

自闭症网瘾萝莉.ら 提交于 2020-08-01 04:53:52
问题 I got troubles and I thinks its CoordinatorLayout's fault but not sure. I'm using ViewPager2 inside a ConstraintLayout and I use the CoordinatorLayout like BottomSheet. But when I drag to hide it not works good. I replaced the ViewPager2 by ViewPager and it works well. I hope you can help me. This is my XML file. <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http:

Issue with CoordinatorLayout and ImageView that adjusts width while scrolling

我是研究僧i 提交于 2020-07-04 06:28:49
问题 I'm attempting to put an ImageView in a CollapsingToolbarLayout in which it takes up the full screen on load and as you scroll the content, the 16x9 resolution image width resizes until the image takes up the full width of the screen. At that point, I'd like the image to parallax with a app:layout_collapseParallaxMultiplier of 0.5 Using this XML Layout: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res