Tag: android-support-library

android.support.v4.util.Pair vs android.util.Pair

I read about support.v4 lib that allows android backward compatibility. So IIUC, when there is an ambiguity – it’s always best practice to import the lib from android.support.v4 … right?

CollapsingToolbarLayout scrolling behavior on tablets

There’s an issue with the CollapsingToolbarLayout on tablets when scrolling NestedScrollView that contains small number of views the issue is that the toolbar collapses even after the the scrolling stops. you can reproduce the issue source code: https://github.com/chrisbanes/cheesesquare Is there a way to prevent this from happening?

Passing Attributes to Child View in Compound Views

I’m trying to make a compound view, where by I can set attributes in xml and have them be passed to the children in the compound view. In the code below, I want to set the android:text and have it passed to the the EditText. Is this possible without having to set every attribute as […]

View reuse in fragments android

I am trying to save my View states in my fragment but I am concerned I make be leaking my Activity. Here is what I am doing: @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle state){ if(mView != null){ View oldParent = mView.getParent(); if(oldParent != container){ ((ViewGroup)oldParent).removeView(mView); } return mView; } else{ mView = inflater.inflate(R.id.fragview, […]

How to use AutoScrollHelper

I recently found that the v4 library has a utility class AutoScrollHelper, and its subclass is ListViewAutoScrollHelper. Does anyone have a demo for this?

Android Palette: Why not working with this particular image?

I am currently working with the Palette API from support library (https://developer.android.com/tools/support-library/features.html#v7-palette) The code below works fine with hundreds of pictures, no problem at all. I set the text and background color depending on the palette results. The result is awesome and really nice looking (if you want to re-use it in your application, do […]

Is this a bug in Android support design Library?

I just started to use the new Deisgn library from Google : ‘com.android.support:design:22.2.0′ I use the FloatingActionButton and I have a small issue between Android below 5.0 and over 5.0. Watch the screenshot : Android 4.4 : Android 5.0 : As you can see, on Android 4.4, there is a margin around the FAB. I […]

Equivalent of NavUtils when not using the Android support library?

This question has also been asked by someone on the Android Developers Google Group (link), but it does not have an answer… I recently removed the v4 support library from my Android project in Eclipse, because my application only targets Android 4.0 (Ice Cream Sandwich) and up. I’m now going through all the support library […]

Android ActionMode title background color

I`m using new android support library 21.0.2 and when i call ActionMode for text selection i got this. It seems than title textview background is transparent. Redefining titleTextStyle of ActionMode has no effect. Any suggestions? Thanks. theme.xml <item name=”actionModeStyle”>@style/ActionMode</item> <item name=”android:actionModeStyle”>@style/ActionMode</item> <style name=”ActionMode” parent=”@style/Widget.AppCompat.ActionMode”> <item name=”titleTextStyle”>@style/ActionModeTitleTextStyle</item> </style> <style name=”ActionModeTitleTextStyle” parent=”@style/TextAppearance.AppCompat.Widget.ActionMode.Title”> <item name=”android:background”>#ff0000</item> <item name=”android:colorBackground”>#ff0000</item> </style>

Styling the SearchView Widget using support library v21

I’m trying to style the SearchView widget using the new AppCompat v21, but I’m facing some problems. No matter what layout I set on “suggestionRowLayout” attribute, it does nothing at all. The suggestion dropdown list of the SearchView remains the same way. Other problem that I’m having is when the “accent color” is the same […]

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