Skip to content

Commit

Permalink
Small UI improvements for Scan Barcode Screen
Browse files Browse the repository at this point in the history
Upping versionCode to 66
  • Loading branch information
Dima-Android committed May 24, 2024
1 parent e0dc529 commit 965ca48
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,6 @@ internal class ScanBarcodeViewModel @Inject constructor(
}
}

fun cancelAllLookups() {
identifierLookupController.cancelAllLookups()
updateLookupState(State.waitingInput)
}

private fun setupAttachmentObserving() {
attachmentDownloaderEventStream.flow()
.onEach { update ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ import org.zotero.android.uicomponents.topbar.NewCustomTopBar
import org.zotero.android.uicomponents.topbar.NewHeadingTextButton

@Composable
internal fun ScanBarcodeCloseScanCancelTopBar(
internal fun ScanBarcodeCloseScanAnotherTopBar(
onClose: () -> Unit,
onCancelAll: () -> Unit,
onScan: () -> Unit,
) {
NewCustomTopBar(
Expand All @@ -19,15 +18,11 @@ internal fun ScanBarcodeCloseScanCancelTopBar(
text = stringResource(id = Strings.close),
onClick = onClose
)
NewHeadingTextButton(
text = stringResource(id = Strings.cancel_all),
onClick = onCancelAll
)
},
rightContainerContent = listOf {
NewHeadingTextButton(
style = CustomTheme.typography.defaultBold,
text = stringResource(id = Strings.scan),
text = stringResource(id = Strings.scan_another),
onClick = onScan
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,9 @@ internal fun ScanBarcodeScreen(
}
CustomScaffold(
topBar = {
ScanBarcodeCloseScanCancelTopBar(
ScanBarcodeCloseScanAnotherTopBar(
onClose = onClose,
onScan = viewModel::launchBarcodeScanner,
onCancelAll = {
viewModel.cancelAllLookups()
onClose()
}
onScan = viewModel::launchBarcodeScanner
)
},
) {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
<string name="errors_lookup_no_identifiers_with_lookup_data">Zotero could not find any new identifiers in your input, or they are already being added. Please verify your input and try again.</string>
<string name="queued">Queued…</string>
<string name="failed">Failed</string>
<string name="scan">Scan</string>
<string name="scan_another">Scan Another</string>
</resources>
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/BuildConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ object BuildConfig {
const val compileSdkVersion = 34
const val targetSdk = 33

val versionCode = 65 // Must be updated on every build
val versionCode = 66 // Must be updated on every build
val version = Version(
major = 1,
minor = 0,
Expand Down

0 comments on commit 965ca48

Please sign in to comment.