rn-system-bar 3.0.0 → 3.0.2

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.
@@ -3,13 +3,13 @@
3
3
  // ─────────────────────────────────────────────
4
4
 
5
5
  buildscript {
6
- ext.kotlin_version = "1.9.0"
6
+ ext.kotlin_version = "2.1.20"
7
7
  repositories {
8
8
  google()
9
9
  mavenCentral()
10
10
  }
11
11
  dependencies {
12
- classpath "com.android.tools.build:gradle:8.1.1"
12
+ classpath "com.android.tools.build:gradle:8.5.0"
13
13
  classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14
14
  }
15
15
  }
@@ -18,12 +18,12 @@ apply plugin: "com.android.library"
18
18
  apply plugin: "kotlin-android"
19
19
 
20
20
  android {
21
- compileSdkVersion 34
21
+ compileSdk 36
22
22
  namespace "com.systembar"
23
23
 
24
24
  defaultConfig {
25
- minSdkVersion 21
26
- targetSdkVersion 34
25
+ minSdk 24
26
+ targetSdk 36
27
27
  }
28
28
 
29
29
  compileOptions {
@@ -25,7 +25,7 @@ class SystemBarModule(
25
25
  override fun getName(): String = "SystemBar"
26
26
 
27
27
  // ── Helper ─────────────────────────────────────
28
- private fun activity(): Activity? = currentActivity
28
+ private fun activity(): Activity? = reactContext.currentActivity
29
29
 
30
30
  private fun audioManager(): AudioManager =
31
31
  reactContext.getSystemService(Context.AUDIO_SERVICE) as AudioManager
@@ -135,17 +135,19 @@ class SystemBarModule(
135
135
  act.runOnUiThread {
136
136
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
137
137
  val controller = act.window.insetsController ?: return@runOnUiThread
138
+ // BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE is the only non-deprecated
139
+ // constant on API 30+. "inset-swipe" and "inset-touch" both map to
140
+ // the default persistent behavior (bars are always visible after show).
138
141
  controller.systemBarsBehavior = when (behavior) {
139
- "inset-swipe" ->
140
- WindowInsetsController.BEHAVIOR_SHOW_BARS_BY_SWIPE
141
- "inset-touch" ->
142
- WindowInsetsController.BEHAVIOR_SHOW_BARS_BY_TOUCH
143
- else -> // "overlay-swipe" (default)
142
+ "overlay-swipe" ->
144
143
  WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
144
+ else ->
145
+ // "inset-swipe" / "inset-touch": bars stay visible after swipe
146
+ @Suppress("DEPRECATION")
147
+ WindowInsetsController.BEHAVIOR_SHOW_BARS_BY_SWIPE
145
148
  }
146
149
  }
147
- // API < 30: behavior is controlled via systemUiVisibility flags
148
- // IMMERSIVE_STICKY is the closest to overlay-swipe on older APIs
150
+ // API < 30: behavior is controlled via IMMERSIVE_STICKY flag
149
151
  }
150
152
  }
151
153
 
@@ -15,6 +15,7 @@ class SystemBarPackage : ReactPackage {
15
15
  reactContext: ReactApplicationContext
16
16
  ): List<NativeModule> = listOf(SystemBarModule(reactContext))
17
17
 
18
+ @Suppress("DEPRECATION")
18
19
  override fun createViewManagers(
19
20
  reactContext: ReactApplicationContext
20
21
  ): List<ViewManager<*, *>> = emptyList()
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "rn-system-bar",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
4
4
  "description": "Control Android & iOS system bars, brightness, volume, orientation and screen flags from React Native.",
5
5
  "main": "index.ts",
6
6
  "react-native": "index.ts",
7
7
  "types": "src/types.ts",
8
+ "homepage": "https://github.com/your-org/rn-system-bar",
8
9
  "license": "MIT",
9
10
  "author": "Your Name",
10
11
  "keywords": [
@@ -30,10 +31,5 @@
30
31
  "peerDependencies": {
31
32
  "react": ">=18.0.0",
32
33
  "react-native": ">=0.73.0"
33
- },
34
- "codegenConfig": {
35
- "name": "RNSystemBarSpec",
36
- "type": "modules",
37
- "jsSrcsDir": "specs"
38
34
  }
39
35
  }