禁止屏幕旋转隐藏右下角手动旋转按钮

项目中,禁止屏幕自动旋转。但是设备横竖屏物理旋转,因为重力感应器原因,切换后,竖屏方向时,右下角位置(底部导航栏位置)出现手动旋转屏幕按钮,点击后会旋转,这个地方在什么位置呢?

一图标如下

二怎样隐藏该图标显示呢

他不在launcher模块中,在framework/base/SystemUI/下

packages/SystemUI/src/com/android/systemui/statusbar/phone/RotationButtonController.java

//packages/SystemUI/src/com/android/systemui/statusbar/phone/RotationButtonController.java



    void setRotateSuggestionButtonState(final boolean visible, final boolean force) {
        // At any point the the button can become invisible because an a11y service became active.
        // Similarly, a call to make the button visible may be rejected because an a11y service is
        // active. Must account for this.
        // Rerun a show animation to indicate change but don't rerun a hide animation
       + if (true) {
       +    android.util.Log.d("RotationButtonController", " setRotateSuggestionButtonState return, rotation button not need show-----");
        +    return;
       + }
            android.util.Log.d("RotationButtonController", " setRotateSuggestionButtonState run first---");
        if (!visible && !mRotationButton.isVisible()) return;
        final View view = mRotationButton.getCurrentView();
        if (view == null) return;
        final KeyButtonDrawable currentDrawable = mRotationButton.getImageDrawable();
        if (currentDrawable == null) return;
        // Clear any pending suggestion flag as it has either been nullified or is being shown
        mPendingRotationSuggestion = false;

OVER~

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值