Ehviewer-Overhauled / Ehviewer

EhViewer overhauled with Material Design 3, Jetpack Compose and more
GNU General Public License v3.0
5.15k stars 231 forks source link

Unexpected back press behavior on Android 14 #1322

Open FooIbar opened 1 year ago

FooIbar commented 1 year ago

复现步骤 / Step to reproduce

  1. Launch app
  2. Navigate to Downloads
  3. Press back button

预期行为 / Expected behaviour

Back to homepage

实际行为 / Actual Behaviour

Back to launcher

应用日志 / App logs

No response

备注 / Addition details

And this:

https://github.com/Ehviewer-Overhauled/Ehviewer/assets/118464521/b112c045-88b5-4e57-8150-50ebf8736b17

EhViewer 版本号 / EhViewer version code

1.8.9.0-SNAPSHOT

EhViewer CI 版本 / EhViewer CI Version

5422c04

Android 系统版本 / Android version

14

设备型号 / Device model

sdk_gphone64_x86_64

SoC 型号 / Soc model

/

自查步骤 / Verify steps

FooIbar commented 1 year ago
┬───
│ GC Root: Thread object
│
├─ android.os.HandlerThread instance
│    Leaking: NO (PathClassLoader↓ is not leaking)
│    Thread name: 'LeakCanary-Heap-Dump'
│    ↓ Thread.contextClassLoader
├─ dalvik.system.PathClassLoader instance
│    Leaking: NO (DownloadManager↓ is not leaking and A ClassLoader is never leaking)
│    ↓ ClassLoader.runtimeInternalObjects
├─ java.lang.Object[] array
│    Leaking: NO (DownloadManager↓ is not leaking)
│    ↓ Object[3266]
├─ com.hippo.ehviewer.download.DownloadManager class
│    Leaking: NO (DownloadsScene↓ is not leaking and a class is never leaking)
│    ↓ static DownloadManager.mDownloadInfoListeners
├─ java.util.ArrayList instance
│    Leaking: NO (DownloadsScene↓ is not leaking)
│    ↓ ArrayList[1]
├─ com.hippo.ehviewer.ui.scene.DownloadsScene instance
│    Leaking: NO (FragmentContainerView↓ is not leaking and Fragment#mFragmentManager is not null)
│    Fragment.mTag=0f77fb06-a118-4e37-9677-ba3056f3c5cb
│    ↓ Fragment.mContainer
├─ androidx.fragment.app.FragmentContainerView instance
│    Leaking: NO (View attached)
│    View is part of a window view hierarchy
│    View.mAttachInfo is not null (view attached)
│    View.mID = R.id.fragment_container
│    View.mWindowAttachCount = 1
│    mContext instance of com.hippo.ehviewer.ui.MainActivity with mDestroyed = false
│    ↓ FragmentContainerView.disappearingFragmentChildren
│                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
├─ java.util.ArrayList instance
│    Leaking: UNKNOWN
│    Retaining 60 B in 2 objects
│    ↓ ArrayList[2]
│               ~~~
╰→ androidx.coordinatorlayout.widget.CoordinatorLayout instance
​     Leaking: YES (ObjectWatcher was watching this because com.hippo.ehviewer.ui.scene.GalleryListScene received
​     Fragment#onDestroyView() callback (references to its views should be cleared to prevent leaks))
​     Retaining 260.3 kB in 5935 objects
​     key = ce15d164-edd8-4583-980f-a714a3150570
​     watchDurationMillis = 15502
​     retainedDurationMillis = 7324
​     View not part of a window view hierarchy
​     View.mAttachInfo is null (view detached)
​     View.mWindowAttachCount = 1
​     mContext instance of com.hippo.ehviewer.ui.MainActivity with mDestroyed = false

Meanwhile

asuka-mio commented 1 year ago

Androidx fragment写的有点问题

FooIbar commented 1 year ago

Also back press on Android 14 won't close right drawer.

FooIbar commented 1 year ago

Predictive back 选择留在原界面会导致:

https://github.com/Ehviewer-Overhauled/Ehviewer/assets/118464521/71ff9117-1533-408c-b2ac-d0497644decc