android-support-design

Save BottomNavigationView selected item during screen rotation

╄→尐↘猪︶ㄣ 提交于 2019-12-01 03:14:48
Using ASL's 25.0 BottomNavigationView i'm faced with some troubles, like a save selected item (or his index) and selected item programmatically. Unfortunately, there are plenty of features missing in BottomNavigationView at this stage. Your question was really interesting and I wrote this extended BottomNavigationView that preserves the state and, in your case, saves last selected item. Here is gist to the code This extension includes: Gives public two method to set and get selected items programatically. Saves and restores state only for the last selection. Lets wait until ASL devs fix this .

Save BottomNavigationView selected item during screen rotation

我的未来我决定 提交于 2019-11-30 23:49:04
问题 Using ASL's 25.0 BottomNavigationView i'm faced with some troubles, like a save selected item (or his index) and selected item programmatically. 回答1: Unfortunately, there are plenty of features missing in BottomNavigationView at this stage. Your question was really interesting and I wrote this extended BottomNavigationView that preserves the state and, in your case, saves last selected item. Here is gist to the code This extension includes: Gives public two method to set and get selected

NoClassDefFoundError: android.support.design.internal.NavigationMenu on Android 4.2.2 (wiko)

大兔子大兔子 提交于 2019-11-30 18:37:55
I am trying to use the Android Support Design library (in version 23.0.1) and the class NavigationMenu (I use this class as an XML tag into a layout). When I execute my app on a Samsung on Android 4.3 or on a Nexus on Android 5.x or 6.0 everything works well, but when I execute the app on a Wiko Rainbow on Android 4.2.2, it crashes with the following exception : java.lang.RuntimeException: Unable to start activity ComponentInfo{applicationId/package.MainActivity}: android.view.InflateException: Binary XML file line #11: Error inflating class <unknown> [...] Caused by: android.view

How to create AppBarLayout which overlaps content of CoordinatorLayout

孤人 提交于 2019-11-30 15:00:59
问题 When using a CoordinatorLayout with AppBarLayout on some activities I need the content to be under the AppBarLayout, i.e. the Toolbar is using some transparent color and overlays the content. By default CoordinatorLayout + AppBarLayout arrange things so that toolbar and scrolling content are next to eachother, without any overlapping. Android developer guides have the documentation on this here and it looks like this (but those flags do not seem to work with Toolbar and appcompat - I tried):

How to create AppBarLayout which overlaps content of CoordinatorLayout

五迷三道 提交于 2019-11-30 13:45:43
When using a CoordinatorLayout with AppBarLayout on some activities I need the content to be under the AppBarLayout, i.e. the Toolbar is using some transparent color and overlays the content. By default CoordinatorLayout + AppBarLayout arrange things so that toolbar and scrolling content are next to eachother, without any overlapping. Android developer guides have the documentation on this here and it looks like this (but those flags do not seem to work with Toolbar and appcompat - I tried): So I need something that looks like on image above, but with all the scrolling goodies provided by

AppBarLayout.setExpanded(boolean, true) weird animation in support library 23.1.1

穿精又带淫゛_ 提交于 2019-11-30 12:25:14
问题 In my app I expand or contract the AppBarLayout on a specific event using setExpanded(boolean, true) . I've got a good result, with a snappy and fluid animation using com.android.support:design:23.1.0 , then I updated to 23.1.1 and the animation got very slow and not snappy at all. In the source code of android.support.design.widget.AppBarLayout , I located the problem in animateOffsetTo (under public static class Behavior extends HeaderBehavior<AppBarLayout> ), that in the version 23.1.0 was

CoordinatorLayout status bar padding disappears from ViewPager 2nd page

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-30 11:24:46
问题 EDIT of 01/02/2016: Bug should be resolved by applying the code provided by Android Team: https://stackoverflow.com/a/35132144/3397345, see accepted answer below. EDIT of 27/01/2016: Bug still not resolved in v23.1.1. Solutions provided until now don't give transparent status bar (which is the purpose of this layout) or are too complex. A new screen-record of the bug available here: https://www.youtube.com/watch?v=76IxhlUx8MQ EDIT of 23/07/2015: Support Design Library v22.2.1 didn't fix :-(

How to enable horizontal scroll in tab like Google Play?

时间秒杀一切 提交于 2019-11-30 07:52:41
I'm referencing a great demo here regarding material design. It has tabs, but when I add too many the tab items get squished (see screenshot). How can I make it scroll horizontally? I believe below is the layout I should make the change, but I combed the docs and can't seem to get it, pls help! <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"> <android.support.design.widget

Android, DrawerLayout + Fragments + CollapsingToolbarLayout

大城市里の小女人 提交于 2019-11-30 05:18:51
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 DrawerLayout , meant to stay there all the time, but was not able to get it to scroll (on a Nexus5 API 22).

TextInputLayout animation overlaps the text when the text is set programmatically

我与影子孤独终老i 提交于 2019-11-30 05:08:09
I am using TextInputLayout with the design support library 22.2.1 . I set the value of the EditText programmatically, and when the screen appears, I can see that the hint of the TextInputLayout overlaps the text inside, before moving in the floating position. Here a simple layout: <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <EditText android:id="@+id/editText1" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="hint1" /> </android.support.design.widget.TextInputLayout> In my