From 43c484e35f31d165215dfa07d1edac7eda1dbe61 Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Thu, 29 Apr 2021 13:41:43 +1000 Subject: [PATCH] Clean --- .../loki/activities/LinkDeviceActivity.kt | 4 +--- .../activities/RecoveryPhraseRestoreActivity.kt | 2 -- .../securesms/loki/activities/RegisterActivity.kt | 2 -- app/src/main/res/layout/activity_home.xml | 14 +++++++------- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/loki/activities/LinkDeviceActivity.kt b/app/src/main/java/org/thoughtcrime/securesms/loki/activities/LinkDeviceActivity.kt index cc878e4beb..2d6854f774 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/loki/activities/LinkDeviceActivity.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/loki/activities/LinkDeviceActivity.kt @@ -45,7 +45,7 @@ class LinkDeviceActivity : BaseActionBarActivity(), ScanQRCodeWrapperFragmentDel private var restoreJob: Job? = null override fun onBackPressed() { - if (restoreJob?.isActive == true) return // don't allow going back with pending job + if (restoreJob?.isActive == true) return // Don't allow going back with a pending job super.onBackPressed() } @@ -53,14 +53,12 @@ class LinkDeviceActivity : BaseActionBarActivity(), ScanQRCodeWrapperFragmentDel override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setUpActionBarSessionLogo() - // Set the registration sync variables TextSecurePreferences.apply { setHasViewedSeed(this@LinkDeviceActivity, true) setConfigurationMessageSynced(this@LinkDeviceActivity, false) setRestorationTime(this@LinkDeviceActivity, System.currentTimeMillis()) setLastProfileUpdateTime(this@LinkDeviceActivity, 0) } - // registration variables are synced setContentView(R.layout.activity_link_device) viewPager.adapter = adapter tabLayout.setupWithViewPager(viewPager) diff --git a/app/src/main/java/org/thoughtcrime/securesms/loki/activities/RecoveryPhraseRestoreActivity.kt b/app/src/main/java/org/thoughtcrime/securesms/loki/activities/RecoveryPhraseRestoreActivity.kt index 0ee7e0f574..841b9e789a 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/loki/activities/RecoveryPhraseRestoreActivity.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/loki/activities/RecoveryPhraseRestoreActivity.kt @@ -30,14 +30,12 @@ class RecoveryPhraseRestoreActivity : BaseActionBarActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setUpActionBarSessionLogo() - // Set the registration sync variables TextSecurePreferences.apply { setHasViewedSeed(this@RecoveryPhraseRestoreActivity, true) setConfigurationMessageSynced(this@RecoveryPhraseRestoreActivity, false) setRestorationTime(this@RecoveryPhraseRestoreActivity, System.currentTimeMillis()) setLastProfileUpdateTime(this@RecoveryPhraseRestoreActivity, System.currentTimeMillis()) } - // registration variables are synced setContentView(R.layout.activity_recovery_phrase_restore) mnemonicEditText.imeOptions = mnemonicEditText.imeOptions or 16777216 // Always use incognito keyboard restoreButton.setOnClickListener { restore() } diff --git a/app/src/main/java/org/thoughtcrime/securesms/loki/activities/RegisterActivity.kt b/app/src/main/java/org/thoughtcrime/securesms/loki/activities/RegisterActivity.kt index 229edab444..79f462b9f8 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/loki/activities/RegisterActivity.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/loki/activities/RegisterActivity.kt @@ -39,14 +39,12 @@ class RegisterActivity : BaseActionBarActivity() { super.onCreate(savedInstanceState) setContentView(R.layout.activity_register) setUpActionBarSessionLogo() - // Set the registration sync variables TextSecurePreferences.apply { setHasViewedSeed(this@RegisterActivity, false) setConfigurationMessageSynced(this@RegisterActivity, true) setRestorationTime(this@RegisterActivity, 0) setLastProfileUpdateTime(this@RegisterActivity, System.currentTimeMillis()) } - // registration variables are synced registerButton.setOnClickListener { register() } copyButton.setOnClickListener { copyPublicKey() } val termsExplanation = SpannableStringBuilder("By using this service, you agree to our Terms of Service and Privacy Policy") diff --git a/app/src/main/res/layout/activity_home.xml b/app/src/main/res/layout/activity_home.xml index 437246f230..49b5d36053 100644 --- a/app/src/main/res/layout/activity_home.xml +++ b/app/src/main/res/layout/activity_home.xml @@ -98,13 +98,6 @@ android:layout_height="match_parent" android:background="@drawable/home_activity_gradient" /> - - + + \ No newline at end of file