material-design

What context Should be Use in setUserVisibleHint Method

◇◆丶佛笑我妖孽 提交于 2019-12-05 22:05:35
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 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 setUserVisibleHint(boolean isVisibleToUser) { super.setUserVisibleHint(isVisibleToUser); if (getActivity() != null) {

Ripple effect on custom navigation drawer

Deadly 提交于 2019-12-05 22:01:12
问题 I'm developing my first app providing to it the new material look. I'm a bit lost with this so I'm following some tutorials to implement things like Toolbar, Navigation Drawer, etc. I have to say that I'm doing it providing compatibility to pre-lollipop android versions, so I'm using support libraries. What concers to my question, is that I have just implemented the Navigation Drawer following one of this tutorials and using the following libraries for compatibility: support.v4.widget

Styling the SearchView Widget using support library v21

隐身守侯 提交于 2019-12-05 21:58:36
问题 I'm trying to style the SearchView widget using the new AppCompat v21, but I'm facing some problems. No matter what layout I set on "suggestionRowLayout" attribute, it does nothing at all. The suggestion dropdown list of the SearchView remains the same way. Other problem that I'm having is when the "accent color" is the same color as the "primary color", in the searchview is impossible to distinguish where is the caret. Do you know how can I change the accent color in the SearchView to only

CollapsingToolbarLayout | Scrolling and layout issues

吃可爱长大的小学妹 提交于 2019-12-05 20:41:18
Related Questions CollapsingToolbarLayout | Scrolling and layout issues 2 Question I have been working with the Android Support Design Library and successfully implemented the CoordinatorLayout that causes the Toolbar and TabLayout to scroll out of view when scrolling. This works very well, so I figured I would try my luck with the new CollapsingToolbarLayout . In a seperate activity, I have been having issue-after-issue with implementing CollapsingToolbarLayout . I am, as they say, close but no cigar. I want to use 2 different fragments Header Image (Currently just an ImageView ) "Scrollable"

Material tabs with toolbar like design

巧了我就是萌 提交于 2019-12-05 20:15:38
I saw this sample code for android playstore like layout on stackoverflow post , but due to low reputation i was not able to comment there. i am trying to achieve similar design for my project and would like if someone can help me get full code for this design apart from the layout file shared here. Thanks. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v7.widget.Toolbar xmlns:app="http://schemas

Different width for Navigation Drawer in Tablet and Phone

一曲冷凌霜 提交于 2019-12-05 19:32:53
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. Create values-sw600dp folder in your project and add dimens.xml file in it. Define width in dimens.xml file of both values and values

Circular Reveal Android Compat With Design Library 28

蓝咒 提交于 2019-12-05 19:02:19
问题 How To Create A Circular Reveal Animation In Android With Design Library Version 28 I Saw few Classes Which They Are Have Reveal Word Like This Items : android.support.design.circularreveal.CircularRevealFrameLayout android.support.design.circularreveal.CircularRevealGridLayout android.support.design.circularreveal.CircularRevealLinearLayout android.support.design.circularreveal.CircularRevealRelativeLayout android.support.design.circularreveal.cardview.CircularRevealCardView android.support

Xamarin - Classes not found (android support library)

爷,独闯天下 提交于 2019-12-05 18:59:14
I'm trying to implement Material Design with backward compatibility using AppCompat. Following the tutorial . But I'm getting the following error Error 1 error: package android.support.v4.app.FragmentManager does not exist android.support.v4.app.FragmentManager.OnBackStackChangedListener C:\Users\Italo\Documents\Xamarin\TemaMaterial\TemaMaterial\obj\Debug\android\src\mono\android\support\v4\app\FragmentManager_OnBackStackChangedListenerImplementor.java 8 41 TemaMaterial Error 2 error: package android.support.v4.content.Loader does not exist android.support.v4.content.Loader

Change AppBarLayout height programmatically in Android

你说的曾经没有我的故事 提交于 2019-12-05 18:43:20
问题 I'm trying to implement Flexible Space with image pattern, using this tutorial. Everything works fine. Notice the height definition of the AppBarLayout which is 192dp. I'd like to make the height 1/3 of the screen instead, to match this google example for the pattern here. Here's the code in the activity's onCreate (the layout xml is exactly the same as in the tutorial): AppBarLayout appbar = (AppBarLayout)findViewById(R.id.appbar); float density = getResources().getDisplayMetrics().density;

how to change actionbar's menu item text color in material design

旧街凉风 提交于 2019-12-05 17:54:27
I'm trying to update my notepad app to use Material Design, even on older devices. What i did so far: add library appcompat_v7 to my project, to support Material Design on older devices modify theme in AndroidManifest, adding android:theme="@style/Theme.NoteItTheme" to <application ... ></application> attributes creating the theme in /res/values/themes.xml: <?xml version="1.0" encoding="utf-8"?> <resources xmlns:android="http://schemas.android.com/apk/res/android"> <style name="Theme.NoteItTheme" parent="Theme.AppCompat.Light"> <!-- Here we setting appcompat’s actionBarStyle --> <!-- <item