Tag: android-support-library

Android Design Support Library Secondary Drawer Menu

I’ve switched to the official Google Design Support Library. Now, I want to use a secondary menu with a divider like this: But as Android is using the Menu Inflater I have no idea what to do now. I can add a second group, but then the items have the same size and there is […]

Add android support library v4 to intellij ide

I am trying to use viewpager from android support library v4 in intelli j. Currently, I am using the Android SDK 4.1 I copied android-support-v4.jar to my intellij android project under ‘libs’ in the project settings of intellij I went to “Modules” => “MyModuleName” => dependencies tab, and add the android-support-v4.jar, by navigating the path […]

In a snackbar action, how I can I be sure it's safe to permanently delete a soft-deleted record from the database?

I am using Snackbar in android and I have implemented an action so that user can undo the action (the action is clearing all the items in the listview).Removing and adding the items back to the listview has already been done and working fine. My issue is that, items are stored in sqlite database and […]

Is there any reason to use the support.v4 library in Android?

I’ve been working on an app that is targeting Android 4.0 and above with no plans of supporting earlier versions. Is there any good reasons for me to continue using the support library?

Getting ActionBar Title TextView with AppCompat v7 r21

I have a library that requires to use the color of the TextView for the ActionBar title. Prior to AppCompat v7 r21 I could just findViewById and get the color from the view directly. However, for some reason now that does not work. The view is always null. I’ve written code that parses the entire […]

How to show action items at the bottom using Toolbar

main.xml <item android:id=”@+id/action_back” android:orderInCategory=”100″ app:showAsAction=”always” android:icon=”@drawable/ic_action_back” android:title=”@string/back”/> <item android:id=”@+id/action_save” android:orderInCategory=”100″ app:showAsAction=”always” android:icon=”@drawable/ic_action_save” android:title=”@string/save”/> <item android:id=”@+id/action_sort” android:orderInCategory=”100″ app:showAsAction=”always” android:icon=”@drawable/ic_action_sort_dark” android:title=”@string/sort”/> <item android:id=”@+id/action_new” android:orderInCategory=”100″ app:showAsAction=”always” android:icon=”@drawable/ic_new” android:title=”@string/new_menu”/> Manifest.xml <activity android:name=”com.app.FileFragmentActivity” android:uiOptions=”splitActionBarWhenNarrow” android:label=”@string/app_name” > </activity> Output: Requirement: I want to show action items at the bottom like in the two screenshots above (marked in red). I am using […]

Call requires API level 23 (current min is 14): android.app.Activity#requestPermissions,checkSelfPermission

This question already has an answer here: The method checkSelfPermission(Context, String) is undefined for the type ContextCompat 2 answers

CoordinatorLayout ignores margins for views with anchor

Given I’m using a layout like this: <android.support.design.widget.CoordinatorLayout android:id=”@+id/main_content” xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:app=”http://schemas.android.com/apk/res-auto” android:layout_width=”match_parent” android:layout_height=”match_parent” android:fitsSystemWindows=”true”> <android.support.design.widget.AppBarLayout android:id=”@+id/appbar” android:layout_width=”match_parent” android:layout_height=”@dimen/flexible_space_image_height” android:fitsSystemWindows=”true” android:theme=”@style/ThemeOverlay.AppCompat.Dark.ActionBar”> <android.support.design.widget.CollapsingToolbarLayout android:id=”@+id/collapsing_toolbar” android:layout_width=”match_parent” android:layout_height=”match_parent” android:fitsSystemWindows=”true” app:expandedTitleMarginEnd=”64dp” app:expandedTitleMarginStart=”48dp” app:statusBarScrim=”@android:color/transparent” app:layout_scrollFlags=”scroll|exitUntilCollapsed”> <android.support.v7.widget.Toolbar android:id=”@+id/toolbar” android:layout_width=”match_parent” android:layout_height=”?attr/actionBarSize” app:layout_collapseMode=”pin” app:popupTheme=”@style/ThemeOverlay.AppCompat.Light” /> </android.support.design.widget.CollapsingToolbarLayout> </android.support.design.widget.AppBarLayout> <android.support.v7.widget.RecyclerView android:id=”@+id/mainView” android:layout_width=”match_parent” android:layout_height=”match_parent” app:layout_behavior=”@string/appbar_scrolling_view_behavior” /> <android.support.design.widget.FloatingActionButton android:layout_width=”70dp” android:layout_height=”70dp” android:layout_marginBottom=”20dp” app:fabSize=”normal” app:layout_anchor=”@id/appbar” app:layout_anchorGravity=”bottom|center_horizontal” /> </android.support.design.widget.CoordinatorLayout> Which is […]

CollapsingToolbarLayout with multiline title

Is it possible to make CollapsingToolbarLayout‘s expanded title text wraps across several lines (similar to TextView.maxLines attribute)?

How can I use Android's Face Unlock within my own private application?

I want to use Face Unlock as a second factor for my app, since most of my users will not lock their phones with a password. Are there Android APIs available to integrate Face Unlock in an Android app? There are Face Detection APIs out there for photo recognition, but I couldn’t find APIs available […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.