mirror of
https://github.com/Myzel394/Alibi.git
synced 2025-06-19 07:15:25 +02:00
fix: Improve DonationsTile
This commit is contained in:
parent
e7bc1ac0b3
commit
cc3b0736c9
@ -4,6 +4,7 @@ import android.content.ClipData
|
|||||||
import android.content.ClipboardManager
|
import android.content.ClipboardManager
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import androidx.compose.animation.AnimatedVisibility
|
import androidx.compose.animation.AnimatedVisibility
|
||||||
|
import androidx.compose.animation.core.animateFloatAsState
|
||||||
import androidx.compose.animation.expandVertically
|
import androidx.compose.animation.expandVertically
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
@ -17,6 +18,7 @@ import androidx.compose.foundation.layout.size
|
|||||||
import androidx.compose.foundation.lazy.LazyColumn
|
import androidx.compose.foundation.lazy.LazyColumn
|
||||||
import androidx.compose.foundation.rememberScrollState
|
import androidx.compose.foundation.rememberScrollState
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
|
import androidx.compose.material.icons.filled.ArrowDropDown
|
||||||
import androidx.compose.material.icons.filled.ContentCopy
|
import androidx.compose.material.icons.filled.ContentCopy
|
||||||
import androidx.compose.material.icons.filled.CurrencyBitcoin
|
import androidx.compose.material.icons.filled.CurrencyBitcoin
|
||||||
import androidx.compose.material.icons.filled.CurrencyFranc
|
import androidx.compose.material.icons.filled.CurrencyFranc
|
||||||
@ -38,6 +40,7 @@ import androidx.compose.runtime.setValue
|
|||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.draw.clip
|
import androidx.compose.ui.draw.clip
|
||||||
|
import androidx.compose.ui.draw.rotate
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.semantics.contentDescription
|
import androidx.compose.ui.semantics.contentDescription
|
||||||
@ -69,6 +72,10 @@ fun DonationsTile() {
|
|||||||
MaterialTheme.colorScheme.surfaceVariant
|
MaterialTheme.colorScheme.surfaceVariant
|
||||||
)
|
)
|
||||||
.padding(16.dp),
|
.padding(16.dp),
|
||||||
|
horizontalArrangement = Arrangement.SpaceBetween,
|
||||||
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
) {
|
||||||
|
Row(
|
||||||
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
) {
|
) {
|
||||||
@ -92,6 +99,20 @@ fun DonationsTile() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val rotation by animateFloatAsState(
|
||||||
|
if (donationsOpened) -180f else 0f,
|
||||||
|
label = "iconRotation"
|
||||||
|
)
|
||||||
|
|
||||||
|
Icon(
|
||||||
|
Icons.Default.ArrowDropDown,
|
||||||
|
contentDescription = null,
|
||||||
|
modifier = Modifier
|
||||||
|
.size(ButtonDefaults.IconSize.times(1.2f))
|
||||||
|
.rotate(rotation)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
val clipboardManager =
|
val clipboardManager =
|
||||||
LocalContext.current.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
|
LocalContext.current.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
|
||||||
|
|
||||||
@ -109,7 +130,7 @@ fun DonationsTile() {
|
|||||||
val clip = ClipData.newPlainText("text", crypto.value)
|
val clip = ClipData.newPlainText("text", crypto.value)
|
||||||
clipboardManager.setPrimaryClip(clip)
|
clipboardManager.setPrimaryClip(clip)
|
||||||
}
|
}
|
||||||
.padding(8.dp)
|
.padding(16.dp)
|
||||||
.horizontalScroll(rememberScrollState()),
|
.horizontalScroll(rememberScrollState()),
|
||||||
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
@ -95,6 +95,6 @@
|
|||||||
<string name="accessibility_open_in_browser">Open link in browser: %s</string>
|
<string name="accessibility_open_in_browser">Open link in browser: %s</string>
|
||||||
<string name="ui_about_contribute_translation">Translate Alibi into your language</string>
|
<string name="ui_about_contribute_translation">Translate Alibi into your language</string>
|
||||||
<string name="ui_about_contribute_donatation">Make a donation</string>
|
<string name="ui_about_contribute_donatation">Make a donation</string>
|
||||||
<string name="ui_about_gpg_key_hint">You can copy my GPG key here. This key only exists once and I can use it to prove to you that I\'m really who I am. Please save it now so that you don\'t fall for a phishing attack later on.</string>
|
<string name="ui_about_gpg_key_hint">You can copy my GPG key here. This key only exists once and I can use it to prove to you that I\'m really who I am. Please save it now so that you can verify my signature later.</string>
|
||||||
<string name="ui_about_gpg_key_copy">Copy GPG Key</string>
|
<string name="ui_about_gpg_key_copy">Copy GPG Key</string>
|
||||||
</resources>
|
</resources>
|
Loading…
x
Reference in New Issue
Block a user