How to add “Android Design Support Library” to Eclipse with ADT-plugin?

Before use the design support library, you have to import support-v7-appcompat library from android-sdks\extras\android\support\v7\appcompat. Then, you have to: create an android library project in eclipse for design support library put the contents of directory android-sdks\extras\android\support\design in the design support library project Link appcompat-v7 library to design support library project Link support library project from your … Read more

How I can remove the unnecessary top padding of the Navigation view?

You can override predefined dimensions at your dimens.xml as; <dimen name=”design_navigation_padding_top_default” tools:override=”true”>0dp</dimen> <dimen name=”design_navigation_separator_vertical_padding” tools:override=”true”>0dp</dimen> <dimen name=”design_navigation_padding_bottom” tools:override=”true”>0dp</dimen> Other possible values are here: https://github.com/android/platform_frameworks_support/blob/master/design/res/values/dimens.xml

TextInputLayout not showing EditText hint before user focus on it

Update: This is a bug that has been fixed in version 22.2.1 of the library. Original Answer: As mentioned by @shkschneider, this is a known bug. Github user @ljubisa987 recently posted a Gist for a workaround: https://gist.github.com/ljubisa987/e33cd5597da07172c55d As noted in the comments, the workaround only works on Android Lollipop and older. It does not work … Read more

How to use a TabLayout with Toolbar inside CollapsingToolbarLayout?

Here’s the way I managed to do this, I don’t think that’s the best solution though if anyone finds a better way please feel free to post the answer. <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:layout_width=”match_parent” android:layout_height=”match_parent” android:fitsSystemWindows=”true”> <android.support.v4.view.ViewPager android:id=”@+id/viewpager” android:layout_width=”match_parent” android:layout_height=”match_parent” app:layout_behavior=”@string/appbar_scrolling_view_behavior” /> <android.support.design.widget.AppBarLayout android:id=”@+id/appbar” android:layout_width=”match_parent” android:layout_height=”@dimen/detail_backdrop_height” android:theme=”@style/ThemeOverlay.AppCompat.Dark.ActionBar” android:fitsSystemWindows=”true”> <android.support.design.widget.CollapsingToolbarLayout android:id=”@+id/collapsing_toolbar” android:layout_width=”match_parent” android:layout_height=”206dip” android:background=”@color/primary_dark” app:layout_scrollFlags=”scroll|exitUntilCollapsed” android:fitsSystemWindows=”true” … Read more

File res/drawable/abc_ic_ab_back_material.xml from drawable resource ID #0x7f020016 [duplicate]

I think you need to make changes in your gradle. // Gradle Plugin 2.0+ android { defaultConfig { vectorDrawables.useSupportLibrary = true } } You’ll note this new attribute only exists in the version 2.0 of the Gradle Plugin. If you are using Gradle 1.5 you’ll instead use // Gradle Plugin 1.5 android { defaultConfig { … Read more

Changing the background color of a Tab in TabLayout (Android design support library) doesn’t occupy the entire tab space

Define a selector as a drawable, and also have a drawable for the selected/unselected states. For this solution, I started with the code from this answer, and then added the functionality that changes the background color for the current Tab. First, the selector, tab_background.xml in the drawable folder: <?xml version=”1.0″ encoding=”utf-8″?> <selector xmlns:android=”http://schemas.android.com/apk/res/android”> <item android:drawable=”@drawable/tab_background_selected” … Read more

How to change the new TabLayout indicator color and height

Having the problem that the new TabLayout uses the indicator color from the value colorAccent, I decided to dig into the android.support.design.widget.TabLayout implementation, finding that there are no public methods to customize this. However I found this style specification of the TabLayout: <style name=”Base.Widget.Design.TabLayout” parent=”android:Widget”> <item name=”tabMaxWidth”>@dimen/tab_max_width</item> <item name=”tabIndicatorColor”>?attr/colorAccent</item> <item name=”tabIndicatorHeight”>2dp</item> <item name=”tabPaddingStart”>12dp</item> <item name=”tabPaddingEnd”>12dp</item> … Read more

Change EditText hint color when using TextInputLayout

Define android:textColorHint in your application theme: <style name=”AppTheme” parent=”Theme.AppCompat.NoActionBar”> <item name=”colorPrimary”>@color/primary</item> <item name=”colorPrimaryDark”>@color/primary_dark</item> <item name=”colorAccent”>@color/accent</item> <item name=”android:textColorHint”>@color/secondary_text</item> </style> Source Or, in your layout, like: <android.support.design.widget.TextInputLayout android:layout_width=”match_parent” android:layout_height=”wrap_content” android.support.design:hintTextAppearance=”@style/GreenTextInputLayout” android:textColorHint=”@color/secondary_text”>