Skip to content
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
4 changes: 4 additions & 0 deletions app/src/main/java/org/fairscan/app/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,10 @@ class MainActivity : ComponentActivity() {
setResult(RESULT_CANCELED)
finish()
}
},
shouldDisplayBackButton = {
viewModel.currentScreen.value !is Screen.Main.Camera
|| launchMode == LaunchMode.EXTERNAL_SCAN_TO_PDF
}
)
}
Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/org/fairscan/app/ui/Navigation.kt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ data class Navigation(
val toLibrariesScreen: () -> Unit,
val toSettingsScreen: (() -> Unit)?,
val back: () -> Unit,
val shouldDisplayBackButton: () -> Boolean,
)

@ConsistentCopyVisibility
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/org/fairscan/app/ui/PreviewUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import org.fairscan.app.ui.state.PageThumbnail
import org.fairscan.imageprocessing.ColorMode

fun dummyNavigation(): Navigation {
return Navigation({}, {}, {}, {}, {}, {}, {}, {})
return Navigation({}, {}, {}, {}, {}, {}, {}, {}, { -> true})
}

fun fakeDocument(pageIds: ImmutableList<String>, context: Context): DocumentUiModel {
Expand Down
14 changes: 8 additions & 6 deletions app/src/main/java/org/fairscan/app/ui/components/Scaffold.kt
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,14 @@ fun MyScaffold(
}
}
}
BackButton(
navigation.back,
modifier = Modifier
.align(Alignment.TopStart)
.windowInsetsPadding(WindowInsets.safeDrawing)
)
if (navigation.shouldDisplayBackButton()) {
BackButton(
navigation.back,
modifier = Modifier
.align(Alignment.TopStart)
.windowInsetsPadding(WindowInsets.safeDrawing)
)
}
AppOverflowMenu(
navigation,
modifier = Modifier
Expand Down
Loading