Skip to content

Commit

Permalink
修复浏览画廊时全屏模式无法关闭的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaojieonly committed Dec 12, 2024
1 parent 4c22c51 commit 9b32fbc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
16 changes: 12 additions & 4 deletions app/src/main/java/com/hippo/ehviewer/ui/GalleryActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import android.view.MotionEvent;
import android.view.View;
import android.view.Window;
import android.view.WindowInsets;
import android.view.WindowManager;
import android.webkit.MimeTypeMap;
import android.widget.CompoundButton;
Expand All @@ -58,6 +59,10 @@
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.widget.SwitchCompat;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowCompat;
import androidx.core.view.WindowInsetsCompat;
import androidx.core.view.WindowInsetsControllerCompat;

import com.hippo.android.resource.AttrResources;
import com.hippo.ehviewer.AppConfig;
Expand Down Expand Up @@ -387,9 +392,12 @@ private void onCreateView(@Nullable Bundle savedInstanceState) {

// System UI helper
if (Settings.getReadingFullscreen()) {
int systemUiLevel;
systemUiLevel = SystemUiHelper.LEVEL_IMMERSIVE;
mSystemUiHelper = new SystemUiHelper(this, systemUiLevel,
Window w = getWindow();
w.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION,
WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
w.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS,
WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
mSystemUiHelper = new SystemUiHelper(this, SystemUiHelper.LEVEL_IMMERSIVE,
SystemUiHelper.FLAG_LAYOUT_IN_SCREEN_OLDER_DEVICES | SystemUiHelper.FLAG_IMMERSIVE_STICKY);
mSystemUiHelper.hide();
mShowSystemUi = false;
Expand Down Expand Up @@ -655,7 +663,7 @@ private void autoRead(View view) {
long initialDelay = Settings.getStartTransferTime();
long waitTime = initialDelay * 2L;
try {
transferService.scheduleAtFixedRate(
transferService.scheduleWithFixedDelay(
() -> transHandle.post(() -> {
if (mGalleryView == null) {
return;
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,10 @@

<style name="AppTheme.Toolbar.Black" parent="AppTheme.Black.NoActionBar" />

<style name="AppTheme.Gallery" parent="AppTheme.Dark.NoActionBar">
<style name="AppTheme.Gallery" parent="AppTheme.Dark">
<item name="gallerySliderBackgroundColor">@color/gallery_slider_background_dark</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
<item name="windowNoTitle">true</item>
<!-- <item name="android:windowFullscreen">true</item>-->
</style>

<style name="AppTheme.Gallery.Dark" />
Expand Down

0 comments on commit 9b32fbc

Please sign in to comment.