react-native-legal 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/com/reactnativelegal/ReactNativeLegalActivity.kt +12 -1
- package/android/src/main/res/values/colors.xml +3 -0
- package/android/src/main/res/values/styles.xml +4 -4
- package/android/src/main/res/values-night/colors.xml +3 -0
- package/package.json +1 -1
- package/android/src/main/res/values-v29/styles.xml +0 -8
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
package com.reactnativelegal
|
|
2
2
|
|
|
3
3
|
import android.content.pm.PackageManager
|
|
4
|
+
import android.content.res.Configuration
|
|
4
5
|
import android.os.Bundle
|
|
5
6
|
import android.view.MenuItem
|
|
6
7
|
import android.view.View
|
|
7
8
|
import androidx.appcompat.app.AppCompatActivity
|
|
8
9
|
import androidx.appcompat.widget.Toolbar
|
|
10
|
+
import androidx.core.view.WindowCompat
|
|
9
11
|
import androidx.core.view.WindowInsetsCompat
|
|
10
12
|
import androidx.core.view.updatePadding
|
|
11
13
|
import com.mikepenz.aboutlibraries.LibsBuilder.Companion.BUNDLE_TITLE
|
|
@@ -23,6 +25,15 @@ class ReactNativeLegalActivity : AppCompatActivity() {
|
|
|
23
25
|
super.onCreate(savedInstanceState)
|
|
24
26
|
setContentView(R.layout.activity_licenses)
|
|
25
27
|
|
|
28
|
+
val isLightTheme =
|
|
29
|
+
resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK !=
|
|
30
|
+
Configuration.UI_MODE_NIGHT_YES
|
|
31
|
+
|
|
32
|
+
WindowCompat.getInsetsController(window, window.decorView).apply {
|
|
33
|
+
isAppearanceLightStatusBars = isLightTheme
|
|
34
|
+
isAppearanceLightNavigationBars = isLightTheme
|
|
35
|
+
}
|
|
36
|
+
|
|
26
37
|
val bundle = intent.extras
|
|
27
38
|
fragment = LibsSupportFragment().apply { arguments = bundle }
|
|
28
39
|
|
|
@@ -56,7 +67,7 @@ class ReactNativeLegalActivity : AppCompatActivity() {
|
|
|
56
67
|
}
|
|
57
68
|
|
|
58
69
|
private fun setupToolbar(bundle: Bundle?) {
|
|
59
|
-
val title = bundle?.
|
|
70
|
+
val title = bundle?.getString(BUNDLE_TITLE, "") ?: ""
|
|
60
71
|
|
|
61
72
|
val toolbar = findViewById<Toolbar>(R.id.toolbar)
|
|
62
73
|
setSupportActionBar(toolbar)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="utf-8"?>
|
|
2
2
|
<resources>
|
|
3
|
-
<style name="ReactNativeLegalTheme" parent="Theme.MaterialComponents.
|
|
4
|
-
<item name="android:statusBarColor"
|
|
5
|
-
<item name="android:windowBackground"
|
|
3
|
+
<style name="ReactNativeLegalTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
|
4
|
+
<item name="android:statusBarColor">?attr/colorSurface</item>
|
|
5
|
+
<item name="android:windowBackground">?attr/colorSurface</item>
|
|
6
6
|
</style>
|
|
7
|
-
</resources>
|
|
7
|
+
</resources>
|
package/package.json
CHANGED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<resources>
|
|
3
|
-
<style name="ReactNativeLegalTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
|
|
4
|
-
<item name="android:statusBarColor">#F3EFEE</item>
|
|
5
|
-
<item name="android:windowBackground">#F3EFEE</item>
|
|
6
|
-
<item name="android:forceDarkAllowed">false</item>
|
|
7
|
-
</style>
|
|
8
|
-
</resources>
|