diff --git a/app/src/main/java/com/github/libretube/activities/MainActivity.kt b/app/src/main/java/com/github/libretube/activities/MainActivity.kt index 79176eea4..2c3885e1a 100644 --- a/app/src/main/java/com/github/libretube/activities/MainActivity.kt +++ b/app/src/main/java/com/github/libretube/activities/MainActivity.kt @@ -36,7 +36,6 @@ import com.github.libretube.models.SearchViewModel import com.github.libretube.preferences.PreferenceHelper import com.github.libretube.preferences.PreferenceKeys import com.github.libretube.services.ClosingService -import com.github.libretube.util.LocaleHelper import com.github.libretube.util.NetworkHelper import com.github.libretube.util.ThemeHelper import com.google.android.material.dialog.MaterialAlertDialogBuilder @@ -54,9 +53,6 @@ class MainActivity : BaseActivity() { lateinit var searchView: SearchView override fun onCreate(savedInstanceState: Bundle?) { - // set the language - LocaleHelper.updateLanguage(this) - super.onCreate(savedInstanceState) autoRotationEnabled = PreferenceHelper.getBoolean(PreferenceKeys.AUTO_ROTATION, false) diff --git a/app/src/main/java/com/github/libretube/extensions/BaseActivity.kt b/app/src/main/java/com/github/libretube/extensions/BaseActivity.kt index cae26114a..da84ae45a 100644 --- a/app/src/main/java/com/github/libretube/extensions/BaseActivity.kt +++ b/app/src/main/java/com/github/libretube/extensions/BaseActivity.kt @@ -2,13 +2,20 @@ package com.github.libretube.extensions import android.os.Bundle import androidx.appcompat.app.AppCompatActivity +import com.github.libretube.util.LocaleHelper import com.github.libretube.util.ThemeHelper +/** + * Activity that applies the LibreTube theme and the in-app language + */ open class BaseActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { // set the app theme (e.g. Material You) ThemeHelper.updateTheme(this) + // set the apps language + LocaleHelper.updateLanguage(this) + super.onCreate(savedInstanceState) } }