diff --git a/app/src/main/java/org/thoughtcrime/securesms/onboarding/loading/LoadingManager.kt b/app/src/main/java/org/thoughtcrime/securesms/onboarding/loading/LoadingManager.kt index f12fa10468..9ed83fe7ba 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/onboarding/loading/LoadingManager.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/onboarding/loading/LoadingManager.kt @@ -10,6 +10,7 @@ import org.session.libsession.utilities.TextSecurePreferences import org.session.libsignal.database.LokiAPIDatabaseProtocol import org.session.libsignal.utilities.hexEncodedPublicKey import org.thoughtcrime.securesms.ApplicationContext +import org.thoughtcrime.securesms.crypto.KeyPairUtilities import org.thoughtcrime.securesms.dependencies.ConfigFactory import javax.inject.Inject import javax.inject.Singleton @@ -40,9 +41,9 @@ class LoadingManager @Inject constructor( database.clearReceivedMessageHashValues() // RestoreActivity handles seed this way - val keyPairGenerationResult = org.thoughtcrime.securesms.crypto.KeyPairUtilities.generate(seed) + val keyPairGenerationResult = KeyPairUtilities.generate(seed) val x25519KeyPair = keyPairGenerationResult.x25519KeyPair - org.thoughtcrime.securesms.crypto.KeyPairUtilities.store(context, seed, keyPairGenerationResult.ed25519KeyPair, x25519KeyPair) + KeyPairUtilities.store(context, seed, keyPairGenerationResult.ed25519KeyPair, x25519KeyPair) configFactory.keyPairChanged() val userHexEncodedPublicKey = x25519KeyPair.hexEncodedPublicKey val registrationID = org.session.libsignal.utilities.KeyHelper.generateRegistrationId(false) diff --git a/app/src/main/java/org/thoughtcrime/securesms/onboarding/recoverypassword/RecoveryPasswordViewModel.kt b/app/src/main/java/org/thoughtcrime/securesms/onboarding/recoverypassword/RecoveryPasswordViewModel.kt index f5648c681f..eaac6d38dc 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/onboarding/recoverypassword/RecoveryPasswordViewModel.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/onboarding/recoverypassword/RecoveryPasswordViewModel.kt @@ -4,9 +4,7 @@ import android.app.Application import android.content.ClipData import android.content.ClipboardManager import android.content.Context -import android.graphics.Bitmap import androidx.lifecycle.AndroidViewModel -import androidx.preference.PreferenceFragmentCompat.OnPreferenceStartFragmentCallback import dagger.hilt.android.lifecycle.HiltViewModel import org.session.libsession.utilities.AppTextSecurePreferences import org.session.libsession.utilities.TextSecurePreferences @@ -14,8 +12,6 @@ import org.session.libsignal.crypto.MnemonicCodec import org.session.libsignal.utilities.hexEncodedPrivateKey import org.thoughtcrime.securesms.crypto.IdentityKeyUtil import org.thoughtcrime.securesms.crypto.MnemonicUtilities -import org.thoughtcrime.securesms.util.QRCodeUtilities -import org.thoughtcrime.securesms.util.toPx import javax.inject.Inject @HiltViewModel diff --git a/app/src/main/java/org/thoughtcrime/securesms/ui/components/Button.kt b/app/src/main/java/org/thoughtcrime/securesms/ui/components/Button.kt index 4382335550..87edb4df6e 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/ui/components/Button.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/ui/components/Button.kt @@ -96,7 +96,7 @@ fun Button( type: ButtonType, modifier: Modifier = Modifier, enabled: Boolean = true, - size: ButtonSize = ButtonSize.Large, + size: ButtonStyle = ButtonStyle.Large, elevation: ButtonElevation? = type.elevation, shape: Shape = MaterialTheme.shapes.small, border: BorderStroke? = type.border(color, enabled), @@ -134,7 +134,7 @@ fun Button( type: ButtonType, modifier: Modifier = Modifier, enabled: Boolean = true, - size: ButtonSize = ButtonSize.Large, + size: ButtonStyle = ButtonStyle.Large, elevation: ButtonElevation? = type.elevation, shape: Shape = MaterialTheme.shapes.small, border: BorderStroke? = type.border(color, enabled), @@ -163,14 +163,14 @@ fun Button( } @Composable fun SlimOutlineButton(onClick: () -> Unit, modifier: Modifier = Modifier, color: Color = LocalColors.current.text, enabled: Boolean = true, content: @Composable () -> Unit) { - Button(onClick, color, ButtonType.Outline, modifier, enabled, ButtonSize.Slim) { content() } + Button(onClick, color, ButtonType.Outline, modifier, enabled, ButtonStyle.Slim) { content() } } /** * Courtesy [SlimOutlineButton] implementation for buttons that just display text. */ @Composable fun SlimOutlineButton(text: String, modifier: Modifier = Modifier, color: Color = LocalColors.current.text, enabled: Boolean = true, onClick: () -> Unit) { - Button(text, onClick, color, ButtonType.Outline, modifier, enabled, ButtonSize.Slim) + Button(text, onClick, color, ButtonType.Outline, modifier, enabled, ButtonStyle.Slim) } @Composable @@ -179,13 +179,13 @@ fun SlimOutlineCopyButton( color: Color = LocalColors.current.text, onClick: () -> Unit ) { - OutlineCopyButton(modifier, ButtonSize.Slim, color, onClick) + OutlineCopyButton(modifier, ButtonStyle.Slim, color, onClick) } @Composable fun OutlineCopyButton( modifier: Modifier = Modifier, - size: ButtonSize = ButtonSize.Large, + size: ButtonStyle = ButtonStyle.Large, color: Color = LocalColors.current.buttonOutline, onClick: () -> Unit ) { diff --git a/app/src/main/java/org/thoughtcrime/securesms/ui/components/ButtonSize.kt b/app/src/main/java/org/thoughtcrime/securesms/ui/components/ButtonSize.kt index 2f5baf0f7e..adee855cd5 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/ui/components/ButtonSize.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/ui/components/ButtonSize.kt @@ -13,7 +13,7 @@ import androidx.compose.ui.unit.dp import org.thoughtcrime.securesms.ui.baseBold import org.thoughtcrime.securesms.ui.extraSmallBold -interface ButtonSize { +interface ButtonStyle { @OptIn(ExperimentalMaterialApi::class) @SuppressLint("ComposableNaming") @Composable fun applyButtonConstraints(content: @Composable () -> Unit) { @@ -34,14 +34,13 @@ interface ButtonSize { val textStyle: TextStyle val minHeight: Dp - object Large: ButtonSize { + object Large: ButtonStyle { override val textStyle = baseBold.copy(textAlign = TextAlign.Center) override val minHeight = 41.dp } - object Slim: ButtonSize { + object Slim: ButtonStyle { override val textStyle = extraSmallBold.copy(textAlign = TextAlign.Center) override val minHeight = 29.dp } - }