Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalUriHandler
import androidx.compose.ui.unit.IntOffset
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.viewmodel.navigation3.rememberViewModelStoreNavEntryDecorator
Expand Down Expand Up @@ -184,13 +185,20 @@ fun MainNavigation() {
}
entry<About> {
val context = LocalContext.current
val uriHandler = LocalUriHandler.current
AboutScreen(
onBackPressed = {
backStack.removeLastOrNull()
},
onLicensesClicked = {
context.startActivity(Intent(context, OssLicensesMenuActivity::class.java))
},
onPrivacyClicked = {
uriHandler.openUri("https://policies.google.com/privacy")
},
onTermsClicked = {
uriHandler.openUri("https://policies.google.com/terms")
}
Comment on lines +196 to +201
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For better maintainability and to avoid magic strings, it's recommended to extract these URLs into constants. You could define them in a companion object or a separate Constants file. This makes them easier to manage and update if they ever change, and prevents potential typos if they are used in multiple places.

For example:

object AppConstants {
    const val PRIVACY_POLICY_URL = "https://policies.google.com/privacy"
    const val TERMS_OF_SERVICE_URL = "https://policies.google.com/terms"
}

)
}
},
Expand Down
Loading