material-design

No toolbar elevation shadow on Android 9

孤者浪人 提交于 2019-12-07 03:22:41
I'm struggling to make toolbar shadow appear on Android 28+. I tried multiple solutions suggested, but none worked. Following styles work well for all devices below 28: toolbar.xml <?xml version="1.0" encoding="utf-8"?> <androidx.appcompat.widget.Toolbar xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/toolbar" style="@style/Widget.App.Toolbar" android:layout_width="match_parent" android:background="?attr/colorPrimary" android:layout_height="?attr/actionBarSize" /> styles.xml <style name="Widget.App.Toolbar.V1"

Why are my buttons' click areas too small inside a CollapsingToolbarLayout?

时光毁灭记忆、已成空白 提交于 2019-12-07 02:24:19
问题 I've got three buttons inside a CollapsingToolbarLayout . When expanded, the idea is to modify a filter on the image gallery being displayed, or pop up an edit dialog. I was getting inconsistent results–the buttons were only responding to clicks intermittently. Eventually, I realized the issue was that the clickable area was much smaller than the client rect of the view. Horizontally, they seem normal, but vertically the clickable area is much shorter than the button. In the emulator I was

setError for TextInputLayout showing Error

送分小仙女□ 提交于 2019-12-07 00:53:48
问题 TextInputLayout working fine, when tried to set Error it showing error. Code: if (etFirstName.getText().length() == 0) { etFirstName.requestFocus(); tvFirstName.setError("Please enter firstname"); } else { tvFirstName.setError(null); tvFirstName.setErrorEnabled(false); } Check Log: java.lang.RuntimeException: Failed to resolve attribute at index 24 at android.content.res.TypedArray.getColor(TypedArray.java:401) at android.widget.TextView.<init>(TextView.java:692) at android.widget.TextView.

CoordinatorLayout does not hide Toolbar on scrolling despite implementing all required parameters

好久不见. 提交于 2019-12-07 00:01:12
问题 Here is my setup, i am running a DrawerLayout , within it is a CoordinatorLayout containing an AppBarLayout and a nestedscrollview . I am trying to have the nestedscrollview scroll normally and the Toolbar to get hidden on scrolling down and reppear on scrolling up. Attached within is my XML code. Would appreciate any help.. have read all related questions and implemented their answers without any success. <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk

Why should I start using Google Material Design Lite instead of Twitter Bootstrap or Foundation

跟風遠走 提交于 2019-12-06 22:54:20
问题 Disclaimer: I don't want to start any fight against Google Fanboys . I'm just asking because I didn't find a direct answer to my question and maybe someone who already started working with it (or any googledev) can give advice. Google recently announced Material Design Lite 1.0 and the project has been starred over 9k times on Github in a few days. I read some posts [1, 2] comparing MDL vs Twitter Bootstrap and I don't understand why anyone outside Google's headquarters should consider start

How to set Floating Action Button image to fill the button?

孤街浪徒 提交于 2019-12-06 21:59:38
问题 Usually icons are set for floating action buttons, but I need to set an image, so I can make a circular image. I added it to the project (using Android Studio-> New -> Image Asset), but the image didn't fill the entire button: My xml: <com.github.clans.fab.FloatingActionMenu android:id="@+id/run_menu" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" android:paddingBottom="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin"

CoordinatorLayout not working

ぃ、小莉子 提交于 2019-12-06 20:36:02
问题 I am attempting to implement a CoordinatorLayout from the newly announced Android Design Support Library and I have used the following code in my XML layout as per the sample here: <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.AppBarLayout android

I want to set a transparent background layer when I click on the floating action menu.

自古美人都是妖i 提交于 2019-12-06 19:54:28
This is what I have done so far. Created FloatingActionButton. Now As the + icon is pressed a translucent layer should be there at the back. <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <com.getbase.floatingactionbutton.FloatingActionsMenu android:id="@+id/actionMenu" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" android:layout_marginBottom="60dp" fab:fab_addButtonColorNormal="@color/primary" fab:fab

Is there any way to do a Material-style shadow in API < 21 (5.0 Lollipop)?

余生长醉 提交于 2019-12-06 19:49:58
问题 Material design makes a huge emphasis on the metaphor of "sheets of paper". To make these, shadows are essential. Since Material design is a philosophy and not an API (despite it being built into L), this should be done anywhere (Windows Forms, HTML/CSS, etc.). How do I do this in Android API 14 to 20? Note that premade PNGs won't really be that practical for circular and other non-square shapes. 回答1: If you're not worried about backwards compatibility past Lollipop, you can set the elevation

How to add ripple effect to an ionic 2 element?

守給你的承諾、 提交于 2019-12-06 18:16:16
问题 Some elements, like the button, have native ripple effect on Ionic 2. Others like cards doesn't. How could I add support to ripple effect on an arbitrary Ionic 2 element? 回答1: Try wrapping the content like this: <button ion-item> <ion-item style="background: rgba(0,0,0,0);">Content</ion-item> </button> 回答2: As I see by sources of Ionic v3.3, a container element must contain an empty div element with button-effect class, also the container must have tappable attribute and be styled as position