Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix]disable page indicator in ActionRow when no pages #4

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions app/src/main/java/top/maary/oblivionis/ui/ActionComponents.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package top.maary.oblivionis.ui

import android.net.Uri
import android.provider.MediaStore
import android.util.Log
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.clickable
import androidx.compose.foundation.combinedClickable
Expand Down Expand Up @@ -221,14 +222,14 @@ fun ActionRow(
) {
OutlinedButton(
onClick = {},
modifier = Modifier
.height(48.dp)
modifier = Modifier.height(48.dp),
enabled = (pagesCount != 0)
) {
Text(
modifier = Modifier.padding(start = 8.dp, end = 32.dp),
text = stringResource(R.string.pager_count, currentPage, pagesCount)
text = stringResource(R.string.pager_count,
if (pagesCount == 0) 0 else currentPage, pagesCount)
)

}
if (loading) {
LinearProgressIndicator(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ class ActionViewModel(
private fun databaseMarkAll(images: List<MediaStoreImage>) = viewModelScope.launch {
images.forEach {
if (it.isExcluded) return@forEach
imageRepository.mark(it.copy(isMarked = false))
imageRepository.mark(it.copy(isMarked = true))
}
}

Expand Down
Loading