material-design

How to show Snackbar when Activity starts?

孤者浪人 提交于 2019-12-18 10:22:49
问题 I want to show android Snackbar (android.support.design.widget.Snackbar) when the activity starts just like we show a Toast . But the problem is we have to specify the parent layout when creating Snackbar like this: Snackbar.make(parentlayout, "This is main activity", Snackbar.LENGTH_LONG) .setAction("CLOSE", new View.OnClickListener() { @Override public void onClick(View view) { } }) .setActionTextColor(getResources().getColor(android.R.color.holo_red_light )) .show(); How to give parent

Two floating action buttons next to each other

人盡茶涼 提交于 2019-12-18 10:15:01
问题 The material design documentation has an example of Google Maps showing two floating action buttons next to one another (actually, one above the other). How is this done? I have two FAB's in a coordinator layout, but they end up on top of one another, so you only see one button. <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout

Android L - Floating Action Button (FAB)

本秂侑毒 提交于 2019-12-18 09:59:31
问题 Did Google already released a defined style or a component for this new circular FAB button or should I implement the design on my own? The button is described here: Google Design | Floating Action Buttons EDIT (05/2015): Check Lukas' answer / Gabriele's answer showing an easy way to implement it with the design support library. 回答1: UPDATE : there's now an official widget for FAB: FloatingActionButton, see Gabriele Mariotti reply for full information. According to Adam Powell and Chet Haase

mat-table can't bind dataSource

本秂侑毒 提交于 2019-12-18 09:38:50
问题 I am trying to use angular material table MatTableModule , but when passing the data to the [dataSource] input I am getting the Can't bind to 'dataSource' since it isn't a known property of 'table'. error. I have already imported the MatTableModule and as pointed at GitHub issue #5577 also imported CdkTableModule but still no luck. Any ideas? 回答1: The problem was that the material angular version I'm using is v5.2.4, so the template should be <mat-table #table [dataSource]="dataSource"></mat

Is any difference between a MaterialButton and a simple Button?

≯℡__Kan透↙ 提交于 2019-12-18 09:03:33
问题 If I set Theme.MaterialComponents.Light as my main theme, will be any difference between these two buttons if I use them in an xml layout? <Button /> <com.google.android.material.button.MaterialButton /> As I saw they behave both as MaterialButtons. If I want to get the behavior of the old plain button, I have to use: <androidx.appcompat.widget.AppCompatButton /> Thanks in advance! 回答1: If you are using a Material Theme there is no difference between <Button /> and <com.google.android

How do ligature icons work in Material Icons?

。_饼干妹妹 提交于 2019-12-18 07:45:00
问题 Using Material Icons, a plus icon can be added as follows: <i class="material-icons">add</i> The text add is no longer visible. Why does this happen and where does the plus icon come from? I know it's defined in the font file, but how? If it's due to the word add linked with the plus icon in the font file, then why doesn't the following work in Bootstrap, with its Glyphicons? <span style="font-family: 'Glyphicons Halflings'">\20ac</span> 回答1: EXPLANATION When you strip all the technical

How do ligature icons work in Material Icons?

孤街浪徒 提交于 2019-12-18 07:44:34
问题 Using Material Icons, a plus icon can be added as follows: <i class="material-icons">add</i> The text add is no longer visible. Why does this happen and where does the plus icon come from? I know it's defined in the font file, but how? If it's due to the word add linked with the plus icon in the font file, then why doesn't the following work in Bootstrap, with its Glyphicons? <span style="font-family: 'Glyphicons Halflings'">\20ac</span> 回答1: EXPLANATION When you strip all the technical

using paper datatable in angular2

天涯浪子 提交于 2019-12-18 07:07:36
问题 I have been struggling for quiet a while about using paper-data-table (paper data table by David Mulder) in my angular 2 application. The problem im facing is described in the data table issue: Issue opened regarding using the table in angular 2 applicaiton Basically there is a use of the polymer undocumented dataHost property that gets incorrect value when using it in angular2. I have tried a few angles of solutions which I cant make any of them work completely: 1) I tried to find a way to

Material Date Picker text color

馋奶兔 提交于 2019-12-18 05:13:41
问题 I am trying to change the text color of my DatePicker <DatePicker android:id="@+id/start_date_text" android:layout_width="400dp" android:layout_height="190dp" android:datePickerMode="spinner" android:calendarViewShown="false" style="@style/MyDatePicker" /> This code just gives 3 pickers, month, day and year. How can I change this text color? <style name="MyDatePicker" parent="android:Widget.Material.Light.DatePicker"> <item name="android:textColor">@color/Black</item> </style> where Widget

how to use material design features in api lower than 21 in eclipse?

大城市里の小女人 提交于 2019-12-18 05:13:33
问题 there are many questions regarding this but not even single helped me. So please tell me how to enable material design features in eclipse. i have also imported appcompat_v7 library in project but it does not create a folder with name values_v21 which helps in using those feature i think. So please help me out in this here is my styles.xml file <?xml version="1.0" encoding="utf-8"?> <resources> <style name="AppTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar"> <item name="android