Improve button tips for TipsAndSupport page button tips

This commit is contained in:
Ash 2022-04-24 20:26:56 +08:00
parent 370d159432
commit 2e69c7e300
3 changed files with 19 additions and 2 deletions

View File

@ -54,7 +54,9 @@ fun TipsAndSupport(
val viewState = updateViewModel.viewState.collectAsStateValue()
val githubLink = stringResource(R.string.github_link)
val telegramLink = stringResource(R.string.telegram_link)
val checkingUpdates = stringResource(R.string.checking_updates)
val isLatestVersion = stringResource(R.string.is_latest_version)
val comingSoon = stringResource(R.string.coming_soon)
var currentVersion by remember { mutableStateOf("") }
var pressAMP by remember { mutableStateOf(16f) }
val animatedPress by animateFloatAsState(
@ -109,6 +111,11 @@ fun TipsAndSupport(
pressAMP = 16f
},
onTap = {
Toast.makeText(
context,
checkingUpdates,
Toast.LENGTH_SHORT
).show()
scope.launch {
updateViewModel.dispatch(
UpdateViewAction.CheckUpdate(
@ -187,7 +194,11 @@ fun TipsAndSupport(
// Sponsor
RoundIconButton(RoundIconButtonType.Sponsor(
backgroundColor = MaterialTheme.colorScheme.tertiaryContainer alwaysLight true,
) {})
) {
view.performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP)
view.playSoundEffect(SoundEffectConstants.CLICK)
Toast.makeText(context, comingSoon, Toast.LENGTH_SHORT).show()
})
Spacer(modifier = Modifier.width(16.dp))
// Telegram
@ -223,7 +234,11 @@ fun TipsAndSupport(
// License
RoundIconButton(RoundIconButtonType.License(
backgroundColor = MaterialTheme.colorScheme.secondaryContainer alwaysLight true,
) {})
) {
view.performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP)
view.playSoundEffect(SoundEffectConstants.CLICK)
Toast.makeText(context, comingSoon, Toast.LENGTH_SHORT).show()
})
}
Spacer(modifier = Modifier.height(48.dp))
}

View File

@ -115,5 +115,6 @@
<string name="change_log">更新日志</string>
<string name="update">更新</string>
<string name="skip_this_version">跳过这个版本</string>
<string name="checking_updates">正在检查更新…</string>
<string name="is_latest_version">已是最新版本</string>
</resources>

View File

@ -115,5 +115,6 @@
<string name="change_log">Change Log</string>
<string name="update">Update</string>
<string name="skip_this_version">Skip This Version</string>
<string name="checking_updates">Checking for updates…</string>
<string name="is_latest_version">This is the latest version</string>
</resources>