Tag: android-support-library

How to use or workaround searchManager.getSearchableInfo() on Android API 7?

I can’t find anywhere how to use the support v7 appcompat library with searchManager.getSearchableInfo(). @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); MenuItem menuItem = (MenuItem) menu.findItem(R.id.search_widget); SearchView searchView = (SearchView) MenuItemCompat.getActionView(menuItem); searchView.setSubmitButtonEnabled(true); SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE); searchView.setSearchableInfo( searchManager.getSearchableInfo(getComponentName())); […]

BetterPickers without a support library

I am using https://github.com/derekbrameyer/android-betterpickers to use time- and date pickers for my app. However, my app does not need a support library and it seems like I need SupportFragmentManager when setting a FragmentManager to the Time- and DatePickerBuilder :/ Is there a way to avoid the Support library?

Fragment transition support 25.1.0 with Recyclerview

I was using fragment transitions to animate a view from a recycler view, with the 25.0.1 support lib and the transition was working fine for push and pop the target fragment. The code I’m using to generate the transaction is: supportFragmentManager.beginTransaction() .replaceAddToBackStack(R.id.content, fragment) .addSharedElement(fragment, commonViews) .commit() Now I’m trying to update to the 25.1.0 version […]

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 […]

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