Skip to content

Commit

Permalink
Merge pull request #4 from Steve-Mr/dev
Browse files Browse the repository at this point in the history
[fix]disable page indicator in ActionRow when no pages
  • Loading branch information
Steve-Mr authored Oct 4, 2024
2 parents 75bb440 + 6c4dd88 commit eadbdba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
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

0 comments on commit eadbdba

Please sign in to comment.