Delay SystemUiHelper synchronizing in onWindowFocusChanged()

It fixes invalid SystemUiHelper synchronizing
on XiaoMi MIX2 MIUI 10 Android 8.0
This commit is contained in:
seven332 committed 2018-12-27 16:29:11 +08:00
1 parent 2de859398b
commit ed4267cb36
1 file changed
+8 -6
@@ -430,13 +430,15 @@ public class GalleryActivity extends EhActivity implements SeekBar.OnSeekBarChan
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (hasFocus && mSystemUiHelper != null) {
if (mShowSystemUi) {
mSystemUiHelper.show();
} else {
mSystemUiHelper.hide();
SimpleHandler.getInstance().postDelayed(() -> {
if (hasFocus && mSystemUiHelper != null) {
if (mShowSystemUi) {
mSystemUiHelper.show();
} else {
mSystemUiHelper.hide();
}
}
}
}, 300);
}
@Override