Skip to content

Commit

Permalink
Merge pull request #34 from azrael8576/feat/home
Browse files Browse the repository at this point in the history
Add home screen
  • Loading branch information
azrael8576 authored Nov 15, 2023
2 parents 1d8a137 + f4a54ab commit 081e04b
Show file tree
Hide file tree
Showing 21 changed files with 885 additions and 8 deletions.
1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ android {
dependencies {
implementation(project(":feature:login"))
implementation(project(":feature:teacherschedule"))
implementation(project(":feature:home"))
implementation(project(":feature:contactme"))

implementation(project(":core:designsystem"))
Expand Down
16 changes: 9 additions & 7 deletions app/src/main/java/com/wei/amazingtalker/navigation/AtNavHost.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import androidx.navigation.compose.NavHost
import androidx.window.layout.DisplayFeature
import com.wei.amazingtalker.core.designsystem.ui.DeviceOrientation
import com.wei.amazingtalker.feature.contactme.contactme.navigation.contactMeScreen
import com.wei.amazingtalker.feature.home.home.navigation.homeGraph
import com.wei.amazingtalker.feature.login.login.navigation.loginScreen
import com.wei.amazingtalker.feature.login.welcome.navigation.welcomeGraph
import com.wei.amazingtalker.feature.login.welcome.navigation.welcomeRoute
Expand Down Expand Up @@ -39,13 +40,6 @@ fun AtNavHost(
startDestination = startDestination,
modifier = modifier,
) {
scheduleGraph(
navController = navController,
tokenInvalidNavigate = { appState.tokenInvalidNavigate() },
nestedGraphs = {
scheduleDetailScreen(navController = navController)
},
)
welcomeGraph(
isPortrait = isPortrait,
navController = navController,
Expand All @@ -55,6 +49,14 @@ fun AtNavHost(
)
},
)
scheduleGraph(
navController = navController,
tokenInvalidNavigate = { appState.tokenInvalidNavigate() },
nestedGraphs = {
scheduleDetailScreen(navController = navController)
},
)
homeGraph()
contactMeScreen(
navController = navController,
contentType = contentType,
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/java/com/wei/amazingtalker/ui/AtAppState.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ import com.wei.amazingtalker.core.designsystem.ui.isBookPosture
import com.wei.amazingtalker.core.designsystem.ui.isSeparating
import com.wei.amazingtalker.feature.contactme.contactme.navigation.contactMeRoute
import com.wei.amazingtalker.feature.contactme.contactme.navigation.navigateToContactMe
import com.wei.amazingtalker.feature.home.home.navigation.homeRoute
import com.wei.amazingtalker.feature.home.home.navigation.navigateToHome
import com.wei.amazingtalker.feature.login.login.navigation.loginRoute
import com.wei.amazingtalker.feature.login.welcome.navigation.navigateToWelcome
import com.wei.amazingtalker.feature.login.welcome.navigation.welcomeRoute
Expand Down Expand Up @@ -159,6 +161,7 @@ class AtAppState(
@Composable get() = when (currentDestination?.route) {
scheduleRoute -> TopLevelDestination.SCHEDULE
contactMeRoute -> TopLevelDestination.CONTACT_ME
homeRoute -> TopLevelDestination.HOME
else -> null
}

Expand Down Expand Up @@ -206,6 +209,10 @@ class AtAppState(
topLevelNavOptions,
)

TopLevelDestination.HOME -> navController.navigateToHome(
topLevelNavOptions,
)

TopLevelDestination.CONTACT_ME -> navController.navigateToContactMe(
topLevelNavOptions,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import androidx.compose.material.icons.outlined.Home
import androidx.compose.material.icons.outlined.Info
import androidx.compose.material.icons.outlined.SupportAgent
import androidx.compose.material.icons.outlined.Upcoming
import androidx.compose.material.icons.rounded.Add
import androidx.compose.material.icons.rounded.ArrowBack
import androidx.compose.material.icons.rounded.ArrowBackIosNew
import androidx.compose.material.icons.rounded.ArrowForward
Expand All @@ -14,9 +15,12 @@ import androidx.compose.material.icons.rounded.CalendarMonth
import androidx.compose.material.icons.rounded.Close
import androidx.compose.material.icons.rounded.Home
import androidx.compose.material.icons.rounded.Info
import androidx.compose.material.icons.rounded.Menu
import androidx.compose.material.icons.rounded.Person
import androidx.compose.material.icons.rounded.Phone
import androidx.compose.material.icons.rounded.Search
import androidx.compose.material.icons.rounded.Settings
import androidx.compose.material.icons.rounded.Star
import androidx.compose.material.icons.rounded.SupportAgent
import androidx.compose.material.icons.rounded.Upcoming
import androidx.compose.ui.graphics.vector.ImageVector
Expand All @@ -43,4 +47,8 @@ object AtIcons {
val Phone = Icons.Rounded.Phone
val Upcoming = Icons.Rounded.Upcoming
val UpcomingBorder = Icons.Outlined.Upcoming
val Star = Icons.Rounded.Star
val Person = Icons.Rounded.Person
val Menu = Icons.Rounded.Menu
val Add = Icons.Rounded.Add
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import com.wei.amazingtalker.core.designsystem.component.baselineHeight
@Composable
fun ProfileProperty(label: String, value: String, isLink: Boolean = false) {
Column(modifier = Modifier.padding(vertical = 8.dp)) {
Divider()
Divider(color = MaterialTheme.colorScheme.outline)
Text(
text = label,
modifier = Modifier
Expand Down
1 change: 1 addition & 0 deletions feature/home/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
12 changes: 12 additions & 0 deletions feature/home/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
plugins {
alias(libs.plugins.at.android.feature)
alias(libs.plugins.at.android.library.compose)
alias(libs.plugins.at.android.hilt)
}

android {
namespace = "com.wei.amazingtalker.feature.home"
}

dependencies {
}
4 changes: 4 additions & 0 deletions feature/home/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

</manifest>
Loading

0 comments on commit 081e04b

Please sign in to comment.