material-design

Is it possible to set Material ChipGroup orientation to VERTICAL?

六眼飞鱼酱① 提交于 2021-02-15 06:14:47
问题 I'm adding a material ChipGroup dynamically to a parent linear layout which is set to VERTICAL orientation but the chip items seem to be added horizontally. Is there any way to make it lay out the chip items vertically? setLayoutDirection() method of ChipGroup class method doesn't seem to take any parameter that supports VERTICAL orientation. 回答1: you can set width = match_parent in each Chip item <com.google.android.material.chip.ChipGroup android:id="@+id/chipGroup" android:layout_width=

Centered icon and text (React Material-UI)

↘锁芯ラ 提交于 2021-02-11 15:21:41
问题 I am interested in best way to present a React Material-UI with icon and text, so it is all vertically aligned. Right now it does not work as expected, especially with conditional rendering. <Typography gutterBottom variant="subtitle2" component="h2" align="center"> <Grid container direction="row" alignItems="center" wrap="nowrap"> {p.numRooms > 0 && ( <Grid item xs={2} alignItems="center"> <HotelRoundedIcon color="secondary" /> {p.numRooms} </Grid> )} {p.area > 0 && ( <Grid item xs={2}>

Change switch color when disabled

倖福魔咒の 提交于 2021-02-11 07:37:38
问题 I've a switch that when is enabled and checked, it's color is my colorPrimary. I want to have the same color when it's checked but disabled, and i can't find a way to get it done. I tried using a selector, but it changes the switch background and not the toggle itself. How can i change the toggle of the switch color? Thanks. 回答1: 1-use this in styles.xml <style name="SwitchStyle" parent="Theme.AppCompat.Light"> <item name="colorControlActivated">@color/theme</item> <item name=

Change switch color when disabled

会有一股神秘感。 提交于 2021-02-11 07:34:05
问题 I've a switch that when is enabled and checked, it's color is my colorPrimary. I want to have the same color when it's checked but disabled, and i can't find a way to get it done. I tried using a selector, but it changes the switch background and not the toggle itself. How can i change the toggle of the switch color? Thanks. 回答1: 1-use this in styles.xml <style name="SwitchStyle" parent="Theme.AppCompat.Light"> <item name="colorControlActivated">@color/theme</item> <item name=

MaterialDatePicker is slow

吃可爱长大的小学妹 提交于 2021-02-10 14:41:09
问题 I'm using MaterialDatePicker, but it's slow. public class MainActivity extends AppCompatActivity { MaterialDatePicker.Builder<Long> datePickerBuilder; MaterialDatePicker<Long> datePicker; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); datePickerBuilder = MaterialDatePicker.Builder.datePicker(); datePicker = datePickerBuilder.build(); Button btn = findViewById(R.id.btn); btn.setOnClickListener(new View

MaterialDatePicker is slow

為{幸葍}努か 提交于 2021-02-10 14:40:33
问题 I'm using MaterialDatePicker, but it's slow. public class MainActivity extends AppCompatActivity { MaterialDatePicker.Builder<Long> datePickerBuilder; MaterialDatePicker<Long> datePicker; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); datePickerBuilder = MaterialDatePicker.Builder.datePicker(); datePicker = datePickerBuilder.build(); Button btn = findViewById(R.id.btn); btn.setOnClickListener(new View

How to disable ripple effect on long press of a button in lollipop?

爱⌒轻易说出口 提交于 2021-02-09 02:45:50
问题 How to disable ripple effect on long press of a button in lollipop? When using sherlock long press of a button is not showing ripple effect but when i use appcompat it is showing a ripple effect on click and also on long click of a button . I do not want any ripple effect on the press of a button 回答1: If you have root, have a look at my patch here https://github.com/luv/android5_noripple My patch simply replaces draw function in android.graphics.drawable.Ripple with a function that does

How to disable ripple effect on long press of a button in lollipop?

本秂侑毒 提交于 2021-02-09 02:45:28
问题 How to disable ripple effect on long press of a button in lollipop? When using sherlock long press of a button is not showing ripple effect but when i use appcompat it is showing a ripple effect on click and also on long click of a button . I do not want any ripple effect on the press of a button 回答1: If you have root, have a look at my patch here https://github.com/luv/android5_noripple My patch simply replaces draw function in android.graphics.drawable.Ripple with a function that does

Cannot set Angular Material matColumnDef property

主宰稳场 提交于 2021-02-08 11:52:38
问题 I have a datatable and want to change the value for matColumnDef property. However, I cannot change it when using it with [matColumnDef] as shown below: <ng-container *ngIf="hasButton" [matColumnDef]="action"> On th other hand, when change its value without bracket matColumnDef , the related part is not rendered on the page. So, what is the difference between [matColumnDef] and matColumnDef ? And why I cannot set it by free value? <ng-container *ngIf="hasButton" matColumnDef="action"> 回答1: I

Change ?selectableItemBackgroundBorderless ripple color

无人久伴 提交于 2021-02-07 12:14:42
问题 I'm trying to use ?selectableItemBackgroundBorderless to create borderless ripple for a LinearLayout , it works fine but is not clearly visible. How can I change the default color for ?selectableItemBackgroundBorderless to make the ripple effect visible? I've tried applying ThemeOverlay.AppCompat.Dark theme to the parent layout but it doesn't help. 回答1: As mentioned in the Theming with AppCompat blog post: colorControlHighlight controls the ripple coloring So creating a ThemeOverlay.AppCompat