PreferenceFragmentCompat has padding on PreferenceCategory that I can’t get rid of

Actually there is a better hack to fix this, also with resource overriding: Create res/values-sw360dp-v13/values-preference.xml: <?xml version=”1.0″ encoding=”utf-8″?> <resources xmlns:tools=”http://schemas.android.com/tools”> <bool name=”config_materialPreferenceIconSpaceReserved” tools:ignore=”MissingDefaultResource,PrivateResource”>false</bool> <dimen name=”preference_category_padding_start” tools:ignore=”MissingDefaultResource,PrivateResource”>0dp</dimen> </resources> The <bool> fixes the default value of iconSpacePreserved for all Preference; The <dimen> fixes the PreferenceCategory. EDIT: If you are using androidx.preference:preference:1.1.0-alpha01 or above, you won’t need the … Read more

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

How to use setOutlineProvider instead of setOutline in Lollipop

Just to complete the @ianhanniballake answer: Button fab = (Button) findViewById(R.id.fab); //Outline outline = new Outline(); //outline.setOval(0, 0, size, size); //fab.setOutline(outline); ViewOutlineProvider viewOutlineProvider = new ViewOutlineProvider() { @Override public void getOutline(View view, Outline outline) { // Or read size directly from the view’s width/height int size = getResources().getDimensionPixelSize(R.dimen.fab_size); outline.setOval(0, 0, size, size); } }; fab.setOutlineProvider(viewOutlineProvider);

Color of animated ActionBarDrawerToggle in ActionBar

This should work.. <style name=”DrawerArrowStyle” parent=”Widget.AppCompat.DrawerArrowToggle”> <item name=”spinBars”>true</item> <item name=”color”>@color/your_color</item> </style> and in your parent theme.. <style name=”AppTheme” parent=”AppBaseTheme”> <item name=”drawerArrowStyle”>@style/DrawerArrowStyle</item> . . . </style>

How to create a card toolbar using appcompat v7

Thanks Gabriele for all the help. Here is working code: Activity : public class MainActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_mai); Toolbar toolbar = (Toolbar) findViewById(R.id.card_toolbar); if (toolbar != null) { // inflate your menu toolbar.inflateMenu(R.menu.main); toolbar.setTitle(“Card Toolbar”); toolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem menuItem) { return true; } … Read more

Android Material Design Datepicker with AppCompat

Update: As well pointed out by jfcartier, there’s now also MaterialDateTimePicker. It’s probably a nicer solution than the one below since it has a nice themable API. You could try the android-betterpickers library. It has a CalendarDatePickerDialog widget that looks like the one you want. It provides a light and a dark theme, but for … Read more

How animate Burger to Arrow with Appcompat v7 21, Toolbar and DrawerLayout

Have a look here, it describes how you solve it. https://stackoverflow.com/a/26447144 The essential part is the following: <style name=”AppTheme” parent=”Theme.AppCompat.Light”> <item name=”drawerArrowStyle”>@style/DrawerArrowStyle</item> </style> <style name=”DrawerArrowStyle” parent=”Widget.AppCompat.DrawerArrowToggle”> <item name=”spinBars”>true</item> <item name=”color”>@android:color/white</item> </style>