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.
@@ -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?.let { it.getString(BUNDLE_TITLE, "") } ?: ""
70
+ val title = bundle?.getString(BUNDLE_TITLE, "") ?: ""
60
71
 
61
72
  val toolbar = findViewById<Toolbar>(R.id.toolbar)
62
73
  setSupportActionBar(toolbar)
@@ -0,0 +1,3 @@
1
+ <resources>
2
+ <color name="surface">#F3EFEE</color>
3
+ </resources>
@@ -1,7 +1,7 @@
1
1
  <?xml version="1.0" encoding="utf-8"?>
2
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>
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>
@@ -0,0 +1,3 @@
1
+ <resources>
2
+ <color name="surface">#121212</color>
3
+ </resources>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-legal",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "description": "Acknowledge OSS libraries used in your React Native app",
5
5
  "keywords": [
6
6
  "react-native",
@@ -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>