diff --git a/presentation/src/main/java/com/depromeet/presentation/seatReview/ReviewActivity.kt b/presentation/src/main/java/com/depromeet/presentation/seatReview/ReviewActivity.kt index 2ed3848a..c46817da 100644 --- a/presentation/src/main/java/com/depromeet/presentation/seatReview/ReviewActivity.kt +++ b/presentation/src/main/java/com/depromeet/presentation/seatReview/ReviewActivity.kt @@ -27,6 +27,7 @@ import com.depromeet.presentation.seatReview.dialog.DatePickerDialog import com.depromeet.presentation.seatReview.dialog.ImageUploadDialog import com.depromeet.presentation.seatReview.dialog.ReviewMySeatDialog import com.depromeet.presentation.seatReview.dialog.SelectSeatDialog +import com.depromeet.presentation.util.Utils import dagger.hilt.android.AndroidEntryPoint import java.io.FileNotFoundException import java.io.InputStream @@ -53,6 +54,10 @@ class ReviewActivity : BaseActivity({ override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) + Utils(this).apply { + setStatusBarColor(window, com.depromeet.designsystem.R.color.color_background_tertiary) + } + viewModel.getStadiumName() observeStadiumName() observePreSignedUrl() diff --git a/presentation/src/main/java/com/depromeet/presentation/util/Utils.kt b/presentation/src/main/java/com/depromeet/presentation/util/Utils.kt index 83f5dc4a..b2e94a6f 100644 --- a/presentation/src/main/java/com/depromeet/presentation/util/Utils.kt +++ b/presentation/src/main/java/com/depromeet/presentation/util/Utils.kt @@ -1,10 +1,20 @@ package com.depromeet.presentation.util +import android.app.Activity import android.content.Context import android.content.Intent +import android.os.Build +import android.view.View +import android.view.Window +import android.view.WindowInsetsController +import android.view.WindowManager +import androidx.annotation.ColorRes +import androidx.core.view.WindowCompat -object Utils { - fun restartApp(context: Context, toastMsg: String?) { +class Utils( + private val context: Context +) { + fun restartApp(toastMsg: String?) { val packageManager = context.packageManager val packageName = context.packageName val componentName = packageManager.getLaunchIntentForPackage(packageName)?.component @@ -14,4 +24,39 @@ object Utils { } Runtime.getRuntime().exit(0) } + + fun setStatusBarColor( + window: Window, + @ColorRes color: Int + ) { + window.statusBarColor = context.getColor(color) + } + + fun isStatusBarBlackIconColor( + window: Window + ) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { + window.insetsController?.setSystemBarsAppearance( + WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS, + WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS + ) + } else { + window.decorView.systemUiVisibility = + View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR + } + } + + fun isStatusBarWhiteIconColor( + window: Window + ) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { + window.insetsController?.setSystemBarsAppearance( + 0, + WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS + ) + } else { + + window.decorView.systemUiVisibility = 0 + } + } }