本文整理匯總了Java中com.actionbarsherlock.app.SherlockListActivity類的典型用法代碼示例。如果您正苦於以下問題:Java SherlockListActivity類的具體用法?Java SherlockListActivity怎麽用?Java SherlockListActivity使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
SherlockListActivity類屬於com.actionbarsherlock.app包,在下文中一共展示了SherlockListActivity類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getContextForInflater
import com.actionbarsherlock.app.SherlockListActivity; //導入依賴的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);
}
示例2: getContextForInflater
import com.actionbarsherlock.app.SherlockListActivity; //導入依賴的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;
}
示例3: getActionBar
import com.actionbarsherlock.app.SherlockListActivity; //導入依賴的package包/類
private ActionBar getActionBar(Activity activity) {
if (activity instanceof SherlockActivity) {
return ((SherlockActivity) activity).getSupportActionBar();
}
if (activity instanceof SherlockFragmentActivity) {
return ((SherlockFragmentActivity) activity).getSupportActionBar();
}
if (activity instanceof SherlockListActivity) {
return ((SherlockListActivity) activity).getSupportActionBar();
}
ActionBar actionBar = getActionBarWithReflection(activity, "getSupportActionBar");
if (actionBar == null) {
throw new RuntimeException("Activity should derive from one of the ActionBarSherlock activities "
+ "or implement a method called getSupportActionBar");
}
return actionBar;
}
示例4: actionBarSet
import com.actionbarsherlock.app.SherlockListActivity; //導入依賴的package包/類
public static synchronized void actionBarSet(SherlockListActivity activity) {
actionBarSet(activity, activity.getSupportActionBar());
}
示例5: showUpButton
import com.actionbarsherlock.app.SherlockListActivity; //導入依賴的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();
}
}