Skip to content

Commit b90e2c9

Browse files
committed
code refactor
1 parent d890498 commit b90e2c9

File tree

66 files changed

+420
-193
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+420
-193
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,18 @@
88
android:allowBackup="true"
99
android:dataExtractionRules="@xml/data_extraction_rules"
1010
android:fullBackupContent="@xml/backup_rules"
11-
android:icon="@mipmap/ic_launcher"
11+
android:icon="@drawable/logo"
1212
android:label="@string/app_name"
13-
android:roundIcon="@mipmap/ic_launcher_round"
13+
android:roundIcon="@drawable/logo"
1414
android:supportsRtl="true"
1515
android:theme="@style/Theme.SongQuest"
1616
tools:targetApi="31">
1717
<activity
1818
android:name=".MainActivity"
1919
android:exported="true"
2020
android:label="@string/app_name"
21-
android:theme="@style/Theme.SongQuest">
21+
android:screenOrientation="portrait"
22+
android:theme="@style/Theme.SplashScreen">
2223
<intent-filter>
2324
<action android:name="android.intent.action.MAIN" />
2425

app/src/main/java/com/spongycode/songquest/MainActivity.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
package com.spongycode.songquest
22

3+
import android.os.Build
34
import android.os.Bundle
45
import androidx.activity.ComponentActivity
56
import androidx.activity.compose.setContent
7+
import androidx.annotation.RequiresApi
68
import androidx.compose.foundation.layout.fillMaxSize
79
import androidx.compose.material3.MaterialTheme
810
import androidx.compose.material3.Surface
911
import androidx.compose.ui.Modifier
10-
import com.spongycode.songquest.navigation.NavContainer
12+
import com.spongycode.songquest.ui.navigation.NavContainer
1113
import com.spongycode.songquest.ui.theme.SongQuestTheme
1214
import dagger.hilt.android.AndroidEntryPoint
1315

1416
@AndroidEntryPoint
1517
class MainActivity : ComponentActivity() {
18+
@RequiresApi(Build.VERSION_CODES.O)
1619
override fun onCreate(savedInstanceState: Bundle?) {
20+
setTheme(R.style.Theme_SongQuest)
1721
super.onCreate(savedInstanceState)
1822
setContent {
1923
SongQuestTheme {

app/src/main/java/com/spongycode/songquest/screen/starter/StarterScreen.kt

Lines changed: 0 additions & 48 deletions
This file was deleted.

app/src/main/java/com/spongycode/songquest/navigation/NavContainer.kt renamed to app/src/main/java/com/spongycode/songquest/ui/navigation/NavContainer.kt

Lines changed: 53 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.spongycode.songquest.navigation
1+
package com.spongycode.songquest.ui.navigation
22

33
import android.os.Build
44
import androidx.annotation.RequiresApi
@@ -10,16 +10,16 @@ import androidx.navigation.NavHostController
1010
import androidx.navigation.compose.NavHost
1111
import androidx.navigation.compose.composable
1212
import androidx.navigation.compose.rememberNavController
13-
import com.spongycode.songquest.screen.gameplay.home.HomeScreen
14-
import com.spongycode.songquest.screen.auth.forgot_password.ForgotPasswordScreen
15-
import com.spongycode.songquest.screen.auth.login.LoginScreen
16-
import com.spongycode.songquest.screen.auth.register.RegisterScreen
17-
import com.spongycode.songquest.screen.gameplay.gameover.GameOverScreen
18-
import com.spongycode.songquest.screen.gameplay.history.HistoryScreen
19-
import com.spongycode.songquest.screen.gameplay.leaderboard.LeaderboardScreen
20-
import com.spongycode.songquest.screen.gameplay.playing.PlayingScreen
21-
import com.spongycode.songquest.screen.gameplay.profile.ProfileScreen
22-
import com.spongycode.songquest.screen.starter.StarterScreen
13+
import com.spongycode.songquest.ui.screen.auth.forgot_password.ForgotPasswordScreen
14+
import com.spongycode.songquest.ui.screen.auth.login.LoginScreen
15+
import com.spongycode.songquest.ui.screen.auth.register.RegisterScreen
16+
import com.spongycode.songquest.ui.screen.gameplay.gameover.GameOverScreen
17+
import com.spongycode.songquest.ui.screen.gameplay.history.HistoryScreen
18+
import com.spongycode.songquest.ui.screen.gameplay.home.HomeScreen
19+
import com.spongycode.songquest.ui.screen.gameplay.leaderboard.LeaderboardScreen
20+
import com.spongycode.songquest.ui.screen.gameplay.playing.PlayingScreen
21+
import com.spongycode.songquest.ui.screen.gameplay.profile.ProfileScreen
22+
import com.spongycode.songquest.ui.screen.starter.StarterScreen
2323

2424
@RequiresApi(Build.VERSION_CODES.O)
2525
@Composable
@@ -77,13 +77,52 @@ fun NavContainer(startDestination: String) {
7777
val gameId = it.arguments?.getString("gameId")
7878
GameOverScreen(gameId = gameId!!, navController = navController)
7979
}
80-
composable(route = "profile") {
80+
composable(route = "profile",
81+
enterTransition = {
82+
slideIntoContainer(
83+
AnimatedContentTransitionScope.SlideDirection.Start, tween(100)
84+
)
85+
},
86+
popEnterTransition = {
87+
EnterTransition.None
88+
},
89+
exitTransition = {
90+
slideOutOfContainer(
91+
AnimatedContentTransitionScope.SlideDirection.End, tween(100)
92+
)
93+
}) {
8194
ProfileScreen(navController = navController)
8295
}
83-
composable(route = "history") {
96+
composable(route = "history",
97+
enterTransition = {
98+
slideIntoContainer(
99+
AnimatedContentTransitionScope.SlideDirection.Start, tween(100)
100+
)
101+
},
102+
popEnterTransition = {
103+
EnterTransition.None
104+
},
105+
exitTransition = {
106+
slideOutOfContainer(
107+
AnimatedContentTransitionScope.SlideDirection.End, tween(100)
108+
)
109+
}) {
84110
HistoryScreen(navController = navController)
85111
}
86-
composable(route = "leaderboard") {
112+
composable(route = "leaderboard",
113+
enterTransition = {
114+
slideIntoContainer(
115+
AnimatedContentTransitionScope.SlideDirection.Start, tween(100)
116+
)
117+
},
118+
popEnterTransition = {
119+
EnterTransition.None
120+
},
121+
exitTransition = {
122+
slideOutOfContainer(
123+
AnimatedContentTransitionScope.SlideDirection.End, tween(100)
124+
)
125+
}) {
87126
LeaderboardScreen(navController = navController)
88127
}
89128
}

app/src/main/java/com/spongycode/songquest/screen/auth/components/CustomAnnotatedString.kt renamed to app/src/main/java/com/spongycode/songquest/ui/screen/auth/components/CustomAnnotatedString.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.spongycode.songquest.screen.auth.components
1+
package com.spongycode.songquest.ui.screen.auth.components
22

33
import androidx.compose.foundation.clickable
44
import androidx.compose.material3.MaterialTheme

app/src/main/java/com/spongycode/songquest/screen/auth/components/CustomButton.kt renamed to app/src/main/java/com/spongycode/songquest/ui/screen/auth/components/CustomButton.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.spongycode.songquest.screen.auth.components
1+
package com.spongycode.songquest.ui.screen.auth.components
22

33
import androidx.compose.foundation.layout.fillMaxWidth
44
import androidx.compose.foundation.layout.padding

app/src/main/java/com/spongycode/songquest/screen/auth/components/CustomTextField.kt renamed to app/src/main/java/com/spongycode/songquest/ui/screen/auth/components/CustomTextField.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.spongycode.songquest.screen.auth.components
1+
package com.spongycode.songquest.ui.screen.auth.components
22

33
import androidx.compose.foundation.background
44
import androidx.compose.foundation.clickable

app/src/main/java/com/spongycode/songquest/screen/auth/components/TitleText.kt renamed to app/src/main/java/com/spongycode/songquest/ui/screen/auth/components/TitleText.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
package com.spongycode.songquest.screen.auth.components
1+
package com.spongycode.songquest.ui.screen.auth.components
22

33
import androidx.compose.material3.Text
44
import androidx.compose.runtime.Composable
5+
import androidx.compose.ui.graphics.Color
56
import androidx.compose.ui.text.font.FontWeight
67
import androidx.compose.ui.unit.sp
78
import com.spongycode.songquest.util.Fonts
@@ -12,6 +13,7 @@ fun TitleText(title: String) {
1213
text = title,
1314
fontSize = 30.sp,
1415
fontWeight = FontWeight.W600,
15-
fontFamily = Fonts.poppinsFamily
16+
fontFamily = Fonts.poppinsFamily,
17+
color = Color.Black
1618
)
1719
}

app/src/main/java/com/spongycode/songquest/screen/auth/forgot_password/ForgotPasswordEvent.kt renamed to app/src/main/java/com/spongycode/songquest/ui/screen/auth/forgot_password/ForgotPasswordEvent.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.spongycode.songquest.screen.auth.forgot_password
1+
package com.spongycode.songquest.ui.screen.auth.forgot_password
22

33
sealed class ForgotPasswordEvent {
44
data class EnteredEmail(val value: String) : ForgotPasswordEvent()

app/src/main/java/com/spongycode/songquest/screen/auth/forgot_password/ForgotPasswordScreen.kt renamed to app/src/main/java/com/spongycode/songquest/ui/screen/auth/forgot_password/ForgotPasswordScreen.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.spongycode.songquest.screen.auth.forgot_password
1+
package com.spongycode.songquest.ui.screen.auth.forgot_password
22

33
import android.annotation.SuppressLint
44
import androidx.compose.foundation.layout.Box
@@ -28,10 +28,10 @@ import androidx.compose.ui.unit.dp
2828
import androidx.hilt.navigation.compose.hiltViewModel
2929
import androidx.navigation.NavHostController
3030
import com.spongycode.songquest.R
31-
import com.spongycode.songquest.screen.auth.components.CustomButton
32-
import com.spongycode.songquest.screen.auth.components.CustomTextField
33-
import com.spongycode.songquest.screen.auth.components.TitleText
34-
import com.spongycode.songquest.screen.auth.forgot_password.ForgotPasswordState.*
31+
import com.spongycode.songquest.ui.screen.auth.components.CustomButton
32+
import com.spongycode.songquest.ui.screen.auth.components.CustomTextField
33+
import com.spongycode.songquest.ui.screen.auth.components.TitleText
34+
import com.spongycode.songquest.ui.screen.auth.forgot_password.ForgotPasswordState.*
3535
import com.spongycode.songquest.ui.theme.DecentBlue
3636
import com.spongycode.songquest.ui.theme.DecentGreen
3737
import com.spongycode.songquest.ui.theme.DecentRed

0 commit comments

Comments
 (0)