material-design

how do i create a grid of cards with angular material?

对着背影说爱祢 提交于 2019-12-04 01:19:29
I am trying to create a grid of three cards per row using ng-repeat. I have a normal array of javascript objects attached to the scope. The code below will create a fresh row for every card. <div layout="row" ng-repeat='post in posts' layout-fill="" layout-align=""> <md-card> <md-card-content> <h2 class="md-title">{{post.title}}</h2> <p> {{post.summary}} </p> </md-card-content> <div class="md-actions" layout="row" layout-align="end center"> <md-button>View More</md-button> </div> </md-card> <br> How can I iterate over my array and display the cards in rows of three? I looked at this post and

Android colorControlNormal xml attributes doesn't work pre-Lollipop

孤者浪人 提交于 2019-12-04 01:12:46
I've been trying to change the color of the EditText line on the bottom, but my EditText still doesn't wanna change the color, but it's using the style from Material . I've tried to change the color following these answer: link So I have an EditText with the Material form but not the colors I've set. I've put appcompat-v7 in my Gradle config file, and it's already working for the color primary. <style name="AppBaseTheme.MiddleTheme.Widget.EditText" parent="Theme.AppCompat.Light"> <item name="colorPrimary">@color/middle_primary</item> <!-- Those 3 lines are staying in red war in IntelliJ but it

How do I set default value on md-select component from angular 2 material design?

血红的双手。 提交于 2019-12-04 00:00:47
I have the following select component that gets populated from a data coming from a rest api. How Can I set default selected value on md-select? <md-select placeholder= "Warehouse" style="width: 100%" [(ngModel)]='selectedProductWarehouse.warehouse' name="Warehouse" required #Warehouse="ngModel"> <md-option *ngFor="let warehouse of warehouses" [value]="warehouse">{{warehouse.description}}</md-option> </md-select> you may try below, Component HTML <md-select placeholder="Favorite food" [(ngModel)]="selectedValue" name="food"> <md-option *ngFor="let food of foods" [value]="food.value" > {{food

How to implement WhatsApp like material design SearchView?

白昼怎懂夜的黑 提交于 2019-12-03 20:22:15
WhatsApp has such Toolbar: When 'Search' menu item clicked, from the top SearchView comes down which takes whole space of toolbar: When I tried to implement SearchView, it looks like this: I found some libraries to implement this: Android Material SearchView by Eugene Horan and MaterialSearchView by krishnakapil . But they are not like in WhatsApp. This question may seem weird, I could not find the way how to do this. So my question is how to implement WhatsApp like material design SearchView which comes from the top? I have developed a well received library by the comunity. Does exactly what

Is there an official API for centered title on Toolbar like on popular Android apps, in the new material design?

孤人 提交于 2019-12-03 19:54:01
问题 Background In the past, Google always shown the toolbar to have the title aligned to the left: https://material.io/develop/android/components/app-bar-layout/ However, recently, it seems that on some of its apps, the title is centered, even if it doesn't have symmetric content on the left and right. Example is on "Messages" app: And on "Google News" app : It also got updated on the material guidelines, here. Example: Some people like to call it "material design 2.0", as it got various things

Apply tint to PreferenceActivity widgets with AppCompat v21

妖精的绣舞 提交于 2019-12-03 18:26:16
问题 I'm using CheckboxPreference in a PreferenceActivity and an AppCompat theme from the v21 support library. As you already know, with this latest library widgets like checkboxes, editTexts, radio buttons etc are tinted with the secondary color defined in the theme. In the preference screen, text is in the right color as specifified by my theme, but checkboxes and edittext are not. It seems that when the CheckboxPreference instance creates the widget, it doesn't apply my theme to it. Radio

Error inflating class RecyclerView

萝らか妹 提交于 2019-12-03 18:00:38
问题 So my code simply makes a list of CardViews using RecyclerView. Upon running my code i kept getting a weird error claiming there was an error in my xml. After tinkering for a while i found out that in my layout file if i change <RecyclerView> to <android.support.v7.widget.RecyclerView> everything would work just fine. Why is this happening? My activity. import android.support.v7.app.ActionBarActivity; import android.os.Bundle; import android.support.v7.widget.LinearLayoutManager; import

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

扶醉桌前 提交于 2019-12-03 17:11:31
问题 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">

How to change the uinavigationbar title's position?

假如想象 提交于 2019-12-03 16:56:26
I've managed to change the navigationbar height by using my own navigationbar, but the title is still centered. I want it to be at the 72px position from the left. override func sizeThatFits(size: CGSize) -> CGSize { return CGSizeMake(UIScreen.mainScreen().bounds.width, 56) } I used this to change the height but I didn't find a way to change the position of all the items. I tried to set the frame but I can't. I can't change the position of the button too. i wanna look like this Create a UIView object add UIButton and UILabel in it to show a similar view. Add this custom view into left bar

How to use ItemAnimator in a RecyclerView?

好久不见. 提交于 2019-12-03 16:27:06
问题 I want to do animation when an item is added or removed from adapter of recyclerview. I'am trying to use RecyclerView.ItemAnimator as follows but it is not working.. public class MyAnimator extends RecyclerView.ItemAnimator{ @Override public boolean animateAdd(ViewHolder arg0) { Log.d("test","Added Animation"); return false; } @Override public boolean animateChange(ViewHolder arg0, ViewHolder arg1, int arg2, int arg3, int arg4, int arg5) { Log.d("test","Change Animation"); return false; }