android-appbarlayout

ANDROID: Error inflating class android.support.design.widget.AppBarLayout

可紊 提交于 2020-05-14 21:32:08
问题 I added a toolbar to my layout and now I get this error when running: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.myapp/mainactivity.MainActivity}: android.view.InflateException: Binary XML file line #9: Binary XML file line #2: Error inflating class android.support.design.widget.AppBarLayout This is my activity layout: <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas

CollapsingToolbarLayout: custom contentScrim similar to Facebook

只谈情不闲聊 提交于 2020-02-26 07:19:06
问题 I want to create a custom contentScrim for my collapsingToolbarLayout . My collapsingToolbarLayout has an imageview inside. When it scrolls, in theory the imageview is suppose to fade out and my scrim color is suppose to fade in. We all know we can create a scrim like this: <android.support.design.widget.CollapsingToolbarLayout android:id="@+id/collapsing_toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" app:contentScrim="?attr/colorPrimary" android:background=

How to have a collapsing of top view into a smaller sized view?

六月ゝ 毕业季﹏ 提交于 2020-02-17 06:50:12
问题 This question was asked before in a too broad and unclear way here, so I've made it much more specific, with full explanation and code of what I've tried. Background I'm required to mimic the way the Google Calendar has a view at the top, that can animate and push down the view at the bottom, yet it has extra, different behavior. I've summarized what I'm trying to do on 3 characteristics: Pressing on the toolbar will always work, to toggle expanding/collapsing of the top view, while having an

AppBarLayout CollapsingToolbar how to disable expand on EditText click?

懵懂的女人 提交于 2020-02-02 04:39:05
问题 In my test app I disable expansion of AppBarLayout when it is collapsed (by scrolling RecycleView ). I do that by adding addOnOffsetChangedListener to AppBarLayout . However, when I click EditText it expands again but, I do not want it to expand. How to disable the expansion of AppBarLayout when I click EditText ? I have put the whole code, so that everyone can copy/paste the code, create new project and test this fast. Here is how the .gif looks Here is XML code: <?xml version="1.0" encoding

Error inflating class com.google.android.material.appbar.AppBarLayout

一世执手 提交于 2020-01-23 05:22:10
问题 I have bellow xml : <?xml version="1.0" encoding="utf-8"?> <androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/drawerLayout" android:layout_width="match_parent" android:layout_height="match_parent"> <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent"> <com.google.android.material.appbar.AppBarLayout android:id="@+id/appBarLayout" android

Android appbarlayout elevation appears in status bar

十年热恋 提交于 2020-01-22 17:11:47
问题 How do I get rid of the elevation in the status bar? If I set in AppbarLayout the app:elevation to 0dp the elevation doesn't appear anymore in status bar but also not below the AppbarLayout. How do I just get the elevation under the AppbarLayout? Here's a screenshot of what I mean: puush link, notice the shadow in the status bar :( Thanks! 回答1: Our concern is about shadow of AppBarLayout visible when status bar is transparent. Having an opaque status bar is not viable at all times. This

Android appbarlayout elevation appears in status bar

假如想象 提交于 2020-01-22 17:11:10
问题 How do I get rid of the elevation in the status bar? If I set in AppbarLayout the app:elevation to 0dp the elevation doesn't appear anymore in status bar but also not below the AppbarLayout. How do I just get the elevation under the AppbarLayout? Here's a screenshot of what I mean: puush link, notice the shadow in the status bar :( Thanks! 回答1: Our concern is about shadow of AppBarLayout visible when status bar is transparent. Having an opaque status bar is not viable at all times. This

Can I overlap the AppBarLayout with a persistant bottomsheet

感情迁移 提交于 2020-01-14 05:46:08
问题 I want to overlap a AppBarLayout which contains a toolbar with a persistent bottomsheet(when it is in expanded state only).Please tell me at least a hint if it is possible. This is my layout file where my AppBarLayout is defined <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=

AppBarLayout inflating error after migrating to AndroidX

北战南征 提交于 2020-01-12 07:47:26
问题 When migrating to AndroidX I faced this problem: Java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mandarine.android/com.mandarine.android.features.root.RootActivity}: android.view.InflateException: Binary XML file line #18: Binary XML file line #18: Error inflating class android.support.design.widget.AppBarLayout 回答1: Unless you implement the old support libraries and enable Jetifier, you have to rename all your support classes in XML. android.support.design.widget

collapsing toolbar layout like google play store

社会主义新天地 提交于 2020-01-09 09:12:11
问题 i want to make a collapsing toolbar layout like google play store. like this: https://sendvid.com/ugjspx8r and here is my layout: http://sendvid.com/s4mx3xem how can i do that with new android support library? here is my layout xml file: <android.support.design.widget.CoordinatorLayout xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android