本文整理汇总了Java中com.actionbarsherlock.ActionBarSherlock.DEBUG属性的典型用法代码示例。如果您正苦于以下问题:Java ActionBarSherlock.DEBUG属性的具体用法?Java ActionBarSherlock.DEBUG怎么用?Java ActionBarSherlock.DEBUG使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.actionbarsherlock.ActionBarSherlock
的用法示例。
在下文中一共展示了ActionBarSherlock.DEBUG属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: requestFeature
@Override
public boolean requestFeature(int featureId) {
if (ActionBarSherlock.DEBUG) Log.d(TAG, "[requestFeature] featureId: " + featureId);
if (mContentParent != null) {
throw new AndroidRuntimeException("requestFeature() must be called before adding content");
}
switch (featureId) {
case Window.FEATURE_ACTION_BAR:
case Window.FEATURE_ACTION_BAR_OVERLAY:
case Window.FEATURE_ACTION_MODE_OVERLAY:
case Window.FEATURE_INDETERMINATE_PROGRESS:
case Window.FEATURE_NO_TITLE:
case Window.FEATURE_PROGRESS:
mFeatures |= (1 << featureId);
return true;
default:
return false;
}
}
示例2: setContentView
@Override
public void setContentView(View view, ViewGroup.LayoutParams params) {
if (ActionBarSherlock.DEBUG) Log.d(TAG, "[setContentView] view: " + view + ", params: " + params);
if (mContentParent == null) {
installDecor();
} else {
mContentParent.removeAllViews();
}
mContentParent.addView(view, params);
Window.Callback callback = mActivity.getWindow().getCallback();
if (callback != null) {
callback.onContentChanged();
}
initActionBar();
}
示例3: onMenuItemSelected
@Override
public boolean onMenuItemSelected(int featureId, MenuItem item) {
if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onMenuItemSelected] featureId: " + featureId + ", item: " + item);
if (featureId == Window.FEATURE_OPTIONS_PANEL) {
if (onOptionsItemSelected(item)) {
return true;
}
if (mFragments.mAdded != null) {
for (int i = 0; i < mFragments.mAdded.size(); i++) {
Fragment f = mFragments.mAdded.get(i);
if (f != null && !f.mHidden && f.mHasMenu && f.mMenuVisible && f instanceof OnOptionsItemSelectedListener) {
if (((OnOptionsItemSelectedListener)f).onOptionsItemSelected(item)) {
return true;
}
}
}
}
}
return false;
}
示例4: getActionBar
@Override
public ActionBar getActionBar() {
if (ActionBarSherlock.DEBUG) Log.d(TAG, "[getActionBar]");
initActionBar();
return mActionBar;
}
示例5: loadUiOptionsFromManifest
private static int loadUiOptionsFromManifest(Activity activity) {
int uiOptions = 0;
try {
final String thisPackage = activity.getClass().getName();
if (ActionBarSherlock.DEBUG) Log.i(TAG, "Parsing AndroidManifest.xml for " + thisPackage);
final String packageName = activity.getApplicationInfo().packageName;
final AssetManager am = activity.createPackageContext(packageName, 0).getAssets();
final XmlResourceParser xml = am.openXmlResourceParser("AndroidManifest.xml");
int eventType = xml.getEventType();
while (eventType != XmlPullParser.END_DOCUMENT) {
if (eventType == XmlPullParser.START_TAG) {
String name = xml.getName();
if ("application".equals(name)) {
//Check if the <application> has the attribute
if (ActionBarSherlock.DEBUG) Log.d(TAG, "Got <application>");
for (int i = xml.getAttributeCount() - 1; i >= 0; i--) {
if (ActionBarSherlock.DEBUG) Log.d(TAG, xml.getAttributeName(i) + ": " + xml.getAttributeValue(i));
if ("uiOptions".equals(xml.getAttributeName(i))) {
uiOptions = xml.getAttributeIntValue(i, 0);
break; //out of for loop
}
}
} else if ("activity".equals(name)) {
//Check if the <activity> is us and has the attribute
if (ActionBarSherlock.DEBUG) Log.d(TAG, "Got <activity>");
Integer activityUiOptions = null;
String activityPackage = null;
boolean isOurActivity = false;
for (int i = xml.getAttributeCount() - 1; i >= 0; i--) {
if (ActionBarSherlock.DEBUG) Log.d(TAG, xml.getAttributeName(i) + ": " + xml.getAttributeValue(i));
//We need both uiOptions and name attributes
String attrName = xml.getAttributeName(i);
if ("uiOptions".equals(attrName)) {
activityUiOptions = xml.getAttributeIntValue(i, 0);
} else if ("name".equals(attrName)) {
activityPackage = cleanActivityName(packageName, xml.getAttributeValue(i));
if (!thisPackage.equals(activityPackage)) {
break; //out of for loop
}
isOurActivity = true;
}
//Make sure we have both attributes before processing
if ((activityUiOptions != null) && (activityPackage != null)) {
//Our activity, uiOptions specified, override with our value
uiOptions = activityUiOptions.intValue();
}
}
if (isOurActivity) {
//If we matched our activity but it had no logo don't
//do any more processing of the manifest
break;
}
}
}
eventType = xml.nextToken();
}
} catch (Exception e) {
e.printStackTrace();
}
if (ActionBarSherlock.DEBUG) Log.i(TAG, "Returning " + Integer.toHexString(uiOptions));
return uiOptions;
}
示例6: onCreatePanelMenu
@Override
public final boolean onCreatePanelMenu(int featureId, android.view.Menu menu) {
if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onCreatePanelMenu] featureId: " + featureId + ", menu: " + menu);
if (featureId == Window.FEATURE_OPTIONS_PANEL && !mIgnoreNativeCreate) {
mIgnoreNativeCreate = true;
boolean result = getSherlock().dispatchCreateOptionsMenu(menu);
mIgnoreNativeCreate = false;
if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onCreatePanelMenu] returning " + result);
return result;
}
return super.onCreatePanelMenu(featureId, menu);
}
示例7: requestFeature
@Override
public boolean requestFeature(int featureId) {
if (ActionBarSherlock.DEBUG) Log.d(TAG, "[requestFeature] featureId: " + featureId);
final boolean result = mActivity.getWindow().requestFeature(featureId);
if (ActionBarSherlock.DEBUG) Log.d(TAG, "[requestFeature] returning " + result);
return result;
}
示例8: addContentView
@Override
public void addContentView(View view, ViewGroup.LayoutParams params) {
if (ActionBarSherlock.DEBUG) Log.d(TAG, "[addContentView] view: " + view + ", params: " + params);
if (mContentParent == null) {
installDecor();
}
mContentParent.addView(view, params);
initActionBar();
}
示例9: dispatchConfigurationChanged
@Override
public void dispatchConfigurationChanged(Configuration newConfig) {
if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchConfigurationChanged] newConfig: " + newConfig);
if (aActionBar != null) {
aActionBar.onConfigurationChanged(newConfig);
}
}
示例10: dispatchPause
@Override
public void dispatchPause() {
if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchPause]");
if (wActionBar != null && wActionBar.isOverflowMenuShowing()) {
wActionBar.hideOverflowMenu();
}
}
示例11: ensureActionBar
@Override
public void ensureActionBar() {
if (ActionBarSherlock.DEBUG) Log.d(TAG, "[ensureActionBar]");
if (mDecor == null) {
initActionBar();
}
}
示例12: setContentView
@Override
public void setContentView(View view, LayoutParams params) {
if (ActionBarSherlock.DEBUG) Log.d(TAG, "[setContentView] view: " + view + ", params: " + params);
mActivity.getWindow().setContentView(view, params);
initActionBar();
}
示例13: dispatchPrepareOptionsMenu
@Override
public boolean dispatchPrepareOptionsMenu(android.view.Menu menu) {
if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchPrepareOptionsMenu] android.view.Menu: " + menu);
if (mActionMode != null) {
return false;
}
mMenuIsPrepared = false;
if (!preparePanel()) {
return false;
}
if (isReservingOverflow()) {
return false;
}
if (mNativeItemMap == null) {
mNativeItemMap = new HashMap<android.view.MenuItem, MenuItemImpl>();
} else {
mNativeItemMap.clear();
}
if (mMenu == null) {
return false;
}
boolean result = mMenu.bindNativeOverflow(menu, this, mNativeItemMap);
if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchPrepareOptionsMenu] returning " + result);
return result;
}
示例14: dispatchMenuOpened
@Override
public boolean dispatchMenuOpened(int featureId, android.view.Menu menu) {
if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchMenuOpened] featureId: " + featureId + ", menu: " + menu);
if (featureId == Window.FEATURE_ACTION_BAR || featureId == Window.FEATURE_OPTIONS_PANEL) {
if (aActionBar != null) {
aActionBar.dispatchMenuVisibilityChanged(true);
}
return true;
}
return false;
}
示例15: onPreparePanel
@Override
public boolean onPreparePanel(int featureId, View view, Menu menu) {
if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onPreparePanel] featureId: " + featureId + ", view: " + view + " menu: " + menu);
if (featureId == Window.FEATURE_OPTIONS_PANEL) {
boolean result = onPrepareOptionsMenu(menu);
if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onPreparePanel] activity prepare result: " + result);
boolean show = false;
if (mFragments.mAdded != null) {
for (int i = 0; i < mFragments.mAdded.size(); i++) {
Fragment f = mFragments.mAdded.get(i);
if (f != null && !f.mHidden && f.mHasMenu && f.mMenuVisible && f instanceof OnPrepareOptionsMenuListener) {
show = true;
((OnPrepareOptionsMenuListener)f).onPrepareOptionsMenu(menu);
}
}
}
if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onPreparePanel] fragments prepare result: " + show);
result |= show;
result &= menu.hasVisibleItems();
if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onPreparePanel] returning " + result);
return result;
}
return false;
}