当前位置: 首页>>代码示例>>Java>>正文


Java Window.Callback方法代码示例

本文整理汇总了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();
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:19,代码来源:ActionBarSherlockCompat.java

示例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();
        }
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:27,代码来源:AppCompatDelegateImplV7.java

示例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;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:8,代码来源:AppCompatDelegateImplV7.java

示例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;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:11,代码来源:AppCompatDelegateImplV7.java

示例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;
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:12,代码来源:AppCompatDelegateImplV7.java

示例6: WindowCallbackProxy

import android.view.Window; //导入方法依赖的package包/类
public WindowCallbackProxy(Activity activity, Window.Callback callback) {
    mCallback = callback;
    mActivity = activity;
}
 
开发者ID:lizhangqu,项目名称:chromium-net-for-android,代码行数:5,代码来源:BaseChromiumApplication.java

示例7: AbstractWindowCallback

import android.view.Window; //导入方法依赖的package包/类
public AbstractWindowCallback(Window.Callback callback) {
    mCallback = callback;
}
 
开发者ID:316boss,项目名称:TopNotification,代码行数:4,代码来源:AbstractWindowCallback.java

示例8: MyWindowCallback

import android.view.Window; //导入方法依赖的package包/类
public MyWindowCallback(Window.Callback localCallback, Activity activity) {
    mLocalCallback = localCallback;
    mActivity = activity;
}
 
开发者ID:pchmn,项目名称:MaterialChipsInput,代码行数:5,代码来源:MyWindowCallback.java

示例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;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:75,代码来源:AppCompatDelegateImplV7.java

示例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);
                }
            });
        }
    }
 
开发者ID:316boss,项目名称:TopNotification,代码行数:29,代码来源:TopNotification.java

示例11: setWindowCallback

import android.view.Window; //导入方法依赖的package包/类
void setWindowCallback(Window.Callback callback); 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:2,代码来源:DecorToolbar.java


注:本文中的android.view.Window.Callback方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。