本文整理汇总了Java中android.view.Window.Callback方法的典型用法代码示例。如果您正苦于以下问题:Java Window.Callback方法的具体用法?Java Window.Callback怎么用?Java Window.Callback使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.Window
的用法示例。
在下文中一共展示了Window.Callback方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setContentView
import android.view.Window; //导入方法依赖的package包/类
@Override
public void setContentView(int layoutResId) {
if (ActionBarSherlock.DEBUG) Log.d(TAG, "[setContentView] layoutResId: " + layoutResId);
if (mContentParent == null) {
installDecor();
} else {
mContentParent.removeAllViews();
}
mActivity.getLayoutInflater().inflate(layoutResId, mContentParent);
Window.Callback callback = mActivity.getWindow().getCallback();
if (callback != null) {
callback.onContentChanged();
}
initActionBar();
}
示例2: reopenMenu
import android.view.Window; //导入方法依赖的package包/类
private void reopenMenu(MenuBuilder menu, boolean toggleMenuMode) {
if (this.mDecorContentParent == null || !this.mDecorContentParent.canShowOverflowMenu() || (ViewConfigurationCompat.hasPermanentMenuKey(ViewConfiguration.get(this.mContext)) && !this.mDecorContentParent.isOverflowMenuShowPending())) {
PanelFeatureState st = getPanelState(0, true);
st.refreshDecorView = true;
closePanel(st, false);
openPanel(st, null);
return;
}
Window.Callback cb = getWindowCallback();
if (this.mDecorContentParent.isOverflowMenuShowing() && toggleMenuMode) {
this.mDecorContentParent.hideOverflowMenu();
if (!isDestroyed()) {
cb.onPanelClosed(108, getPanelState(0, true).menu);
}
} else if (cb != null && !isDestroyed()) {
if (this.mInvalidatePanelMenuPosted && (this.mInvalidatePanelMenuFeatures & 1) != 0) {
this.mWindow.getDecorView().removeCallbacks(this.mInvalidatePanelMenuRunnable);
this.mInvalidatePanelMenuRunnable.run();
}
st = getPanelState(0, true);
if (st.menu != null && !st.refreshMenuContent && cb.onPreparePanel(0, st.createdPanelView, st.menu)) {
cb.onMenuOpened(108, st.menu);
this.mDecorContentParent.showOverflowMenu();
}
}
}
示例3: onOpenSubMenu
import android.view.Window; //导入方法依赖的package包/类
public boolean onOpenSubMenu(MenuBuilder subMenu) {
Window.Callback cb = AppCompatDelegateImplV7.this.getWindowCallback();
if (cb != null) {
cb.onMenuOpened(108, subMenu);
}
return true;
}
示例4: onMenuItemSelected
import android.view.Window; //导入方法依赖的package包/类
public boolean onMenuItemSelected(MenuBuilder menu, MenuItem item) {
Window.Callback cb = getWindowCallback();
if (!(cb == null || isDestroyed())) {
PanelFeatureState panel = findMenuPanel(menu.getRootMenu());
if (panel != null) {
return cb.onMenuItemSelected(panel.featureId, item);
}
}
return false;
}
示例5: checkCloseActionMenu
import android.view.Window; //导入方法依赖的package包/类
private void checkCloseActionMenu(MenuBuilder menu) {
if (!this.mClosingActionMenu) {
this.mClosingActionMenu = true;
this.mDecorContentParent.dismissPopups();
Window.Callback cb = getWindowCallback();
if (!(cb == null || isDestroyed())) {
cb.onPanelClosed(108, menu);
}
this.mClosingActionMenu = false;
}
}
示例6: WindowCallbackProxy
import android.view.Window; //导入方法依赖的package包/类
public WindowCallbackProxy(Activity activity, Window.Callback callback) {
mCallback = callback;
mActivity = activity;
}
示例7: AbstractWindowCallback
import android.view.Window; //导入方法依赖的package包/类
public AbstractWindowCallback(Window.Callback callback) {
mCallback = callback;
}
示例8: MyWindowCallback
import android.view.Window; //导入方法依赖的package包/类
public MyWindowCallback(Window.Callback localCallback, Activity activity) {
mLocalCallback = localCallback;
mActivity = activity;
}
示例9: preparePanel
import android.view.Window; //导入方法依赖的package包/类
private boolean preparePanel(PanelFeatureState st, KeyEvent event) {
if (isDestroyed()) {
return false;
}
if (st.isPrepared) {
return true;
}
boolean isActionBarMenu;
if (!(this.mPreparedPanel == null || this.mPreparedPanel == st)) {
closePanel(this.mPreparedPanel, false);
}
Window.Callback cb = getWindowCallback();
if (cb != null) {
st.createdPanelView = cb.onCreatePanelView(st.featureId);
}
if (st.featureId == 0 || st.featureId == 108) {
isActionBarMenu = true;
} else {
isActionBarMenu = false;
}
if (isActionBarMenu && this.mDecorContentParent != null) {
this.mDecorContentParent.setMenuPrepared();
}
if (st.createdPanelView == null && !(isActionBarMenu && (peekSupportActionBar() instanceof ToolbarActionBar))) {
if (st.menu == null || st.refreshMenuContent) {
if (st.menu == null && (!initializePanelMenu(st) || st.menu == null)) {
return false;
}
if (isActionBarMenu && this.mDecorContentParent != null) {
if (this.mActionMenuPresenterCallback == null) {
this.mActionMenuPresenterCallback = new ActionMenuPresenterCallback();
}
this.mDecorContentParent.setMenu(st.menu, this.mActionMenuPresenterCallback);
}
st.menu.stopDispatchingItemsChanged();
if (cb.onCreatePanelMenu(st.featureId, st.menu)) {
st.refreshMenuContent = false;
} else {
st.setMenu(null);
if (!isActionBarMenu || this.mDecorContentParent == null) {
return false;
}
this.mDecorContentParent.setMenu(null, this.mActionMenuPresenterCallback);
return false;
}
}
st.menu.stopDispatchingItemsChanged();
if (st.frozenActionViewState != null) {
st.menu.restoreActionViewStates(st.frozenActionViewState);
st.frozenActionViewState = null;
}
if (cb.onPreparePanel(0, st.createdPanelView, st.menu)) {
boolean z;
if (KeyCharacterMap.load(event != null ? event.getDeviceId() : -1).getKeyboardType() != 1) {
z = true;
} else {
z = false;
}
st.qwertyMode = z;
st.menu.setQwertyMode(st.qwertyMode);
st.menu.startDispatchingItemsChanged();
} else {
if (isActionBarMenu && this.mDecorContentParent != null) {
this.mDecorContentParent.setMenu(null, this.mActionMenuPresenterCallback);
}
st.menu.startDispatchingItemsChanged();
return false;
}
}
st.isPrepared = true;
st.isHandled = false;
this.mPreparedPanel = st;
return true;
}
示例10: setBackKeyListener
import android.view.Window; //导入方法依赖的package包/类
private void setBackKeyListener() {
if (mContext instanceof Activity) {
final Window window = ((Activity) mContext).getWindow();
final Window.Callback callback = window.getCallback();
((Activity) mContext).getWindow().setCallback(new AbstractWindowCallback(callback) {
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
if (!mOutsideTouchable && mState == VISIBLE) {
if (mCancelable) {
return true;
} else {
return false;
}
}
return callback.dispatchKeyEvent(event);
}
});
}
}
示例11: setWindowCallback
import android.view.Window; //导入方法依赖的package包/类
void setWindowCallback(Window.Callback callback);