android-design-library

AppBarLayout change offset programmatically

倾然丶 夕夏残阳落幕 提交于 2019-12-10 04:21:20
问题 How can I change the offset of the AppBarLayout programmatically? I want a certain offset to the AppBarLayout(partially expanded) when the Activity first loads, then the user could expand it more or collapse it. The current behaviour is that it's fully expanded when the Activity first loads. my.xml <android.support.design.widget.AppBarLayout android:id="@+id/app_bar_layout" android:layout_width="match_parent" android:layout_height="300dp" android:fitsSystemWindows="true" android:theme="@style

My FloatingActionButton has some weird lines coming out of it on 4.4 and lower

允我心安 提交于 2019-12-10 02:58:37
问题 As the title says, my FloatingActionButton has some weird lines coming out of it only on 4.4 or lower. On Lollipop it works fine. This is a picture of the issue: The play image doesn't have those lines in it. My xml: <android.support.design.widget.FloatingActionButton android:id="@+id/play" android:layout_width="48dp" android:layout_height="48dp" android:src="@drawable/ic_av_play_arrow" app:borderWidth="0dp" app:elevation="6dp" app:layout_anchor="@+id/image" app:layout_anchorGravity="center

android : TextInputLayout hides drawableRight of child EditText

佐手、 提交于 2019-12-10 02:30:48
问题 I am always updated with library updates, and this is what it resulted into. In build.gradle(Project:xxx): classpath 'com.android.tools.build:gradle:2.2.0-beta1' In build.gradle(Module:app) compile 'com.android.support:appcompat-v7:24.2.0' compile 'com.android.support:design:24.2.0' And put password field as below: <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <android.support.v7.widget.AppCompatEditText android:layout

(Collapsing)Toolbar title resets its position after Snackbar appearance

谁都会走 提交于 2019-12-09 18:14:01
问题 I have a layout with CollapsingToolbarLayout and CoordinatorLayout as root element. Whenever a Snackbar is shown in the activity the title of the toolbar resets its position to the default expanded title position of the CollapsingToolbar even if the toolbar is not (fully) expanded. The second picture shows that the title is fixed no matter if the toolbar expands or not. The result is the same when I call snackbar.show() in activity or fragment . My layout structure looks like this:

Snackbar with API 21

心已入冬 提交于 2019-12-09 16:44:54
问题 I'm trying to implement the new Snackbars in my app but I can't. First of all I downloaded the zip file from this SnackBarSampleActivity. I unziped it and then I import it in Eclipse. Now I get an error retrieving parent... for the theme parent in styles.xml . I change it to android:Theme.Light and the error was gone. I right clicked the project and checked isLibrary in Properties/Android, I right clicked my app and in Properties/Android I add the library. Finally I paste the code to show a

Android Studio XML preview not showing

二次信任 提交于 2019-12-09 15:10:05
问题 There is something wrong with the AppBarLayout . UPDATE: This is a new error. The XML view preview doesn't show anything. The normal Design View shows a preview but nothing is clickable on it. java.lang.IllegalArgumentException: object is not an instance of declaring class Here is the error: java.lang.IllegalArgumentException: java.lang.ClassCastException@24bbb842 at sun.reflect.GeneratedMethodAccessor319.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke

TextInputLayout hint color in error state

家住魔仙堡 提交于 2019-12-09 14:52:18
问题 As per Googles Material Guidelines: https://material.io/guidelines/components/text-fields.html#text-fields-layout TextInputLayout hint should be the same color as the Error message: However it is not like that and when I call setError("My error") only the underline and the error message show up in red. How can I change this behavior to account for Google's own guidelines? 回答1: here is how you can do it <android.support.design.widget.TextInputLayout android:padding="8dp" android:id="@+id

Bug with anchored FloatingActionButton in support library 24.2.1

核能气质少年 提交于 2019-12-09 14:32:51
问题 I have been having this issue since 24.2.0, but now I'm using 24.2.1 and the bug is still here, it only works well <= 24.1.1. I have an anchored FloatingActionButton done like this: <ScrollView 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="match_parent"> <android.support.design.widget.CoordinatorLayout android:id="@+id

Icons in TabLayout

那年仲夏 提交于 2019-12-09 06:22:34
问题 I have a simple AppCompatActivity with one simple Toolbar (android.support.v7.widget.Toolbar), one Design-Library TabLayout and one ViewPager . Now I have in this case 4 fragments which are inside the viewpager and can be swiped from the sides. That works fine. But as soon as I use mTabLayout.setupWithViewPager(mViewPager); , the icons disappear but I can tab on the empty spaces which works fine. If I remove the line, the icons are visible again, the "swipe" works but if I tab to an icon,

Navigation Drawer statusbar

我怕爱的太早我们不能终老 提交于 2019-12-09 04:30:32
I'm having trouble making Navigation drawer over statusbar . I'm using new Design support library. In blogspot thay said: NavigationView takes care of the scrim protection of the status bar for you, ensuring that your NavigationView interacts with the status bar appropriately on API21+ devices. But it has no documentation so I'm very confused how to use Drawer to achieve desired effect. I tried inserting following attributes in my styles-v21: <item name="android:windowDrawsSystemBarBackgrounds">true</item> <item name="android:statusBarColor">@android:color/transparent</item> after this