最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

java - How to remove transient displaying in top of status bar in android? - Stack Overflow

programmeradmin0浏览0评论

In car, there is an overlay displaying on top of status bar for applications in full screen when swipe down on top of status bar. Again when swipe down, notification panel is displaying.

But I want to remove the overlay on top of status bar and display the notification panel directly on first swipe of applications with full screen. But i am not able to identify how to remove the overlay on top of status bar. When I analysed, i found the below method is calling during first swipe of status bar.

public class CarSystemBar extends SystemUI implements CommandQueue.Callbacks{
......
@Override
    public void showTransient(int displayId, int[] types) {

        Log.i(TAG, "showTransient: ");
        if (displayId != mDisplayId) {
            return;
        }
        try{

            if (containsType(types, ITYPE_STATUS_BAR)) {
                if (!mStatusBarTransientShown) {
                    mStatusBarTransientShown = true;
                    handleTransientChanged();
                }
            }
            if (containsType(types, ITYPE_NAVIGATION_BAR)) {
                if (!mNavBarTransientShown) {
                    mNavBarTransientShown = true;
                    handleTransientChanged();
                }
            }
        }catch (Exception e) {
            Log.e(TAG, "Exception"+e);
        }
    }

 @Override
    public void abortTransient(int displayId, int[] types) {
        Log.i(TAG, "abortTransient: ");
        if (displayId != mDisplayId) {
            return;
        }
        if (!containsType(types, ITYPE_STATUS_BAR) && !containsType(types, ITYPE_NAVIGATION_BAR)) {
            return;
        }
        clearTransient();
    }

    private void clearTransient() {
        Log.i(TAG,"clearTransient");
        if (mStatusBarTransientShown) {
            mStatusBarTransientShown = false;
            handleTransientChanged();
        }
        if (mNavBarTransientShown) {
            mNavBarTransientShown = false;
            handleTransientChanged();
        }
    }

Scenario: When I swipe down, showTransient log is displaying and again when I swipe down notification panel is displaying.

I couldn't find why showTransient() is calling. How to skip to directly call NotificationPanel?

Source Ref

发布评论

评论列表(0)

  1. 暂无评论