Skip to content

Commit

Permalink
fix deep links
Browse files Browse the repository at this point in the history
  • Loading branch information
DerGoogler committed Jan 1, 2025
1 parent 18734a4 commit e70681c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
6 changes: 0 additions & 6 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data android:scheme="mmrl" />
<data android:host="module" />

<data android:scheme="http" />
<data android:host="mmrl.dergoogler.com" />
<data android:pathPrefix="/module" />
Expand All @@ -81,9 +78,6 @@
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data android:scheme="mmrl" />
<data android:host="search" />

<data android:scheme="http" />
<data android:host="mmrl.dergoogler.com" />
<data android:pathPrefix="/search" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@ fun NavGraphBuilder.repositoryScreen(
navArgument("moduleId") { type = NavType.StringType },
navArgument("repoUrl") { type = NavType.StringType },
),
deepLinks = listOf(
navDeepLink {
uriPattern = "https://mmrl.dergoogler.com/module/{repoUrl}/{moduleId}"
},
navDeepLink {
uriPattern = "http://mmrl.dergoogler.com/module/{repoUrl}/{moduleId}"
}
),
enterTransition = { scaleIn() + fadeIn() },
exitTransition = { fadeOut() }
) {
Expand Down Expand Up @@ -137,13 +145,14 @@ fun NavGraphBuilder.repositoryScreen(
navArgument("repoUrl") { type = NavType.StringType },
navArgument("value") { type = NavType.StringType }
),
deepLinks = listOf(navDeepLink { uriPattern = "mmrl://search/{repoUrl}/{type}/{value}" },
deepLinks = listOf(
navDeepLink {
uriPattern = "https://mmrl.dergoogler.com/search/{repoUrl}/{type}/{value}"
},
navDeepLink {
uriPattern = "http://mmrl.dergoogler.com/search/{repoUrl}/{type}/{value}"
}),
}
),
enterTransition = { scaleIn() + fadeIn() },
exitTransition = { fadeOut() }
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ import dev.dergoogler.mmrl.compat.ext.isNotNullOrBlank
import dev.dergoogler.mmrl.compat.ext.nullable
import dev.dergoogler.mmrl.compat.ext.shareText
import dev.dergoogler.mmrl.compat.ext.takeTrue
import dev.dergoogler.mmrl.compat.ext.toEncodedUrl
import dev.dergoogler.mmrl.compat.ext.toFormattedDateSafely
import dev.dergoogler.mmrl.compat.ext.toFormattedFileSize
import kotlinx.coroutines.launch
Expand Down Expand Up @@ -290,7 +291,7 @@ fun NewViewScreen(
},
onClick = {
menuExpanded = false
context.shareText("https://mmrl.dergoogler.com/module/${module.id}")
context.shareText("https://mmrl.dergoogler.com/module/${repoUrl.toEncodedUrl()}/${module.id}?utm_medium=share&utm_source=${context.packageName}")
}
)

Expand Down

0 comments on commit e70681c

Please sign in to comment.