Getting exception : java.lang.NoClassDefFoundError: android.support.v7.app.AppCompatDelegateImplV14

I resolved this issue and if anyone is experiencing this issue try these options(3rd point fixed my problem): Add multiDexEnabled true in defaultConfig of build.gradle. defaultConfig { applicationId “com.something.ranjith.androidprojdel” minSdkVersion 15 targetSdkVersion 22 versionCode 1 versionName “1.0” multiDexEnabled true } Remove android support library if your activity extends `AppcompatActivity’ compile ‘com.android.support:support-v4:22.+’ //remove this If you … Read more

Change Navigation View Item Color Dynamically Android

use app:itemIconTint in your NavigationView for icons and use app:itemTextColor for textColors Sample : drawable/navigation_text_color : <selector xmlns:android=”http://schemas.android.com/apk/res/android”> <!– This is used when the Navigation Item is checked –> <item android:color=”#009688″ android:state_checked=”true” /> <!– This is the default text color –> <item android:color=”#E91E63″ /> </selector> and layout : <android.support.design.widget.NavigationView . . app:itemTextColor=”@drawable/navigation_text_color”/>

How to get appropriate images in respective android Device in Android Studio

You have to follow this to support multiple devices : changes in screen density. xlarge screens are at least 960dp x 720dp large screens are at least 640dp x 480dp normal screens are at least 470dp x 320dp small screens are at least 426dp x 320dp Make this layout files, so that it will be … Read more

How can I change the NavigationView’s item text size?

Create new style at the file app/src/main/res/values/styles.xml <style name=”NavigationDrawerStyle”> <item name=”android:textSize”>20sp</item><!– text size in menu–> <!– item size in menu–> <item name=”android:listPreferredItemHeightSmall”>40dp</item> <item name=”listPreferredItemHeightSmall”>40dp</item> <!– item padding left in menu–> <item name=”android:listPreferredItemPaddingLeft”>8dp</item> <item name=”listPreferredItemPaddingLeft”>8dp</item> <!– item padding right in menu–> <item name=”android:listPreferredItemPaddingRight”>8dp</item> <item name=”listPreferredItemPaddingRight”>8dp</item> </style> Add it to your main_layout.xml <android.support.design.widget.NavigationView … app:theme=”@style/NavigationDrawerStyle” ….> </android.support.design.widget.NavigationView> … Read more

android:textAllCaps=”false” not working for TabLayout design Support

UPDATE FOR DESIGN LIBRARY 23.2.0+ The original answer doesn’t work with design library 23.2.0 or later. Thanks for @fahmad6 pointed out in comment, in case someone missed that comment, I’ll put it here. You need to set both textAllCaps and android:textAllCaps to false to disable all capitalize setting. <style name=”MyCustomTextAppearance” parent=”TextAppearance.Design.Tab”> <item name=”textAllCaps”>false</item> <item name=”android:textAllCaps”>false</item> … Read more

Support library VectorDrawable Resources$NotFoundException

It took 3 separate things for me to get this to work using support library 23.4.0: Add this to build.gradle defaultConfig { vectorDrawables.useSupportLibrary = true } Add the following to onCreate of your Application class AppCompatDelegate.setCompatVectorFromResourcesEnabled(true); (From the reference of this link – “https://stackoverflow.com/a/45582033/10752962“) In API less then 21,use this line before setContentView(); For all … Read more

TextInputLayout :How to give padding or margin to hint?

The solution proposed by ganesh2shiv works for the most part, although I’ve found it also de-centres the hint text displayed inside the EditText when not focused. A better trick is to set the desired paddingTop to the EditText but also embed the extra padding within the EditText’s background. A fairly sane way to do this … Read more