File tree Expand file tree Collapse file tree 3 files changed +9
-0
lines changed
camera/java/com/microsoft/reacttestapp/camera
main/java/com/microsoft/reacttestapp
reacthost-0.76/java/com/microsoft/reacttetapp/react Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ fun MainActivity.scanForQrCode() {
3333 }
3434 fragment.show(supportFragmentManager, QRCodeScannerFragment .TAG )
3535 }
36+
3637 shouldShowRequestPermissionRationale(Manifest .permission.CAMERA ) -> {
3738 Snackbar
3839 .make(
@@ -49,6 +50,7 @@ fun MainActivity.scanForQrCode() {
4950 }
5051 .show()
5152 }
53+
5254 else -> {
5355 ActivityCompat .requestPermissions(
5456 this ,
Original file line number Diff line number Diff line change @@ -201,21 +201,25 @@ class MainActivity : ReactActivity() {
201201 reload(BundleSource .Disk )
202202 true
203203 }
204+
204205 R .id.load_from_dev_server -> {
205206 PackagerConnectionSettings (this ).debugServerHost = " "
206207 reload(BundleSource .Server )
207208 true
208209 }
210+
209211 R .id.remember_last_component -> {
210212 val enable = ! menuItem.isChecked
211213 menuItem.isChecked = enable
212214 session.shouldRememberLastComponent = enable
213215 true
214216 }
217+
215218 R .id.scan_qr_code -> {
216219 scanForQrCode()
217220 true
218221 }
222+
219223 R .id.show_dev_options -> {
220224 val devSupportManager = if (BuildConfig .REACTAPP_USE_BRIDGELESS ) {
221225 (application as TestApp ).reactHost.devSupportManager
@@ -225,6 +229,7 @@ class MainActivity : ReactActivity() {
225229 devSupportManager?.showDevOptionsDialog()
226230 true
227231 }
232+
228233 else -> false
229234 }
230235 }
@@ -254,6 +259,7 @@ class MainActivity : ReactActivity() {
254259 .newInstance(component)
255260 .show(supportFragmentManager, ComponentBottomSheetDialogFragment .TAG )
256261 }
262+
257263 else -> {
258264 findActivityClass(component.name)?.let {
259265 startActivity(Intent (this , it))
Original file line number Diff line number Diff line change @@ -108,6 +108,7 @@ class MainReactNativeHost(
108108 BundleSource .Action .RELOAD -> {
109109 reactInstanceManager.devSupportManager.handleReloadJS()
110110 }
111+
111112 BundleSource .Action .RESTART -> {
112113 if (activity !is MainActivity ) {
113114 activity.navigateUpTo(Intent (application, MainActivity .Companion ::class .java))
You can’t perform that action at this time.
0 commit comments