@@ -137,11 +137,10 @@ import com.nononsenseapps.feeder.ui.compose.utils.isCompactDevice
137
137
import com.nononsenseapps.feeder.ui.compose.utils.onKeyEventLikeEscape
138
138
import com.nononsenseapps.feeder.ui.compose.utils.rememberIsItemMostlyVisible
139
139
import com.nononsenseapps.feeder.ui.compose.utils.rememberIsItemVisible
140
+ import com.nononsenseapps.feeder.util.ActivityLauncher
140
141
import com.nononsenseapps.feeder.util.ToastMaker
141
142
import com.nononsenseapps.feeder.util.emailBugReportIntent
142
143
import com.nononsenseapps.feeder.util.logDebug
143
- import com.nononsenseapps.feeder.util.openLinkInBrowser
144
- import com.nononsenseapps.feeder.util.openLinkInCustomTab
145
144
import java.time.Instant
146
145
import java.time.LocalDateTime
147
146
import kotlinx.coroutines.CoroutineScope
@@ -190,7 +189,7 @@ fun FeedScreen(
190
189
}
191
190
}
192
191
193
- val context = LocalContext .current
192
+ val activityLauncher : ActivityLauncher by LocalDI .current.instance()
194
193
195
194
// Each feed gets its own scroll state. Persists across device rotations, but is cleared when
196
195
// switching feeds
@@ -293,7 +292,10 @@ fun FeedScreen(
293
292
SettingsDestination .navigate(navController)
294
293
},
295
294
onSendFeedback = {
296
- context.startActivity(emailBugReportIntent())
295
+ activityLauncher.startActivity(
296
+ openAdjacentIfSuitable = true ,
297
+ intent = emailBugReportIntent(),
298
+ )
297
299
},
298
300
onImport = {
299
301
try {
@@ -365,10 +367,10 @@ fun FeedScreen(
365
367
viewModel.openArticle(
366
368
itemId = itemId,
367
369
openInBrowser = { articleLink ->
368
- openLinkInBrowser(context, articleLink)
370
+ activityLauncher. openLinkInBrowser(articleLink)
369
371
},
370
372
openInCustomTab = { articleLink ->
371
- openLinkInCustomTab(context, articleLink, toolbarColor)
373
+ activityLauncher. openLinkInCustomTab(articleLink, toolbarColor)
372
374
},
373
375
navigateToArticle = {
374
376
ArticleDestination .navigate(navController, itemId)
@@ -1015,7 +1017,7 @@ fun FeedListContent(
1015
1017
modifier : Modifier = Modifier ,
1016
1018
) {
1017
1019
val coroutineScope = rememberCoroutineScope()
1018
- val context = LocalContext .current
1020
+ val activityLauncher : ActivityLauncher by LocalDI .current.instance()
1019
1021
1020
1022
Box (modifier = modifier) {
1021
1023
AnimatedVisibility (
@@ -1149,7 +1151,10 @@ fun FeedListContent(
1149
1151
},
1150
1152
null ,
1151
1153
)
1152
- context.startActivity(intent)
1154
+ activityLauncher.startActivity(
1155
+ openAdjacentIfSuitable = false ,
1156
+ intent = intent,
1157
+ )
1153
1158
},
1154
1159
) {
1155
1160
onItemClick(previewItem.id)
@@ -1199,7 +1204,7 @@ fun FeedGridContent(
1199
1204
modifier : Modifier = Modifier ,
1200
1205
) {
1201
1206
val coroutineScope = rememberCoroutineScope()
1202
- val context = LocalContext .current
1207
+ val activityLauncher : ActivityLauncher by LocalDI .current.instance()
1203
1208
1204
1209
val screenHeightPx = with (LocalDensity .current) {
1205
1210
LocalConfiguration .current.screenHeightDp.dp.toPx().toInt()
@@ -1328,7 +1333,10 @@ fun FeedGridContent(
1328
1333
},
1329
1334
null ,
1330
1335
)
1331
- context.startActivity(intent)
1336
+ activityLauncher.startActivity(
1337
+ openAdjacentIfSuitable = false ,
1338
+ intent = intent,
1339
+ )
1332
1340
},
1333
1341
) {
1334
1342
onItemClick(previewItem.id)
0 commit comments