Extract from_notification extra to a constant in IntentNavigationExtras
Allow `IntentProvider` to receive extras and `PendingIntentFactory` to send them.
This commit is contained in:
parent
04feea5d25
commit
1d77aa447d
7 changed files with 54 additions and 15 deletions
|
|
@ -10,6 +10,7 @@ package io.element.android.x.intent
|
|||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import androidx.core.net.toUri
|
||||
import dev.zacsweers.metro.AppScope
|
||||
import dev.zacsweers.metro.ContributesBinding
|
||||
|
|
@ -32,11 +33,12 @@ class DefaultIntentProvider(
|
|||
roomId: RoomId?,
|
||||
threadId: ThreadId?,
|
||||
eventId: EventId?,
|
||||
extras: Bundle?,
|
||||
): Intent {
|
||||
return Intent(context, MainActivity::class.java).apply {
|
||||
action = Intent.ACTION_VIEW
|
||||
data = deepLinkCreator.create(sessionId, roomId, threadId, eventId).toUri()
|
||||
putExtra("from_notification", true)
|
||||
extras?.let(::putExtras)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue