material-design

Android Material Design: Failed to find style 'toolbarStyle' in current theme

社会主义新天地 提交于 2019-12-02 20:31:52
I am trying to use the toolbar widget in android 21 with a custom style but I can't get rid off this error : Failed to find style 'toolbarStyle' in current theme . Here is my layout xml file : <android.support.v7.widget.Toolbar xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/patient_toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" app:theme="@style/AppTheme.Patient" /> Here is the Patient theme : <resources> <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light"> <!-- Customize your theme here. --> </style>

Unable to get exact circle shape when using card view

帅比萌擦擦* 提交于 2019-12-02 20:09:58
I'm using card view for floating action button in android material design. I'm using following code for get the circle <android.support.v7.widget.CardView android:id="@+id/fab" android:layout_width="38dp" android:layout_height="38dp" android:layout_marginBottom="10dp" android:layout_marginRight="10dp" card_view:background="@color/blue" card_view:cardCornerRadius="19dp" card_view:cardPreventCornerOverlap = "false" card_view:cardElevation="6dp" > </android.support.v7.widget.CardView> I have set corner radius as half of width. but still I can't get the circle shape. I have solved the problem. Now

Android Fullscreen dialog confirmation and dismissive actions

我的梦境 提交于 2019-12-02 19:34:11
Fullscreen dialogs in material design should have the confirmation and dismissive actions on the actionbar/toolbar. My question, how can i do this? To show the dialog: getFragmentManager().beginTransaction() .add(R.id.container, new MyDialogFragment()) .addToBackStack(null).commit(); My dialog fragment: public class MyDialogFragment extends DialogFragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return inflater.inflate(R.layout.fragment_layout, container, false); } } Only two things need to be done: Change the up icon Add a

Android EditText with different floating label and placeholder

早过忘川 提交于 2019-12-02 19:27:29
How can i create an editText that looks like this? You can do this using TextInputLayout and EditText . Here is your XML: <android.support.design.widget.TextInputLayout android:id="@+id/text_input_layout" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Label"> <EditText android:id="@+id/edit_text" android:layout_width="match_parent" android:layout_height="wrap_content" android:inputType="text" /> </android.support.design.widget.TextInputLayout> 1. Add attribute android:hint="Label" to TextInputLayout to show its hints Label always. 2. Programmatically set

Android L Change Theme Colors Error

a 夏天 提交于 2019-12-02 19:14:57
问题 I've been following the new steps for Android L here: http://developer.android.com/preview/material/theme.html I've have been trying to change the colors of the status bar but it doesn't work. My styles.xml: <?xml version="1.0" encoding="utf-8"?> <resources> <style name="AppTheme" parent="android:style/Theme.Material.Light"> <!-- Main theme colors --> <!-- your apps branding color (for the app bar) --> <item name="android:colorPrimaryDark">@color/primary_dark</item> <item name="android

Ripple effect for lollipop views

白昼怎懂夜的黑 提交于 2019-12-02 19:06:54
I have been developing an app for Lollipop (API 21). When I change the Button color to something, the ripple effect doesn't works. I found some third party libraries for the ripple effect, but I want to do this with standard API. This answer didn't help either. XML: <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="New Button" android:id="@+id/button" android:layout_below="@+id/textView" android:background="@android:color/holo_blue_bright" android:layout_alignParentStart="true" android:layout_marginTop="76dp" /> You have to set your button's

icon with real color shows black background

℡╲_俬逩灬. 提交于 2019-12-02 18:59:13
问题 Using the new theme Theme.MaterialComponents when placing an icon on a button shows me a black box, how can I place an icon with its real color? <Button android:id="@+id/idGoogle" app:icon="@drawable/ic_google" app:iconTintMode="add"/> 回答1: The solution <Button android:id="@+id/idGoogle" app:icon="@drawable/ic_google" app:iconTint="@null"/> 来源: https://stackoverflow.com/questions/54637591/icon-with-real-color-shows-black-background

Angular Material Design - Change flex value with screen size

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-02 18:50:44
I'm new to AngularJS so please bear with me. I'm using Angular Material Design and I have difficulties in identifying a way to efficiently do responsive grids. Please see my comments in the code below: <div layout="row"> <div layout="row" flex="75" layout-sm="column" class="ptn-info-grid" layout-margin> <!-- USING ROW FOR DESKTOP AND COLUMN FOR MOBILE DEVICES --> <div layout="column" flex="66"> <!-- I want this div occupy 2/3 of screen in Desktop but change to 100 in mobile devices (but stays in 66) --> <div layout="row" layout-sm="column"> <div class="ptn-info-grid-item" flex>1</div> <div

Material Design icon colors

a 夏天 提交于 2019-12-02 18:49:40
Which color should be the "dark" material icon ? On the official documentation ( https://www.google.com/design/spec/style/icons.html#icons-system-icons at the bottom) it is 54 % black (grey) , but all downloads of the material icons are either white or 100 % black . Also on the new official site https://www.google.com/design/icons/ you can download either white or black, but not "grey"! So I have to set 54 % to all downloaded icons for myself? Or did I miss something? I am too late to reply but nevertheless I will answer the question since it may save lot of time for some developers. I myself

How to change the size of menu item icon in NavigationView?

房东的猫 提交于 2019-12-02 18:46:01
I have the following menu item: <item android:id="@+id/lock" android:checkable="true" android:title="@string/lock" > <menu > <item android:id="@+id/block_mess" android:checked="true" android:icon="@drawable/chantinnhan" android:title="@string/block_mess_string" /> <item android:id="@+id/block_call" android:checked="false" android:icon="@drawable/chancuocgoi" android:title="@string/block_call_string" /> <item android:id="@+id/lock_app" android:checked="false" android:icon="@drawable/khoaungdung" android:title="@string/lock_app_string" /> </menu> </item> ...there's still more but it's really