@hedia/recommendation-screen 1.0.0 → 1.0.2
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/Changelog.md +8 -4
- package/README.md +3 -3
- package/android/app/BUCK +55 -55
- package/android/app/build.gradle +225 -225
- package/android/app/build_defs.bzl +19 -19
- package/android/app/debug.keystore +0 -0
- package/android/app/proguard-rules.pro +10 -10
- package/android/app/src/debug/AndroidManifest.xml +8 -8
- package/android/app/src/debug/java/com/hediarecommendationscreen/ReactNativeFlipper.java +72 -72
- package/android/app/src/main/AndroidManifest.xml +27 -27
- package/android/app/src/main/java/com/hediarecommendationscreen/MainActivity.java +15 -15
- package/android/app/src/main/java/com/hediarecommendationscreen/MainApplication.java +80 -80
- package/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/android/app/src/main/res/values/strings.xml +3 -3
- package/android/app/src/main/res/values/styles.xml +9 -9
- package/android/build.gradle +38 -38
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +5 -5
- package/android/gradle.properties +28 -28
- package/android/gradlew +188 -188
- package/android/gradlew.bat +0 -0
- package/android/settings.gradle +3 -3
- package/index.ts +0 -0
- package/ios/HediaRecommendationScreen/AppDelegate.h +8 -8
- package/ios/HediaRecommendationScreen/AppDelegate.m +58 -58
- package/ios/HediaRecommendationScreen/Base.lproj/LaunchScreen.xib +42 -42
- package/ios/HediaRecommendationScreen/Images.xcassets/AppIcon.appiconset/Contents.json +37 -37
- package/ios/HediaRecommendationScreen/Images.xcassets/Contents.json +6 -6
- package/ios/HediaRecommendationScreen/Info.plist +57 -57
- package/ios/HediaRecommendationScreen/main.m +9 -9
- package/ios/HediaRecommendationScreen-tvOS/Info.plist +53 -53
- package/ios/HediaRecommendationScreen-tvOSTests/Info.plist +24 -24
- package/ios/HediaRecommendationScreen.xcodeproj/project.pbxproj +807 -807
- package/ios/HediaRecommendationScreen.xcodeproj/xcshareddata/xcschemes/HediaRecommendationScreen-tvOS.xcscheme +88 -88
- package/ios/HediaRecommendationScreen.xcodeproj/xcshareddata/xcschemes/HediaRecommendationScreen.xcscheme +88 -88
- package/ios/HediaRecommendationScreenTests/HediaRecommendationScreenTests.m +65 -65
- package/ios/HediaRecommendationScreenTests/Info.plist +24 -24
- package/ios/Podfile +104 -104
- package/package.json +8 -12
- package/src/RecommendationScreen.tsx +3 -4
- package/src/assets/happy.png +0 -0
- package/src/assets/happy_active.png +0 -0
- package/src/assets/neutral.png +0 -0
- package/src/assets/neutral_active.png +0 -0
- package/src/assets/sad.png +0 -0
- package/src/assets/sad_active.png +0 -0
- package/src/assets/semi_happy.png +0 -0
- package/src/assets/semi_happy_active.png +0 -0
- package/src/assets/semi_sad.png +0 -0
- package/src/assets/semi_sad_active.png +0 -0
- package/src/components/Emotion.tsx +1 -2
- package/src/components/Header.tsx +1 -2
- package/src/components/Icon.js +41 -41
- package/src/components/InfoBars.tsx +0 -0
- package/src/components/InvisibleNumberInput.tsx +0 -0
- package/src/components/MoodIcon.tsx +0 -0
- package/src/components/RecentInsulin.tsx +4 -5
- package/src/components/RecommendedCarbs.tsx +8 -9
- package/src/components/RecommendedInsulin.tsx +2 -3
- package/src/components/Remeasure.tsx +3 -4
- package/src/components/TransferToLogbook.tsx +2 -3
- package/src/locale/da/messages.js +1 -1
- package/src/locale/da/messages.po +31 -29
- package/src/locale/en/messages.js +1 -1
- package/src/locale/en/messages.po +32 -30
- package/src/locale/i18nUtils.ts +0 -0
- package/src/types/enum.ts +0 -0
- package/src/types/types.ts +0 -0
- package/src/utils/Constants.ts +0 -0
- package/src/utils/RecommendationError.ts +4 -6
- package/src/utils/Utils.ts +0 -0
- package/.prettierignore +0 -2
- package/index-git.sh +0 -5
- package/index.d.ts +0 -5
- package/index.js +0 -16
- package/src/RecommendationScreen.d.ts +0 -42
- package/src/RecommendationScreen.js +0 -142
- package/src/components/Emotion.d.ts +0 -14
- package/src/components/Emotion.js +0 -55
- package/src/components/Header.d.ts +0 -52
- package/src/components/Header.js +0 -83
- package/src/components/InfoBars.d.ts +0 -67
- package/src/components/InfoBars.js +0 -89
- package/src/components/InvisibleNumberInput.d.ts +0 -24
- package/src/components/InvisibleNumberInput.js +0 -64
- package/src/components/MoodIcon.d.ts +0 -14
- package/src/components/MoodIcon.js +0 -53
- package/src/components/RecentInsulin.d.ts +0 -9
- package/src/components/RecentInsulin.js +0 -91
- package/src/components/RecommendedCarbs.d.ts +0 -30
- package/src/components/RecommendedCarbs.js +0 -193
- package/src/components/RecommendedInsulin.d.ts +0 -22
- package/src/components/RecommendedInsulin.js +0 -110
- package/src/components/Remeasure.d.ts +0 -13
- package/src/components/Remeasure.js +0 -89
- package/src/components/TransferToLogbook.d.ts +0 -14
- package/src/components/TransferToLogbook.js +0 -81
- package/src/locale/i18nUtils.d.ts +0 -5
- package/src/locale/i18nUtils.js +0 -22
- package/src/types/enum.d.ts +0 -26
- package/src/types/enum.js +0 -34
- package/src/types/types.d.ts +0 -21
- package/src/types/types.js +0 -2
- package/src/utils/Constants.d.ts +0 -3
- package/src/utils/Constants.js +0 -6
- package/src/utils/RecommendationError.d.ts +0 -9
- package/src/utils/RecommendationError.js +0 -17
- package/src/utils/Utils.d.ts +0 -5
- package/src/utils/Utils.js +0 -24
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
-
xmlns:tools="http://schemas.android.com/tools">
|
|
4
|
-
|
|
5
|
-
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
|
|
6
|
-
|
|
7
|
-
<application android:usesCleartextTraffic="true" tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" />
|
|
8
|
-
</manifest>
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
+
xmlns:tools="http://schemas.android.com/tools">
|
|
4
|
+
|
|
5
|
+
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
|
|
6
|
+
|
|
7
|
+
<application android:usesCleartextTraffic="true" tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" />
|
|
8
|
+
</manifest>
|
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
-
*
|
|
4
|
-
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
|
|
5
|
-
* directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
package com.hediarecommendationscreen;
|
|
8
|
-
|
|
9
|
-
import android.content.Context;
|
|
10
|
-
import com.facebook.flipper.android.AndroidFlipperClient;
|
|
11
|
-
import com.facebook.flipper.android.utils.FlipperUtils;
|
|
12
|
-
import com.facebook.flipper.core.FlipperClient;
|
|
13
|
-
import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
|
|
14
|
-
import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
|
|
15
|
-
import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
|
|
16
|
-
import com.facebook.flipper.plugins.inspector.DescriptorMapping;
|
|
17
|
-
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
|
|
18
|
-
import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
|
|
19
|
-
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
|
|
20
|
-
import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
|
|
21
|
-
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
|
|
22
|
-
import com.facebook.react.ReactInstanceManager;
|
|
23
|
-
import com.facebook.react.bridge.ReactContext;
|
|
24
|
-
import com.facebook.react.modules.network.NetworkingModule;
|
|
25
|
-
import okhttp3.OkHttpClient;
|
|
26
|
-
|
|
27
|
-
public class ReactNativeFlipper {
|
|
28
|
-
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
|
|
29
|
-
if (FlipperUtils.shouldEnableFlipper(context)) {
|
|
30
|
-
final FlipperClient client = AndroidFlipperClient.getInstance(context);
|
|
31
|
-
|
|
32
|
-
client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
|
|
33
|
-
client.addPlugin(new ReactFlipperPlugin());
|
|
34
|
-
client.addPlugin(new DatabasesFlipperPlugin(context));
|
|
35
|
-
client.addPlugin(new SharedPreferencesFlipperPlugin(context));
|
|
36
|
-
client.addPlugin(CrashReporterPlugin.getInstance());
|
|
37
|
-
|
|
38
|
-
NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
|
|
39
|
-
NetworkingModule.setCustomClientBuilder(
|
|
40
|
-
new NetworkingModule.CustomClientBuilder() {
|
|
41
|
-
@Override
|
|
42
|
-
public void apply(OkHttpClient.Builder builder) {
|
|
43
|
-
builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
client.addPlugin(networkFlipperPlugin);
|
|
47
|
-
client.start();
|
|
48
|
-
|
|
49
|
-
// Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
|
|
50
|
-
// Hence we run if after all native modules have been initialized
|
|
51
|
-
ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
|
|
52
|
-
if (reactContext == null) {
|
|
53
|
-
reactInstanceManager.addReactInstanceEventListener(
|
|
54
|
-
new ReactInstanceManager.ReactInstanceEventListener() {
|
|
55
|
-
@Override
|
|
56
|
-
public void onReactContextInitialized(ReactContext reactContext) {
|
|
57
|
-
reactInstanceManager.removeReactInstanceEventListener(this);
|
|
58
|
-
reactContext.runOnNativeModulesQueueThread(
|
|
59
|
-
new Runnable() {
|
|
60
|
-
@Override
|
|
61
|
-
public void run() {
|
|
62
|
-
client.addPlugin(new FrescoFlipperPlugin());
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
} else {
|
|
68
|
-
client.addPlugin(new FrescoFlipperPlugin());
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
|
|
5
|
+
* directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
package com.hediarecommendationscreen;
|
|
8
|
+
|
|
9
|
+
import android.content.Context;
|
|
10
|
+
import com.facebook.flipper.android.AndroidFlipperClient;
|
|
11
|
+
import com.facebook.flipper.android.utils.FlipperUtils;
|
|
12
|
+
import com.facebook.flipper.core.FlipperClient;
|
|
13
|
+
import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
|
|
14
|
+
import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
|
|
15
|
+
import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
|
|
16
|
+
import com.facebook.flipper.plugins.inspector.DescriptorMapping;
|
|
17
|
+
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
|
|
18
|
+
import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
|
|
19
|
+
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
|
|
20
|
+
import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
|
|
21
|
+
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
|
|
22
|
+
import com.facebook.react.ReactInstanceManager;
|
|
23
|
+
import com.facebook.react.bridge.ReactContext;
|
|
24
|
+
import com.facebook.react.modules.network.NetworkingModule;
|
|
25
|
+
import okhttp3.OkHttpClient;
|
|
26
|
+
|
|
27
|
+
public class ReactNativeFlipper {
|
|
28
|
+
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
|
|
29
|
+
if (FlipperUtils.shouldEnableFlipper(context)) {
|
|
30
|
+
final FlipperClient client = AndroidFlipperClient.getInstance(context);
|
|
31
|
+
|
|
32
|
+
client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
|
|
33
|
+
client.addPlugin(new ReactFlipperPlugin());
|
|
34
|
+
client.addPlugin(new DatabasesFlipperPlugin(context));
|
|
35
|
+
client.addPlugin(new SharedPreferencesFlipperPlugin(context));
|
|
36
|
+
client.addPlugin(CrashReporterPlugin.getInstance());
|
|
37
|
+
|
|
38
|
+
NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
|
|
39
|
+
NetworkingModule.setCustomClientBuilder(
|
|
40
|
+
new NetworkingModule.CustomClientBuilder() {
|
|
41
|
+
@Override
|
|
42
|
+
public void apply(OkHttpClient.Builder builder) {
|
|
43
|
+
builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
client.addPlugin(networkFlipperPlugin);
|
|
47
|
+
client.start();
|
|
48
|
+
|
|
49
|
+
// Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
|
|
50
|
+
// Hence we run if after all native modules have been initialized
|
|
51
|
+
ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
|
|
52
|
+
if (reactContext == null) {
|
|
53
|
+
reactInstanceManager.addReactInstanceEventListener(
|
|
54
|
+
new ReactInstanceManager.ReactInstanceEventListener() {
|
|
55
|
+
@Override
|
|
56
|
+
public void onReactContextInitialized(ReactContext reactContext) {
|
|
57
|
+
reactInstanceManager.removeReactInstanceEventListener(this);
|
|
58
|
+
reactContext.runOnNativeModulesQueueThread(
|
|
59
|
+
new Runnable() {
|
|
60
|
+
@Override
|
|
61
|
+
public void run() {
|
|
62
|
+
client.addPlugin(new FrescoFlipperPlugin());
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
} else {
|
|
68
|
+
client.addPlugin(new FrescoFlipperPlugin());
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
2
|
-
package="com.hediarecommendationscreen">
|
|
3
|
-
|
|
4
|
-
<uses-permission android:name="android.permission.INTERNET" />
|
|
5
|
-
|
|
6
|
-
<application
|
|
7
|
-
android:name=".MainApplication"
|
|
8
|
-
android:label="@string/app_name"
|
|
9
|
-
android:icon="@mipmap/ic_launcher"
|
|
10
|
-
android:roundIcon="@mipmap/ic_launcher_round"
|
|
11
|
-
android:allowBackup="false"
|
|
12
|
-
android:theme="@style/AppTheme">
|
|
13
|
-
<activity
|
|
14
|
-
android:name=".MainActivity"
|
|
15
|
-
android:label="@string/app_name"
|
|
16
|
-
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
|
|
17
|
-
android:launchMode="singleTask"
|
|
18
|
-
android:windowSoftInputMode="adjustResize">
|
|
19
|
-
<intent-filter>
|
|
20
|
-
<action android:name="android.intent.action.MAIN" />
|
|
21
|
-
<category android:name="android.intent.category.LAUNCHER" />
|
|
22
|
-
</intent-filter>
|
|
23
|
-
</activity>
|
|
24
|
-
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
|
|
25
|
-
</application>
|
|
26
|
-
|
|
27
|
-
</manifest>
|
|
1
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
2
|
+
package="com.hediarecommendationscreen">
|
|
3
|
+
|
|
4
|
+
<uses-permission android:name="android.permission.INTERNET" />
|
|
5
|
+
|
|
6
|
+
<application
|
|
7
|
+
android:name=".MainApplication"
|
|
8
|
+
android:label="@string/app_name"
|
|
9
|
+
android:icon="@mipmap/ic_launcher"
|
|
10
|
+
android:roundIcon="@mipmap/ic_launcher_round"
|
|
11
|
+
android:allowBackup="false"
|
|
12
|
+
android:theme="@style/AppTheme">
|
|
13
|
+
<activity
|
|
14
|
+
android:name=".MainActivity"
|
|
15
|
+
android:label="@string/app_name"
|
|
16
|
+
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
|
|
17
|
+
android:launchMode="singleTask"
|
|
18
|
+
android:windowSoftInputMode="adjustResize">
|
|
19
|
+
<intent-filter>
|
|
20
|
+
<action android:name="android.intent.action.MAIN" />
|
|
21
|
+
<category android:name="android.intent.category.LAUNCHER" />
|
|
22
|
+
</intent-filter>
|
|
23
|
+
</activity>
|
|
24
|
+
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
|
|
25
|
+
</application>
|
|
26
|
+
|
|
27
|
+
</manifest>
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
package com.hediarecommendationscreen;
|
|
2
|
-
|
|
3
|
-
import com.facebook.react.ReactActivity;
|
|
4
|
-
|
|
5
|
-
public class MainActivity extends ReactActivity {
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Returns the name of the main component registered from JavaScript. This is used to schedule
|
|
9
|
-
* rendering of the component.
|
|
10
|
-
*/
|
|
11
|
-
@Override
|
|
12
|
-
protected String getMainComponentName() {
|
|
13
|
-
return "HediaRecommendationScreen";
|
|
14
|
-
}
|
|
15
|
-
}
|
|
1
|
+
package com.hediarecommendationscreen;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.ReactActivity;
|
|
4
|
+
|
|
5
|
+
public class MainActivity extends ReactActivity {
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Returns the name of the main component registered from JavaScript. This is used to schedule
|
|
9
|
+
* rendering of the component.
|
|
10
|
+
*/
|
|
11
|
+
@Override
|
|
12
|
+
protected String getMainComponentName() {
|
|
13
|
+
return "HediaRecommendationScreen";
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
package com.hediarecommendationscreen;
|
|
2
|
-
|
|
3
|
-
import android.app.Application;
|
|
4
|
-
import android.content.Context;
|
|
5
|
-
import com.facebook.react.PackageList;
|
|
6
|
-
import com.facebook.react.ReactApplication;
|
|
7
|
-
import com.facebook.react.ReactInstanceManager;
|
|
8
|
-
import com.facebook.react.ReactNativeHost;
|
|
9
|
-
import com.facebook.react.ReactPackage;
|
|
10
|
-
import com.facebook.soloader.SoLoader;
|
|
11
|
-
import java.lang.reflect.InvocationTargetException;
|
|
12
|
-
import java.util.List;
|
|
13
|
-
|
|
14
|
-
public class MainApplication extends Application implements ReactApplication {
|
|
15
|
-
|
|
16
|
-
private final ReactNativeHost mReactNativeHost =
|
|
17
|
-
new ReactNativeHost(this) {
|
|
18
|
-
@Override
|
|
19
|
-
public boolean getUseDeveloperSupport() {
|
|
20
|
-
return BuildConfig.DEBUG;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
@Override
|
|
24
|
-
protected List<ReactPackage> getPackages() {
|
|
25
|
-
@SuppressWarnings("UnnecessaryLocalVariable")
|
|
26
|
-
List<ReactPackage> packages = new PackageList(this).getPackages();
|
|
27
|
-
// Packages that cannot be autolinked yet can be added manually here, for example:
|
|
28
|
-
// packages.add(new MyReactNativePackage());
|
|
29
|
-
return packages;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
@Override
|
|
33
|
-
protected String getJSMainModuleName() {
|
|
34
|
-
return "index";
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
@Override
|
|
39
|
-
public ReactNativeHost getReactNativeHost() {
|
|
40
|
-
return mReactNativeHost;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
@Override
|
|
44
|
-
public void onCreate() {
|
|
45
|
-
super.onCreate();
|
|
46
|
-
SoLoader.init(this, /* native exopackage */ false);
|
|
47
|
-
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Loads Flipper in React Native templates. Call this in the onCreate method with something like
|
|
52
|
-
* initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
|
|
53
|
-
*
|
|
54
|
-
* @param context
|
|
55
|
-
* @param reactInstanceManager
|
|
56
|
-
*/
|
|
57
|
-
private static void initializeFlipper(
|
|
58
|
-
Context context, ReactInstanceManager reactInstanceManager) {
|
|
59
|
-
if (BuildConfig.DEBUG) {
|
|
60
|
-
try {
|
|
61
|
-
/*
|
|
62
|
-
We use reflection here to pick up the class that initializes Flipper,
|
|
63
|
-
since Flipper library is not available in release mode
|
|
64
|
-
*/
|
|
65
|
-
Class<?> aClass = Class.forName("com.hediarecommendationscreen.ReactNativeFlipper");
|
|
66
|
-
aClass
|
|
67
|
-
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
|
|
68
|
-
.invoke(null, context, reactInstanceManager);
|
|
69
|
-
} catch (ClassNotFoundException e) {
|
|
70
|
-
e.printStackTrace();
|
|
71
|
-
} catch (NoSuchMethodException e) {
|
|
72
|
-
e.printStackTrace();
|
|
73
|
-
} catch (IllegalAccessException e) {
|
|
74
|
-
e.printStackTrace();
|
|
75
|
-
} catch (InvocationTargetException e) {
|
|
76
|
-
e.printStackTrace();
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
1
|
+
package com.hediarecommendationscreen;
|
|
2
|
+
|
|
3
|
+
import android.app.Application;
|
|
4
|
+
import android.content.Context;
|
|
5
|
+
import com.facebook.react.PackageList;
|
|
6
|
+
import com.facebook.react.ReactApplication;
|
|
7
|
+
import com.facebook.react.ReactInstanceManager;
|
|
8
|
+
import com.facebook.react.ReactNativeHost;
|
|
9
|
+
import com.facebook.react.ReactPackage;
|
|
10
|
+
import com.facebook.soloader.SoLoader;
|
|
11
|
+
import java.lang.reflect.InvocationTargetException;
|
|
12
|
+
import java.util.List;
|
|
13
|
+
|
|
14
|
+
public class MainApplication extends Application implements ReactApplication {
|
|
15
|
+
|
|
16
|
+
private final ReactNativeHost mReactNativeHost =
|
|
17
|
+
new ReactNativeHost(this) {
|
|
18
|
+
@Override
|
|
19
|
+
public boolean getUseDeveloperSupport() {
|
|
20
|
+
return BuildConfig.DEBUG;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@Override
|
|
24
|
+
protected List<ReactPackage> getPackages() {
|
|
25
|
+
@SuppressWarnings("UnnecessaryLocalVariable")
|
|
26
|
+
List<ReactPackage> packages = new PackageList(this).getPackages();
|
|
27
|
+
// Packages that cannot be autolinked yet can be added manually here, for example:
|
|
28
|
+
// packages.add(new MyReactNativePackage());
|
|
29
|
+
return packages;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@Override
|
|
33
|
+
protected String getJSMainModuleName() {
|
|
34
|
+
return "index";
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
@Override
|
|
39
|
+
public ReactNativeHost getReactNativeHost() {
|
|
40
|
+
return mReactNativeHost;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@Override
|
|
44
|
+
public void onCreate() {
|
|
45
|
+
super.onCreate();
|
|
46
|
+
SoLoader.init(this, /* native exopackage */ false);
|
|
47
|
+
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Loads Flipper in React Native templates. Call this in the onCreate method with something like
|
|
52
|
+
* initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
|
|
53
|
+
*
|
|
54
|
+
* @param context
|
|
55
|
+
* @param reactInstanceManager
|
|
56
|
+
*/
|
|
57
|
+
private static void initializeFlipper(
|
|
58
|
+
Context context, ReactInstanceManager reactInstanceManager) {
|
|
59
|
+
if (BuildConfig.DEBUG) {
|
|
60
|
+
try {
|
|
61
|
+
/*
|
|
62
|
+
We use reflection here to pick up the class that initializes Flipper,
|
|
63
|
+
since Flipper library is not available in release mode
|
|
64
|
+
*/
|
|
65
|
+
Class<?> aClass = Class.forName("com.hediarecommendationscreen.ReactNativeFlipper");
|
|
66
|
+
aClass
|
|
67
|
+
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
|
|
68
|
+
.invoke(null, context, reactInstanceManager);
|
|
69
|
+
} catch (ClassNotFoundException e) {
|
|
70
|
+
e.printStackTrace();
|
|
71
|
+
} catch (NoSuchMethodException e) {
|
|
72
|
+
e.printStackTrace();
|
|
73
|
+
} catch (IllegalAccessException e) {
|
|
74
|
+
e.printStackTrace();
|
|
75
|
+
} catch (InvocationTargetException e) {
|
|
76
|
+
e.printStackTrace();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<resources>
|
|
2
|
-
<string name="app_name">HediaRecommendationScreen</string>
|
|
3
|
-
</resources>
|
|
1
|
+
<resources>
|
|
2
|
+
<string name="app_name">HediaRecommendationScreen</string>
|
|
3
|
+
</resources>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
<resources>
|
|
2
|
-
|
|
3
|
-
<!-- Base application theme. -->
|
|
4
|
-
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
|
5
|
-
<!-- Customize your theme here. -->
|
|
6
|
-
<item name="android:textColor">#000000</item>
|
|
7
|
-
</style>
|
|
8
|
-
|
|
9
|
-
</resources>
|
|
1
|
+
<resources>
|
|
2
|
+
|
|
3
|
+
<!-- Base application theme. -->
|
|
4
|
+
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
|
5
|
+
<!-- Customize your theme here. -->
|
|
6
|
+
<item name="android:textColor">#000000</item>
|
|
7
|
+
</style>
|
|
8
|
+
|
|
9
|
+
</resources>
|
package/android/build.gradle
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
|
2
|
-
|
|
3
|
-
buildscript {
|
|
4
|
-
ext {
|
|
5
|
-
buildToolsVersion = "28.0.3"
|
|
6
|
-
minSdkVersion = 16
|
|
7
|
-
compileSdkVersion = 28
|
|
8
|
-
targetSdkVersion = 28
|
|
9
|
-
}
|
|
10
|
-
repositories {
|
|
11
|
-
google()
|
|
12
|
-
jcenter()
|
|
13
|
-
}
|
|
14
|
-
dependencies {
|
|
15
|
-
classpath("com.android.tools.build:gradle:3.5.2")
|
|
16
|
-
|
|
17
|
-
// NOTE: Do not place your application dependencies here; they belong
|
|
18
|
-
// in the individual module build.gradle files
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
allprojects {
|
|
23
|
-
repositories {
|
|
24
|
-
mavenLocal()
|
|
25
|
-
maven {
|
|
26
|
-
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
|
|
27
|
-
url("$rootDir/../node_modules/react-native/android")
|
|
28
|
-
}
|
|
29
|
-
maven {
|
|
30
|
-
// Android JSC is installed from npm
|
|
31
|
-
url("$rootDir/../node_modules/jsc-android/dist")
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
google()
|
|
35
|
-
jcenter()
|
|
36
|
-
maven { url 'https://www.jitpack.io' }
|
|
37
|
-
}
|
|
38
|
-
}
|
|
1
|
+
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
|
2
|
+
|
|
3
|
+
buildscript {
|
|
4
|
+
ext {
|
|
5
|
+
buildToolsVersion = "28.0.3"
|
|
6
|
+
minSdkVersion = 16
|
|
7
|
+
compileSdkVersion = 28
|
|
8
|
+
targetSdkVersion = 28
|
|
9
|
+
}
|
|
10
|
+
repositories {
|
|
11
|
+
google()
|
|
12
|
+
jcenter()
|
|
13
|
+
}
|
|
14
|
+
dependencies {
|
|
15
|
+
classpath("com.android.tools.build:gradle:3.5.2")
|
|
16
|
+
|
|
17
|
+
// NOTE: Do not place your application dependencies here; they belong
|
|
18
|
+
// in the individual module build.gradle files
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
allprojects {
|
|
23
|
+
repositories {
|
|
24
|
+
mavenLocal()
|
|
25
|
+
maven {
|
|
26
|
+
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
|
|
27
|
+
url("$rootDir/../node_modules/react-native/android")
|
|
28
|
+
}
|
|
29
|
+
maven {
|
|
30
|
+
// Android JSC is installed from npm
|
|
31
|
+
url("$rootDir/../node_modules/jsc-android/dist")
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
google()
|
|
35
|
+
jcenter()
|
|
36
|
+
maven { url 'https://www.jitpack.io' }
|
|
37
|
+
}
|
|
38
|
+
}
|
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
distributionBase=GRADLE_USER_HOME
|
|
2
|
-
distributionPath=wrapper/dists
|
|
3
|
-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip
|
|
4
|
-
zipStoreBase=GRADLE_USER_HOME
|
|
5
|
-
zipStorePath=wrapper/dists
|
|
1
|
+
distributionBase=GRADLE_USER_HOME
|
|
2
|
+
distributionPath=wrapper/dists
|
|
3
|
+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip
|
|
4
|
+
zipStoreBase=GRADLE_USER_HOME
|
|
5
|
+
zipStorePath=wrapper/dists
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
# Project-wide Gradle settings.
|
|
2
|
-
|
|
3
|
-
# IDE (e.g. Android Studio) users:
|
|
4
|
-
# Gradle settings configured through the IDE *will override*
|
|
5
|
-
# any settings specified in this file.
|
|
6
|
-
|
|
7
|
-
# For more details on how to configure your build environment visit
|
|
8
|
-
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
|
9
|
-
|
|
10
|
-
# Specifies the JVM arguments used for the daemon process.
|
|
11
|
-
# The setting is particularly useful for tweaking memory settings.
|
|
12
|
-
# Default value: -Xmx10248m -XX:MaxPermSize=256m
|
|
13
|
-
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
|
|
14
|
-
|
|
15
|
-
# When configured, Gradle will run in incubating parallel mode.
|
|
16
|
-
# This option should only be used with decoupled projects. More details, visit
|
|
17
|
-
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
|
18
|
-
# org.gradle.parallel=true
|
|
19
|
-
|
|
20
|
-
# AndroidX package structure to make it clearer which packages are bundled with the
|
|
21
|
-
# Android operating system, and which are packaged with your app's APK
|
|
22
|
-
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
|
23
|
-
android.useAndroidX=true
|
|
24
|
-
# Automatically convert third-party libraries to use AndroidX
|
|
25
|
-
android.enableJetifier=true
|
|
26
|
-
|
|
27
|
-
# Version of flipper SDK to use with React Native
|
|
28
|
-
FLIPPER_VERSION=0.33.1
|
|
1
|
+
# Project-wide Gradle settings.
|
|
2
|
+
|
|
3
|
+
# IDE (e.g. Android Studio) users:
|
|
4
|
+
# Gradle settings configured through the IDE *will override*
|
|
5
|
+
# any settings specified in this file.
|
|
6
|
+
|
|
7
|
+
# For more details on how to configure your build environment visit
|
|
8
|
+
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
|
9
|
+
|
|
10
|
+
# Specifies the JVM arguments used for the daemon process.
|
|
11
|
+
# The setting is particularly useful for tweaking memory settings.
|
|
12
|
+
# Default value: -Xmx10248m -XX:MaxPermSize=256m
|
|
13
|
+
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
|
|
14
|
+
|
|
15
|
+
# When configured, Gradle will run in incubating parallel mode.
|
|
16
|
+
# This option should only be used with decoupled projects. More details, visit
|
|
17
|
+
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
|
18
|
+
# org.gradle.parallel=true
|
|
19
|
+
|
|
20
|
+
# AndroidX package structure to make it clearer which packages are bundled with the
|
|
21
|
+
# Android operating system, and which are packaged with your app's APK
|
|
22
|
+
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
|
23
|
+
android.useAndroidX=true
|
|
24
|
+
# Automatically convert third-party libraries to use AndroidX
|
|
25
|
+
android.enableJetifier=true
|
|
26
|
+
|
|
27
|
+
# Version of flipper SDK to use with React Native
|
|
28
|
+
FLIPPER_VERSION=0.33.1
|