Revert "Add link of source code in app"

This reverts commit 197f4a5157.
pull/511/head
Muhammad Anas Shamsi 2 years ago
parent 197f4a5157
commit 43bb4359f5

@ -16,9 +16,6 @@
package com.google.samples.apps.nowinandroid.ui
import android.content.Intent
import android.net.Uri
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ExperimentalLayoutApi
import androidx.compose.foundation.layout.Row
@ -48,13 +45,11 @@ import androidx.compose.runtime.remember
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTagsAsResourceId
import androidx.core.content.ContextCompat
import androidx.lifecycle.compose.ExperimentalLifecycleComposeApi
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.navigation.NavDestination
@ -73,10 +68,10 @@ import com.google.samples.apps.nowinandroid.core.designsystem.icon.Icon.ImageVec
import com.google.samples.apps.nowinandroid.core.designsystem.icon.NiaIcons
import com.google.samples.apps.nowinandroid.core.designsystem.theme.GradientColors
import com.google.samples.apps.nowinandroid.core.designsystem.theme.LocalGradientColors
import com.google.samples.apps.nowinandroid.feature.settings.R as settingsR
import com.google.samples.apps.nowinandroid.feature.settings.SettingsDialog
import com.google.samples.apps.nowinandroid.navigation.NiaNavHost
import com.google.samples.apps.nowinandroid.navigation.TopLevelDestination
import com.google.samples.apps.nowinandroid.feature.settings.R as settingsR
@OptIn(
ExperimentalMaterial3Api::class,
@ -95,7 +90,6 @@ fun NiaApp(
) {
val shouldShowGradientBackground =
appState.currentTopLevelDestination == TopLevelDestination.FOR_YOU
val context = LocalContext.current
NiaBackground {
NiaGradientBackground(
@ -171,10 +165,6 @@ fun NiaApp(
if (destination != null) {
NiaTopAppBar(
titleRes = destination.titleTextId,
navigationIcon = NiaIcons.Codebase,
navigationIconContentDescription = stringResource(
id = settingsR.string.top_app_bar_navigation_icon_description
),
actionIcon = NiaIcons.Settings,
actionIconContentDescription = stringResource(
id = settingsR.string.top_app_bar_action_icon_description
@ -182,12 +172,7 @@ fun NiaApp(
colors = TopAppBarDefaults.centerAlignedTopAppBarColors(
containerColor = Color.Transparent
),
onNavigationClick = {
val launchResourceIntent = Intent(Intent.ACTION_VIEW, Uri.parse(
CODEBASE_URL))
ContextCompat.startActivity(context, launchResourceIntent, null)
},
onActionClick = { appState.setShowSettingsDialog(true) },
onActionClick = { appState.setShowSettingsDialog(true) }
)
}
@ -284,5 +269,3 @@ private fun NavDestination?.isTopLevelDestinationInHierarchy(destination: TopLev
this?.hierarchy?.any {
it.route?.contains(destination.name, true) ?: false
} ?: false
private const val CODEBASE_URL = "https://github.com/android/nowinandroid"

@ -26,7 +26,6 @@ import androidx.compose.material.icons.rounded.Add
import androidx.compose.material.icons.rounded.ArrowBack
import androidx.compose.material.icons.rounded.Check
import androidx.compose.material.icons.rounded.Close
import androidx.compose.material.icons.rounded.Code
import androidx.compose.material.icons.rounded.ExpandLess
import androidx.compose.material.icons.rounded.Fullscreen
import androidx.compose.material.icons.rounded.Grid3x3
@ -66,7 +65,6 @@ object NiaIcons {
val Person = Icons.Rounded.Person
val PlayArrow = Icons.Rounded.PlayArrow
val Search = Icons.Rounded.Search
val Codebase = Icons.Rounded.Code
val Settings = Icons.Rounded.Settings
val ShortText = Icons.Rounded.ShortText
val Tag = Icons.Rounded.Tag

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?><!--
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2022 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
@ -15,7 +16,6 @@
-->
<resources>
<string name="top_app_bar_action_icon_description">Settings</string>
<string name="top_app_bar_navigation_icon_description">Codebase</string>
<string name="settings_title">Settings</string>
<string name="loading">Loading...</string>
<string name="privacy_policy">Privacy policy</string>

Loading…
Cancel
Save