Skip to content

Commit 4258f10

Browse files
committed
Фикс ночной темы
1 parent b03be12 commit 4258f10

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

app/src/main/java/com/apochromat/codeblockmobile/ProjectActivity.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import android.os.Looper
88
import android.view.Menu
99
import android.view.MenuItem
1010
import android.widget.Toast
11+
import androidx.appcompat.app.AppCompatDelegate
1112
import androidx.core.view.GravityCompat
1213
import androidx.recyclerview.widget.ItemTouchHelper
1314
import androidx.recyclerview.widget.LinearLayoutManager
@@ -34,6 +35,7 @@ class ProjectActivity : AppCompatActivity() {
3435
}
3536

3637
override fun onCreate(savedInstanceState: Bundle?) {
38+
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)
3739
super.onCreate(savedInstanceState)
3840
bindingClass = ActivityProjectBinding.inflate(layoutInflater)
3941
setContentView(bindingClass.root)

app/src/main/res/values/themes.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<resources xmlns:tools="http://schemas.android.com/tools">
22
<!-- Base application theme. -->
33
<style name="Theme.CodeblockMobile" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
4+
5+
<item name="android:forceDarkAllowed" tools:targetApi="q">false</item>
46
<!-- Primary brand color. -->
57
<item name="colorPrimary">@color/dark_blue</item>
68
<item name="colorPrimaryVariant">@color/dark_blue</item>
@@ -14,6 +16,7 @@
1416
<!-- Customize your theme here. -->
1517
</style>
1618
<style name="Theme.CodeblockMobile.NoActionBar">
19+
<item name="android:forceDarkAllowed" tools:targetApi="q">false</item>
1720
<item name="windowActionBar">false</item>
1821
<item name="windowNoTitle">true</item>
1922
<item name="android:windowFullscreen">true</item>

0 commit comments

Comments
 (0)