Add back button to message notifications

This commit is contained in:
Andrew 2024-06-25 20:55:18 +09:30
parent 86fcd035a1
commit 1e9b0ec7f8
3 changed files with 7 additions and 12 deletions

View File

@ -12,8 +12,9 @@ import network.loki.messenger.R
import org.session.libsession.utilities.TextSecurePreferences import org.session.libsession.utilities.TextSecurePreferences
import org.thoughtcrime.securesms.BaseActionBarActivity import org.thoughtcrime.securesms.BaseActionBarActivity
import org.thoughtcrime.securesms.onboarding.loading.LoadingManager import org.thoughtcrime.securesms.onboarding.loading.LoadingManager
import org.thoughtcrime.securesms.onboarding.messagenotifications.startMessageNotificationsActivity import org.thoughtcrime.securesms.onboarding.messagenotifications.MessageNotificationsActivity
import org.thoughtcrime.securesms.ui.setComposeContent import org.thoughtcrime.securesms.ui.setComposeContent
import org.thoughtcrime.securesms.util.start
import javax.inject.Inject import javax.inject.Inject
@AndroidEntryPoint @AndroidEntryPoint
@ -38,8 +39,7 @@ class LoadAccountActivity : BaseActionBarActivity() {
lifecycleScope.launch { lifecycleScope.launch {
viewModel.events.collect { viewModel.events.collect {
loadingManager.load(it.mnemonic) loadingManager.load(it.mnemonic)
startMessageNotificationsActivity() start<MessageNotificationsActivity>()
finish()
} }
} }

View File

@ -31,7 +31,7 @@ class MessageNotificationsActivity : BaseActionBarActivity() {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setUpActionBarSessionLogo(true) setUpActionBarSessionLogo()
prefs.setHasSeenWelcomeScreen(true) prefs.setHasSeenWelcomeScreen(true)
setComposeContent { MessageNotificationsScreen() } setComposeContent { MessageNotificationsScreen() }
@ -54,9 +54,3 @@ class MessageNotificationsActivity : BaseActionBarActivity() {
} }
} }
} }
fun Context.startMessageNotificationsActivity(flags: Int = 0) {
Intent(this, MessageNotificationsActivity::class.java)
.also { it.flags = flags }
.also(::startActivity)
}

View File

@ -13,9 +13,10 @@ import org.session.libsession.utilities.TextSecurePreferences
import org.thoughtcrime.securesms.ApplicationContext import org.thoughtcrime.securesms.ApplicationContext
import org.thoughtcrime.securesms.BaseActionBarActivity import org.thoughtcrime.securesms.BaseActionBarActivity
import org.thoughtcrime.securesms.home.startHomeActivity import org.thoughtcrime.securesms.home.startHomeActivity
import org.thoughtcrime.securesms.onboarding.messagenotifications.startMessageNotificationsActivity import org.thoughtcrime.securesms.onboarding.messagenotifications.MessageNotificationsActivity
import org.thoughtcrime.securesms.ui.setComposeContent import org.thoughtcrime.securesms.ui.setComposeContent
import org.thoughtcrime.securesms.util.setUpActionBarSessionLogo import org.thoughtcrime.securesms.util.setUpActionBarSessionLogo
import org.thoughtcrime.securesms.util.start
import javax.inject.Inject import javax.inject.Inject
private const val EXTRA_LOAD_FAILED = "extra_load_failed" private const val EXTRA_LOAD_FAILED = "extra_load_failed"
@ -44,7 +45,7 @@ class PickDisplayNameActivity : BaseActionBarActivity() {
lifecycleScope.launch { lifecycleScope.launch {
viewModel.events.collect { viewModel.events.collect {
if (loadFailed) startHomeActivity() else startMessageNotificationsActivity() if (loadFailed) startHomeActivity() else start<MessageNotificationsActivity>()
} }
} }
} }