Switch onboarding seed step and display name step

This commit is contained in:
Niels Andriesse 2019-09-18 11:57:46 +10:00
parent 88dbeddb04
commit 9b2a90639d
4 changed files with 13 additions and 13 deletions

View File

@ -13,7 +13,7 @@ import android.support.v4.app.Fragment;
import org.thoughtcrime.securesms.crypto.MasterSecretUtil;
import org.thoughtcrime.securesms.jobs.PushNotificationReceiveJob;
import org.thoughtcrime.securesms.logging.Log;
import org.thoughtcrime.securesms.loki.AccountDetailsActivity;
import org.thoughtcrime.securesms.loki.SeedActivity;
import org.thoughtcrime.securesms.push.SignalServiceNetworkAccess;
import org.thoughtcrime.securesms.registration.WelcomeActivity;
import org.thoughtcrime.securesms.service.KeyCachingService;
@ -185,7 +185,7 @@ public abstract class PassphraseRequiredActionBarActivity extends BaseActionBarA
}
private Intent getPushRegistrationIntent() {
return getRoutedIntent(AccountDetailsActivity.class, getCreateProfileIntent());
return getRoutedIntent(SeedActivity.class, getCreateProfileIntent());
}
private Intent getCreateProfileIntent() {

View File

@ -4,8 +4,10 @@ import android.content.Intent
import android.os.Bundle
import android.view.inputmethod.InputMethodManager
import kotlinx.android.synthetic.main.activity_account_details.*
import network.loki.messenger.R;
import network.loki.messenger.R
import org.thoughtcrime.securesms.ApplicationContext
import org.thoughtcrime.securesms.BaseActionBarActivity
import org.thoughtcrime.securesms.ConversationListActivity
import org.thoughtcrime.securesms.util.TextSecurePreferences
import org.whispersystems.signalservice.api.crypto.ProfileCipher
@ -29,7 +31,12 @@ class AccountDetailsActivity : BaseActionBarActivity() {
}
val inputMethodManager = getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager
inputMethodManager.hideSoftInputFromWindow(nameEditText.windowToken, 0)
startActivity(Intent(this, SeedActivity::class.java))
TextSecurePreferences.setHasSeenWelcomeScreen(this, true)
TextSecurePreferences.setPromptedPushRegistration(this, true)
val application = ApplicationContext.getInstance(this)
application.setUpP2PAPI()
application.startLongPollingIfNeeded()
startActivity(Intent(this, ConversationListActivity::class.java))
finish()
}
}

View File

@ -10,9 +10,7 @@ import android.view.inputmethod.InputMethodManager
import android.widget.Toast
import kotlinx.android.synthetic.main.activity_seed.*
import network.loki.messenger.R
import org.thoughtcrime.securesms.ApplicationContext
import org.thoughtcrime.securesms.BaseActionBarActivity
import org.thoughtcrime.securesms.ConversationListActivity
import org.thoughtcrime.securesms.crypto.IdentityKeyUtil
import org.thoughtcrime.securesms.database.Address
import org.thoughtcrime.securesms.database.DatabaseFactory
@ -159,15 +157,11 @@ class SeedActivity : BaseActionBarActivity() {
DatabaseFactory.getIdentityDatabase(this).saveIdentity(Address.fromSerialized(hexEncodedPublicKey), publicKey,
IdentityDatabase.VerifiedStatus.VERIFIED, true, System.currentTimeMillis(), true)
TextSecurePreferences.setLocalNumber(this, hexEncodedPublicKey)
TextSecurePreferences.setPromptedPushRegistration(this, true)
val application = ApplicationContext.getInstance(this)
application.setUpP2PAPI()
application.startLongPollingIfNeeded()
when (mode) {
Mode.Register -> Analytics.shared.track("Seed Created")
Mode.Restore -> Analytics.shared.track("Seed Restored")
}
startActivity(Intent(this, ConversationListActivity::class.java))
startActivity(Intent(this, AccountDetailsActivity::class.java))
finish()
}
// endregion

View File

@ -8,7 +8,6 @@ import android.support.annotation.NonNull;
import org.thoughtcrime.securesms.BaseActionBarActivity;
import org.thoughtcrime.securesms.permissions.Permissions;
import org.thoughtcrime.securesms.util.CommunicationActions;
import org.thoughtcrime.securesms.util.TextSecurePreferences;
import network.loki.messenger.R;
@ -37,7 +36,7 @@ public class WelcomeActivity extends BaseActionBarActivity {
.ifNecessary()
.withRationaleDialog(getString(R.string.activity_landing_permission_dialog_message), R.drawable.ic_folder_white_48dp)
.onAnyResult(() -> {
TextSecurePreferences.setHasSeenWelcomeScreen(WelcomeActivity.this, true);
// TextSecurePreferences.setHasSeenWelcomeScreen(WelcomeActivity.this, true);
Intent nextIntent = getIntent().getParcelableExtra("next_intent");