带抽屉的Android 9.0

时间:2019-09-15 12:38:53

标签: android drawer

好吧,这是我面临的一个真正的怪异问题,而且我似乎甚至都无法正确搜索它。 我有一个使用4个抽屉的应用程序。屏幕两侧各一个(上,下,左,右) 现在,该应用程序可以在许多设备上运行,并且一切正常。

最近,我们购买了运行android 9.0的Galaxy A70,突然之间,四个抽屉中的两个抽屉无法正常工作。 右侧和底部抽屉在打开和关闭时均按预期工作。 左右抽屉似乎太“敏感”,一旦我尝试打开抽屉,它就会立即再次关闭,而“ onScrollStarted”甚至都没有被调用)

是否有关于此怪异行为的文档?我尝试使用Google搜索,发现了许多与设置中的手势和触摸有关的主题,我尝试关注所有这些内容,似乎没有什么改变。

上抽屉代码:

slidingDrawerUp.setOnDrawerScrollListener(new SlidingDrawer.OnDrawerScrollListener() {
        @Override
        public void onScrollStarted() {
            if (slidingDrawerRight.isOpened())
                slidingDrawerRight.animateClose();
            if (slidingDrawerLeft.isOpened())
                slidingDrawerLeft.animateClose();
            if(slidingDrawerBottom.isOpened())
                slidingDrawerBottom.animateClose();

            slidingDrawerUp.startAnimation(animationUp);
        }
        @Override
        public void onScrollEnded() {
        }
    });

底部抽屉:

slidingDrawerBottom = (SlidingDrawer) findViewById(R.id.drawer_bottom);
    slidingDrawerBottom.setOnDrawerScrollListener(new SlidingDrawer.OnDrawerScrollListener() {
        @Override
        public void onScrollStarted() {
            if (slidingDrawerRight.isOpened())
                slidingDrawerRight.animateClose();
            if (slidingDrawerLeft.isOpened())
                slidingDrawerLeft.animateClose();
            if (slidingDrawerUp.isOpened())
                slidingDrawerUp.animateClose();
            slidingDrawerBottom.startAnimation(animationButtom);
        }
        @Override
        public void onScrollEnded() {
        }
    });

右抽屉:

slidingDrawerRight.setOnDrawerScrollListener(new SlidingDrawer.OnDrawerScrollListener() {
        @Override
        public void onScrollStarted() {
            if (slidingDrawerUp.isOpened())
                slidingDrawerUp.animateClose();
            if (slidingDrawerLeft.isOpened())
                slidingDrawerLeft.animateClose();
            if(slidingDrawerBottom.isOpened())
                slidingDrawerBottom.animateClose();
            slidingDrawerRight.startAnimation(animationLeft);
        }
        @Override
        public void onScrollEnded() {
        }
    });

左抽屉:

slidingDrawerLeft.setOnDrawerScrollListener(new SlidingDrawer.OnDrawerScrollListener() {
        @Override
        public void onScrollStarted() {
            if (slidingDrawerRight.isOpened())
                slidingDrawerRight.animateClose();
            if (slidingDrawerUp.isOpened())
                slidingDrawerUp.animateClose();
            if(slidingDrawerBottom.isOpened())
                slidingDrawerBottom.animateClose();
            slidingDrawerLeft.startAnimation(animationRight);

        }

        @Override
        public void onScrollEnded() {
        }
    });

0 个答案:

没有答案