material-design

Show and Hide Bottom Sheet Programmatically

三世轮回 提交于 2020-06-24 05:08:05
问题 I have implemented Bottom Sheet functionality within my activity in onCreate() using this solution and this library sheet = new BottomSheet.Builder(this, R.style.BottomSheet_Dialog) .title("New") .grid() // <-- important part .sheet(R.menu.menu_bottom_sheet) .listener(new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // TODO } }).build(); Now, I would like to Show Bottom sheet, on click of button and in a same way want to hide bottom

Nested class in another selected class with makeStyles

强颜欢笑 提交于 2020-06-17 02:56:15
问题 I need to know how to target 'element' when root is selected This is makeStyles: const useStyles = makeStyles(theme => ({ root:{ '&.selected': { } }, element: { } }) This is jsx <div className={`${classes.root} ${elementSelected ? 'selected : ''}`}> <div className={classes.element}> </div> </div> 回答1: You can use https://www.npmjs.com/package/classnames to achieve this. const useStyles = makeStyles(theme => ({ root:{ '&.selected $element': { } } }) And your JSX import classNames from

Dynamically change background color of mat-expansion-panel-header based on whether or not it is expanded

五迷三道 提交于 2020-06-14 06:32:30
问题 I've been struggling to find a way to dynamically change the background color of a material design expansion panel header based on whether or not the panel is expanded. When the panel is closed I'd like the background color to be white, but when it is expanded I want to change that color to something else. I'm not seeing something I can base this change off of, maybe I'm missing something. I'm new to angular and was thinking I would just be able to base it off of [expanded]'s setting but it

MaterialCardview requires Theme.AppCompat

点点圈 提交于 2020-06-13 21:45:53
问题 I'm trying to test my skills on new Google Material components. But for now I am encountering a problem with MaterialCardView The building process tells me The style on this component requires your app theme to be Theme.AppCompat [..] at com.google.android.material.card.MaterialCardView.<init> With this clue I added style="@style/Theme.AppCompat" & android:theme="@style/Theme.AppCompat" to the MaterialCardView and also to my Activity in the manifest. I tried also to change my Acitivity to

How to set TextInputLayout's outlined box floating hint background color

≯℡__Kan透↙ 提交于 2020-05-29 09:56:26
问题 How to change the background color of the floating hint in a text input layout outline box style to transparent. I think the attached picture clearly states the issue It should be red above the stroke and white below). What I did to change the background itself was: <style name="App.TextInputLayout" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"> <item name="boxBackgroundColor">@color/white</item> </style> Any help is greatly appreciated 回答1: If you look at the style

Binding element 'index' implicitly has an 'any' type

若如初见. 提交于 2020-05-25 12:04:26
问题 Using the demo project of angular2-mdl as a guide I ported the tab component and tried to implement it as follow: import { Component } from '@angular/core'; @Component({ selector: 'my-dashboard', templateUrl: './landing.my.html' }) export class MyDashboard { public activeIndex = 0; public tabChanged({index}): void { this.activeIndex = index; } } and the template is: <mdl-tabs mdl-ripple mdl-tab-active-index="0" (mdl-tab-active-changed)="tabChanged($event)"> <mdl-tab-panel mdl-tab-panel-title=

Material Components Default to colorAccent instead of colorPrimary

时光总嘲笑我的痴心妄想 提交于 2020-05-24 03:57:49
问题 My AppTheme in styles.xml looks like this: <style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> <item name="android:textColorPrimary">@color/textColorPrimary</item> <item name="android:windowTranslucentStatus">true</item> <item name="android:windowTranslucentNavigation"

Material Components Default to colorAccent instead of colorPrimary

泪湿孤枕 提交于 2020-05-24 03:56:21
问题 My AppTheme in styles.xml looks like this: <style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> <item name="android:textColorPrimary">@color/textColorPrimary</item> <item name="android:windowTranslucentStatus">true</item> <item name="android:windowTranslucentNavigation"

switching to Theme.MaterialComponents from Theme.AppCompat shows white blank labels & buttons

非 Y 不嫁゛ 提交于 2020-05-23 21:10:33
问题 I was using Material design 1.1.0 . For tabs with viewpager2 I updated it to '1.2.0-alpha05' Material library version it was working fine for single module but was crashing for another module where I've developed my custom material designed TextInputLayout. I changed theme from 'Theme.AppCompat.Light.NoActionBar' to Theme.MaterialComponents.Light.NoActionBar and crash fixed. After fixing crash and upgrading theme it is showing me white floating label , buttons , indiators etc anyone please

switching to Theme.MaterialComponents from Theme.AppCompat shows white blank labels & buttons

…衆ロ難τιáo~ 提交于 2020-05-23 21:09:08
问题 I was using Material design 1.1.0 . For tabs with viewpager2 I updated it to '1.2.0-alpha05' Material library version it was working fine for single module but was crashing for another module where I've developed my custom material designed TextInputLayout. I changed theme from 'Theme.AppCompat.Light.NoActionBar' to Theme.MaterialComponents.Light.NoActionBar and crash fixed. After fixing crash and upgrading theme it is showing me white floating label , buttons , indiators etc anyone please