Skip to content

Commit

Permalink
#186 / Application 함수화
Browse files Browse the repository at this point in the history
  • Loading branch information
haeti-dev committed Feb 18, 2024
1 parent 48f2986 commit 9b96f12
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions app/src/main/java/sopt/uni/UniApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,31 @@ import timber.log.Timber
class UniApplication : Application() {
override fun onCreate() {
super.onCreate()
initializeSparkleStorage()
initializeKakaoSdk()
initializeDebugTree()
setDefaultNightMode()
clearSharedPreferences()
}

private fun initializeSparkleStorage() {
SparkleStorage.init(this)
SparkleStorage.timerClear()
}

private fun initializeKakaoSdk() {
KakaoSdk.init(this, BuildConfig.KAKAO_APP_KEY)
}

private fun initializeDebugTree() {
if (BuildConfig.DEBUG) Timber.plant(Timber.DebugTree())
}

private fun setDefaultNightMode() {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)
}

private fun clearSharedPreferences() {
val sharedPreferences =
applicationContext.getSharedPreferences("timer_prefs", Context.MODE_PRIVATE)
val editor = sharedPreferences.edit()
Expand Down

0 comments on commit 9b96f12

Please sign in to comment.