mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-13 13:50:30 +05:30
Merge pull request #252 from nin0-dev/master
Fixed dynamic color on Android 12+
This commit is contained in:
commit
c366dc9c95
@ -39,6 +39,7 @@ class MainActivity : AppCompatActivity() {
|
||||
lateinit var navController : NavController
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
DynamicColors.applyToActivityIfAvailable(this)
|
||||
super.onCreate(savedInstanceState)
|
||||
val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this)
|
||||
RetrofitInstance.url = sharedPreferences.getString("instance", "https://pipedapi.kavin.rocks/")!!
|
||||
@ -49,7 +50,7 @@ class MainActivity : AppCompatActivity() {
|
||||
SponsorBlockSettings.sponsorsEnabled = sharedPreferences.getBoolean("sponsors_category_key", false)
|
||||
SponsorBlockSettings.outroEnabled = sharedPreferences.getBoolean("outro_category_key", false)
|
||||
|
||||
DynamicColors.applyToActivitiesIfAvailable(application)
|
||||
|
||||
val languageName = sharedPreferences.getString("language", "sys")
|
||||
if (languageName != "") {
|
||||
var locale = if (languageName != "sys" && "$languageName".length < 3 ){
|
||||
|
@ -4,6 +4,7 @@ import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.content.DialogInterface
|
||||
import android.content.Intent
|
||||
import com.google.android.material.color.DynamicColors
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import android.os.Bundle
|
||||
|
||||
@ -12,6 +13,7 @@ class Player : Activity() {
|
||||
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
DynamicColors.applyToActivityIfAvailable(this)
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_player)
|
||||
|
||||
|
@ -19,6 +19,7 @@ import androidx.appcompat.app.AppCompatDelegate
|
||||
import androidx.core.app.ActivityCompat
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.google.android.material.color.DynamicColors
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.preference.ListPreference
|
||||
import androidx.preference.Preference
|
||||
@ -36,6 +37,7 @@ class SettingsActivity : AppCompatActivity(),
|
||||
SharedPreferences.OnSharedPreferenceChangeListener{
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
DynamicColors.applyToActivityIfAvailable(this)
|
||||
super.onCreate(savedInstanceState)
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
overridePendingTransition(50, 50);
|
||||
@ -352,4 +354,4 @@ class SettingsActivity : AppCompatActivity(),
|
||||
startActivity(intent)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user