craft-native 0.0.223 → 0.0.224

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.
@@ -92,6 +92,7 @@ import android.widget.Switch
92
92
  import android.widget.TextView
93
93
  import android.widget.MediaController
94
94
  import android.widget.VideoView
95
+ import androidx.activity.OnBackPressedCallback
95
96
  import androidx.appcompat.app.AppCompatActivity
96
97
  import androidx.appcompat.app.AppCompatDelegate
97
98
  import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
@@ -3826,6 +3827,9 @@ class MainActivity : AppCompatActivity() {
3826
3827
  override fun onCreate(savedInstanceState: Bundle?) {
3827
3828
  applyConfiguredAppearance()
3828
3829
  super.onCreate(savedInstanceState)
3830
+ onBackPressedDispatcher.addCallback(this, object : OnBackPressedCallback(true) {
3831
+ override fun handleOnBackPressed() = handleNativeBack()
3832
+ })
3829
3833
  initialDeepLink = savedInstanceState?.getString("craft.initialDeepLink")?.let(Uri::parse) ?: intent?.data
3830
3834
  initialDeepLinkClaimed = savedInstanceState?.getBoolean("craft.initialDeepLinkClaimed", false) ?: false
3831
3835
  deliveredInitialDeepLink = savedInstanceState?.getBoolean("craft.deliveredInitialDeepLink", false) ?: false
@@ -3987,8 +3991,7 @@ class MainActivity : AppCompatActivity() {
3987
3991
  }
3988
3992
 
3989
3993
  private fun onBackPressedDispatcherCompat() {
3990
- @Suppress("DEPRECATION")
3991
- onBackPressed()
3994
+ onBackPressedDispatcher.onBackPressed()
3992
3995
  }
3993
3996
 
3994
3997
  private fun haptic() {
@@ -7286,7 +7289,9 @@ class MainActivity : AppCompatActivity() {
7286
7289
  }
7287
7290
 
7288
7291
  @Deprecated("Uses the activity back callback for native route navigation")
7289
- override fun onBackPressed() {
7292
+ override fun onBackPressed() = handleNativeBack()
7293
+
7294
+ private fun handleNativeBack() {
7290
7295
  val screen = screens.lastOrNull() ?: return back()
7291
7296
  val modal = screen.modalVisibility.entries.lastOrNull { (view, visible) -> visible && view.visibility == View.VISIBLE }
7292
7297
  if (modal != null) {
package/dist/cli.js CHANGED
@@ -3424,7 +3424,7 @@ function pinCraftNativeDependency(packagePath, craftVersion) {
3424
3424
  `);
3425
3425
  }
3426
3426
  // package.json
3427
- var version = "0.0.223";
3427
+ var version = "0.0.224";
3428
3428
 
3429
3429
  // bin/cli.ts
3430
3430
  var spawnedFrom = process6.env[CRAFT_CLI_SPAWN_MARKER];
package/dist/index.cjs CHANGED
@@ -309,7 +309,7 @@ function craftBinaryNotFoundMessage(triedPath) {
309
309
  `);
310
310
  }
311
311
  // package.json
312
- var version = "0.0.223";
312
+ var version = "0.0.224";
313
313
 
314
314
  // src/sdk-version.ts
315
315
  var SDK_VERSION = version;
package/dist/index.js CHANGED
@@ -57,7 +57,7 @@ function craftBinaryNotFoundMessage(triedPath) {
57
57
  `);
58
58
  }
59
59
  // package.json
60
- var version = "0.0.223";
60
+ var version = "0.0.224";
61
61
 
62
62
  // src/sdk-version.ts
63
63
  var SDK_VERSION = version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "craft-native",
3
- "version": "0.0.223",
3
+ "version": "0.0.224",
4
4
  "type": "module",
5
5
  "description": "Build desktop apps with web languages - TypeScript SDK for Craft",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",