Skip to content

Commit

Permalink
[fix] Fix #76; fix FilePicker bottom padding bug; change main screens…
Browse files Browse the repository at this point in the history
… top bar title alignment
  • Loading branch information
SkyD666 committed Jul 28, 2024
1 parent 10b902d commit 10fc2e7
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ android {
minSdk = 24
targetSdk = 34
versionCode = 18
versionName = "1.1-beta57"
versionName = "1.1-rc01"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ private fun FeedList(
snackbarHost = { SnackbarHost(hostState = snackbarHostState) },
topBar = {
AniVuTopBar(
style = AniVuTopBarStyle.CenterAligned,
style = AniVuTopBarStyle.Small,
title = { Text(text = stringResource(id = R.string.feed_screen_name)) },
actions = {
AniVuIconButton(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ fun FilePickerScreen(
contentPadding = PaddingValues(
start = paddingValues.calculateStartPadding(LocalLayoutDirection.current),
end = paddingValues.calculateEndPadding(LocalLayoutDirection.current),
bottom = if (pickFolder) 0.dp else paddingValues.calculateBottomPadding(),
),
) {
(uiState.fileListState as? FileListState.Success)?.list?.forEach { file ->
Expand Down
23 changes: 11 additions & 12 deletions app/src/main/java/com/skyd/anivu/ui/fragment/media/MediaScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -112,27 +112,26 @@ fun MediaScreen(path: String, viewModel: MediaViewModel = hiltViewModel()) {
snackbarHost = { SnackbarHost(hostState = snackbarHostState) },
topBar = {
AniVuTopBar(
style = AniVuTopBarStyle.CenterAligned,
style = AniVuTopBarStyle.Small,
title = { Text(text = stringResource(R.string.media_screen_name)) },
colors = TopAppBarDefaults.centerAlignedTopAppBarColors(
navigationIconContentColor = TopAppBarDefaults.centerAlignedTopAppBarColors().actionIconContentColor
colors = TopAppBarDefaults.topAppBarColors(
navigationIconContentColor = TopAppBarDefaults.topAppBarColors().actionIconContentColor
),
navigationIcon = {
AniVuIconButton(
onClick = {
navigateToFilePicker(navController = navController, path = path)
},
imageVector = Icons.Outlined.MyLocation,
contentDescription = stringResource(id = R.string.data_screen_media_lib_location),
)
},
navigationIcon = {},
scrollBehavior = scrollBehavior,
windowInsets = WindowInsets.safeDrawing.run {
var sides = WindowInsetsSides.Top + WindowInsetsSides.Right
if (windowSizeClass.isCompact) sides += WindowInsetsSides.Left
only(sides)
},
actions = {
AniVuIconButton(
onClick = {
navigateToFilePicker(navController = navController, path = path)
},
imageVector = Icons.Outlined.MyLocation,
contentDescription = stringResource(id = R.string.data_screen_media_lib_location),
)
AniVuIconButton(
onClick = { dispatch(MediaIntent.Refresh(path)) },
imageVector = Icons.Outlined.Refresh,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ fun Media1Item(
val isMedia = rememberSaveable(data) { data.isMedia }
val isDir = rememberSaveable(data) { data.isDir }

val fileNameWithoutExtension = data.name.substringBeforeLast(".")
val fileExtension = data.name.substringAfterLast(".", "")
val fileNameWithoutExtension = if (isDir) data.name else data.name.substringBeforeLast(".")
val fileExtension = if (isDir) "" else data.name.substringAfterLast(".", "")


Row(
modifier = Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ fun MoreScreen() {
snackbarHost = { SnackbarHost(hostState = snackbarHostState) },
topBar = {
AniVuTopBar(
style = AniVuTopBarStyle.CenterAligned,
style = AniVuTopBarStyle.Small,
title = { Text(text = stringResource(id = R.string.more_screen_name)) },
navigationIcon = {},
windowInsets = WindowInsets.safeDrawing.only(
Expand Down

0 comments on commit 10fc2e7

Please sign in to comment.