material-design

how to make bottom app bar or bottom navigation bar like google home app?

孤人 提交于 2020-08-20 20:39:28
问题 I want to make a layout like above. Can anyone help me how to do that? I have tried the new material bottom app bar. but I couldn't achieve this view. 回答1: Finally got the solution. Just place bottomAppBar under your bottomNavigationView with transparent background. And add empty menu item to menu.xml to free space for the FAB. XML: <?xml version="1.0" encoding="utf-8"?> <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app=

“Cannot read property 'MDCSwitch' of undefined” error when importing an MDC Switch component

你离开我真会死。 提交于 2020-08-10 23:08:48
问题 I'm writing a Node app using express and material-components-web and I'm having a problem where TextField works but Switch does not. Here's the code I'm using to attach the relevant JS to the elements: [].slice.call(document.querySelectorAll('.mdc-text-field')).forEach( function(ele) { mdc.textField.MDCTextField.attachTo(ele); }); [].slice.call(document.querySelectorAll('.mdc-switch')).forEach( function(ele) { mdc.switch.MDCSwitch.attachTo(ele); }); When I comment out the code for the

How to implement Menu display on Extended Floating Action Button click android

我们两清 提交于 2020-08-10 19:29:26
问题 I want to implement the Extended FAB button in the format mentioned on the material website (https://kstatic.googleusercontent.com/files/8f9b57829c943c97be7c4b2485cf678f041dfe7c7ef523cfb2e97f1aeee21431f83d98cc07befeeed904fabb258298e3a7ac95f9da5d3da7a4adcff658cea851) https://material.io/components/buttons-floating-action-button#types-of-transitions Kindly help on how to achieve the same. 回答1: You can use the Material motion and the Transition between Views. For example define in your layout:

How to give fixed height to Angular Material Table

拟墨画扇 提交于 2020-08-04 03:41:10
问题 I have an angular material table(10 rows) for which i want to fix the height to 300px(Vertical scroll should be used to see the extra rows). When i give height in the styles to 300px it is not having any effect. The contents of the table are going out of the height given. See the link for the image. I want to have two tables one below another and i want to give them equal height 50%. The first table itself taking 10 rows height . Angular Material Table 回答1: I use a wrapper div with class <div

Android Date Time picker in one dialog

岁酱吖の 提交于 2020-08-01 05:54:11
问题 I am using material Date Time picker for my Android app. But I want to combine the Date and Time picker in one dialog. I am following this one. But I need to select the time right after the date selection. Please suggest possible way to do this one. 回答1: You can call TimePicker after DatePicker set Date. Like this.. String date_time = ""; int mYear; int mMonth; int mDay; int mHour; int mMinute; et_show_date_time = (EditText) findViewById(R.id.et_show_date_time); btn_set_date_time = (Button)

bottomSheetDialogFragment full screen

佐手、 提交于 2020-07-31 07:31:28
问题 What I'm trying to achieve is something like Instagram in-app web browser, used when you click an ad: what I did, is I used a WebView bottomSheetDialogFragment, and I override onCreateDialog to get the full screen like this : @Override public Dialog onCreateDialog(Bundle savedInstanceState) { BottomSheetDialog bottomSheetDialog=(BottomSheetDialog)super.onCreateDialog(savedInstanceState); bottomSheetDialog.setOnShowListener(dialog -> { BottomSheetDialog dialogc = (BottomSheetDialog) dialog;

How to display progress drawable animation in Chip Material Component?

不想你离开。 提交于 2020-07-22 07:21:06
问题 According to the official Design docs for Action Chips, we are supposed to be able to add a progress state to chips. Sadly, the Development docs don't mention this at all. Has anyone managed to figure out how to achieve the effect shown here? 回答1: It is possible to implement this behavior using the chipIcon attribute and androidx.swiperefreshlayout.widget.CircularProgressDrawable . xml app:chipIconWithProgress="@{viewModel.taskIsStarting ? null : @drawable/ic_play_arrow}" and BindingAdapter

Material Angular scroll to element on mat-list

扶醉桌前 提交于 2020-07-21 00:36:50
问题 I have an Angular Material list with multiple elements, where one of them can be selected. When I load this list I want to scroll list up to that selected element, to make it more visible. Is there any option? I was thinking about something like in ngOnInit to check if item is selected, but I have really no idea how to scroll this list up to that item. Note: not whole page should be scrolled, only the elements on the list. component.html <mat-nav-list> <mat-list-item *ngFor="let item of items

Material Angular scroll to element on mat-list

别说谁变了你拦得住时间么 提交于 2020-07-21 00:36:30
问题 I have an Angular Material list with multiple elements, where one of them can be selected. When I load this list I want to scroll list up to that selected element, to make it more visible. Is there any option? I was thinking about something like in ngOnInit to check if item is selected, but I have really no idea how to scroll this list up to that item. Note: not whole page should be scrolled, only the elements on the list. component.html <mat-nav-list> <mat-list-item *ngFor="let item of items

Make an arrow shape both side with xml

半世苍凉 提交于 2020-07-18 06:32:07
问题 I want to make a button shape like this Is there a way to do this with XML ? Actually I am looking for like this 回答1: It is not exactly what you are looking for, because it is not with realized with a XML. However with the new MaterialButton it is very simple to obtain it: Just define the Button in your layout: <com.google.android.material.button.MaterialButton app:cornerRadius="0dp" android:paddingLeft="24dp" android:paddingRight="12dp" .../> Then just use the ShapeAppearanceModel to define