mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 07:50:31 +05:30
fix: configuration issues causing missing margin in download player
This commit is contained in:
parent
47c3bf0ffe
commit
89259e56a0
@ -2,6 +2,7 @@ package com.github.libretube.ui.base
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.pm.ActivityInfo
|
import android.content.pm.ActivityInfo
|
||||||
|
import android.content.res.Configuration
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import com.github.libretube.R
|
import com.github.libretube.R
|
||||||
@ -53,21 +54,17 @@ open class BaseActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun attachBaseContext(newBase: Context?) {
|
override fun attachBaseContext(newBase: Context?) {
|
||||||
if (newBase == null) {
|
super.attachBaseContext(newBase)
|
||||||
super.attachBaseContext(null)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// change the locale according to the user's preference (or system language as fallback)
|
// change the locale according to the user's preference (or system language as fallback)
|
||||||
val locale = LocaleHelper.getAppLocale()
|
val locale = LocaleHelper.getAppLocale()
|
||||||
Locale.setDefault(locale)
|
Locale.setDefault(locale)
|
||||||
|
|
||||||
val configuration = newBase.resources.configuration.apply {
|
val configuration = Configuration().apply {
|
||||||
setLocale(locale)
|
setLocale(locale)
|
||||||
}
|
}
|
||||||
val newContext = newBase.createConfigurationContext(configuration)
|
|
||||||
|
|
||||||
super.attachBaseContext(newContext)
|
applyOverrideConfiguration(configuration)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user