mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 16:57:50 +00:00
Add back button to message notifications
This commit is contained in:
parent
86fcd035a1
commit
1e9b0ec7f8
@ -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()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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)
|
|
||||||
}
|
|
||||||
|
@ -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>()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user