mirror of
https://github.com/YTVanced/VancedManager
synced 2024-11-25 12:45:12 +00:00
added some comments
This commit is contained in:
parent
eb5a0c9764
commit
aa91076d07
4 changed files with 15 additions and 5 deletions
|
@ -6,6 +6,8 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
|||
import com.vanced.manager.R
|
||||
import com.vanced.manager.ui.core.ThemeActivity
|
||||
|
||||
// This activity will NOT be used in manifest
|
||||
// since MainActivity will extend it
|
||||
@SuppressLint("Registered")
|
||||
open class Main: ThemeActivity() {
|
||||
|
||||
|
|
|
@ -19,11 +19,7 @@ open class About : BaseFragment() {
|
|||
}
|
||||
|
||||
license.setOnClickListener {
|
||||
openUrl(
|
||||
"https://raw.githubusercontent.com/YTVanced/VancedInstaller/dev/LICENSE",
|
||||
R.color.GitHub
|
||||
)
|
||||
|
||||
openUrl("https://raw.githubusercontent.com/YTVanced/VancedInstaller/dev/LICENSE", R.color.GitHub)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ open class Home : BaseFragment() {
|
|||
|
||||
val pm = activity?.packageManager
|
||||
|
||||
//Damn that's a lot of buttons
|
||||
val microginstallbtn = getView()?.findViewById(R.id.microg_installbtn) as Button
|
||||
val microguninstallbtn = getView()?.findViewById(R.id.microg_uninstallbtn) as Button
|
||||
val microgsettingsbtn = getView()?.findViewById(R.id.microg_settingsbtn) as Button
|
||||
|
@ -29,6 +30,7 @@ open class Home : BaseFragment() {
|
|||
val twitterbtn = getView()?.findViewById(R.id.twitterbtn) as Button
|
||||
val redditbtn = getView()?.findViewById(R.id.redditbtn) as Button
|
||||
|
||||
//we need to check whether these apps are installed or not
|
||||
val microgStatus = pm?.let { isPackageInstalled("com.mgoogle.android.gms", it) }
|
||||
val vancedStatus = pm?.let { isPackageInstalled("com.vanced.android.youtube", it) }
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ import com.vanced.manager.R
|
|||
|
||||
@SuppressLint("Registered")
|
||||
open class ThemeActivity : AppCompatActivity() {
|
||||
|
||||
private lateinit var currentTheme: String
|
||||
private lateinit var pref: SharedPreferences
|
||||
|
||||
|
@ -31,12 +32,21 @@ open class ThemeActivity : AppCompatActivity() {
|
|||
override fun onResume() {
|
||||
val theme = pref.getString("theme_mode", "")
|
||||
super.onResume()
|
||||
//if for some weird reasons we get invalid
|
||||
//theme, recreate activity
|
||||
if (currentTheme != theme)
|
||||
recreate()
|
||||
|
||||
//set Task Header color in recents menu for
|
||||
//devices with lower Android version than Pie
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) {
|
||||
setTaskBG()
|
||||
}
|
||||
}
|
||||
|
||||
//This stupid ass AppCompatDelegate does
|
||||
//not want to work, so I have to use my
|
||||
//own implementation of theme switching
|
||||
private fun setFinalTheme(currentTheme: String) {
|
||||
when (currentTheme) {
|
||||
"LIGHT" -> setTheme(R.style.LightTheme_Blue)
|
||||
|
|
Loading…
Reference in a new issue