-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: upgrade React Native to 0.76.3
- Loading branch information
1 parent
ff96499
commit a0a9942
Showing
40 changed files
with
7,365 additions
and
5,443 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 0 additions & 75 deletions
75
android/app/src/debug/java/com/bitpay/wallet/ReactNativeFlipper.java
This file was deleted.
Oops, something went wrong.
109 changes: 0 additions & 109 deletions
109
android/app/src/main/java/com/bitpay/wallet/MainActivity.java
This file was deleted.
Oops, something went wrong.
108 changes: 108 additions & 0 deletions
108
android/app/src/main/java/com/bitpay/wallet/MainActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
package com.bitpay.wallet | ||
|
||
import android.app.Activity | ||
import android.content.Intent | ||
import android.graphics.Color | ||
import android.os.Build | ||
import android.os.Bundle | ||
import android.view.View | ||
import android.view.WindowManager | ||
import com.braze.ui.inappmessage.BrazeInAppMessageManager | ||
import com.facebook.react.ReactActivity | ||
import com.facebook.react.ReactActivityDelegate | ||
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled | ||
import com.facebook.react.defaults.DefaultReactActivityDelegate | ||
import com.zoontek.rnbootsplash.RNBootSplash | ||
|
||
class MainActivity : ReactActivity() { | ||
|
||
/** | ||
* Returns the name of the main component registered from JavaScript. This is used to schedule | ||
* rendering of the component. | ||
*/ | ||
override fun getMainComponentName(): String = "BitPay" | ||
|
||
/** | ||
* Returns the instance of the [ReactActivityDelegate]. Here we use a util class [DefaultReactActivityDelegate] | ||
* which allows you to easily enable Fabric and Concurrent React (aka React 18) with two boolean flags. | ||
*/ | ||
override fun createReactActivityDelegate(): ReactActivityDelegate = | ||
DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled) | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(null) | ||
(application as MainApplication).addActivityToStack(this.javaClass) | ||
RNBootSplash.init(this, R.drawable.bootsplash) | ||
|
||
window.apply { | ||
setFlags( | ||
WindowManager.LayoutParams.FLAG_SECURE, | ||
WindowManager.LayoutParams.FLAG_SECURE | ||
) | ||
|
||
if (Build.VERSION.SDK_INT in 19..20) { | ||
setWindowFlag(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, true) | ||
} | ||
|
||
if (Build.VERSION.SDK_INT >= 19) { | ||
decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | ||
} | ||
|
||
// make fully Android Transparent Status bar | ||
if (Build.VERSION.SDK_INT >= 21) { | ||
setWindowFlag(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, false) | ||
statusBarColor = Color.TRANSPARENT | ||
} | ||
} | ||
} | ||
|
||
private fun setWindowFlag(bits: Int, on: Boolean) { | ||
val win = window | ||
val winParams = win.attributes | ||
if (on) { | ||
winParams.flags = winParams.flags or bits | ||
} else { | ||
winParams.flags = winParams.flags and bits.inv() | ||
} | ||
win.attributes = winParams | ||
} | ||
|
||
override fun onNewIntent(intent: Intent) { | ||
super.onNewIntent(intent) | ||
setIntent(intent) | ||
// Clear the intent data so that the next time the Activity is opened, | ||
// it will not be opened with old deeplink | ||
getIntent().data = null | ||
} | ||
|
||
override fun onResume() { | ||
super.onResume() | ||
// Registers the BrazeInAppMessageManager for the current Activity. This Activity will now listen for | ||
// in-app messages from Braze. | ||
BrazeInAppMessageManager.getInstance().registerInAppMessageManager(this) | ||
} | ||
|
||
override fun onPause() { | ||
super.onPause() | ||
// Unregisters the BrazeInAppMessageManager for the current Activity. | ||
BrazeInAppMessageManager.getInstance().unregisterInAppMessageManager(this) | ||
} | ||
|
||
override fun onDestroy() { | ||
super.onDestroy() | ||
(application as MainApplication).removeActivityFromStack(this.javaClass) | ||
} | ||
|
||
companion object { | ||
private fun setWindowFlag(activity: Activity, bits: Int, on: Boolean) { | ||
val win = activity.window | ||
val winParams = win.attributes | ||
if (on) { | ||
winParams.flags = winParams.flags or bits | ||
} else { | ||
winParams.flags = winParams.flags and bits.inv() | ||
} | ||
win.attributes = winParams | ||
} | ||
} | ||
} |
Oops, something went wrong.