From 5452ea74f4aeb5a96c0a261526eadde176370cb5 Mon Sep 17 00:00:00 2001 From: Ammar Githam Date: Fri, 28 May 2021 08:16:15 +0900 Subject: [PATCH] Convert BaseLanguageActivity to kotlin --- .../activities/BaseLanguageActivity.kt | 29 +++++++++---------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/awais/instagrabber/activities/BaseLanguageActivity.kt b/app/src/main/java/awais/instagrabber/activities/BaseLanguageActivity.kt index aeaad606..f61171ac 100755 --- a/app/src/main/java/awais/instagrabber/activities/BaseLanguageActivity.kt +++ b/app/src/main/java/awais/instagrabber/activities/BaseLanguageActivity.kt @@ -1,21 +1,18 @@ -package awais.instagrabber.activities; +package awais.instagrabber.activities -import android.os.Bundle; +import android.os.Bundle +import androidx.appcompat.app.AppCompatActivity +import awais.instagrabber.utils.LocaleUtils +import awais.instagrabber.utils.ThemeUtils -import androidx.annotation.Nullable; -import androidx.appcompat.app.AppCompatActivity; - -import awais.instagrabber.utils.LocaleUtils; -import awais.instagrabber.utils.ThemeUtils; - -public abstract class BaseLanguageActivity extends AppCompatActivity { - protected BaseLanguageActivity() { - LocaleUtils.updateConfig(this); +abstract class BaseLanguageActivity protected constructor() : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + ThemeUtils.changeTheme(this) + super.onCreate(savedInstanceState) } - @Override - protected void onCreate(@Nullable final Bundle savedInstanceState) { - ThemeUtils.changeTheme(this); - super.onCreate(savedInstanceState); + init { + @Suppress("LeakingThis") + LocaleUtils.updateConfig(this) } -} +} \ No newline at end of file