react-native-acoustic-connect-beta 16.0.5 → 16.0.7
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.
- package/Example/nativebase-v3-kitchensink/android/app/build.gradle +102 -81
- package/Example/nativebase-v3-kitchensink/android/app/src/debug/AndroidManifest.xml +1 -2
- package/Example/nativebase-v3-kitchensink/android/app/src/debug/java/com/geekyants/kitchensinkappnativebase/ReactNativeFlipper.java +10 -4
- package/Example/nativebase-v3-kitchensink/android/app/src/main/AndroidManifest.xml +3 -3
- package/Example/nativebase-v3-kitchensink/android/app/src/main/java/com/geekyants/kitchensinkappnativebase/MainActivity.java +14 -12
- package/Example/nativebase-v3-kitchensink/android/app/src/main/java/com/geekyants/kitchensinkappnativebase/MainApplication.java +41 -55
- package/Example/nativebase-v3-kitchensink/android/app/src/main/java/com/geekyants/kitchensinkappnativebase/generated/BasePackageList.java +21 -0
- package/Example/nativebase-v3-kitchensink/android/build.gradle +15 -25
- package/Example/nativebase-v3-kitchensink/android/gradle.properties +20 -3
- package/Example/nativebase-v3-kitchensink/android/settings.gradle +1 -1
- package/Example/nativebase-v3-kitchensink/babel.config.js +7 -1
- package/Example/nativebase-v3-kitchensink/ios/.xcode.env +11 -0
- package/Example/nativebase-v3-kitchensink/ios/KitchenSinkappnativebase/AppDelegate.h +2 -3
- package/Example/nativebase-v3-kitchensink/ios/KitchenSinkappnativebase/AppDelegate.m +10 -69
- package/Example/nativebase-v3-kitchensink/ios/KitchenSinkappnativebase/Images.xcassets/AppIcon.appiconset/Contents.json +7 -116
- package/Example/nativebase-v3-kitchensink/ios/KitchenSinkappnativebase/Info.plist +4 -0
- package/Example/nativebase-v3-kitchensink/ios/KitchenSinkappnativebase.xcodeproj/project.pbxproj +47 -37
- package/Example/nativebase-v3-kitchensink/ios/Podfile +105 -53
- package/Example/nativebase-v3-kitchensink/ios/Podfile.properties.json +2 -1
- package/Example/nativebase-v3-kitchensink/ios/build/XCBuildData/a6b76eb483287825e3d8acec0a94d196.xcbuilddata/build-request.json +27 -0
- package/Example/nativebase-v3-kitchensink/ios/build/XCBuildData/a6b76eb483287825e3d8acec0a94d196.xcbuilddata/description.msgpack +0 -0
- package/Example/nativebase-v3-kitchensink/ios/build/XCBuildData/a6b76eb483287825e3d8acec0a94d196.xcbuilddata/manifest.json +1 -0
- package/Example/nativebase-v3-kitchensink/ios/build/XCBuildData/a6b76eb483287825e3d8acec0a94d196.xcbuilddata/target-graph.txt +1 -0
- package/Example/nativebase-v3-kitchensink/ios/build/XCBuildData/a6b76eb483287825e3d8acec0a94d196.xcbuilddata/task-store.msgpack +0 -0
- package/Example/nativebase-v3-kitchensink/ios/build/XCBuildData/c0fec93a979a5e37e3134ca391db148a.xcbuilddata/build-request.json +27 -0
- package/Example/nativebase-v3-kitchensink/ios/build/XCBuildData/c0fec93a979a5e37e3134ca391db148a.xcbuilddata/description.msgpack +0 -0
- package/Example/nativebase-v3-kitchensink/ios/build/XCBuildData/c0fec93a979a5e37e3134ca391db148a.xcbuilddata/manifest.json +1 -0
- package/Example/nativebase-v3-kitchensink/ios/build/XCBuildData/c0fec93a979a5e37e3134ca391db148a.xcbuilddata/target-graph.txt +1 -0
- package/Example/nativebase-v3-kitchensink/ios/build/XCBuildData/c0fec93a979a5e37e3134ca391db148a.xcbuilddata/task-store.msgpack +0 -0
- package/Example/nativebase-v3-kitchensink/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm +2008 -0
- package/Example/nativebase-v3-kitchensink/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h +2448 -0
- package/Example/nativebase-v3-kitchensink/ios/build/generated/ios/FBReactNativeSpecJSI-generated.cpp +1523 -0
- package/Example/nativebase-v3-kitchensink/ios/build/generated/ios/FBReactNativeSpecJSI.h +5509 -0
- package/Example/nativebase-v3-kitchensink/ios/build/generated/ios/React-Codegen.podspec.json +1 -0
- package/Example/nativebase-v3-kitchensink/metro.config.js +12 -14
- package/Example/nativebase-v3-kitchensink/package.json +21 -18
- package/Example/nativebase-v3-kitchensink/src/components/RootComponent.tsx +3 -3
- package/Example/nativebase-v3-kitchensink/src/nb/NativeBase/src/core/NativeBaseProvider.tsx +2 -2
- package/GroovyUtils/psgrep.sh +1 -0
- package/Jenkinsfile +27 -25
- package/android/config.gradle +4 -4
- package/android/src/main/assets/ConnectAdvancedConfig.json +3 -0
- package/android/src/main/assets/TealeafBasicConfig.properties +26 -68
- package/android/src/main/assets/TealeafLayoutConfig.json +1 -26
- package/android/src/main/java/com/tl/uic/rncxa/RNCxaModule.java +127 -100
- package/android/src/main/java/com/tl/uic/rncxa/RNCxaPackage.java +7 -3
- package/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm +0 -0
- package/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h +0 -0
- package/ios/build/generated/ios/React-Codegen.podspec.json +1 -0
- package/latestChanges +0 -1
- package/package.json +1 -1
- package/Example/nativebase-v3-kitchensink/android/app/BUCK +0 -55
- package/Example/nativebase-v3-kitchensink/android/app/build_defs.bzl +0 -19
- package/Example/nativebase-v3-kitchensink/ios/KitchenSinkappnativebase/noop-file.swift +0 -4
- package/Example/nativebase-v3-kitchensink/iosSDKDebug/KitchenSinkappnativebase.xcodeproj/project.pbxproj +0 -543
- package/Example/nativebase-v3-kitchensink/iosSDKDebug/KitchenSinkappnativebase.xcodeproj/xcshareddata/xcschemes/KitchenSinkappnativebase.xcscheme +0 -100
- package/Example/nativebase-v3-kitchensink/iosSDKDebug/KitchenSinkappnativebase.xcworkspace/contents.xcworkspacedata +0 -13
- package/Example/nativebase-v3-kitchensink/iosSDKDebug/KitchenSinkappnativebaseDebugSDK.xcworkspace/contents.xcworkspacedata +0 -10
- package/Example/nativebase-v3-kitchensink/iosSDKDebug/KitchenSinkappnativebaseDebugSDK.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/Example/nativebase-v3-kitchensink/iosSDKDebug/Podfile +0 -51
- package/Example/nativebase-v3-kitchensink/node/.expo/README.md +0 -17
- package/Example/nativebase-v3-kitchensink/node/.expo/settings.json +0 -8
- package/Example/nativebase-v3-kitchensink/yarn.lock +0 -13679
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
// prohibited.
|
|
9
9
|
//
|
|
10
10
|
|
|
11
|
-
|
|
12
11
|
package com.tl.uic.rncxa;
|
|
13
12
|
|
|
14
13
|
import android.app.Activity;
|
|
@@ -21,23 +20,24 @@ import android.view.inputmethod.InputMethodManager;
|
|
|
21
20
|
import android.widget.EditText;
|
|
22
21
|
import android.widget.TextView;
|
|
23
22
|
|
|
23
|
+
import androidx.annotation.NonNull;
|
|
24
|
+
|
|
24
25
|
import com.facebook.react.bridge.LifecycleEventListener;
|
|
25
26
|
import com.facebook.react.bridge.Promise;
|
|
26
27
|
import com.facebook.react.bridge.ReactApplicationContext;
|
|
27
28
|
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
28
29
|
import com.facebook.react.bridge.ReactMethod;
|
|
29
30
|
import com.facebook.react.bridge.ReadableMap;
|
|
30
|
-
import com.facebook.react.uimanager.NativeViewHierarchyManager;
|
|
31
|
-
import com.facebook.react.uimanager.UIBlock;
|
|
32
31
|
import com.facebook.react.uimanager.UIManagerModule;
|
|
33
32
|
import com.ibm.eo.EOCore;
|
|
34
33
|
import com.ibm.eo.model.EOMonitoringLevel;
|
|
35
|
-
import com.
|
|
34
|
+
import com.acoustic.connect.android.connectmod.Connect;
|
|
36
35
|
import com.tl.uic.model.ScreenviewType;
|
|
37
36
|
import com.tl.uic.util.LayoutUtil;
|
|
38
37
|
|
|
39
38
|
import java.util.HashMap;
|
|
40
39
|
import java.util.Map;
|
|
40
|
+
import java.util.Objects;
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
/**
|
|
@@ -56,6 +56,7 @@ public class RNCxaModule extends ReactContextBaseJavaModule implements Lifecycle
|
|
|
56
56
|
this.reactContext.addLifecycleEventListener(this);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
@NonNull
|
|
59
60
|
@Override
|
|
60
61
|
public String getName() {
|
|
61
62
|
return "RNCxa";
|
|
@@ -69,10 +70,11 @@ public class RNCxaModule extends ReactContextBaseJavaModule implements Lifecycle
|
|
|
69
70
|
*/
|
|
70
71
|
@ReactMethod
|
|
71
72
|
public void setCurrentScreenName(final String logicalPageName, final Promise promise) {
|
|
72
|
-
boolean result = Connect.resumeConnect(getCurrentActivity(), logicalPageName, false);
|
|
73
|
+
boolean result = Connect.INSTANCE.resumeConnect(getCurrentActivity(), logicalPageName, false);
|
|
73
74
|
updateResult(result, promise);
|
|
74
75
|
}
|
|
75
76
|
|
|
77
|
+
// TODO fix
|
|
76
78
|
/**
|
|
77
79
|
* @param readableMap
|
|
78
80
|
* @param moduleName
|
|
@@ -160,7 +162,7 @@ public class RNCxaModule extends ReactContextBaseJavaModule implements Lifecycle
|
|
|
160
162
|
map.put(entry.getKey(), entry.getValue().toString());
|
|
161
163
|
}
|
|
162
164
|
|
|
163
|
-
final boolean result = Connect.logCustomEvent(eventName, map, logLevel);
|
|
165
|
+
final boolean result = Connect.INSTANCE.logCustomEvent(eventName, map, logLevel);
|
|
164
166
|
updateResult(result, promise);
|
|
165
167
|
}
|
|
166
168
|
|
|
@@ -174,7 +176,7 @@ public class RNCxaModule extends ReactContextBaseJavaModule implements Lifecycle
|
|
|
174
176
|
*/
|
|
175
177
|
@ReactMethod
|
|
176
178
|
public void logExceptionEvent(final String message, final String stackInfo, final Boolean unhandled, final Promise promise) {
|
|
177
|
-
final boolean result = Connect.logExceptionEvent("React Plugin", message, stackInfo, unhandled);
|
|
179
|
+
final boolean result = Connect.INSTANCE.logExceptionEvent("React Plugin", message, stackInfo, unhandled);
|
|
178
180
|
updateResult(result, promise);
|
|
179
181
|
}
|
|
180
182
|
|
|
@@ -187,27 +189,25 @@ public class RNCxaModule extends ReactContextBaseJavaModule implements Lifecycle
|
|
|
187
189
|
*/
|
|
188
190
|
@ReactMethod
|
|
189
191
|
public void logScreenLayout(final String logicalPageName, final int delay, final Promise promise) {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
Connect.setCurrentLogicalPageName(logicalPageName);
|
|
194
|
-
Connect.logScreenview(getCurrentActivity(), logicalPageName, ScreenviewType.LOAD);
|
|
192
|
+
// Init current page, check before loglayout.
|
|
193
|
+
Connect.INSTANCE.setCurrentLogicalPageName(logicalPageName);
|
|
194
|
+
Connect.INSTANCE.logScreenview(getCurrentActivity(), logicalPageName, ScreenviewType.LOAD);
|
|
195
195
|
if (LayoutUtil.canCaptureUserEvents(null, logicalPageName)) {
|
|
196
|
-
final boolean result = Connect.logScreenLayout(getCurrentActivity(), logicalPageName, delay < 0 ? 300 : delay, true);
|
|
196
|
+
final boolean result = Connect.INSTANCE.logScreenLayout(Objects.requireNonNull(getCurrentActivity()), logicalPageName, delay < 0 ? 300 : delay, true);
|
|
197
197
|
updateResult(result, promise);
|
|
198
198
|
}
|
|
199
199
|
updateResult(true, promise);
|
|
200
200
|
}
|
|
201
201
|
|
|
202
202
|
/**
|
|
203
|
-
* Log GeoLocation. Below permission is need in the
|
|
203
|
+
* Log GeoLocation. Below permission is need in the AndroidManifest.xml file.
|
|
204
204
|
* <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
|
205
205
|
*
|
|
206
|
-
* @param promise
|
|
206
|
+
* @param promise Promise used to get result.
|
|
207
207
|
*/
|
|
208
208
|
@ReactMethod
|
|
209
209
|
public void logLocation(final Promise promise) {
|
|
210
|
-
final boolean result = Connect.logGeolocation(EOMonitoringLevel.kEOMonitoringLevelInfo.getValue());
|
|
210
|
+
final boolean result = Connect.INSTANCE.logGeolocation(EOMonitoringLevel.kEOMonitoringLevelInfo.getValue());
|
|
211
211
|
updateResult(result, promise);
|
|
212
212
|
}
|
|
213
213
|
|
|
@@ -224,60 +224,57 @@ public class RNCxaModule extends ReactContextBaseJavaModule implements Lifecycle
|
|
|
224
224
|
*/
|
|
225
225
|
@ReactMethod
|
|
226
226
|
public void logLocationUpdateWithLatitude(final double lat, final double lng, final int logLevel, final Promise promise) {
|
|
227
|
-
final boolean result = Connect.logLocationUpdateEventWithLatitude(lat, lng, logLevel);
|
|
227
|
+
final boolean result = Connect.INSTANCE.logLocationUpdateEventWithLatitude(lat, lng, logLevel);
|
|
228
228
|
updateResult(result, promise);
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
/**
|
|
232
232
|
* Add focus listener to handle EditText UI control.
|
|
233
233
|
*
|
|
234
|
-
* @param textView
|
|
235
|
-
* @param accessibilityID
|
|
236
|
-
* @param activity
|
|
234
|
+
* @param textView Input TextView.
|
|
235
|
+
* @param accessibilityID Accessibility ID(virtual id).
|
|
236
|
+
* @param activity Current activity.
|
|
237
237
|
*/
|
|
238
238
|
public void addFocusAndRegister(final TextView textView, final String accessibilityID, final Activity activity) {
|
|
239
|
-
textView.setOnFocusChangeListener(
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
Connect.logEvent(keyboardView, Connect.TLF_UI_KEYBOARD_DID_SHOW_NOTIFICATION);
|
|
250
|
-
Connect.logEvent(v, Connect.TLF_ON_FOCUS_CHANGE_IN);
|
|
251
|
-
} else {
|
|
252
|
-
Connect.logEvent(keyboardView, Connect.TLF_UI_KEYBOARD_DID_SHOW_NOTIFICATION, accessibilityID);
|
|
253
|
-
Connect.logEvent(v, Connect.TLF_ON_FOCUS_CHANGE_IN, accessibilityID);
|
|
254
|
-
}
|
|
239
|
+
textView.setOnFocusChangeListener((v, hasFocus) -> {
|
|
240
|
+
if (hasFocus) {
|
|
241
|
+
InputMethodManager imm = (InputMethodManager) v.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
|
|
242
|
+
imm.showSoftInput(v, InputMethodManager.SHOW_FORCED);
|
|
243
|
+
// TODO update class
|
|
244
|
+
KeyboardView keyboardView = new KeyboardView(v.getContext().getApplicationContext(), null);
|
|
245
|
+
|
|
246
|
+
if (TextUtils.isEmpty(accessibilityID)) {
|
|
247
|
+
Connect.INSTANCE.logEvent(keyboardView, Connect.TLF_UI_KEYBOARD_DID_SHOW_NOTIFICATION);
|
|
248
|
+
Connect.INSTANCE.logEvent(v, Connect.TLF_ON_FOCUS_CHANGE_IN);
|
|
255
249
|
} else {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
250
|
+
Connect.INSTANCE.logEvent(keyboardView, Connect.TLF_UI_KEYBOARD_DID_SHOW_NOTIFICATION, accessibilityID);
|
|
251
|
+
Connect.INSTANCE.logEvent(v, Connect.TLF_ON_FOCUS_CHANGE_IN, accessibilityID);
|
|
252
|
+
}
|
|
253
|
+
} else {
|
|
254
|
+
Connect.INSTANCE.logEvent(v, Connect.TLF_ON_FOCUS_CHANGE_OUT);
|
|
255
|
+
InputMethodManager imm = (InputMethodManager) v.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
|
|
256
|
+
imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
|
|
259
257
|
|
|
260
|
-
|
|
258
|
+
KeyboardView keyboardView = new KeyboardView(v.getContext().getApplicationContext(), null);
|
|
261
259
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
}
|
|
260
|
+
if (TextUtils.isEmpty(accessibilityID)) {
|
|
261
|
+
Connect.INSTANCE.logEvent(keyboardView, Connect.TLF_UI_KEYBOARD_DID_HIDE_NOTIFICATION);
|
|
262
|
+
} else {
|
|
263
|
+
Connect.INSTANCE.logEvent(keyboardView, Connect.TLF_UI_KEYBOARD_DID_HIDE_NOTIFICATION, accessibilityID);
|
|
267
264
|
}
|
|
268
265
|
}
|
|
269
266
|
});
|
|
270
267
|
|
|
271
|
-
Connect.registerFormField(textView, activity);
|
|
268
|
+
Connect.INSTANCE.registerFormField(textView, activity);
|
|
272
269
|
}
|
|
273
270
|
|
|
274
271
|
/**
|
|
275
272
|
* Requests that the framework logs the click events on any UIControl or View. Click event is a
|
|
276
273
|
* normalized form of touch up inside event.
|
|
277
274
|
*
|
|
278
|
-
* @param targetViewId
|
|
279
|
-
* @param accessibilityID
|
|
280
|
-
* @param promise
|
|
275
|
+
* @param targetViewId A valid native View Id for lookup.
|
|
276
|
+
* @param accessibilityID Accessibility ID(virtual id).
|
|
277
|
+
* @param promise Javascript Promise interface.
|
|
281
278
|
*/
|
|
282
279
|
@ReactMethod
|
|
283
280
|
public void logClickEvent(final int targetViewId, final String accessibilityID, final Promise promise) {
|
|
@@ -286,24 +283,22 @@ public class RNCxaModule extends ReactContextBaseJavaModule implements Lifecycle
|
|
|
286
283
|
// Add UI-block so we can get a valid reference to the map-view
|
|
287
284
|
final UIManagerModule uiManager = context.getNativeModule(UIManagerModule.class);
|
|
288
285
|
|
|
289
|
-
uiManager.addUIBlock(
|
|
290
|
-
|
|
291
|
-
final View view = nvhm.resolveView(targetViewId);
|
|
286
|
+
Objects.requireNonNull(uiManager).addUIBlock(nvhm -> {
|
|
287
|
+
final View view = nvhm.resolveView(targetViewId);
|
|
292
288
|
|
|
293
|
-
|
|
294
|
-
|
|
289
|
+
if (view == null) {
|
|
290
|
+
updateResult(null, promise);
|
|
291
|
+
} else {
|
|
292
|
+
if (view instanceof EditText) {
|
|
293
|
+
addFocusAndRegister((EditText) view, null, getCurrentActivity());
|
|
295
294
|
} else {
|
|
296
|
-
if (
|
|
297
|
-
|
|
295
|
+
if (!TextUtils.isEmpty(accessibilityID)) {
|
|
296
|
+
Connect.INSTANCE.logEvent(view, "click", accessibilityID);
|
|
298
297
|
} else {
|
|
299
|
-
|
|
300
|
-
Connect.logEvent(view, "click", accessibilityID);
|
|
301
|
-
} else {
|
|
302
|
-
Connect.logEvent(view, "click");
|
|
303
|
-
}
|
|
298
|
+
Connect.INSTANCE.logEvent(view, "click");
|
|
304
299
|
}
|
|
305
|
-
updateResult(true, promise);
|
|
306
300
|
}
|
|
301
|
+
updateResult(true, promise);
|
|
307
302
|
}
|
|
308
303
|
});
|
|
309
304
|
} catch (Exception e) {
|
|
@@ -311,6 +306,12 @@ public class RNCxaModule extends ReactContextBaseJavaModule implements Lifecycle
|
|
|
311
306
|
}
|
|
312
307
|
}
|
|
313
308
|
|
|
309
|
+
/**
|
|
310
|
+
* Log click events on react native control.
|
|
311
|
+
*
|
|
312
|
+
* @param targetViewId Target id of the control.
|
|
313
|
+
* @param promise Javascript Promise interface.
|
|
314
|
+
*/
|
|
314
315
|
@ReactMethod
|
|
315
316
|
public void logClickEvent(final int targetViewId, final Promise promise) {
|
|
316
317
|
try {
|
|
@@ -318,20 +319,18 @@ public class RNCxaModule extends ReactContextBaseJavaModule implements Lifecycle
|
|
|
318
319
|
// Add UI-block so we can get a valid reference to the map-view
|
|
319
320
|
final UIManagerModule uiManager = context.getNativeModule(UIManagerModule.class);
|
|
320
321
|
|
|
321
|
-
uiManager.addUIBlock(
|
|
322
|
-
|
|
323
|
-
final View view = nvhm.resolveView(targetViewId);
|
|
322
|
+
Objects.requireNonNull(uiManager).addUIBlock(nvhm -> {
|
|
323
|
+
final View view = nvhm.resolveView(targetViewId);
|
|
324
324
|
|
|
325
|
-
|
|
326
|
-
|
|
325
|
+
if (view == null) {
|
|
326
|
+
updateResult(null, promise);
|
|
327
|
+
} else {
|
|
328
|
+
if (view instanceof EditText) {
|
|
329
|
+
addFocusAndRegister((EditText) view, null, getCurrentActivity());
|
|
327
330
|
} else {
|
|
328
|
-
|
|
329
|
-
addFocusAndRegister((EditText) view, null, getCurrentActivity());
|
|
330
|
-
} else {
|
|
331
|
-
Connect.logEvent(view, "click");
|
|
332
|
-
}
|
|
333
|
-
updateResult(true, promise);
|
|
331
|
+
Connect.INSTANCE.logEvent(view, "click");
|
|
334
332
|
}
|
|
333
|
+
updateResult(true, promise);
|
|
335
334
|
}
|
|
336
335
|
});
|
|
337
336
|
} catch (Exception e) {
|
|
@@ -342,10 +341,10 @@ public class RNCxaModule extends ReactContextBaseJavaModule implements Lifecycle
|
|
|
342
341
|
/**
|
|
343
342
|
* Log EditText change event.
|
|
344
343
|
*
|
|
345
|
-
* @param targetViewId
|
|
346
|
-
* @param accessibilityID
|
|
347
|
-
* @param text
|
|
348
|
-
* @param promise
|
|
344
|
+
* @param targetViewId A valid native View Id for lookup.
|
|
345
|
+
* @param accessibilityID Accessibility ID(virtual id).
|
|
346
|
+
* @param text The input string
|
|
347
|
+
* @param promise Javascript Promise interface.
|
|
349
348
|
*/
|
|
350
349
|
@ReactMethod
|
|
351
350
|
public void logTextChangeEvent(final int targetViewId, final String accessibilityID, final String text, final Promise promise) {
|
|
@@ -354,20 +353,18 @@ public class RNCxaModule extends ReactContextBaseJavaModule implements Lifecycle
|
|
|
354
353
|
// Add UI-block so we can get a valid reference to the map-view
|
|
355
354
|
final UIManagerModule uiManager = context.getNativeModule(UIManagerModule.class);
|
|
356
355
|
|
|
357
|
-
uiManager.addUIBlock(
|
|
358
|
-
|
|
359
|
-
final View view = nvhm.resolveView(targetViewId);
|
|
356
|
+
Objects.requireNonNull(uiManager).addUIBlock(nvhm -> {
|
|
357
|
+
final View view = nvhm.resolveView(targetViewId);
|
|
360
358
|
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
}
|
|
369
|
-
updateResult(true, promise);
|
|
359
|
+
if (view == null) {
|
|
360
|
+
updateResult(null, promise);
|
|
361
|
+
} else {
|
|
362
|
+
if (view instanceof EditText && ((EditText) view).getOnFocusChangeListener() == null) {
|
|
363
|
+
// First time, logEvent and subsequent calls will be handled in change listener
|
|
364
|
+
Connect.INSTANCE.logEvent(view, Connect.TLF_ON_FOCUS_CHANGE_IN, accessibilityID);
|
|
365
|
+
addFocusAndRegister((EditText) view, accessibilityID, getCurrentActivity());
|
|
370
366
|
}
|
|
367
|
+
updateResult(true, promise);
|
|
371
368
|
}
|
|
372
369
|
});
|
|
373
370
|
} catch (Exception e) {
|
|
@@ -384,7 +381,7 @@ public class RNCxaModule extends ReactContextBaseJavaModule implements Lifecycle
|
|
|
384
381
|
*/
|
|
385
382
|
@ReactMethod
|
|
386
383
|
public void logScreenViewContextLoad(final String logicalPageName, final String referrer, final Promise promise) {
|
|
387
|
-
final boolean result = Connect.logScreenview(getCurrentActivity(), logicalPageName, ScreenviewType.LOAD, referrer);
|
|
384
|
+
final boolean result = Connect.INSTANCE.logScreenview(Objects.requireNonNull(getCurrentActivity()), logicalPageName, ScreenviewType.LOAD, referrer);
|
|
388
385
|
updateResult(result, promise);
|
|
389
386
|
}
|
|
390
387
|
|
|
@@ -397,7 +394,27 @@ public class RNCxaModule extends ReactContextBaseJavaModule implements Lifecycle
|
|
|
397
394
|
*/
|
|
398
395
|
@ReactMethod
|
|
399
396
|
public void logScreenViewContextUnLoad(final String logicalPageName, final String referrer, final Promise promise) {
|
|
400
|
-
final boolean result = Connect.logScreenview(getCurrentActivity(), logicalPageName, ScreenviewType.UNLOAD, referrer);
|
|
397
|
+
final boolean result = Connect.INSTANCE.logScreenview(Objects.requireNonNull(getCurrentActivity()), logicalPageName, ScreenviewType.UNLOAD, referrer);
|
|
398
|
+
updateResult(result, promise);
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* Log signal json data.
|
|
403
|
+
*
|
|
404
|
+
* @param signalJSON React-Native compatible map type.
|
|
405
|
+
* @param logLevel The monitoring level of the event.
|
|
406
|
+
* @param promise Javascript Promise interface.
|
|
407
|
+
*/
|
|
408
|
+
@ReactMethod
|
|
409
|
+
public void logSignal(final ReadableMap signalJSON, final int logLevel, final Promise promise) {
|
|
410
|
+
HashMap<String, Object> map = new HashMap<>();
|
|
411
|
+
|
|
412
|
+
// Convert to conform with React-Native MAP type
|
|
413
|
+
for (Map.Entry<String, Object> entry : signalJSON.toHashMap().entrySet()) {
|
|
414
|
+
map.put(entry.getKey(), entry.getValue().toString());
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
final boolean result = Connect.INSTANCE.logSignal(map, logLevel);
|
|
401
418
|
updateResult(result, promise);
|
|
402
419
|
}
|
|
403
420
|
|
|
@@ -408,32 +425,42 @@ public class RNCxaModule extends ReactContextBaseJavaModule implements Lifecycle
|
|
|
408
425
|
* @param promise Javascript Promise interface.
|
|
409
426
|
*/
|
|
410
427
|
private void updateResult(Object result, Promise promise) {
|
|
411
|
-
if ((result != null) && ((Boolean) result)
|
|
412
|
-
promise.resolve(
|
|
428
|
+
if ((result != null) && ((Boolean) result)) {
|
|
429
|
+
promise.resolve(true);
|
|
413
430
|
} else {
|
|
414
431
|
promise.reject("", "", new Throwable());
|
|
415
432
|
}
|
|
416
433
|
}
|
|
417
434
|
|
|
435
|
+
/**
|
|
436
|
+
* Used when host resumes.
|
|
437
|
+
*/
|
|
418
438
|
@Override
|
|
419
439
|
public void onHostResume() {
|
|
420
440
|
// Initialize Connect library, and hook into activity lifecycle events to help detect if app is in background
|
|
421
|
-
if (!Connect.isEnabled()) {
|
|
422
|
-
if (Connect.getApplication() == null) {
|
|
423
|
-
|
|
441
|
+
if (!Connect.INSTANCE.isEnabled()) {
|
|
442
|
+
if (Connect.INSTANCE.getApplication() == null) {
|
|
443
|
+
Connect.INSTANCE.init((Application) this.reactContext.getApplicationContext());
|
|
424
444
|
}
|
|
425
|
-
Connect.enable();
|
|
445
|
+
Connect.INSTANCE.enable();
|
|
426
446
|
}
|
|
427
|
-
Connect.onResume(getCurrentActivity(), null);
|
|
447
|
+
Connect.INSTANCE.onResume(getCurrentActivity(), null);
|
|
428
448
|
}
|
|
429
449
|
|
|
450
|
+
/**
|
|
451
|
+
* Used when host gets paused.
|
|
452
|
+
*/
|
|
430
453
|
@Override
|
|
431
454
|
public void onHostPause() {
|
|
432
|
-
Connect.onPause(getCurrentActivity(), null);
|
|
455
|
+
Connect.INSTANCE.onPause(getCurrentActivity(), null);
|
|
433
456
|
}
|
|
434
457
|
|
|
458
|
+
/**
|
|
459
|
+
* Used when host gets destroyed.
|
|
460
|
+
*/
|
|
435
461
|
@Override
|
|
436
462
|
public void onHostDestroy() {
|
|
437
|
-
|
|
463
|
+
// TODO fix
|
|
464
|
+
// Connect.INSTANCE.onDestroy(getCurrentActivity(), null);
|
|
438
465
|
}
|
|
439
466
|
}
|
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
|
|
12
12
|
package com.tl.uic.rncxa;
|
|
13
13
|
|
|
14
|
+
import androidx.annotation.NonNull;
|
|
15
|
+
|
|
14
16
|
import com.facebook.react.ReactPackage;
|
|
15
17
|
import com.facebook.react.bridge.NativeModule;
|
|
16
18
|
import com.facebook.react.bridge.ReactApplicationContext;
|
|
@@ -21,13 +23,15 @@ import java.util.Collections;
|
|
|
21
23
|
import java.util.List;
|
|
22
24
|
|
|
23
25
|
public class RNCxaPackage implements ReactPackage {
|
|
26
|
+
@NonNull
|
|
24
27
|
@Override
|
|
25
|
-
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
|
|
26
|
-
return
|
|
28
|
+
public List<NativeModule> createNativeModules(@NonNull ReactApplicationContext reactContext) {
|
|
29
|
+
return List.of(new RNCxaModule(reactContext));
|
|
27
30
|
}
|
|
28
31
|
|
|
32
|
+
@NonNull
|
|
29
33
|
@Override
|
|
30
|
-
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
|
|
34
|
+
public List<ViewManager> createViewManagers(@NonNull ReactApplicationContext reactContext) {
|
|
31
35
|
return Collections.emptyList();
|
|
32
36
|
}
|
|
33
37
|
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"React-Codegen","version":"0.72.6","summary":"Temp pod for generated files for React Native","homepage":"https://facebook.com/","license":"Unlicense","authors":"Facebook","compiler_flags":"-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-documentation -Wno-nullability-completeness -std=c++17","source":{"git":""},"header_mappings_dir":"./","platforms":{"ios":"12.4"},"source_files":"**/*.{h,mm,cpp}","pod_target_xcconfig":{"HEADER_SEARCH_PATHS":"\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\" \"$(PODS_ROOT)/Headers/Private/React-Fabric\" \"$(PODS_ROOT)/Headers/Private/React-RCTFabric\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_TARGET_SRCROOT)\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-Fabric/React_Fabric.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-graphics/React_graphics.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios\" \"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-RCTFabric/RCTFabric.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-utils/React_utils.framework/Headers\"","FRAMEWORK_SEARCH_PATHS":[]},"dependencies":{"React-jsiexecutor":[],"RCT-Folly":[],"RCTRequired":[],"RCTTypeSafety":[],"React-Core":[],"React-jsi":[],"ReactCommon/turbomodule/bridging":[],"ReactCommon/turbomodule/core":[],"React-NativeModulesApple":[],"glog":[],"DoubleConversion":[],"React-jsc":[],"React-rncore":[],"FBReactNativeSpec":[]}}
|
package/latestChanges
CHANGED
package/package.json
CHANGED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
# To learn about Buck see [Docs](https://buckbuild.com/).
|
|
2
|
-
# To run your application with Buck:
|
|
3
|
-
# - install Buck
|
|
4
|
-
# - `npm start` - to start the packager
|
|
5
|
-
# - `cd android`
|
|
6
|
-
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
|
|
7
|
-
# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
|
|
8
|
-
# - `buck install -r android/app` - compile, install and run application
|
|
9
|
-
#
|
|
10
|
-
|
|
11
|
-
load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
|
|
12
|
-
|
|
13
|
-
lib_deps = []
|
|
14
|
-
|
|
15
|
-
create_aar_targets(glob(["libs/*.aar"]))
|
|
16
|
-
|
|
17
|
-
create_jar_targets(glob(["libs/*.jar"]))
|
|
18
|
-
|
|
19
|
-
android_library(
|
|
20
|
-
name = "all-libs",
|
|
21
|
-
exported_deps = lib_deps,
|
|
22
|
-
)
|
|
23
|
-
|
|
24
|
-
android_library(
|
|
25
|
-
name = "app-code",
|
|
26
|
-
srcs = glob([
|
|
27
|
-
"src/main/java/**/*.java",
|
|
28
|
-
]),
|
|
29
|
-
deps = [
|
|
30
|
-
":all-libs",
|
|
31
|
-
":build_config",
|
|
32
|
-
":res",
|
|
33
|
-
],
|
|
34
|
-
)
|
|
35
|
-
|
|
36
|
-
android_build_config(
|
|
37
|
-
name = "build_config",
|
|
38
|
-
package = "com.geekyants.kitchensinkappnativebase",
|
|
39
|
-
)
|
|
40
|
-
|
|
41
|
-
android_resource(
|
|
42
|
-
name = "res",
|
|
43
|
-
package = "com.geekyants.kitchensinkappnativebase",
|
|
44
|
-
res = "src/main/res",
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
android_binary(
|
|
48
|
-
name = "app",
|
|
49
|
-
keystore = "//android/keystores:debug",
|
|
50
|
-
manifest = "src/main/AndroidManifest.xml",
|
|
51
|
-
package_type = "debug",
|
|
52
|
-
deps = [
|
|
53
|
-
":app-code",
|
|
54
|
-
],
|
|
55
|
-
)
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"""Helper definitions to glob .aar and .jar targets"""
|
|
2
|
-
|
|
3
|
-
def create_aar_targets(aarfiles):
|
|
4
|
-
for aarfile in aarfiles:
|
|
5
|
-
name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")]
|
|
6
|
-
lib_deps.append(":" + name)
|
|
7
|
-
android_prebuilt_aar(
|
|
8
|
-
name = name,
|
|
9
|
-
aar = aarfile,
|
|
10
|
-
)
|
|
11
|
-
|
|
12
|
-
def create_jar_targets(jarfiles):
|
|
13
|
-
for jarfile in jarfiles:
|
|
14
|
-
name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")]
|
|
15
|
-
lib_deps.append(":" + name)
|
|
16
|
-
prebuilt_jar(
|
|
17
|
-
name = name,
|
|
18
|
-
binary_jar = jarfile,
|
|
19
|
-
)
|