Skip to content

Commit

Permalink
fix: Fix system-bar borders & add back reader settings (#230)
Browse files Browse the repository at this point in the history
Signed-off-by: starry-shivam <starry@krsh.dev>
  • Loading branch information
starry-shivam authored Oct 10, 2024
1 parent b62d804 commit fbd93b2
Show file tree
Hide file tree
Showing 17 changed files with 352 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ aboutLibraries {


dependencies {
def composeBom = platform('androidx.compose:compose-bom:2024.09.02')
def composeBom = platform('androidx.compose:compose-bom:2024.09.03')
implementation composeBom
androidTestImplementation composeBom

Expand All @@ -111,7 +111,7 @@ dependencies {
implementation "androidx.compose.runtime:runtime-livedata"
implementation "androidx.compose.material3:material3"
// Material icons.
implementation 'androidx.compose.material:material-icons-extended:1.7.2'
implementation 'androidx.compose.material:material-icons-extended:1.7.3'
// Material theme for main activity.
implementation 'com.google.android.material:material:1.12.0'
// Android 12+ splash API.
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
<activity
android:name=".ui.screens.reader.main.activities.ReaderActivity"
android:configChanges="orientation|screenSize|uiMode|locale|layoutDirection|screenLayout"
android:exported="true">
android:exported="true"
android:theme="@style/Theme.Myne.ReaderActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ fun MainScreen(
Scaffold(
bottomBar = {
BottomBar(navController = navController)
}, containerColor = MaterialTheme.colorScheme.background
},
containerColor = MaterialTheme.colorScheme.background,
) {
NavGraph(
startDestination = startDestination,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,13 @@ class ReaderActivity : AppCompatActivity() {
ChaptersContent(
state = state,
lazyListState = lazyListState,
onToggleReaderMenu = {
viewModel.toggleReaderMenu()
toggleSystemBars(state.showReaderMenu)
}
onToggleReaderMenu = { viewModel.toggleReaderMenu() }
)

// Toggle system bars based on reader menu visibility.
LaunchedEffect(state.showReaderMenu) {
toggleSystemBars(state.showReaderMenu)
}
})
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ private fun ChapterLazyItemItem(
val context = LocalContext.current
val paragraphs = remember { chunkText(chapter.body) }

val targetFontSize = (state.fontSize / 10) * 1.8f
val targetFontSize = remember(state.fontSize) {
(state.fontSize / 10) * 1.8f
}

val fontSize by animateFloatAsState(
targetValue = targetFontSize,
animationSpec = tween(durationMillis = 300),
Expand Down
Loading

0 comments on commit fbd93b2

Please sign in to comment.