-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwithRNOrientationMainActivity.spec.ts.snap
More file actions
57 lines (44 loc) · 2.33 KB
/
withRNOrientationMainActivity.spec.ts.snap
File metadata and controls
57 lines (44 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`withRNOrientationMainActivity updates the MainActivity.kt with both import and method implementation 1`] = `
"package com.orientationdirectorexample
import android.content.Intent
import android.content.res.Configuration
import android.os.Bundle
import com.facebook.react.ReactActivity
import com.facebook.react.ReactActivityDelegate
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
import com.facebook.react.defaults.DefaultReactActivityDelegate
// React Native Orientation Director @generated begin @react-native-orientation-director/library-import - expo prebuild (DO NOT MODIFY) sync-dd77fee7fe624fed474053ea60c3105920a01a6a
import com.orientationdirector.implementation.ConfigurationChangedBroadcastReceiver
// React Native Orientation Director @generated end @react-native-orientation-director/library-import
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 = "OrientationDirectorExample"
/**
* Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
* which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
*/
override fun createReactActivityDelegate(): ReactActivityDelegate =
DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(null)
}
// React Native Orientation Director @generated begin @react-native-orientation-director/supportedInterfaceOrientationsFor-implementation - expo prebuild (DO NOT MODIFY) sync-7a5cdf10057b2ddf1bcf4593bf408862cbed5473
override fun onConfigurationChanged(newConfig: Configuration) {
super.onConfigurationChanged(newConfig)
val orientationDirectorCustomAction =
packageName + "." + ConfigurationChangedBroadcastReceiver.CUSTOM_INTENT_ACTION
val intent =
Intent(orientationDirectorCustomAction).apply {
putExtra("newConfig", newConfig)
setPackage(packageName)
}
this.sendBroadcast(intent)
}
// React Native Orientation Director @generated end @react-native-orientation-director/supportedInterfaceOrientationsFor-implementation
}
"
`;