diff --git a/app-nia-catalog/README.md b/app-nia-catalog/README.md index 99503ba84..cf6d05f4f 100644 --- a/app-nia-catalog/README.md +++ b/app-nia-catalog/README.md @@ -1,3 +1,3 @@ # :app-nia-catalog module ## Dependency graph -![Dependency graph](../../docs/images/graphs/dep_graph_app_nia_catalog.svg) +![Dependency graph](../docs/images/graphs/dep_graph_app_nia_catalog.svg) diff --git a/app/README.md b/app/README.md index f80083494..a3fb4572a 100644 --- a/app/README.md +++ b/app/README.md @@ -1,3 +1,3 @@ # :app module ## Dependency graph -![Dependency graph](../../docs/images/graphs/dep_graph_app.svg) +![Dependency graph](../docs/images/graphs/dep_graph_app.svg) diff --git a/app/src/main/kotlin/com/google/samples/apps/nowinandroid/ui/interests2pane/InterestsListDetailScreen.kt b/app/src/main/kotlin/com/google/samples/apps/nowinandroid/ui/interests2pane/InterestsListDetailScreen.kt index b3594b81f..335f83371 100644 --- a/app/src/main/kotlin/com/google/samples/apps/nowinandroid/ui/interests2pane/InterestsListDetailScreen.kt +++ b/app/src/main/kotlin/com/google/samples/apps/nowinandroid/ui/interests2pane/InterestsListDetailScreen.kt @@ -17,8 +17,6 @@ package com.google.samples.apps.nowinandroid.ui.interests2pane import androidx.activity.compose.BackHandler -import androidx.compose.foundation.layout.Box -import androidx.compose.material3.Text import androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi import androidx.compose.material3.adaptive.layout.ListDetailPaneScaffold import androidx.compose.material3.adaptive.layout.ListDetailPaneScaffoldRole @@ -39,6 +37,7 @@ import androidx.navigation.navArgument import com.google.samples.apps.nowinandroid.feature.interests.InterestsRoute import com.google.samples.apps.nowinandroid.feature.interests.navigation.INTERESTS_ROUTE import com.google.samples.apps.nowinandroid.feature.interests.navigation.TOPIC_ID_ARG +import com.google.samples.apps.nowinandroid.feature.topic.TopicDetailPlaceholder import com.google.samples.apps.nowinandroid.feature.topic.navigation.TOPIC_ROUTE import com.google.samples.apps.nowinandroid.feature.topic.navigation.navigateToTopic import com.google.samples.apps.nowinandroid.feature.topic.navigation.topicScreen @@ -113,9 +112,7 @@ internal fun InterestsListDetailScreen( onTopicClick = ::onTopicClickShowDetailPane, ) composable(route = TOPIC_ROUTE) { - Box { - Text("Placeholder") - } + TopicDetailPlaceholder() } } }, diff --git a/feature/topic/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/topic/TopicDetailPlaceholder.kt b/feature/topic/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/topic/TopicDetailPlaceholder.kt new file mode 100644 index 000000000..627fb8fb3 --- /dev/null +++ b/feature/topic/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/topic/TopicDetailPlaceholder.kt @@ -0,0 +1,71 @@ +/* + * Copyright 2024 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.samples.apps.nowinandroid.feature.topic + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material3.Card +import androidx.compose.material3.CardDefaults +import androidx.compose.material3.Icon +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import com.google.samples.apps.nowinandroid.core.designsystem.theme.NiaTheme + +@Composable +fun TopicDetailPlaceholder(modifier: Modifier = Modifier) { + Card( + modifier = modifier, + colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.surfaceVariant), + shape = RoundedCornerShape(24.dp, 24.dp, 0.dp, 0.dp), + ) { + Column( + modifier = Modifier.fillMaxSize(), + horizontalAlignment = Alignment.CenterHorizontally, + verticalArrangement = Arrangement.spacedBy( + 20.dp, + alignment = Alignment.CenterVertically, + ), + ) { + Icon( + painter = painterResource(id = R.drawable.feature_topic_ic_topic_placeholder), + contentDescription = null, + tint = MaterialTheme.colorScheme.primary, + ) + Text( + text = stringResource(id = R.string.feature_topic_select_an_interest), + style = MaterialTheme.typography.titleLarge, + ) + } + } +} + +@Preview(widthDp = 200, heightDp = 300) +@Composable +fun TopicDetailPlaceholderPreview() { + NiaTheme { + TopicDetailPlaceholder() + } +} diff --git a/feature/topic/src/main/res/drawable/feature_topic_ic_topic_placeholder.xml b/feature/topic/src/main/res/drawable/feature_topic_ic_topic_placeholder.xml new file mode 100644 index 000000000..0518401da --- /dev/null +++ b/feature/topic/src/main/res/drawable/feature_topic_ic_topic_placeholder.xml @@ -0,0 +1,55 @@ + + + + + + + + + + diff --git a/feature/topic/src/main/res/values/strings.xml b/feature/topic/src/main/res/values/strings.xml index 5fefc3f42..fe4a6dc29 100644 --- a/feature/topic/src/main/res/values/strings.xml +++ b/feature/topic/src/main/res/values/strings.xml @@ -16,4 +16,5 @@ --> Loading topic + Select an Interest diff --git a/generateModuleGraphs.sh b/generateModuleGraphs.sh index 27dea22da..faeac9a30 100755 --- a/generateModuleGraphs.sh +++ b/generateModuleGraphs.sh @@ -56,14 +56,23 @@ check_and_create_readme() { local file_name="$2" local readme_path="${module_path:1}" # Remove leading colon - readme_path=${readme_path//:/\/} # Replace colons with slashes using sed + readme_path=${readme_path//:/\/} # Replace colons with slashes readme_path="${readme_path}/README.md" #Append the filename # Check if README.md exists and create it if not if [[ ! -f "$readme_path" ]]; then echo "Creating README.md for ${module_path}" - # Calculate the correct relative path to the image - local relative_image_path="../../docs/images/graphs/${file_name}.svg" + + # Determine the depth of the module based on the number of colons + local depth=$(awk -F: '{print NF-1}' <<< "${module_path}") + + # Construct the relative image path with the correct number of "../" + local relative_image_path="../" + for ((i=1; i<$depth; i++)); do + relative_image_path+="../" + done + relative_image_path+="docs/images/graphs/${file_name}.svg" + echo "# ${module_path} module" > "$readme_path" echo "## Dependency graph" >> "$readme_path" echo "![Dependency graph](${relative_image_path})" >> "$readme_path"