Package the Rust mobile core and generated Kotlin API for Android (#92)
Dependency security audit / rustsec (push) Failing after 24s
Dependency security audit / rustsec (push) Failing after 24s
This commit is contained in:
1 parent
e079b82b15
commit
fcb36a0684
42 files changed
+1586
-172
No files matched your search
@@ -18,6 +18,7 @@ import androidx.compose.ui.semantics.heading
|
||||
import androidx.compose.ui.semantics.semantics
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||
import de.rfc1437.ironstorage.core.NativeFailure
|
||||
import de.rfc1437.ironstorage.core.ShellState
|
||||
import de.rfc1437.ironstorage.core.ShellTab
|
||||
|
||||
@@ -44,12 +45,33 @@ fun ShellScreen(viewModel: ShellViewModel) {
|
||||
) {
|
||||
Text(stringResource(R.string.app_name), style = MaterialTheme.typography.headlineLarge)
|
||||
val page = snapshot.pages.firstOrNull { it.tab == snapshot.selectedTab }
|
||||
val nativeFailure = snapshot.nativeFailure
|
||||
val title = if (nativeFailure != null) {
|
||||
stringResource(R.string.native_failure_title)
|
||||
} else {
|
||||
page?.stateTitle ?: stringResource(R.string.scaffold_title)
|
||||
}
|
||||
val detail = if (nativeFailure == null) {
|
||||
page?.detail ?: stringResource(R.string.scaffold_detail)
|
||||
} else {
|
||||
stringResource(
|
||||
when (nativeFailure) {
|
||||
NativeFailure.UnsupportedAbi -> R.string.native_unsupported_device
|
||||
NativeFailure.MissingLibrary,
|
||||
NativeFailure.ContractMismatch,
|
||||
NativeFailure.ChecksumMismatch,
|
||||
NativeFailure.LoadFailure -> R.string.native_update_required
|
||||
NativeFailure.RustFailure,
|
||||
NativeFailure.MainThreadCall -> R.string.native_operation_failed
|
||||
}
|
||||
)
|
||||
}
|
||||
Text(
|
||||
page?.stateTitle ?: stringResource(R.string.scaffold_title),
|
||||
title,
|
||||
modifier = Modifier.semantics { heading() },
|
||||
style = MaterialTheme.typography.headlineSmall
|
||||
)
|
||||
Text(page?.detail ?: stringResource(R.string.scaffold_detail))
|
||||
Text(detail)
|
||||
if (snapshot.state == ShellState.Loading) CircularProgressIndicator()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,4 +2,8 @@
|
||||
<string name="app_name">IronStorage</string>
|
||||
<string name="scaffold_title">No Password Store</string>
|
||||
<string name="scaffold_detail">Your password store has not been configured.</string>
|
||||
<string name="native_failure_title">IronStorage Is Unavailable</string>
|
||||
<string name="native_unsupported_device">This device is not supported by this app build.</string>
|
||||
<string name="native_update_required">The installed app components could not be loaded or do not match. Install a complete update without clearing app data.</string>
|
||||
<string name="native_operation_failed">The app could not complete this operation. Try again.</string>
|
||||
</resources>
|
||||
Reference in new issue
Block a user