material-design

how can I change the color of Toast depends on message type in Angular material $mdToast?

霸气de小男生 提交于 2019-12-03 08:04:23
问题 While using $mdToast.simple().content("some test") it is showing the toast with black color. how can I change that color to red, yellow and so, depends on the type of the error messages like error, warning and success. Similar question as this. 回答1: EDIT: For a correct implementation, please use rlay3s solution below :)! OUTDATED: I had problems displaying custom text with jhblacklocks solution, so I decided to do it like this using 'template': var displayToast = function(type, msg) {

AppCompat v21 Dark ToolBar style

社会主义新天地 提交于 2019-12-03 07:46:03
问题 I want my ToolBar to serve as an ActionBar and I want it to look like a light theme with a dark action bar. I can't seem to find the right combination to do it. This is what I have in styles.xml <style name="Theme.MyTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="windowActionBar">false</item> <item name="colorPrimary">@color/my_awesome_color</item> <item name="android:textColorPrimary">@color/my_awesome_text_color</item> <item name="colorPrimaryDark">@color/my_awesome_darker

Unable to get exact circle shape when using card view

落爺英雄遲暮 提交于 2019-12-03 07:28:03
问题 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

Android EditText with different floating label and placeholder

久未见 提交于 2019-12-03 06:51:45
问题 How can i create an editText that looks like this? 回答1: 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.

Material design stepper control

南楼画角 提交于 2019-12-03 06:42:33
问题 Could someone give me an idea how to begin implementing vertical, non-linear stepper control described in the Android Material Design guide here: http://www.google.com/design/spec/components/steppers.html 回答1: you can check this library , however this is still in development. just extend the mobileStepperSimple class and implement the methods init,onFinished. you can add the steppers as fragments by extending the stepperFragment and implement onNextButtonHandler to handle next button click.

Dialog buttons with long text not wrapping / squeezed out - material theme on android 5.0 lollipop

偶尔善良 提交于 2019-12-03 06:32:29
问题 While optimizing an app for material theme on lollipop, I'm encountering this annoying problem: Whenever there is long text on dialog buttons, that doesn't fit the button bar width in total, the text isn't wrapped in multiple lines for those buttons as in previous themes. Instead the following buttons get squeezed out of the dialog, being unreachable (see image below). Screenshot: I've spent a lot of time on this problem so far and the only topic regarding it, that I could find on the

Material Design icon colors

牧云@^-^@ 提交于 2019-12-03 06:22:31
问题 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? 回答1: I am too late to

How to apply global custom style to android.support.design.widget.TextInputEditText?

二次信任 提交于 2019-12-03 06:21:35
I have my AppTheme defined in style.xml where I apply a custom style globally for all my app's TextView , EditText , Button etc. Now I'd like to do the same for android.support.design.widget.TextInputEditText but how? It does not extend EditText so that style is ignored. Here's what I've got: <?xml version="1.0" encoding="utf-8"?> <resources> <style name="AppTheme" parent="@style/Theme.AppCompat.Light.NoActionBar"> <item name="colorPrimary">@color/primary</item> <item name="colorPrimaryDark">@color/primary</item> <item name="colorAccent">@color/accent</item> <!-- Globally override default

iOS Android Material Design Hierarchical Timing using UICollectionView

我的未来我决定 提交于 2019-12-03 06:05:33
I want to do the animation introduced by Android Material Design Hierarchical Timing in iOS using UICollectionView Lets say its a collectionView, and resizing the view is not an issue, what would be the best practice to do this animation in that timely fashion. How to perform the delay One way to do this would be to add the cells one at a time with a timer, and have those cells expand to full size as they come on to the window. #import "ViewController.h" #import "RDCollectionViewCell.h" @interface ViewController () <UICollectionViewDataSource, UICollectionViewDelegate,

How to launch application with Theme.Material on older devices

烈酒焚心 提交于 2019-12-03 05:59:05
问题 How can I run my app on pre-v21 devices? compileSdkVersion 'android-L' minSdkVersion 14 targetSdkVersion 'L' I'm only using the Theme.Material on v21 . I'm NOT using the v20 support library, I'm using com.android.support:support-v4:19.+ When running the application from Android Studio it says that the device in not compatible: {compatible=NO, reason=minSdk(API 20, L preview) != deviceSdk(API 16)} From where is it taking the minSdk 20 ? EDIT: The reason this is happening could be (if verified)