com.actionbarsherlock.app.SherlockPreferenceActivity Java Examples

The following examples show how to use com.actionbarsherlock.app.SherlockPreferenceActivity. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PullToRefreshAttacher.java    From endpoints-codelab-android with GNU General Public License v3.0 6 votes vote down vote up
/**
 * @return Context which should be used for inflating the header layout
 */
public Context getContextForInflater(Activity activity) {
    if (activity instanceof SherlockActivity) {
        return ((SherlockActivity) activity).getSupportActionBar().getThemedContext();
    } else if (activity instanceof SherlockListActivity) {
        return ((SherlockListActivity) activity).getSupportActionBar().getThemedContext();
    } else if (activity instanceof SherlockFragmentActivity) {
        return ((SherlockFragmentActivity) activity).getSupportActionBar()
                .getThemedContext();
    } else if (activity instanceof SherlockExpandableListActivity) {
        return ((SherlockExpandableListActivity) activity).getSupportActionBar()
                .getThemedContext();
    } else if (activity instanceof SherlockPreferenceActivity) {
        return ((SherlockPreferenceActivity) activity).getSupportActionBar()
                .getThemedContext();
    }
    return super.getContextForInflater(activity);
}
 
Example #2
Source File: ActionbarUtil.java    From buddycloud-android with Apache License 2.0 5 votes vote down vote up
/**
 * Show the actionbar with backstack icon
 * 
 * @param activity
 * @param title
 */
public static void showActionBarwithBack(final SherlockPreferenceActivity activity, 
		final String title) {
	if (activity == null) return;
	
	setTitle(activity, title);
	makeOverflowMenuShow(activity.getApplicationContext());
	setActionBar(activity.getActionBar(), activity.getSupportActionBar(), R.drawable.ic_ab_up_compat);
}
 
Example #3
Source File: ActionbarUtil.java    From buddycloud-android with Apache License 2.0 4 votes vote down vote up
public static void setTitle(final SherlockPreferenceActivity activity, final String title) {
	if (activity == null || title == null) return;
	
	activity.getSupportActionBar().setTitle(title);
	activity.getSupportActionBar().setDisplayShowTitleEnabled(true);
}