material-design

What context Should be Use in setUserVisibleHint Method

大憨熊 提交于 2019-12-10 10:08:37
问题 Because All fragment loaded with together In Pager Sliding tab , I need to use setUserVisibleHint() for laoding that fragment selected . I have Problem with Context in the setUserVisibleHint() method : It raised NPE Exception when I use getActivity for my Context. Thanks 回答1: Because getActivity will return null before fragment attached to Activity you need check this value will null or check fragment attached to activity or after onActivityActtached function. @Override public void

upload file with angular 5 and material

假装没事ソ 提交于 2019-12-10 10:04:20
问题 I'm working with Angular 5 and material library. I need to upload a file, but in the documentation, I didn't find an explanation to accomplish this task. Is anybody that have the same need that can suggest me a good tutorial or documentation? Tnx 回答1: There is a nice library that handles this requirement that also follows Marerial Design. See attached link: TeraData file-upload example 来源: https://stackoverflow.com/questions/48889783/upload-file-with-angular-5-and-material

Different width for Navigation Drawer in Tablet and Phone

余生颓废 提交于 2019-12-10 10:02:15
问题 I was trying to implement material design for one of my project and here, the following is mentioned, The maximum width of the nav drawer is 5 times the standard increment (56dp on mobile and 64dp on tablet). So I would like to know how to implement these width for navigation drawer for mobile and tablets. I want to make different width to respective devices, either phone or tablets. I would love to use XML even if this also can be done using Java. Thank you. 回答1: Create values-sw600dp folder

white background for date picker dialog shadow

无人久伴 提交于 2019-12-10 10:02:11
问题 I add datepicker to my application but my problem the shadow for the dialog have white background , use Android 21 for compile . please help me to remove white background ... 回答1: You have a "bug" in your themes.xml or styles.xml material design support library is not working properly with dialogs. So remove the specific dialog code or separate it in different versions. Trying to explain a little bit further. Generally when we extend the original application theme we have an themes.xml and/or

Creating a custom popup dialog menu

霸气de小男生 提交于 2019-12-10 03:56:28
问题 I'm currently trying to achieve popup menu on menu button click as shown in following screen: I tried popupwindow methods but couldn't achieve the exact case. This is how I'm trying: private View.OnClickListener showPopupWindow() { return new View.OnClickListener() { @Override public void onClick(View v) { PopupWindow popUp = popupWindowsort(); popUp.showAsDropDown(v, 1, 1); // show popup like dropdown list } }; } private PopupWindow popupWindowsort() { // initialize a pop up window type

LinearLayout overlapping Support CoordinatorLayout

a 夏天 提交于 2019-12-10 03:16:54
问题 It's the first time I use CoordinatorLayout, and I don't really understand how it works. My LinearLayout is overlapping my Toolbar, as if I were in a FrameLayout, or RelativeLayout, and I don't know how to tell it to go below ( Like android:layout_below with RelativeLayout ) Here is my code: <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/main_content" android

Why was material design lite(MDL) deprecated with MDC?

淺唱寂寞╮ 提交于 2019-12-10 02:04:01
问题 which of the 3 high-level goals did MDL fail: Production-ready components consumable in an a-la-carte fashion Best-in-class performance and adherence to the Material Design guidelines Seamless integration with other JS frameworks and libraries Or were there some other reasons behind deprecating MDL? 回答1: One of the core team members for MDC Web here. We have a migration guide if you're curious about switching from MDL to MDC Web. One thing we accomplished by moving to MDC Web was a new

Android Manifest Merger fails after adding Dependency com.google.android.material

三世轮回 提交于 2019-12-10 01:29:08
问题 We would like to use the most current material design ui elements presented by Google. Therefore I added com.google.android.material:material:1.0.0-beta01 in our projects gradle file. But since then I get the following error. Manifest merger failed : Attribute application@appComponentFactory value=(androidx.core.app.CoreComponentFactory) from [androidx.core:core:1.0.0-beta01] AndroidManifest.xml:22:18-86 is also present at [com.android.support:support-compat:28.0.0-beta01] AndroidManifest.xml

How to keep single checkableBehavior mode in drawer menu for NavigationView when we add section?

邮差的信 提交于 2019-12-10 00:45:08
问题 I try to implement a drawer with new component of material design : NavigationView. It's work very well. When I select an item changes its color change well with android:checkableBehavior="single" . <group android:checkableBehavior="single"> <item android:id="@+id/drawer_home" android:checked="true" android:icon="@drawable/ic_home_black_24dp" android:title="@string/home"/> <item android:id="@+id/drawer_favourite" android:icon="@drawable/ic_favorite_black_24dp" android:title="@string/favourite

How do I prevent Angular component styling override from carrying over to other components?

和自甴很熟 提交于 2019-12-09 19:03:06
问题 I have a couple Angular components that route back and forth to one another. They both have mat-form-field 's. In one component, I am overriding the styling of the underline component like so: ::ng-deep .mat-input-underline { display: none; } When I click on the link to go back to the other component, the styling as defined as above carries over and the underline components are gone. I tried to add styling like: ::ng-deep .mat-input-underline { display: revert; //or display: unset; //or