Skip to content

Commit

Permalink
Add empty screeng
Browse files Browse the repository at this point in the history
  • Loading branch information
masato1230 committed Jun 4, 2022
1 parent efc6abf commit 494a08d
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.jp_funda.qiitaclient.view
package com.jp_funda.qiitaclient

import android.os.Bundle
import androidx.activity.ComponentActivity
Expand All @@ -16,6 +16,8 @@ import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import com.jp_funda.qiitaclient.ui.theme.QiitaClientTheme
import com.jp_funda.qiitaclient.view.detail.DetailScreen
import com.jp_funda.qiitaclient.view.search.SearchScreen

class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
Expand All @@ -38,13 +40,13 @@ class MainActivity : ComponentActivity() {

@Composable
fun MainNavHost(navController: NavHostController) {
NavHost(navController = navController, startDestination = "list") {
composable(route = "list") {
// ここで検索画面のコンポーザブル関数を呼び出す。
NavHost(navController = navController, startDestination = "search") {
composable(route = "search") {
SearchScreen(navController = navController)
}

composable(route = "detail") {
// ここで詳細画面のコンポザブル関数を呼び出す。
DetailScreen()
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.jp_funda.qiitaclient.view.detail

import androidx.compose.material.Scaffold
import androidx.compose.material.Text
import androidx.compose.runtime.Composable

@Composable
fun DetailScreen() {
Scaffold {
Text(text = "詳細画面")
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.jp_funda.qiitaclient.view.search

import androidx.compose.foundation.layout.Column
import androidx.compose.material.Button
import androidx.compose.material.Scaffold
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.navigation.NavController

@Composable
fun SearchScreen(navController: NavController) {
Scaffold {
Column {
Text(text = "検索画面")
Button(onClick = { navController.navigate("detail") }) {
Text(text = "詳細画面へ")
}
}
}
}

0 comments on commit 494a08d

Please sign in to comment.