Improve account switching intents (#3732)
Before, intent creation was scattered across multiple sites, with account switching logic in both `ComposeActivity` and `MainActivity`. Now, intents are only created in `MainActivity` Companion, and account switching only occurs in `MainActivity` Fixes #3695
This commit is contained in:
parent
85f0b1f320
commit
dc9e9f2aeb
8 changed files with 394 additions and 359 deletions
|
|
@ -379,9 +379,7 @@ class SendStatusService : Service(), Injectable {
|
|||
accountId: Long,
|
||||
statusId: Int
|
||||
): Notification {
|
||||
val intent = Intent(this, MainActivity::class.java)
|
||||
intent.putExtra(NotificationHelper.ACCOUNT_ID, accountId)
|
||||
intent.putExtra(MainActivity.OPEN_DRAFTS, true)
|
||||
val intent = MainActivity.draftIntent(this, accountId)
|
||||
|
||||
val pendingIntent = PendingIntent.getActivity(
|
||||
this,
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import android.annotation.TargetApi
|
|||
import android.content.Intent
|
||||
import android.service.quicksettings.TileService
|
||||
import com.keylesspalace.tusky.MainActivity
|
||||
import com.keylesspalace.tusky.components.compose.ComposeActivity
|
||||
|
||||
/**
|
||||
* Small Addition that adds in a QuickSettings tile
|
||||
|
|
@ -29,11 +30,8 @@ import com.keylesspalace.tusky.MainActivity
|
|||
class TuskyTileService : TileService() {
|
||||
|
||||
override fun onClick() {
|
||||
val intent = Intent(this, MainActivity::class.java).apply {
|
||||
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
action = Intent.ACTION_SEND
|
||||
type = "text/plain"
|
||||
}
|
||||
val intent = MainActivity.composeIntent(this, ComposeActivity.ComposeOptions())
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
startActivityAndCollapse(intent)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue