CollapsingToolbarLayout setTitle() does not update unless collapsed

EDIT: This solution is no longer needed. bug fixed in v22.2.1 I didnt want to just leave links so here is the full solution. The bug occurs because the code to handle the collapsable title only updates the actual title if the current title is null or the text size has changed. The workaround is … Read more

How to use setOutlineProvider instead of setOutline in Lollipop

Just to complete the @ianhanniballake answer: Button fab = (Button) findViewById(R.id.fab); //Outline outline = new Outline(); //outline.setOval(0, 0, size, size); //fab.setOutline(outline); ViewOutlineProvider viewOutlineProvider = new ViewOutlineProvider() { @Override public void getOutline(View view, Outline outline) { // Or read size directly from the view’s width/height int size = getResources().getDimensionPixelSize(R.dimen.fab_size); outline.setOval(0, 0, size, size); } }; fab.setOutlineProvider(viewOutlineProvider);

Best way to create a bottom toolbar in android.

<android.support.v7.widget.Toolbar xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:app=”http://schemas.android.com/apk/res-auto” android:id=”@+id/actionbarT” android:layout_width=”match_parent” android:layout_height=”wrap_content” android:background=”@drawable/thebackgroundimageyouwant” android:minHeight=”?attr/actionBarSize” app:theme=”@style/Base.Theme.AppCompat.CompactMenu” > <LinearLayout android:id=”@+id/toolbarmenucontainer” android:layout_width=”match_parent” android:weightSum=”3″ android:layout_height=”match_parent” android:orientation=”horizontal” > <ImageButton android:layout_width=”0dp” android:layout_height=”match_parent” android:background=”@drawable/preferedbackground” android:clickable=”true” android:scaleType=”fitXY” android:layout_weight = “1” android:src=”https://stackoverflow.com/questions/30063426/@drawable/preferredimage” /> <ImageButton android:layout_width=”0dp” android:layout_height=”match_parent” android:background=”@drawable/preferedbackground” android:clickable=”true” android:scaleType=”fitXY” android:layout_weight = “1” android:src=”https://stackoverflow.com/questions/30063426/@drawable/preferredimage” /> <ImageButton android:layout_width=”0dp” android:layout_height=”match_parent” android:background=”@drawable/preferedbackground” android:clickable=”true” android:scaleType=”fitXY” android:layout_weight = “1” android:src=”https://stackoverflow.com/questions/30063426/@drawable/preferredimage” /> </LinearLayout> </android.support.v7.widget.Toolbar> the idea is … Read more

Filtering different columns in a material table

this an example of implement column filter for angular material table based on other material components 👇 structure of column filter for single column <ng-container matColumnDef=”position”> <th mat-header-cell *matHeaderCellDef> <div class=”header”> No. <button mat-button class=”btn-toggle” [matMenuTriggerFor]=”menu”> <mat-icon>keyboard_arrow_down</mat-icon> </button> </div> <mat-menu #menu> <div mat-menu-item mat-filter-item [disableRipple]=”true” class=”menu-title”> No. </div> <div mat-menu-item mat-filter-item [disableRipple]=”true”> <mat-form-field> <mat-select [panelClass]=”‘mat-elevation-z10′” … Read more

How to create a card toolbar using appcompat v7

Thanks Gabriele for all the help. Here is working code: Activity : public class MainActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_mai); Toolbar toolbar = (Toolbar) findViewById(R.id.card_toolbar); if (toolbar != null) { // inflate your menu toolbar.inflateMenu(R.menu.main); toolbar.setTitle(“Card Toolbar”); toolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem menuItem) { return true; } … Read more

Convert colorPrimary to colorPrimaryDark (how much darker)

Material design color palette was not generated by manipulating the color in HSV. It was done with HSL (Hue, Saturation, Lightness). Here is a utility class that will darken/lighten a color using HSL package com.ammar.materialcolorizer; import android.graphics.Color; /** * A utility class for darkening and lightening colors in the same way as * material design … Read more

Trying to have a grid of card with angular material

You could use Flex Box instead of md-grid-list to have the same effect. <div class=”md-padding” layout=”row” flex> <div layout=”row” flex> <div class=”parent” layout=”column” ng-repeat=”user in users” flex> … Your content here </div> </div> </div> Take a look at this Example with fixed number of cards in a row: http://codepen.io/anon/pen/bdQJxy And a responsive example, using Wrap … Read more

Android CollapsingToolbarLayout with custom View

I had the same problem and spend many hours trying to find a solution. My solution was to add the collapsing Views (ImageView and TextView) inside the CollapsingToolbarLayout and then handle the transition in code. This way it’s more flexible and simpler than extending from CollapsingToolbarLayout. First you’ll need to add your Views inside the … Read more

Android Material Design Datepicker with AppCompat

Update: As well pointed out by jfcartier, there’s now also MaterialDateTimePicker. It’s probably a nicer solution than the one below since it has a nice themable API. You could try the android-betterpickers library. It has a CalendarDatePickerDialog widget that looks like the one you want. It provides a light and a dark theme, but for … Read more