android-design-library

AppCompatEditText.getpParent() inside TextInputLayout returns FrameLayout

半世苍凉 提交于 2019-12-18 03:22:25
问题 I am creating simple AppCompatEditText adding OnFocusChangeListener and putting it in the simple TextInputLayout. When AppCompatEditText loosing focus it's content should be validate by isValidParam method. It worked till yesterday, when I used rev.23.0.3 But now, when I used rev.24.0.2, it gives error as below on the 1st row of isValidParam method. java.lang.ClassCastException: android.widget.FrameLayout cannot be cast to android.support.design.widget.TextInputLayout I checked in debugging

android:layout_height=“?attr/actionBarSize” is not working with support:design:23.0.0' library

爱⌒轻易说出口 提交于 2019-12-18 03:11:57
问题 If I set android:layout_height="56dp" , I can see the toolbar in graphical layout. But when I set like the below, <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="@color/purple" android:gravity="center_vertical" android:minHeight="?attr/actionBarSize" app:layout_scrollFlags="scroll|enterAlways" app:popupTheme="@style/ThemeOverlay.AppCompat.Light"> </android.support.v7.widget.Toolbar

android:layout_height=“?attr/actionBarSize” is not working with support:design:23.0.0' library

喜你入骨 提交于 2019-12-18 03:11:19
问题 If I set android:layout_height="56dp" , I can see the toolbar in graphical layout. But when I set like the below, <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="@color/purple" android:gravity="center_vertical" android:minHeight="?attr/actionBarSize" app:layout_scrollFlags="scroll|enterAlways" app:popupTheme="@style/ThemeOverlay.AppCompat.Light"> </android.support.v7.widget.Toolbar

Snackbar in Support Library doesn't include OnDismissListener()?

邮差的信 提交于 2019-12-18 03:04:43
问题 I'd like to implement the new Snackbar included in the latest Design Support Library, but the way it is offered seems counter-intuitive for my, and I assume many others', use. When the user does an important action, I want to allow them to undo it via the Snackbar, but there seems to be no way to detect when it is dismissed to do the action. It makes sense to me to do it the following way: User does action. Show Snackbar and update UI as if the action has been completed (ie it appears that

Unable to use drawable in EditText inside TextInputLayout

只谈情不闲聊 提交于 2019-12-17 20:28:24
问题 I recently upgraded Android Design library from 24.2.1 to 25.0.0. After this the "drawableX" feature in EditText doesn't work. EDIT 01.11: I learned that setting drawable in xml works if you use android:drawableStart instead of android:drawableLeft. But setting setting drawables programatically does not work. I use this to make a "Clear"-button to empty the EditText. But this feature is broken now. I would appreciate any work-arounds or knowledge about if this is intentional from Google or a

Is there a native component for the Floating action button in Android Material Design?

穿精又带淫゛_ 提交于 2019-12-17 19:25:59
问题 My question revolves around the Floating action button that was introduced in Android Material Design. There are many library offering this component on GitHub as: Android-floating-action-button FloatingActionButton CircularFloatingActionMenu Fab Floating-action-button But my question is: Is there a native component with the last release of android.support.vX that was built for Floating action button ? Components such as : android.support.v7.cardview android.support.v4.widget.DrawerLayout

TabLayout (Android Design Library) Text Color

本秂侑毒 提交于 2019-12-17 15:35:37
问题 I'm using the new TabLayout from the Android Design library. I managed to set the textcolor statelist using tabLayout.setTabTextColors(colorstatelist) How can i achieve the same using styles.xml? 回答1: Via XML attributes: <android.support.design.widget.TabLayout android:layout_width="match_parent" android:layout_height="wrap_content" app:tabMode="fixed" app:tabGravity="fill" app:tabTextColor="@color/your_unselected_text_color" app:tabSelectedTextColor="@color/your_selected_text_color"/>

error can not resolve symbol TabLayout and 'design

安稳与你 提交于 2019-12-17 14:04:08
问题 Please help: I got error when import android.support.design.widget.TabLayout It say "can not resolve symbol 'design' My build.gradle: compileSdkVersion 26 buildToolsVersion "26.0.0" dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile 'com.android.support:appcompat-v7:26' compile 'com.android.support.constraint:constraint

How to change android design support library FAB Button border color?

大兔子大兔子 提交于 2019-12-17 10:54:42
问题 I want to change fab button border color. border color is white, inside color is black or transparent I'd like my button to look like this: 回答1: fab.xml in drawable <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:innerRadius="0dp" android:shape="ring" android:thicknessRatio="2" android:useLevel="false" > <solid android:color="@android:color/transparent" /> <stroke android:width="3dp" android:color="@android:color/white" /> <

How to set custom typeface to items in NavigationView?

人走茶凉 提交于 2019-12-17 07:03:12
问题 With the new NavigationView , we are able to set a drawer's items through a menu resource in XML. With that, we can set each item with something like <item android:id="@+id/drawer_my_account" android:icon="@drawable/ic_my_account" android:title="@string/drawer_my_account" /> But now, I want to set a custom typeface to each of those items in my drawer, and I could not find a way to do that, either by XML or by Java code. Is there a way to do it? 回答1: just add following class file to your