Make UI adaptive, fix edge-to-edge IME insets, enable R8 for release#1
Merged
Conversation
Adaptive layout - Convert LazyColumn → LazyVerticalGrid(GridCells.Adaptive(300.dp)) so the torrent list reflows into 2 columns on unfolded foldables and 3 on tablets automatically, with no breakpoint boilerplate. Edge-to-edge - Replace Modifier.safeDrawingPadding() on the NavDisplay entry (which missed IME insets) with Scaffold(contentWindowInsets = WindowInsets.safeDrawing) inside MainScreen. The soft keyboard now correctly pushes content up when the magnet-link field is focused. - consumeWindowInsets(innerPadding) prevents child composables from double-applying system-bar insets. R8 / release shrinking - Enable isMinifyEnabled = true and isShrinkResources = true for the release build type. - Add proguard-rules.pro with targeted keep rules for JNI native methods (TorrentManager) and @serializable data classes (TorrentInfo, PeerInfo) so R8 does not rename or strip them. All 14 Compose UI instrumented tests pass on a Resizable API-37 AVD; phone, unfolded, and tablet window sizes verified visually.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
LazyColumn→LazyVerticalGrid(GridCells.Adaptive(300.dp))— 1 column on phones, 2 on unfolded foldables, 3 on tablets, zero breakpoint boilerplateModifier.safeDrawingPadding()on the nav entry (missed IME) withScaffold(contentWindowInsets = WindowInsets.safeDrawing)+consumeWindowInsetsinsideMainScreen; the keyboard now correctly lifts content when the magnet-link field is focusedisMinifyEnabled+isShrinkResources; addedproguard-rules.prowith targeted keep rules for JNI native methods (TorrentManager) and@Serializabledata classesTest plan
./gradlew connectedAndroidTest)./gradlew testDebugUnitTest)adb emu resize-display 0/1/2./gradlew assembleDebug)./gradlew assembleRelease) — run locally before merging