Merge pull request #303 from ouchadam/feature-back-behaviour

Allow messages `up arrow` to relaunch main screen
This commit is contained in:
Adam Brown 2023-01-07 15:55:46 +00:00 committed by GitHub
commit 068d121634
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> <manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application> <application>
<activity android:name="app.dapk.st.home.MainActivity"/> <activity android:name="app.dapk.st.home.MainActivity" android:launchMode="singleInstance"/>
</application> </application>
</manifest> </manifest>

View File

@ -6,6 +6,7 @@ import android.content.Context
import android.content.Intent import android.content.Intent
import android.os.Parcel import android.os.Parcel
import android.os.Parcelable import android.os.Parcelable
import androidx.core.app.NavUtils
import app.dapk.st.core.AndroidUri import app.dapk.st.core.AndroidUri
import app.dapk.st.core.MimeType import app.dapk.st.core.MimeType
import app.dapk.st.matrix.common.RoomId import app.dapk.st.matrix.common.RoomId
@ -33,7 +34,8 @@ interface Navigator {
} }
fun upToHome() { fun upToHome() {
activity.navigateUpTo(intentFactory.home(activity)) activity.finish()
activity.startActivity(intentFactory.home(activity))
} }
fun toMessenger(roomId: RoomId, attachments: List<MessageAttachment>) { fun toMessenger(roomId: RoomId, attachments: List<MessageAttachment>) {