android-support-design

Android, DrawerLayout + Fragments + CollapsingToolbarLayout

怎甘沉沦 提交于 2019-11-29 03:41:56
问题 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

TextInputLayout animation overlaps the text when the text is set programmatically

谁说胖子不能爱 提交于 2019-11-29 02:29:25
问题 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

How to set the elevation of an AppBarLayout programmatically in the Android Support Library v24.0.0?

让人想犯罪 __ 提交于 2019-11-28 23:15:48
When upgrading from the Android Support Library v23.4.0 to v24.0.0, setting the elevation to 0 programmatically to an AppBarLayout stopped working: appBayLayout.setElevation(0); It does work when setting the elevation in the XML. Edit The AppBarLayout from v24.0.0 uses a StateListAnimator that defines the elevation depending on its state. So using setElevation will have no effect if a StateListAnimator is being used (which happens by default). Set the elevation via the XML or programmatically (both for API >= 21): StateListAnimator stateListAnimator = new StateListAnimator(); stateListAnimator

How to put RelativeLayout inside CoordinatorLayout

旧城冷巷雨未停 提交于 2019-11-28 23:15:45
I'm trying to recreate the search box as it is in Airbnb Android app. So I'm using CoorinatorLayout with Toolbar and RecyclerView . But when I insert something inside the Coordinator besides those two things, it doesn't show up. Here is my code: <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/slidingLayout" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.design.widget.AppBarLayout android:id="@+id/appbar" android:layout

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

馋奶兔 提交于 2019-11-28 22:20:57
问题 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"

Rounded corners on material button

那年仲夏 提交于 2019-11-28 22:18:19
问题 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? 回答1: You need to inherit that style. Add into your styles.xml: <style name="AppTheme.RoundedCornerMaterialButton" parent="Widget.AppCompat.Button.Colored"> <item name=

Android BottomSheetDialogFragment does not expand completely

て烟熏妆下的殇ゞ 提交于 2019-11-28 21:23:12
I have the following test bottom sheet implementation. When I set the peekHeight to a value less than 500, it works. After some value, any increase in peek height will not change how the bottom sheet is expanded. It Just remains there to only drag manually. How do we set the peekHeight programmatically to ensure that the bottom sheet is auto expanded to the peek height. bottom_sheet_dialog_main <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"

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

泄露秘密 提交于 2019-11-28 19:36:53
问题 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

BottomNavigationView display both icons and text labels at all times

我的梦境 提交于 2019-11-28 17:16:45
问题 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"/>

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

与世无争的帅哥 提交于 2019-11-28 17:12:15
问题 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