Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ android {
}

dependencies {
implementation(libs.androidx.compose.adaptive)
val glanceVersion = "1.1.1"

implementation(platform(libs.androidx.compose.bom))
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/java/com/yourssu/ssutime/v2/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ import androidx.activity.result.ActivityResult
import androidx.activity.result.contract.ActivityResultContracts
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.adaptive.currentWindowAdaptiveInfo
import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.mutableStateOf
import androidx.compose.ui.Modifier
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import androidx.window.core.layout.WindowSizeClass
import com.google.android.play.core.appupdate.AppUpdateInfo
import com.google.android.play.core.appupdate.AppUpdateManagerFactory
import com.google.android.play.core.appupdate.AppUpdateOptions
Expand Down Expand Up @@ -138,7 +140,15 @@ class MainActivity : ComponentActivity() {
backStackEntry.savedStateHandle.remove<Boolean>(
SKIP_MAIN_LOAD_FROM_MY_PAGE_BACK_KEY
) == true

val windowSizeClass = currentWindowAdaptiveInfo().windowSizeClass
val isLargeScreen = windowSizeClass.isAtLeastBreakpoint(
WindowSizeClass.WIDTH_DP_MEDIUM_LOWER_BOUND,
WindowSizeClass.HEIGHT_DP_MEDIUM_LOWER_BOUND
)

MainScreen(
isLargeScreen = isLargeScreen,
skipInitialLmsRefresh = skipInitialLmsRefresh.value,
forceInitialLmsRefresh = forceInitialLmsRefresh.value,
homeEntrySource = homeEntrySource.value,
Expand Down
36 changes: 36 additions & 0 deletions app/src/main/java/com/yourssu/ssutime/v2/SSUTime.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ import androidx.datastore.core.Serializer
import androidx.datastore.core.handlers.ReplaceFileCorruptionHandler
import androidx.datastore.dataStore
import com.yourssu.data.AlertData
import com.yourssu.data.LocalChapel
import com.yourssu.data.LocalGrade
import com.yourssu.data.LocalGraduate
import com.yourssu.data.LocalScholarship
import com.yourssu.data.LocalTimetable
import com.yourssu.data.LocalTuition
import com.yourssu.data.LoginData
import com.yourssu.data.TodoData
import com.yourssu.ssutime.v2.network.ApiRepository
Expand All @@ -17,8 +23,14 @@ import com.yourssu.ssutime.v2.screen.login.LoginViewModel
import com.yourssu.ssutime.v2.screen.main.LmsRefreshRepository
import com.yourssu.ssutime.v2.screen.main.MainRepository
import com.yourssu.ssutime.v2.screen.main.MainViewModel
import com.yourssu.ssutime.v2.screen.main.chapelDataStore
import com.yourssu.ssutime.v2.screen.main.gradeDataStore
import com.yourssu.ssutime.v2.screen.main.graduateDataStore
import com.yourssu.ssutime.v2.screen.main.notificationStore
import com.yourssu.ssutime.v2.screen.main.scholarshipDataStore
import com.yourssu.ssutime.v2.screen.main.timetableDataStore
import com.yourssu.ssutime.v2.screen.main.todoDataStore
import com.yourssu.ssutime.v2.screen.main.tuitionDataStore
import com.yourssu.ssutime.v2.screen.my.MyViewModel
import com.yourssu.ssutime.v2.screen.onboarding.OnBoardingData
import com.yourssu.ssutime.v2.screen.onboarding.OnBoardingRepository
Expand Down Expand Up @@ -52,12 +64,24 @@ val appModule = module {
single<DataStore<TodoData>>(named("todoDataStore")) { androidContext().todoDataStore }
single<DataStore<OnBoardingData>>(named("onBoardingDataStore")) { androidContext().onBoardingDataStore }
single<DataStore<AlertData>>(named("alertDataStore")) { androidContext().notificationStore }
single<DataStore<LocalTimetable>>(named("timetableDataStore")) { androidContext().timetableDataStore }
single<DataStore<LocalScholarship>>(named("scholarshipDataStore")) { androidContext().scholarshipDataStore }
single<DataStore<LocalTuition>>(named("tuitionDataStore")) { androidContext().tuitionDataStore }
single<DataStore<LocalGraduate>>(named("graduateDataStore")) { androidContext().graduateDataStore }
single<DataStore<LocalGrade>>(named("gradeDataStore")) { androidContext().gradeDataStore }
single<DataStore<LocalChapel>>(named("chapelDataStore")) { androidContext().chapelDataStore }

single { LoginRepository(get()) }
single {
MainRepository(
get(named("todoDataStore")),
get(named("alertDataStore")),
get(named("timetableDataStore")),
get(named("scholarshipDataStore")),
get(named("tuitionDataStore")),
get(named("graduateDataStore")),
get(named("gradeDataStore")),
get(named("chapelDataStore")),
get(),
androidContext()
)
Expand Down Expand Up @@ -98,6 +122,12 @@ val previewModule = module {
single<DataStore<TodoData>>(named("todoDataStore")) { androidContext().todoDataStore }
single<DataStore<OnBoardingData>>(named("onBoardingDataStore")) { androidContext().onBoardingDataStore }
single<DataStore<AlertData>>(named("alertDataStore")) { androidContext().notificationStore }
single<DataStore<LocalTimetable>>(named("timetableDataStore")) { androidContext().timetableDataStore }
single<DataStore<LocalScholarship>>(named("scholarshipDataStore")) { androidContext().scholarshipDataStore }
single<DataStore<LocalTuition>>(named("tuitionDataStore")) { androidContext().tuitionDataStore }
single<DataStore<LocalGraduate>>(named("graduateDataStore")) { androidContext().graduateDataStore }
single<DataStore<LocalGrade>>(named("gradeDataStore")) { androidContext().gradeDataStore }
single<DataStore<LocalChapel>>(named("chapelDataStore")) { androidContext().chapelDataStore }

single { LoginRepository(get()) }
single {
Expand All @@ -107,6 +137,12 @@ val previewModule = module {
MainRepository(
get(named("todoDataStore")),
get(named("alertDataStore")),
get(named("timetableDataStore")),
get(named("scholarshipDataStore")),
get(named("tuitionDataStore")),
get(named("graduateDataStore")),
get(named("gradeDataStore")),
get(named("chapelDataStore")),
get(),
androidContext()
)
Expand Down
Loading