[#511] Ktlint 0.46.1

This commit is contained in:
Carter Jernigan 2022-06-22 05:48:19 -04:00 committed by GitHub
parent 503d516c8f
commit 45aff80e76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
56 changed files with 122 additions and 68 deletions

View File

@ -1,3 +1,5 @@
@file:Suppress("ktlint:filename")
package co.electriccoin.zcash.crash
import co.electriccoin.zcash.spackle.io.writeAtomically

View File

@ -1,3 +1,5 @@
@file:Suppress("ktlint:filename")
package co.electriccoin.zcash.crash
import kotlinx.datetime.Instant

View File

@ -89,7 +89,7 @@ FLANK_VERSION=21.09.0
FULLADLE_VERSION=0.17.4
GRADLE_VERSIONS_PLUGIN_VERSION=0.42.0
JGIT_VERSION=6.1.0.202203080745-r
KTLINT_VERSION=0.45.2
KTLINT_VERSION=0.46.1
PLAY_PUBLISHER_PLUGIN_VERSION=3.7.0
ACCOMPANIST_PERMISSIONS_VERSION=0.23.1

View File

@ -1,3 +1,5 @@
@file:Suppress("ktlint:filename")
package cash.z.ecc.sdk.test
fun <T> Iterator<T>.count(): Int {

View File

@ -1,3 +1,5 @@
@file:Suppress("ktlint:filename")
package cash.z.ecc.sdk
import cash.z.ecc.android.sdk.Synchronizer

View File

@ -1,3 +1,5 @@
@file:Suppress("ktlint:filename")
package cash.z.ecc.sdk.ext
import java.nio.charset.Charset

View File

@ -7,6 +7,7 @@ object WalletBirthdayFixture {
const val HEIGHT = 1500000
const val HASH = "00047a34c61409682f44640af9352023ad92f69b827d0f2b288f152ebea50f46"
const val EPOCH_SECONDS = 1627076501L
@Suppress("MaxLineLength")
const val TREE = "01172b95f271c6af8f68388f08c8ef970db8ec8d8d61204ecb7b2bb2c38262b92d0010016284585a6c85dadfef27ff33f1403926b4bb391de92e8be797e4280cc4ca2971000001a1ff388639379c0120782b3929bd8871af797be4b651f694aa961bad65a9c12400000001d806c98bda9653d5ae22757eed750871e16e0fb657f52c3d771a4411668e84330001260f6e9fac0922f98d58afbcc3f391ac19d5d944081466929a33b99df19c0e6a0000013d2fd009bf8a22d68f720eac19c411c99014ed9c5f85d5942e15d1fc039e28680001f08f39275112dd8905b854170b7f247cf2df18454d4fa94e6e4f9320cca05f24011f8322ef806eb2430dc4a7a41c1b344bea5be946efc7b4349c1c9edb14ff9d39"

View File

@ -7,6 +7,7 @@ import cash.z.ecc.sdk.model.ZecRequestMessage
object ZecRequestFixture {
const val ADDRESS: String = WalletAddressFixture.UNIFIED_ADDRESS_STRING
@Suppress("MagicNumber")
val AMOUNT = Zatoshi(123)
val MESSAGE = ZecRequestMessage("Thanks for lunch")

View File

@ -11,6 +11,7 @@ object Zip321UriParseFixture {
"for%20your%20purchase"
const val ADDRESS: String = WalletAddressFixture.UNIFIED_ADDRESS_STRING
@Suppress("MagicNumber")
val AMOUNT = Zatoshi(123)
val MESSAGE = ZecRequestMessage("Thank you for your purchase")
@ -19,6 +20,6 @@ object Zip321UriParseFixture {
// Should return ZecRequest.fromUri(toParse) ideally, but it'd end up with an infinite loop for now.
@Suppress("UNUSED_PARAMETER")
suspend fun new(
toParse: String = URI,
toParse: String = URI
) = ZecRequest(WalletAddress.Unified.new(ADDRESS), AMOUNT, MESSAGE)
}

View File

@ -1,3 +1,5 @@
@file:Suppress("ktlint:filename")
package cash.z.ecc.sdk.type
import android.content.Context

View File

@ -18,7 +18,6 @@ object ZecSendExt {
memoString: String,
monetarySeparators: MonetarySeparators
): ZecSendValidation {
// This runBlocking shouldn't have a performance impact, since everything needs to be loaded at this point.
// However it would be better to eliminate it entirely.
val destination = runBlocking { WalletAddress.Unified.new(destinationString) }

View File

@ -20,7 +20,8 @@ class AbstractProcessNameContentProviderTest {
}
val actualProcessName = AbstractProcessNameContentProvider.getProcessNameLegacy(
ctx, ProviderInfo()
ctx,
ProviderInfo()
)
assertEquals(expectedApplicationProcessName, actualProcessName)

View File

@ -1,3 +1,5 @@
@file:Suppress("ktlint:filename")
package co.electriccoin.zcash.spackle
import android.content.Context

View File

@ -14,6 +14,7 @@ class ZcashUiTestRunner : AndroidJUnitRunner() {
val powerManager = ApplicationProvider.getApplicationContext<Context>()
.getSystemService(Context.POWER_SERVICE) as PowerManager
// There is no alternative to this deprecated API. The suggestion of a view to keep the screen
// on won't work well for our tests.
@Suppress("DEPRECATION")

View File

@ -34,7 +34,7 @@ fun PrimaryButton(
onClick: () -> Unit,
text: String,
modifier: Modifier = Modifier,
enabled: Boolean = true,
enabled: Boolean = true
) {
Button(
onClick = onClick,

View File

@ -27,13 +27,13 @@ fun ComposablePreview() {
fun Chip(
index: Index,
text: String,
modifier: Modifier = Modifier,
modifier: Modifier = Modifier
) {
Surface(
modifier = modifier.then(Modifier.padding(4.dp)),
shape = RoundedCornerShape(8.dp),
color = MaterialTheme.colorScheme.secondary,
shadowElevation = 8.dp,
shadowElevation = 8.dp
) {
Row(
modifier = Modifier
@ -42,7 +42,7 @@ fun Chip(
Text(
text = (index.value + 1).toString(),
style = ZcashTheme.typography.chipIndex,
color = ZcashTheme.colors.chipIndex,
color = ZcashTheme.colors.chipIndex
)
Spacer(modifier = Modifier.padding(horizontal = 2.dp, vertical = 0.dp))
Text(

View File

@ -1,3 +1,5 @@
@file:Suppress("ktlint:filename")
package co.electriccoin.zcash.ui.design.component
import androidx.compose.material3.LinearProgressIndicator
@ -11,8 +13,10 @@ import co.electriccoin.zcash.ui.design.theme.ZcashTheme
fun PinkProgress(progress: Progress, modifier: Modifier = Modifier) {
// Needs custom implementation to apply gradient
LinearProgressIndicator(
progress = progress.percent(), modifier,
ZcashTheme.colors.progressStart, ZcashTheme.colors.progressBackground
progress = progress.percent(),
modifier,
ZcashTheme.colors.progressStart,
ZcashTheme.colors.progressBackground
)
}

View File

@ -117,7 +117,7 @@ internal val DarkColorPalette = darkColorScheme(
surface = Dark.backgroundStart,
onSurface = Dark.textBodyOnBackground,
background = Dark.backgroundStart,
onBackground = Dark.textBodyOnBackground,
onBackground = Dark.textBodyOnBackground
)
internal val LightColorPalette = lightColorScheme(
@ -128,7 +128,7 @@ internal val LightColorPalette = lightColorScheme(
surface = Light.backgroundStart,
onSurface = Light.textBodyOnBackground,
background = Light.backgroundStart,
onBackground = Light.textBodyOnBackground,
onBackground = Light.textBodyOnBackground
)
internal val DarkExtendedColorPalette = ExtendedColors(

View File

@ -39,7 +39,7 @@ internal val Typography = Typography(
headlineLarge = TextStyle(
fontFamily = RubikFontFamily,
fontWeight = FontWeight.SemiBold,
fontSize = 30.sp,
fontSize = 30.sp
),
bodyLarge = TextStyle(
fontFamily = RubikFontFamily,
@ -55,13 +55,13 @@ internal val Typography = Typography(
fontFamily = RubikFontFamily,
fontWeight = FontWeight.Normal,
fontSize = 16.sp
),
)
)
@Immutable
data class ExtendedTypography(
val chipIndex: TextStyle,
val listItem: TextStyle,
val listItem: TextStyle
)
val LocalExtendedTypography = staticCompositionLocalOf {

View File

@ -1,4 +1,4 @@
package co.electriccoin.zcash.ui.screen.wallet_address.view
package co.electriccoin.zcash.ui.screen.address.view
import androidx.compose.ui.test.junit4.ComposeContentTestRule
import androidx.compose.ui.test.junit4.createComposeRule

View File

@ -206,6 +206,7 @@ class RequestViewTest : UiTestPrerequisites() {
private val onBackCount = AtomicInteger(0)
private val onCreateCount = AtomicInteger(0)
@Volatile
private var onCreateZecRequest: ZecRequest? = null

View File

@ -227,7 +227,7 @@ class RestoreViewTest : UiTestPrerequisites() {
paste = { "" },
onFinished = {
onFinishedCount.incrementAndGet()
},
}
)
}
}

View File

@ -31,7 +31,7 @@ class UpdateViewIntegrationTest {
priority = AppUpdateChecker.Priority.HIGH,
force = true,
appUpdateInfo = null,
state = UpdateState.Prepared,
state = UpdateState.Prepared
)
)

View File

@ -58,7 +58,6 @@ class AppUpdateCheckerImpTest {
@MediumTest
@OptIn(ExperimentalCoroutinesApi::class)
fun start_update_availability_test() = runTest {
getAppUpdateInfoFlow().onFirst { updateInfo ->
// In case we get result with FAILED state, e.g. app is still not released in the Google
// Play store, there is no way to continue with the test.

View File

@ -33,7 +33,7 @@ class UpdateViewTest : UiTestPrerequisites() {
priority = AppUpdateChecker.Priority.HIGH,
force = true,
appUpdateInfo = null,
state = UpdateState.Prepared,
state = UpdateState.Prepared
)
newTestSetup(updateInfo)
@ -58,7 +58,7 @@ class UpdateViewTest : UiTestPrerequisites() {
priority = AppUpdateChecker.Priority.LOW,
force = false,
appUpdateInfo = null,
state = UpdateState.Prepared,
state = UpdateState.Prepared
)
val testSetup = newTestSetup(updateInfo)
@ -76,7 +76,7 @@ class UpdateViewTest : UiTestPrerequisites() {
priority = AppUpdateChecker.Priority.MEDIUM,
force = false,
appUpdateInfo = null,
state = UpdateState.Prepared,
state = UpdateState.Prepared
)
newTestSetup(updateInfo)
@ -99,7 +99,7 @@ class UpdateViewTest : UiTestPrerequisites() {
priority = AppUpdateChecker.Priority.HIGH,
force = true,
appUpdateInfo = null,
state = UpdateState.Prepared,
state = UpdateState.Prepared
)
val testSetup = newTestSetup(updateInfo)

View File

@ -125,7 +125,8 @@ class WalletCoordinator(context: Context) {
}
}
.stateIn(
walletScope, SharingStarted.WhileSubscribed(),
walletScope,
SharingStarted.WhileSubscribed(),
null
)

View File

@ -29,6 +29,7 @@ import co.electriccoin.zcash.ui.design.component.GradientSurface
import co.electriccoin.zcash.ui.design.component.Override
import co.electriccoin.zcash.ui.design.theme.ZcashTheme
import co.electriccoin.zcash.ui.screen.about.WrapAbout
import co.electriccoin.zcash.ui.screen.address.view.WalletAddresses
import co.electriccoin.zcash.ui.screen.backup.WrapBackup
import co.electriccoin.zcash.ui.screen.backup.copyToClipboard
import co.electriccoin.zcash.ui.screen.home.WrapHome
@ -47,7 +48,6 @@ import co.electriccoin.zcash.ui.screen.support.WrapSupport
import co.electriccoin.zcash.ui.screen.update.AppUpdateCheckerImp
import co.electriccoin.zcash.ui.screen.update.WrapUpdate
import co.electriccoin.zcash.ui.screen.update.model.UpdateState
import co.electriccoin.zcash.ui.screen.wallet_address.view.WalletAddresses
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
@ -265,7 +265,7 @@ class MainActivity : ComponentActivity() {
@Composable
private fun WrapWalletAddresses(
goBack: () -> Unit,
goBack: () -> Unit
) {
val walletAddresses = walletViewModel.addresses.collectAsState().value
if (null == walletAddresses) {
@ -321,7 +321,7 @@ class MainActivity : ComponentActivity() {
startActivity(chooserIntent)
goBack()
},
}
)
}
}
@ -343,7 +343,7 @@ class MainActivity : ComponentActivity() {
synchronizer.send(spendingKey, it)
goBack()
},
}
)
}
}

View File

@ -1,3 +1,5 @@
@file:Suppress("ktlint:filename")
package co.electriccoin.zcash.ui.common
fun <T> List<T>.first(count: Int) = subList(0, minOf(size, count))

View File

@ -8,7 +8,7 @@ object TestChoicesFixture {
val INITIAL_CHOICES =
mapOf(
Pair(Index(0), "baz"),
Pair(Index(1), "foo"),
Pair(Index(1), "foo")
)
fun new(initial: Map<Index, String?> = INITIAL_CHOICES) = TestChoices(initial)

View File

@ -1,3 +1,5 @@
@file:Suppress("ktlint:filename")
package co.electriccoin.zcash.ui.screen.about
import androidx.activity.ComponentActivity

View File

@ -44,7 +44,7 @@ fun AboutPreview() {
@Composable
fun About(
versionInfo: VersionInfo,
goBack: () -> Unit,
goBack: () -> Unit
) {
Scaffold(topBar = {
AboutTopAppBar(onBack = goBack)

View File

@ -1,6 +1,6 @@
@file:Suppress("TooManyFunctions", "PackageNaming")
@file:Suppress("TooManyFunctions")
package co.electriccoin.zcash.ui.screen.wallet_address.view
package co.electriccoin.zcash.ui.screen.address.view
import androidx.compose.foundation.Image
import androidx.compose.foundation.border

View File

@ -36,7 +36,8 @@ internal fun WrapBackup(
val backupViewModel by activity.viewModels<BackupViewModel>()
WrapBackup(
persistableWallet, backupViewModel.backupState,
persistableWallet,
backupViewModel.backupState,
onCopyToClipboard = { copyToClipboard(activity.applicationContext, persistableWallet) },
onBackupComplete = onBackupComplete
)

View File

@ -22,8 +22,9 @@ private fun TestChoices.toSaverMap() = buildMap {
@Suppress("UNCHECKED_CAST")
private fun fromSaverMap(map: Map<String, Any?>): Map<Index, String?> {
return if (map.isEmpty())
return if (map.isEmpty()) {
emptyMap()
else
} else {
(map[KEY_TEST_CHOICES] as Map<Int, String?>).mapKeys { Index(it.key) }
}
}

View File

@ -67,7 +67,7 @@ fun BackupWallet(
choices: TestChoices,
onCopyToClipboard: () -> Unit,
onComplete: () -> Unit,
onChoicesChanged: ((choicesCount: Int) -> Unit)?,
onChoicesChanged: ((choicesCount: Int) -> Unit)?
) {
Column {
when (backupState.current.collectAsState().value) {
@ -185,7 +185,7 @@ private fun TestInProgress(
splitSeedPhrase: List<String>,
selectedTestChoices: TestChoices,
onBack: () -> Unit,
onChoicesChanged: ((choicesCount: Int) -> Unit)?,
onChoicesChanged: ((choicesCount: Int) -> Unit)?
) {
val testChoices = splitSeedPhrase
.mapIndexed { index, word -> TestChoice(Index(index), word) }
@ -224,8 +224,9 @@ private fun TestInProgress(
this[currentIndex] = testChoices[it.value].word
}
)
if (onChoicesChanged != null)
if (onChoicesChanged != null) {
onChoicesChanged(selectedTestChoices.current.value.size)
}
}
} else {
Chip(

View File

@ -1,3 +1,5 @@
@file:Suppress("ktlint:filename")
package co.electriccoin.zcash.ui.screen.backup.view
import androidx.compose.foundation.clickable
@ -55,13 +57,13 @@ fun ChipDropDown(
color = MaterialTheme.colorScheme.secondary,
contentColor = MaterialTheme.colorScheme.secondary,
tonalElevation = 8.dp,
shadowElevation = 8.dp,
shadowElevation = 8.dp
) {
Row(modifier = Modifier.padding(8.dp)) {
Text(
text = (chipIndex.value + 1).toString(),
style = ZcashTheme.typography.chipIndex,
color = ZcashTheme.colors.chipIndex,
color = ZcashTheme.colors.chipIndex
)
Spacer(modifier = Modifier.padding(horizontal = 2.dp, vertical = 0.dp))
Text(

View File

@ -1,3 +1,5 @@
@file:Suppress("ktlint:filename")
package co.electriccoin.zcash.ui.screen.home
import androidx.activity.ComponentActivity

View File

@ -127,7 +127,8 @@ class WalletViewModel(application: Application) : AndroidViewModel(application)
}
}
.stateIn(
viewModelScope, SharingStarted.WhileSubscribed(ANDROID_STATE_FLOW_TIMEOUT),
viewModelScope,
SharingStarted.WhileSubscribed(ANDROID_STATE_FLOW_TIMEOUT),
emptyList()
)
@ -136,7 +137,8 @@ class WalletViewModel(application: Application) : AndroidViewModel(application)
.filterIsInstance<SecretState.Ready>()
.map { WalletAddresses.new(it.persistableWallet) }
.stateIn(
viewModelScope, SharingStarted.WhileSubscribed(ANDROID_STATE_FLOW_TIMEOUT),
viewModelScope,
SharingStarted.WhileSubscribed(ANDROID_STATE_FLOW_TIMEOUT),
null
)
@ -269,7 +271,7 @@ private fun Synchronizer.toTransactions() =
clearedTransactions.distinctUntilChanged(),
pendingTransactions.distinctUntilChanged(),
sentTransactions.distinctUntilChanged(),
receivedTransactions.distinctUntilChanged(),
receivedTransactions.distinctUntilChanged()
) { cleared, pending, sent, received ->
// TODO [#157]: Sort the transactions to show the most recent
buildList<Transaction> {

View File

@ -1,3 +1,5 @@
@file:Suppress("ktlint:filename")
package co.electriccoin.zcash.ui.screen.onboarding
import android.content.ClipboardManager

View File

@ -83,7 +83,7 @@ fun Onboarding(
isDebugMenuEnabled: Boolean,
onImportWallet: () -> Unit,
onCreateWallet: () -> Unit,
onFixtureWallet: () -> Unit,
onFixtureWallet: () -> Unit
) {
Scaffold(
topBar = {
@ -270,7 +270,8 @@ private fun Wallet(onCreateWallet: () -> Unit, onImportWallet: () -> Unit) {
Body(stringResource(R.string.onboarding_4_body))
PrimaryButton(onCreateWallet, stringResource(R.string.onboarding_4_create_new_wallet), Modifier.fillMaxWidth())
TertiaryButton(
onImportWallet, stringResource(R.string.onboarding_4_import_existing_wallet),
onImportWallet,
stringResource(R.string.onboarding_4_import_existing_wallet),
Modifier.fillMaxWidth()
)
}

View File

@ -1,3 +1,5 @@
@file:Suppress("ktlint:filename")
package co.electriccoin.zcash.ui.screen.profile
import androidx.activity.ComponentActivity

View File

@ -92,7 +92,7 @@ private fun ProfileTopAppBar(onBack: () -> Unit) {
) {
Icon(
imageVector = Icons.Filled.ArrowBack,
contentDescription = stringResource(R.string.profile_back_content_description),
contentDescription = stringResource(R.string.profile_back_content_description)
)
}
}

View File

@ -63,7 +63,7 @@ fun PreviewRequest() {
fun Request(
myAddress: WalletAddress.Unified,
goBack: () -> Unit,
onCreateAndSend: (ZecRequest) -> Unit,
onCreateAndSend: (ZecRequest) -> Unit
) {
Scaffold(topBar = {
RequestTopAppBar(onBack = goBack)

View File

@ -254,7 +254,8 @@ private fun ChipGridWithText(
Modifier
.focusRequester(focusRequester)
.weight((CHIP_GRID_ROW_SIZE - chunk.size) * singleItemWeight),
text, setText
text,
setText
)
}
}
@ -273,7 +274,8 @@ private fun NextWordTextField(modifier: Modifier = Modifier, text: String, setTe
* Treat the user input as a password, but disable the transformation to obscure input.
*/
TextField(
value = text, onValueChange = setText,
value = text,
onValueChange = setText,
modifier = modifier
.fillMaxWidth()
.height(IntrinsicSize.Max)
@ -281,7 +283,9 @@ private fun NextWordTextField(modifier: Modifier = Modifier, text: String, setTe
visualTransformation = VisualTransformation.None,
keyboardOptions = KeyboardOptions(
KeyboardCapitalization.None,
autoCorrect = false, imeAction = ImeAction.Done, keyboardType = KeyboardType.Password
autoCorrect = false,
imeAction = ImeAction.Done,
keyboardType = KeyboardType.Password
),
keyboardActions = KeyboardActions(onAny = {})
)

View File

@ -1,3 +1,5 @@
@file:Suppress("ktlint:filename")
package co.electriccoin.zcash.ui.screen.scan
import androidx.activity.ComponentActivity

View File

@ -13,13 +13,13 @@ import java.nio.ByteBuffer
// TODO [#437]: https://github.com/zcash/secant-android-wallet/issues/437
class QrCodeAnalyzer(
private val onQrCodeScanned: (String) -> Unit,
private val onQrCodeScanned: (String) -> Unit
) : ImageAnalysis.Analyzer {
private val supportedImageFormats = listOf(
ImageFormat.YUV_420_888,
ImageFormat.YUV_422_888,
ImageFormat.YUV_444_888,
ImageFormat.YUV_444_888
)
override fun analyze(image: ImageProxy) {

View File

@ -98,11 +98,11 @@ fun Scan(
onBack: () -> Unit,
onScanned: (String) -> Unit,
onOpenSettings: () -> Unit,
onScanStateChanged: (ScanState) -> Unit,
onScanStateChanged: (ScanState) -> Unit
) {
Scaffold(
topBar = { ScanTopAppBar(onBack = onBack) },
snackbarHost = { SnackbarHost(snackbarHostState) },
snackbarHost = { SnackbarHost(snackbarHostState) }
) { paddingValues ->
ScanMainContent(
paddingValues,
@ -210,8 +210,9 @@ private fun ScanMainContent(
} else if (scanState == ScanState.Failed) {
// keep current state
} else if (permissionState.hasPermission) {
if (scanState != ScanState.Scanning)
if (scanState != ScanState.Scanning) {
setScanState(ScanState.Scanning)
}
}
// we calculate the best frame size for the current device screen
@ -271,7 +272,7 @@ private fun ScanMainContent(
onScanStateChanged(ScanState.Failed)
val snackbarResult = snackbarHostState.showSnackbar(
message = context.getString(R.string.scan_setup_failed),
actionLabel = context.getString(R.string.scan_setup_back),
actionLabel = context.getString(R.string.scan_setup_back)
)
if (snackbarResult == SnackbarResult.ActionPerformed) {
onBack()

View File

@ -68,7 +68,7 @@ fun PreviewSend() {
fun Send(
mySpendableBalance: Zatoshi,
goBack: () -> Unit,
onCreateAndSend: (ZecSend) -> Unit,
onCreateAndSend: (ZecSend) -> Unit
) {
// For now, we're avoiding sub-navigation to keep the navigation logic simple. But this might
// change once deep-linking support is added. It depends on whether deep linking should do one of:

View File

@ -1,3 +1,5 @@
@file:Suppress("ktlint:filename")
package co.electriccoin.zcash.ui.screen.settings
import androidx.activity.ComponentActivity
@ -39,7 +41,8 @@ private fun WrapSettings(
onBackupWallet = goWalletBackup,
onRescanWallet = {
walletViewModel.rescanBlockchain()
}, onWipeWallet = {
},
onWipeWallet = {
walletViewModel.wipeEntireWallet()
val onboardingViewModel by activity.viewModels<OnboardingViewModel>()

View File

@ -42,7 +42,7 @@ fun Settings(
onBack: () -> Unit,
onBackupWallet: () -> Unit,
onWipeWallet: () -> Unit,
onRescanWallet: () -> Unit,
onRescanWallet: () -> Unit
) {
Scaffold(topBar = {
SettingsTopAppBar(onBack = onBack)

View File

@ -1,3 +1,5 @@
@file:Suppress("ktlint:filename")
package co.electriccoin.zcash.ui.screen.support
import android.content.Intent

View File

@ -36,7 +36,7 @@ class TimeInfo(
currentTime = currentTime,
rebootTime = currentTime - elapsedRealtime,
installTime = Instant.fromEpochMilliseconds(packageInfo.firstInstallTime),
updateTime = Instant.fromEpochMilliseconds(packageInfo.lastUpdateTime),
updateTime = Instant.fromEpochMilliseconds(packageInfo.lastUpdateTime)
)
}
}

View File

@ -48,7 +48,7 @@ fun PreviewSupport() {
fun Support(
snackbarHostState: SnackbarHostState,
onBack: () -> Unit,
onSend: (String) -> Unit,
onSend: (String) -> Unit
) {
val (message, setMessage) = rememberSaveable { mutableStateOf("") }
val (isShowingDialog, setShowDialog) = rememberSaveable { mutableStateOf(false) }
@ -56,7 +56,8 @@ fun Support(
Scaffold(
topBar = {
SupportTopAppBar(onBack = onBack)
}, snackbarHost = { SnackbarHost(snackbarHostState) },
},
snackbarHost = { SnackbarHost(snackbarHostState) },
floatingActionButton = {
FloatingActionButton(onClick = { setShowDialog(true) }) {
Icon(
@ -131,20 +132,20 @@ private fun SupportConfirmationDialog(
},
confirmButton = {
Button(
onClick = onConfirm,
onClick = onConfirm
) {
Text(stringResource(id = R.string.support_confirmation_dialog_ok))
}
},
dismissButton = {
Button(
onClick = onDismiss,
onClick = onDismiss
) {
Text(stringResource(id = R.string.support_confirmation_dialog_cancel))
}
},
text = {
Text(stringResource(id = R.string.support_confirmation_explanation, stringResource(id = R.string.app_name)))
},
}
)
}

View File

@ -88,7 +88,7 @@ internal fun WrapUpdate(
fun openPlayStoreAppPage(
context: Context,
snackbarHostState: SnackbarHostState,
scope: CoroutineScope,
scope: CoroutineScope
) {
val storeIntent = PlayStoreUtil.newActivityIntent(context)
runCatching {

View File

@ -45,7 +45,7 @@ interface AppUpdateChecker {
}
fun newCheckForUpdateAvailabilityFlow(
context: Context,
context: Context
): Flow<UpdateInfo>
fun newStartUpdateFlow(

View File

@ -125,7 +125,7 @@ private fun UpdateTopAppBar(updateInfo: UpdateInfo) {
}
)
)
},
}
)
}