docs: Comprehensive README update with new features and architecture details
- Add extensive documentation for offline mode, sync, collections, and dashboard features - Document new Material You theming, OLED mode, and widget capabilities - Include detailed sections on metadata extraction, Markdown editor, and import/export - Update technology stack versions (Kotlin 2.0.0, Hilt 2.51.1, Retrofit 2.11.0, Room 2.6.1) - Simplify installation and compilation instructions - Add user guide with first-time setup and
This commit is contained in:
@@ -1,13 +1,17 @@
|
||||
package com.shaarit.presentation.nav
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.core.net.toUri
|
||||
import androidx.navigation.NavType
|
||||
import androidx.navigation.compose.NavHost
|
||||
import androidx.navigation.compose.composable
|
||||
import androidx.navigation.compose.rememberNavController
|
||||
import androidx.navigation.navArgument
|
||||
import androidx.navigation.navDeepLink
|
||||
import java.net.URLEncoder
|
||||
|
||||
sealed class Screen(val route: String) {
|
||||
@@ -22,13 +26,17 @@ sealed class Screen(val route: String) {
|
||||
fun createRoute(linkId: Int): String = "edit/$linkId"
|
||||
}
|
||||
object Tags : Screen("tags")
|
||||
object Collections : Screen("collections")
|
||||
object Dashboard : Screen("dashboard")
|
||||
object Settings : Screen("settings")
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun AppNavGraph(
|
||||
startDestination: String = Screen.Login.route,
|
||||
shareUrl: String? = null,
|
||||
shareTitle: String? = null
|
||||
shareTitle: String? = null,
|
||||
initialDeepLink: String? = null
|
||||
) {
|
||||
val navController = rememberNavController()
|
||||
val context = LocalContext.current
|
||||
@@ -47,6 +55,11 @@ fun AppNavGraph(
|
||||
navController.navigate("add?url=$encodedUrl&title=$encodedTitle&isShare=true") {
|
||||
popUpTo(Screen.Login.route) { inclusive = true }
|
||||
}
|
||||
} else if (initialDeepLink != null) {
|
||||
// Handle deep link after login
|
||||
navController.navigate(initialDeepLink) {
|
||||
popUpTo(Screen.Login.route) { inclusive = true }
|
||||
}
|
||||
} else {
|
||||
navController.navigate(Screen.Feed.createRoute()) {
|
||||
popUpTo(Screen.Login.route) { inclusive = true }
|
||||
@@ -64,6 +77,10 @@ fun AppNavGraph(
|
||||
nullable = true
|
||||
defaultValue = null
|
||||
}
|
||||
),
|
||||
deepLinks = listOf(
|
||||
navDeepLink { uriPattern = "shaarit://feed" },
|
||||
navDeepLink { uriPattern = "shaarit://search" }
|
||||
)
|
||||
) { backStackEntry ->
|
||||
val tag = backStackEntry.arguments?.getString("tag")
|
||||
@@ -73,6 +90,9 @@ fun AppNavGraph(
|
||||
navController.navigate(Screen.Edit.createRoute(linkId))
|
||||
},
|
||||
onNavigateToTags = { navController.navigate(Screen.Tags.route) },
|
||||
onNavigateToCollections = { navController.navigate(Screen.Collections.route) },
|
||||
onNavigateToSettings = { navController.navigate(Screen.Settings.route) },
|
||||
onNavigateToRandom = { },
|
||||
initialTagFilter = tag
|
||||
)
|
||||
}
|
||||
@@ -94,6 +114,9 @@ fun AppNavGraph(
|
||||
type = NavType.BoolType
|
||||
defaultValue = false
|
||||
}
|
||||
),
|
||||
deepLinks = listOf(
|
||||
navDeepLink { uriPattern = "shaarit://add" }
|
||||
)
|
||||
) { backStackEntry ->
|
||||
val isShare = backStackEntry.arguments?.getBoolean("isShare") ?: false
|
||||
@@ -118,7 +141,12 @@ fun AppNavGraph(
|
||||
)
|
||||
}
|
||||
|
||||
composable(Screen.Tags.route) {
|
||||
composable(
|
||||
route = Screen.Tags.route,
|
||||
deepLinks = listOf(
|
||||
navDeepLink { uriPattern = "shaarit://tags" }
|
||||
)
|
||||
) {
|
||||
com.shaarit.presentation.tags.TagsScreen(
|
||||
onNavigateBack = { navController.popBackStack() },
|
||||
onNavigateToFeedWithTag = { tag ->
|
||||
@@ -128,5 +156,42 @@ fun AppNavGraph(
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
composable(
|
||||
route = Screen.Collections.route,
|
||||
deepLinks = listOf(
|
||||
navDeepLink { uriPattern = "shaarit://collections" }
|
||||
)
|
||||
) {
|
||||
com.shaarit.presentation.collections.CollectionsScreen(
|
||||
onNavigateBack = { navController.popBackStack() },
|
||||
onCollectionClick = { collectionId ->
|
||||
// Naviguer vers le feed avec le filtre de collection
|
||||
navController.navigate(Screen.Feed.createRoute()) {
|
||||
popUpTo(Screen.Collections.route) { inclusive = true }
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
composable(
|
||||
route = Screen.Dashboard.route,
|
||||
deepLinks = listOf(
|
||||
navDeepLink { uriPattern = "shaarit://dashboard" }
|
||||
)
|
||||
) {
|
||||
com.shaarit.presentation.dashboard.DashboardScreen(
|
||||
onNavigateBack = { navController.popBackStack() }
|
||||
)
|
||||
}
|
||||
|
||||
composable(
|
||||
route = Screen.Settings.route
|
||||
) {
|
||||
com.shaarit.presentation.settings.SettingsScreen(
|
||||
onNavigateBack = { navController.popBackStack() },
|
||||
onNavigateToDashboard = { navController.navigate(Screen.Dashboard.route) }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user