當前位置: 首頁>>代碼示例>>Java>>正文


Java SherlockPreferenceActivity類代碼示例

本文整理匯總了Java中com.actionbarsherlock.app.SherlockPreferenceActivity的典型用法代碼示例。如果您正苦於以下問題:Java SherlockPreferenceActivity類的具體用法?Java SherlockPreferenceActivity怎麽用?Java SherlockPreferenceActivity使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


SherlockPreferenceActivity類屬於com.actionbarsherlock.app包,在下文中一共展示了SherlockPreferenceActivity類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getContextForInflater

import com.actionbarsherlock.app.SherlockPreferenceActivity; //導入依賴的package包/類
/**
 * @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);
}
 
開發者ID:GoogleCloudPlatform,項目名稱:endpoints-codelab-android,代碼行數:21,代碼來源:PullToRefreshAttacher.java

示例2: getContextForInflater

import com.actionbarsherlock.app.SherlockPreferenceActivity; //導入依賴的package包/類
/**
 * @return Context which should be used for inflating the header layout
 */
public Context getContextForInflater(Activity activity) {
    ActionBar ab = null;
    if (activity instanceof SherlockActivity) {
        ab = ((SherlockActivity) activity).getSupportActionBar();
    } else if (activity instanceof SherlockListActivity) {
        ab = ((SherlockListActivity) activity).getSupportActionBar();
    } else if (activity instanceof SherlockFragmentActivity) {
        ab = ((SherlockFragmentActivity) activity).getSupportActionBar();
    } else if (activity instanceof SherlockExpandableListActivity) {
        ab = ((SherlockExpandableListActivity) activity).getSupportActionBar();
    } else if (activity instanceof SherlockPreferenceActivity) {
        ab = ((SherlockPreferenceActivity) activity).getSupportActionBar();
    }

    Context context = null;
    if (ab != null) {
        context = ab.getThemedContext();
    }
    if (context == null) {
        context = activity;
    }
    return context;
}
 
開發者ID:Mobideck,項目名稱:appdeck-android,代碼行數:27,代碼來源:AbsPullToRefreshAttacher.java

示例3: checkActivity

import com.actionbarsherlock.app.SherlockPreferenceActivity; //導入依賴的package包/類
void checkActivity() {
    Context context = adapterView.getContext();
    if (context instanceof ListActivity) {
        throw new RuntimeException("ListView cannot belong to an activity which subclasses ListActivity");
    }
    if (context instanceof SherlockActivity || context instanceof SherlockFragmentActivity
            || context instanceof SherlockPreferenceActivity) {
        return;
    }
    throw new RuntimeException("ListView must belong to an activity which subclasses SherlockActivity");
}
 
開發者ID:Aptoide,項目名稱:aptoide-backup-apps,代碼行數:12,代碼來源:MultiChoiceAdapterHelper.java

示例4: showActionBarwithBack

import com.actionbarsherlock.app.SherlockPreferenceActivity; //導入依賴的package包/類
/**
 * 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);
}
 
開發者ID:buddycloud,項目名稱:buddycloud-android,代碼行數:15,代碼來源:ActionbarUtil.java

示例5: actionBarSet

import com.actionbarsherlock.app.SherlockPreferenceActivity; //導入依賴的package包/類
public static synchronized void actionBarSet(SherlockPreferenceActivity activity) {
	actionBarSet(activity, activity.getSupportActionBar());
}
 
開發者ID:nfsclient-speedops,項目名稱:NfsClient,代碼行數:4,代碼來源:AppState.java

示例6: setTitle

import com.actionbarsherlock.app.SherlockPreferenceActivity; //導入依賴的package包/類
public static void setTitle(final SherlockPreferenceActivity activity, final String title) {
	if (activity == null || title == null) return;
	
	activity.getSupportActionBar().setTitle(title);
	activity.getSupportActionBar().setDisplayShowTitleEnabled(true);
}
 
開發者ID:buddycloud,項目名稱:buddycloud-android,代碼行數:7,代碼來源:ActionbarUtil.java

示例7: showUpButton

import com.actionbarsherlock.app.SherlockPreferenceActivity; //導入依賴的package包/類
@Override
public void showUpButton() {

	if (getActivity() instanceof SherlockActivity) {

		((SherlockActivity) getActivity()).getSupportActionBar()
				.setDisplayHomeAsUpEnabled(true);

	} else if (getActivity() instanceof SherlockFragmentActivity) {

		((SherlockFragmentActivity) getActivity()).getSupportActionBar()
				.setDisplayHomeAsUpEnabled(true);

	} else if (getActivity() instanceof SherlockExpandableListActivity) {

		((SherlockExpandableListActivity) getActivity())
				.getSupportActionBar().setDisplayHomeAsUpEnabled(true);

	} else if (getActivity() instanceof SherlockListActivity) {

		((SherlockListActivity) getActivity()).getSupportActionBar()
				.setDisplayHomeAsUpEnabled(true);

	} else if (getActivity() instanceof SherlockPreferenceActivity) {
		((SherlockPreferenceActivity) getActivity()).getSupportActionBar()
				.setDisplayHomeAsUpEnabled(true);

	} else {
		super.showUpButton();
	}

}
 
開發者ID:SimoneLocatelli,項目名稱:androidbase,代碼行數:33,代碼來源:SupportActivityHelper.java


注:本文中的com.actionbarsherlock.app.SherlockPreferenceActivity類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。