android-support-design

Rounded corners on material button

痴心易碎 提交于 2019-11-30 04:33:48
I'm following the tips from questions like this to create a button style like suggested on Material Design. However, I need to change the corner radius and haven't been able to do so by inheriting Widget.AppCompat.Button.Colored style and setting the radius parameter. How can I have the same style but with rounded corners? You need to inherit that style. Add into your styles.xml: <style name="AppTheme.RoundedCornerMaterialButton" parent="Widget.AppCompat.Button.Colored"> <item name="android:background">@drawable/rounded_shape</item> </style> Add file drawable/rounded_shape.xml: <shape xmlns

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

只谈情不闲聊 提交于 2019-11-30 03:06:49
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 like this: private void animateOffsetTo(final CoordinatorLayout coordinatorLayout, final AppBarLayout

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

坚强是说给别人听的谎言 提交于 2019-11-30 02:47:13
问题 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

How to set maximum expanded height in android support design bottom sheet?

老子叫甜甜 提交于 2019-11-30 01:33:25
I already showed my bottom sheet layout with its peek height set to 100dp. But how can I limit my bottom sheet to expand to 500dp only? This is my sample layout: <android.support.design.widget.CoordinatorLayout android:id="@+id/coordinator" 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"> <fragment xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/map" android:name="com.google.android.gms

CoordinatorLayout status bar padding disappears from ViewPager 2nd page

自作多情 提交于 2019-11-30 00:11:10
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 :-( Also this happens on toolbar quick return on MainActivity! EDIT of 28/07/2015: Linked question:

Recycler view item fill up entire recycler view height after upgrading support library from “23.1.1” to “23.2.1”

三世轮回 提交于 2019-11-29 22:49:47
Previously, I'm using the following old support libraries "23.1.1". compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.android.support:support-v4:23.1.1' compile 'com.android.support:preference-v7:23.1.1' compile 'com.android.support:preference-v14:23.1.1' compile 'com.android.support:design:23.1.1' compile 'com.android.support:recyclerview-v7:23.1.1' It works pretty well. Here's how my RecyclerView looks like Now, I wish to migrate to "23.2.1", due to some bug fixes done. compile 'com.android.support:appcompat-v7:23.2.1' compile 'com.android.support:support-v4:23.2.1' compile 'com

Changing TabLayout icons on left, top, right or bottom in com.android.support:design:23.1.0

别等时光非礼了梦想. 提交于 2019-11-29 21:36:57
I'm pretty new to android development. So bear with me. I've been trying to align the icon and text in same line in com.android.support:design:23.1.0 for a day. Apparently in com.android.support:design: 23.1.0 they've changed the default icon position to top and text on the bottom. Previously in com.android.support:design: 23.0.1 the default was the icon on left and text in same line as the icon So here's an easy way to solve it (though it might have drawbacks, idk tbh): change the version in your app's build.gradle. ex: 23.1.0 to 23.0.1 and build. And there's a better way to do it (this way

BottomNavigationView display both icons and text labels at all times

前提是你 提交于 2019-11-29 21:10:31
I am using android.support.design.widget.BottomNavigationView from design support library version 25 compile 'com.android.support:design:25.0.0' <android.support.design.widget.BottomNavigationView android:id="@+id/bottomBar" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_gravity="center" app:itemBackground="@color/colorPrimary" app:menu="@menu/bottom_navigation_main" android:forceHasOverlappingRendering="true"/> When there are only three actions in @menu/bottom_navigation_main, it displays both icons and text

How to enable horizontal scroll in tab like Google Play?

浪尽此生 提交于 2019-11-29 10:39:03
问题 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

Android KitKat: android.view.InflateException: Error inflating class android.support.design.widget.NavigationView

柔情痞子 提交于 2019-11-29 05:06:23
Below is my configuration. This works on Android Lollipop but crash on Android Kitkat. I tried every workaround here but can't help: Error inflating class android.support.design.widget.NavigationView build.gradle android { compileSdkVersion 23 buildToolsVersion "23.0.2" defaultConfig { minSdkVersion 14 targetSdkVersion 23 // Support RenderScript Library v8 renderscriptTargetApi 18 renderscriptSupportModeEnabled true } } ext{ supportLibVersion = '23.1.1' } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile "com.android.support:appcompat-v7:$