Skip to content

Commit 89259e5

Browse files
committed
fix: configuration issues causing missing margin in download player
1 parent 47c3bf0 commit 89259e5

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

app/src/main/java/com/github/libretube/ui/base/BaseActivity.kt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package com.github.libretube.ui.base
22

33
import android.content.Context
44
import android.content.pm.ActivityInfo
5+
import android.content.res.Configuration
56
import android.os.Bundle
67
import androidx.appcompat.app.AppCompatActivity
78
import com.github.libretube.R
@@ -53,21 +54,17 @@ open class BaseActivity : AppCompatActivity() {
5354
}
5455

5556
override fun attachBaseContext(newBase: Context?) {
56-
if (newBase == null) {
57-
super.attachBaseContext(null)
58-
return
59-
}
57+
super.attachBaseContext(newBase)
6058

6159
// change the locale according to the user's preference (or system language as fallback)
6260
val locale = LocaleHelper.getAppLocale()
6361
Locale.setDefault(locale)
6462

65-
val configuration = newBase.resources.configuration.apply {
63+
val configuration = Configuration().apply {
6664
setLocale(locale)
6765
}
68-
val newContext = newBase.createConfigurationContext(configuration)
6966

70-
super.attachBaseContext(newContext)
67+
applyOverrideConfiguration(configuration)
7168
}
7269

7370
/**

0 commit comments

Comments
 (0)