android-appbarlayout

CoordinatorLayout inside another CoordinatorLayout

偶尔善良 提交于 2020-01-09 04:17:51
问题 CorodinatorLayout inside another CoordinatorLayout such that scrolling the child-view should also scroll the Parent CoordinatorLayout . I have a coordinatorLayout with ViewPager that contains different Fragment such that on Scroll will hide the tabLayout I have another coordinatorLayout that has a viewPager . This fragment is inflated in ViewPager of parent fragment(parent Coordinator layout ). The problem is onScrolling the child fragment in childViewpager only reflects in coordinator layout

Toolbar isn't in the center of the AppBarLayout

流过昼夜 提交于 2020-01-06 18:52:28
问题 I used this example to build a layout with two NavigationViews: http://v4all123.blogspot.de/2016/03/simple-example-of-navigation-view-on.html It works fine. But also in the demo on this site you can see, that the Toolbar isn't 100% in the middle. The left button has more space to the left than the right button to the right border. Take a look to the screenshot from Android Studio. I've tried to center each view but the only way to get the same space left and right is to add a padding to the

Change background color of title in CollapsingToolbarLayout using scrim or color overlay

孤街浪徒 提交于 2020-01-03 02:00:29
问题 I have been dealing for a while now with changing the color of the background of the title in the collapsingtoolbarlayout but only when is expanded. Why I want is either have a transparent scrim background or a color overlay (like the documentation says): I want this behaviour (or a protective screen with transparent background is also possible), the thing is I found exactly the same question on this post: Android CollapsingToolbarLayout Title background I've applied this solution to my

CollapsingToolbarLayout in fragments

梦想与她 提交于 2020-01-02 07:28:08
问题 I have an AppCompatActivity that contain fragments and it controls the replacing of many fragments. I want to show differents toolbar depending of fragment to show. This is the code for main_activity.xml: <android.support.v4.widget.DrawerLayout 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="@+id/drawer" android:layout_width="match_parent" android:layout_height="match

AppBarLayout - Layout sometimes invisible once it enters view (even if it's not entered)

百般思念 提交于 2019-12-31 03:52:10
问题 I have a problem where sometimes the AppBarLayout will not show its full content all the time when you play around with it: <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v7.widget.RecyclerView android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="

Set Toolbar Icon Colour Programmatically

蹲街弑〆低调 提交于 2019-12-30 10:44:39
问题 How can I set the colour of icons (home and overflow menu icon) in a Toolbar / AppBarLayout programmatically ? I want to change the toolbar's colour scheme for a single fragment in an activity. Setting the AppBarLayout 's background to a light colour (e.g. light gray with appBarLayout.setBackgroundResource(..); ) results in white icons and a white title which are barely visible. Its layout is as follows: <android.support.design.widget.AppBarLayout android:id="@+id/appbar" android:layout_width

How to sync scroll of two CoordinatorLayout + AppBarLayout

巧了我就是萌 提交于 2019-12-30 04:33:10
问题 I have an activity with XML. Something like: <?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/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> <android.support.design.widget.CoordinatorLayout android:id="@+id/coordinator"

AppBarLayout with recyclerView in nested fragment

扶醉桌前 提交于 2019-12-30 03:18:07
问题 As images are always better than words, I present to you my current layout . The toolbar/tabs is in an activity.xml with a viewPager, and the recyclerView is inside a fragment within the viewPager. So you can swipe right/left to see other content. My issue is that I want the AppBarLayout to be binded in its scrolling behaviour to the recyclerView in the first fragment, but not to the other fragments. In the code below, I did this binding but it doesn't work because the recyclerView doesn't

Add app bar scrolling view behavior to multiple views in CoordinatorLayout

◇◆丶佛笑我妖孽 提交于 2019-12-29 02:18:14
问题 I am looking to add scroll support to more than just a single, scrollable, child view of CoordinatorLayout in conjunction with an AppBarLayout and CollapsingToolbarLayout . When scrolling the RecyclerView or the AppBarLayout (condensed code below), the app bar and its contents successfully scroll and collapse. However, when attempting to initiate a scroll event on the LinearLayout above the RecyclerView , nothing happens because the LinearLayout does not know to scroll or collapse the view.

How to implement two OnClickListeners on RecyclerView item click?

做~自己de王妃 提交于 2019-12-25 19:02:21
问题 I'm quite confused since I need to use two OnClickListeners for two different needs. I have a Recyclerview which once any item of his, once pressed, needs to change and I've implemented that successfully using OnBindViewHolder.itemView.setOnClickListener Now, I want that very same click to update my BottomAppBar and for that, I added an interface to my ItemHolder class. The issue is that now I once I click, due to the interface (I guess) nothing happens. I know it might be a bit complicated