Tag: android-support-library

Android Floating Action Button Semi Transparent Background Color

I want to use FAB with semi transparent background color. But I am getting a FAB with two different colors. What’s the problem? <android.support.design.widget.FloatingActionButton xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:app=”http://schemas.android.com/apk/res-auto” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:layout_gravity=”bottom|left” android:fadingEdgeLength=”5dp” app:borderWidth=”0dp” app:elevation=”4dp” app:backgroundTint=”#99f03456″ app:fabSize=”normal”/> And without any drawable.

Once again getting java.lang.NoClassDefFoundError: android.support.v7.internal.view.menu.i after updating to Support Tools 23

I had implemented one of the many solutions listed on https://code.google.com/p/android/issues/detail?id=78377 for this issue with 4.2.2 phones but now that I’ve updated to support tools 23 the issue has come back. If you look at that issue report you’ll see there are a lot of people with that same issue since updating. The solutions on […]

NullPointerException when calling getSupportActionBar() from inside of Fragment (ActionBarCompat)

I just switched from ActionBarSherlock to ActionBarCompat and everything was working well until I ran into this small error. I have a base activity that extends ActionBarActivity and has 3 fragments associated with it. In one of the Fragments onAttach method, I try executing this code: @Override public void onAttach(Activity activity) { super.onAttach(activity); final ActionBar […]

NavigationView and ActionBarDrawerToggle

With the new NavigationView is it still recommended to use ActionBarDrawerToggle or is this not “Material Design”? For instance previously we were supposed to hide action bar items when the drawer was opened but now the guidelines say that they should stay.

CollapsingToolbarLayout sometimes leaves white space below

I have a problem. Here are the screenshots: And here is the code: <?xml version=”1.0″ encoding=”utf-8″?> <android.support.v4.widget.DrawerLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:app=”http://schemas.android.com/apk/res-auto” android:id=”@+id/drawerLayout” android:layout_width=”match_parent” android:layout_height=”match_parent”> <android.support.design.widget.CoordinatorLayout android:id=”@+id/rootLayout” android:layout_width=”match_parent” android:layout_height=”match_parent”> <android.support.design.widget.AppBarLayout android:layout_width=”match_parent” android:layout_height=”256dp” android:theme=”@style/ThemeOverlay.AppCompat.Dark.ActionBar”> <android.support.design.widget.CollapsingToolbarLayout android:id=”@+id/collapsingToolbarLayout” android:layout_width=”match_parent” android:layout_height=”match_parent” app:expandedTitleMarginStart=”64dp” app:layout_scrollFlags=”scroll|exitUntilCollapsed”> <android.support.v7.widget.Toolbar android:id=”@+id/toolbar” android:layout_width=”match_parent” android:layout_height=”?attr/actionBarSize” android:background=”?attr/colorPrimary” android:minHeight=”?attr/actionBarSize” app:layout_collapseMode=”pin” app:popupTheme=”@style/ThemeOverlay.AppCompat.Light” app:theme=”@style/ThemeOverlay.AppCompat.Dark.ActionBar” /> </android.support.design.widget.CollapsingToolbarLayout> </android.support.design.widget.AppBarLayout> <android.support.v4.widget.NestedScrollView android:layout_width=”match_parent” android:layout_height=”match_parent” android:fillViewport=”true” app:layout_behavior=”@string/appbar_scrolling_view_behavior”> <LinearLayout android:layout_width=”match_parent” […]

Using Navigation Drawer without TitleBar or ActionBar

I’m adding a Navigation Drawer to this app that I am developing and I have scoured the internet; forums, stackoverflow, android developer documentation, and still have not found a great answer for this. I know that it is possible to do this without using either of these things. What I am wondering is how. The […]

How can I refresh my ListFragment when it returns to the layout from back stack?

First I should mention that I am using the ActionBarSherlock library for backwards compatibility. I have an activity which adds a ListFragment when it is first started. I have a custom Loader which I implemented and follows the AsnycTaskLoader example very closely. My ListFragment implements the LoaderCallbacks<Cursor> interface. All the appropriate callback methods are called […]

The hierarchy of the type activity is inconsistent when extending ActionBarActivity

Hi I’ve got new v7 support library with appcompat actionbar and when I want to extend from ActionBarActivity as documented here, eclipse show me this error The hierarchy of the type testActivity is inconsistent and when I move my courser on ActionBarActivity class it says The type android.support.v4.app.TaskStackBuilder$SupportParentable cannot be resolved. It is indirectly referenced […]

ConstraintLayout not working in GUI editor Android Studio 3.0 – Canary 4

I’m running into problems when editing layouts that contain a ConstraintLayout element in Android Studio 3.0. My dependencies are as follows: project.ext.support_library_version = ‘26.0.0-beta2’ dependencies { compile ‘com.android.support.constraint:constraint-layout:1.1.0-beta1’ compile “com.android.support:palette-v7:${project.ext.support_library_version}” compile “com.android.support:support-v13:${project.ext.support_library_version}” compile “com.android.support:customtabs:${project.ext.support_library_version}” compile “com.android.support:cardview-v7:${project.ext.support_library_version}” … } The error showing in the UI editor is: The following classes could not be instantiated: –¬†android.support.constraint.ConstraintLayout (Open […]

Set layout_anchor at runtime on FloatingActionButton

I am trying to animate a android.support.design.widget.FloatingActionButton that is pinned to my AppBarLayout. I can set it fine within the layout xml and it shows up fine. However i am doing a Shared Element Transition to this layout and the FAB is showing up before the view is set. I tried to set the visibility […]

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