@momo-kits/native-kits 0.0.1-beta.4 → 0.89.1-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/README.md +1 -0
- package/android/.gradle/8.0/checksums/checksums.lock +0 -0
- package/android/.gradle/8.0/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/8.0/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.0/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.0/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.0/gc.properties +0 -0
- package/android/.gradle/config.properties +2 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/gradle.xml +12 -0
- package/android/.idea/migrations.xml +10 -0
- package/android/.idea/misc.xml +10 -0
- package/android/.idea/vcs.xml +6 -0
- package/android/.idea/workspace.xml +50 -0
- package/android/build.gradle +35 -69
- package/android/local.properties +8 -0
- package/android/proguard-rules.pro +21 -0
- package/android/src/main/AndroidManifest.xml +2 -2
- package/android/src/main/java/com/momoplatform/nativekits/foundations/Button.kt +16 -0
- package/android/src/main/java/com/momoplatform/nativekits/libs/Logo.kt +63 -0
- package/android/src/main/java/com/momoplatform/nativekits/libs/TrustBanner.kt +246 -0
- package/android/src/main/res/drawable/ic_launcher_background.xml +170 -0
- package/android/src/main/res/drawable-v24/ic_launcher_foreground.xml +30 -0
- package/android/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +6 -0
- package/android/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +6 -0
- package/android/src/main/res/mipmap-hdpi/ic_launcher.webp +0 -0
- package/android/src/main/res/mipmap-hdpi/ic_launcher_round.webp +0 -0
- package/android/src/main/res/mipmap-mdpi/ic_launcher.webp +0 -0
- package/android/src/main/res/mipmap-mdpi/ic_launcher_round.webp +0 -0
- package/android/src/main/res/mipmap-xhdpi/ic_launcher.webp +0 -0
- package/android/src/main/res/mipmap-xhdpi/ic_launcher_round.webp +0 -0
- package/android/src/main/res/mipmap-xxhdpi/ic_launcher.webp +0 -0
- package/android/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp +0 -0
- package/android/src/main/res/mipmap-xxxhdpi/ic_launcher.webp +0 -0
- package/android/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp +0 -0
- package/android/src/main/res/values/colors.xml +10 -0
- package/android/src/main/res/values/strings.xml +3 -0
- package/android/src/main/res/values/themes.xml +3 -0
- package/android/src/main/res/values-night/themes.xml +3 -0
- package/android/src/main/res/xml/backup_rules.xml +13 -0
- package/android/src/main/res/xml/data_extraction_rules.xml +19 -0
- package/build.gradle.kts +18 -0
- package/compose/build.gradle.kts +82 -0
- package/compose/src/androidMain/AndroidManifest.xml +2 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/utils/Platform.kt +3 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/utils/SetMaskFilter.kt +8 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/utils/Utils.android.kt +14 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Components.kt +194 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/NavigationContainer.kt +197 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +133 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +62 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeDot.kt +27 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +288 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +80 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Divider.kt +23 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +42 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +126 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +51 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +299 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +246 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +223 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +244 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +281 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PromotionPopup.kt +72 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +65 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +64 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +63 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +73 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +42 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +150 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Radius.kt +12 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +13 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +173 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +242 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +2 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +2 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +2 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +50 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Icons.kt +1321 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Platform.kt +3 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/SetMaskFilter.kt +5 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +97 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/utils/Platform.kt +3 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/utils/SetMaskFilter.kt +9 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/utils/Utils.ios.kt +18 -0
- package/gradle.properties +19 -0
- package/gradlew +240 -0
- package/gradlew.bat +91 -0
- package/ios/Button/Button.swift +9 -2
- package/ios/CalculatorKeyboard/CalculatorKeyboard.swift +126 -0
- package/ios/Checkbox/Checkbox.swift +38 -0
- package/ios/{Colors+Spacing → Colors+Radius+Spacing}/Colors.swift +21 -19
- package/ios/Colors+Radius+Spacing/Radius.swift +22 -0
- package/ios/Image/Image.swift +60 -0
- package/ios/Input/Input.swift +88 -37
- package/ios/OTPKeyboard/KeyboardButton.swift +12 -4
- package/ios/OTPKeyboard/OTPKeyboard.swift +1 -1
- package/ios/Popup/PopupDisplay.swift +169 -0
- package/ios/Popup/PopupInput.swift +96 -0
- package/ios/Popup/PopupPromotion.swift +52 -0
- package/ios/PopupView/FullscreenPopup.swift +251 -0
- package/ios/{Popup → PopupView}/Modifiers.swift +6 -20
- package/ios/{Popup → PopupView}/PopupView.swift +38 -146
- package/ios/PopupView/Utils++.swift +281 -0
- package/ios/ScrollIndicator/ScrollIndicator.swift +79 -0
- package/ios/Switch/Switch.swift +44 -0
- package/ios/Template/Logo/Logo.swift +75 -0
- package/ios/Template/TrustBanner/TrustBanner.swift +189 -0
- package/ios/native-kits.podspec +2 -0
- package/local.properties +8 -0
- package/package.json +6 -6
- package/publish.sh +1 -10
- package/settings.gradle.kts +41 -0
- package/android/gradle.properties +0 -5
- package/android/src/main/java/com/momoplatform/nativekits/NativeKitsPackage.kt +0 -17
- package/android/src/main/java/com/momoplatform/nativekits/NativeKitsViewManager.kt +0 -20
- package/example/ios/Example/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -63
- package/example/ios/Example/Assets.xcassets/Background.colorset/Contents.json +0 -38
- package/example/ios/Example/Assets.xcassets/Border.colorset/Contents.json +0 -38
- package/example/ios/Example/Assets.xcassets/Card.colorset/Contents.json +0 -38
- package/example/ios/Example/Assets.xcassets/Contents.json +0 -6
- package/example/ios/Example/Assets.xcassets/Error.colorset/Contents.json +0 -38
- package/example/ios/Example/Assets.xcassets/Primary.colorset/Contents.json +0 -38
- package/example/ios/Example/Assets.xcassets/PrimaryDark.colorset/Contents.json +0 -38
- package/example/ios/Example/Assets.xcassets/PrimaryLight.colorset/Contents.json +0 -38
- package/example/ios/Example/Assets.xcassets/Secondary.colorset/Contents.json +0 -38
- package/example/ios/Example/Assets.xcassets/Success.colorset/Contents.json +0 -38
- package/example/ios/Example/Assets.xcassets/Text.colorset/Contents.json +0 -38
- package/example/ios/Example/Assets.xcassets/TextSecondary.colorset/Contents.json +0 -38
- package/example/ios/Example/Assets.xcassets/Warning.colorset/Contents.json +0 -38
- package/example/ios/Example/ComponentDetail.swift +0 -35
- package/example/ios/Example/ComponentItem.swift +0 -24
- package/example/ios/Example/ComponentModel.swift +0 -33
- package/example/ios/Example/ContentView.swift +0 -53
- package/example/ios/Example/Example.entitlements +0 -10
- package/example/ios/Example/Foundation/ButtonDemo.swift +0 -80
- package/example/ios/Example/Foundation/Popup/ActionSheets.swift +0 -136
- package/example/ios/Example/Foundation/Popup/Floats.swift +0 -127
- package/example/ios/Example/Foundation/Popup/Popups.swift +0 -101
- package/example/ios/Example/Foundation/PopupDemo.swift +0 -366
- package/example/ios/Example/Foundation/TextInputDemo.swift +0 -31
- package/example/ios/Example/Foundation/TypographyDemo.swift +0 -53
- package/example/ios/Example/Foundation.swift +0 -26
- package/example/ios/Example/Info.plist +0 -18
- package/example/ios/Example/Library/SwipeableDemo.swift +0 -105
- package/example/ios/Example/Library.swift +0 -26
- package/example/ios/Example/Main.swift +0 -11
- package/example/ios/Example/Overview.swift +0 -20
- package/example/ios/Example/Preview Content/Preview Assets.xcassets/Contents.json +0 -6
- package/example/ios/Example/Resource/SFProText-Black.ttf +0 -0
- package/example/ios/Example/Resource/SFProText-Bold.ttf +0 -0
- package/example/ios/Example/Resource/SFProText-Heavy.ttf +0 -0
- package/example/ios/Example/Resource/SFProText-Light.ttf +0 -0
- package/example/ios/Example/Resource/SFProText-Medium.ttf +0 -0
- package/example/ios/Example/Resource/SFProText-Regular.ttf +0 -0
- package/example/ios/Example/Resource/SFProText-Semibold.ttf +0 -0
- package/example/ios/Example/Resource/SFProText-Thin.ttf +0 -0
- package/example/ios/Example/Resource/SFProText-Ultralight.ttf +0 -0
- package/example/ios/Example/Resource/foundation.json +0 -33
- package/example/ios/Example/Resource/library.json +0 -8
- package/example/ios/Example/Utils.swift +0 -30
- package/example/ios/Example/ViewModifier/DarkViewModifier.swift +0 -22
- package/example/ios/Example.xcodeproj/project.pbxproj +0 -570
- package/example/ios/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- package/example/ios/Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/example/ios/Example.xcodeproj/project.xcworkspace/xcuserdata/wem.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/example/ios/Example.xcodeproj/xcuserdata/wem.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
- package/example/ios/Example.xcworkspace/contents.xcworkspacedata +0 -10
- package/example/ios/Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/example/ios/Example.xcworkspace/xcuserdata/wem.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/example/ios/Example.xcworkspace/xcuserdata/wem.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +0 -6
- package/example/ios/Podfile +0 -6
- package/example/ios/Podfile.lock +0 -16
- package/example/ios/Pods/Local Podspecs/MoMoUIKits.podspec.json +0 -29
- package/example/ios/Pods/Manifest.lock +0 -16
- package/example/ios/Pods/Pods.xcodeproj/project.pbxproj +0 -661
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/wem.xcuserdatad/xcschemes/MoMoUIKits.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/wem.xcuserdatad/xcschemes/Pods-Example.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/wem.xcuserdatad/xcschemes/xcschememanagement.plist +0 -25
- package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits-dummy.m +0 -5
- package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits-prefix.pch +0 -12
- package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits-umbrella.h +0 -16
- package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits.debug.xcconfig +0 -12
- package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits.modulemap +0 -6
- package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits.release.xcconfig +0 -12
- package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example-acknowledgements.markdown +0 -3
- package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example-acknowledgements.plist +0 -29
- package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example-dummy.m +0 -5
- package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example-umbrella.h +0 -16
- package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig +0 -14
- package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example.modulemap +0 -6
- package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig +0 -14
- package/ios/Colors+Spacing/Radius.swift +0 -11
- package/ios/Popup/Utils++.swift +0 -163
- /package/ios/{Colors+Spacing → Colors+Radius+Spacing}/Spacing.swift +0 -0
package/README.md
CHANGED
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="GradleSettings">
|
|
4
|
+
<option name="linkedExternalProjectsSettings">
|
|
5
|
+
<GradleProjectSettings>
|
|
6
|
+
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
|
7
|
+
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
|
|
8
|
+
<option name="resolveExternalAnnotations" value="false" />
|
|
9
|
+
</GradleProjectSettings>
|
|
10
|
+
</option>
|
|
11
|
+
</component>
|
|
12
|
+
</project>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
|
4
|
+
<component name="ProjectRootManager">
|
|
5
|
+
<output url="file://$PROJECT_DIR$/build/classes" />
|
|
6
|
+
</component>
|
|
7
|
+
<component name="ProjectType">
|
|
8
|
+
<option name="id" value="Android" />
|
|
9
|
+
</component>
|
|
10
|
+
</project>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="AutoImportSettings">
|
|
4
|
+
<option name="autoReloadType" value="NONE" />
|
|
5
|
+
</component>
|
|
6
|
+
<component name="ChangeListManager">
|
|
7
|
+
<list default="true" id="7ac6a412-719a-420a-88c9-469c04bccebf" name="Changes" comment="" />
|
|
8
|
+
<option name="SHOW_DIALOG" value="false" />
|
|
9
|
+
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
10
|
+
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
|
11
|
+
<option name="LAST_RESOLUTION" value="IGNORE" />
|
|
12
|
+
</component>
|
|
13
|
+
<component name="ClangdSettings">
|
|
14
|
+
<option name="formatViaClangd" value="false" />
|
|
15
|
+
</component>
|
|
16
|
+
<component name="Git.Settings">
|
|
17
|
+
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/.." />
|
|
18
|
+
</component>
|
|
19
|
+
<component name="ProjectId" id="2a7VYs7GWpDvnabiqoEP3S5zR6T" />
|
|
20
|
+
<component name="ProjectViewState">
|
|
21
|
+
<option name="hideEmptyMiddlePackages" value="true" />
|
|
22
|
+
<option name="showLibraryContents" value="true" />
|
|
23
|
+
</component>
|
|
24
|
+
<component name="PropertiesComponent"><![CDATA[{
|
|
25
|
+
"keyToString": {
|
|
26
|
+
"RunOnceActivity.ShowReadmeOnStart": "true",
|
|
27
|
+
"RunOnceActivity.cidr.known.project.marker": "true",
|
|
28
|
+
"android.gradle.sync.needed": "true",
|
|
29
|
+
"cf.first.check.clang-format": "false",
|
|
30
|
+
"cidr.known.project.marker": "true",
|
|
31
|
+
"dart.analysis.tool.window.visible": "false",
|
|
32
|
+
"project.structure.last.edited": "Project",
|
|
33
|
+
"project.structure.proportion": "0.17",
|
|
34
|
+
"project.structure.side.proportion": "0.0",
|
|
35
|
+
"settings.editor.selected.configurable": "preferences.lookFeel",
|
|
36
|
+
"show.migrate.to.gradle.popup": "false"
|
|
37
|
+
}
|
|
38
|
+
}]]></component>
|
|
39
|
+
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
|
40
|
+
<component name="TaskManager">
|
|
41
|
+
<task active="true" id="Default" summary="Default task">
|
|
42
|
+
<changelist id="7ac6a412-719a-420a-88c9-469c04bccebf" name="Changes" comment="" />
|
|
43
|
+
<created>1703669655154</created>
|
|
44
|
+
<option name="number" value="Default" />
|
|
45
|
+
<option name="presentableId" value="Default" />
|
|
46
|
+
<updated>1703669655154</updated>
|
|
47
|
+
</task>
|
|
48
|
+
<servers />
|
|
49
|
+
</component>
|
|
50
|
+
</project>
|
package/android/build.gradle
CHANGED
|
@@ -1,82 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
repositories {
|
|
6
|
-
google()
|
|
7
|
-
mavenCentral()
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
dependencies {
|
|
11
|
-
classpath "com.android.tools.build:gradle:7.2.1"
|
|
12
|
-
// noinspection DifferentKotlinGradleVersion
|
|
13
|
-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
def isNewArchitectureEnabled() {
|
|
18
|
-
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
apply plugin: "com.android.library"
|
|
22
|
-
apply plugin: "kotlin-android"
|
|
23
|
-
|
|
24
|
-
if (isNewArchitectureEnabled()) {
|
|
25
|
-
apply plugin: "com.facebook.react"
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
def getExtOrDefault(name) {
|
|
29
|
-
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["NativeKits_" + name]
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
def getExtOrIntegerDefault(name) {
|
|
33
|
-
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["NativeKits_" + name]).toInteger()
|
|
1
|
+
plugins {
|
|
2
|
+
id 'com.android.library'
|
|
3
|
+
id 'org.jetbrains.kotlin.android'
|
|
34
4
|
}
|
|
35
5
|
|
|
36
6
|
android {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
release {
|
|
46
|
-
minifyEnabled false
|
|
7
|
+
namespace 'com.momoplatform.nativekits'
|
|
8
|
+
compileSdk 34
|
|
9
|
+
|
|
10
|
+
defaultConfig {
|
|
11
|
+
minSdk 23
|
|
12
|
+
targetSdk 34
|
|
13
|
+
versionCode 1
|
|
14
|
+
versionName "1.0"
|
|
47
15
|
}
|
|
48
|
-
}
|
|
49
16
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
17
|
+
compileOptions {
|
|
18
|
+
sourceCompatibility JavaVersion.VERSION_1_8
|
|
19
|
+
targetCompatibility JavaVersion.VERSION_1_8
|
|
20
|
+
}
|
|
53
21
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
22
|
+
kotlinOptions {
|
|
23
|
+
jvmTarget = '1.8'
|
|
24
|
+
}
|
|
58
25
|
|
|
59
|
-
|
|
26
|
+
buildFeatures {
|
|
27
|
+
compose true
|
|
28
|
+
}
|
|
60
29
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
30
|
+
composeOptions {
|
|
31
|
+
kotlinCompilerExtensionVersion = "1.5.8"
|
|
32
|
+
}
|
|
64
33
|
}
|
|
65
34
|
|
|
66
|
-
def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
67
|
-
|
|
68
35
|
dependencies {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
36
|
+
def composeBom = platform('androidx.compose:compose-bom:2023.10.01')
|
|
37
|
+
implementation composeBom
|
|
38
|
+
androidTestImplementation composeBom
|
|
39
|
+
implementation "androidx.compose.material3:material3"
|
|
40
|
+
implementation "androidx.compose.material:material:$rootProject.materialComposeVersion"
|
|
41
|
+
implementation "androidx.compose.foundation:foundation:$rootProject.composeVersion"
|
|
42
|
+
implementation "androidx.compose.ui:ui:$rootProject.composeVersion"
|
|
43
|
+
implementation "androidx.compose.ui:ui-tooling-preview:$rootProject.composeVersion"
|
|
44
|
+
debugImplementation "androidx.compose.ui:ui-tooling:$rootProject.composeVersion"
|
|
45
|
+
implementation("io.coil-kt:coil-compose:2.5.0")
|
|
46
|
+
implementation 'com.google.code.gson:gson:2.8.6'
|
|
75
47
|
|
|
76
|
-
if (isNewArchitectureEnabled()) {
|
|
77
|
-
react {
|
|
78
|
-
jsRootDir = file("../src/")
|
|
79
|
-
libraryName = "NativeKitsView"
|
|
80
|
-
codegenJavaPackageName = "com.momoplatform.nativekits"
|
|
81
|
-
}
|
|
82
48
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
## This file must *NOT* be checked into Version Control Systems,
|
|
2
|
+
# as it contains information specific to your local configuration.
|
|
3
|
+
#
|
|
4
|
+
# Location of the SDK. This is only used by Gradle.
|
|
5
|
+
# For customization when using a Version Control System, please read the
|
|
6
|
+
# header note.
|
|
7
|
+
#Wed Dec 27 16:34:14 ICT 2023
|
|
8
|
+
sdk.dir=/Users/wem/Library/Android/sdk
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Add project specific ProGuard rules here.
|
|
2
|
+
# You can control the set of applied configuration files using the
|
|
3
|
+
# proguardFiles setting in build.gradle.
|
|
4
|
+
#
|
|
5
|
+
# For more details, see
|
|
6
|
+
# http://developer.android.com/guide/developing/tools/proguard.html
|
|
7
|
+
|
|
8
|
+
# If your project uses WebView with JS, uncomment the following
|
|
9
|
+
# and specify the fully qualified class name to the JavaScript interface
|
|
10
|
+
# class:
|
|
11
|
+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
|
12
|
+
# public *;
|
|
13
|
+
#}
|
|
14
|
+
|
|
15
|
+
# Uncomment this to preserve the line number information for
|
|
16
|
+
# debugging stack traces.
|
|
17
|
+
#-keepattributes SourceFile,LineNumberTable
|
|
18
|
+
|
|
19
|
+
# If you keep the line number information, uncomment this to
|
|
20
|
+
# hide the original source file name.
|
|
21
|
+
#-renamesourcefileattribute SourceFile
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
package com.momoplatform.nativekits.foundations
|
|
2
|
+
|
|
3
|
+
import androidx.compose.material3.Text
|
|
4
|
+
import androidx.compose.runtime.Composable
|
|
5
|
+
import androidx.compose.ui.tooling.preview.Preview
|
|
6
|
+
|
|
7
|
+
@Composable
|
|
8
|
+
fun Button (){
|
|
9
|
+
Text("Button")
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@Preview
|
|
13
|
+
@Composable
|
|
14
|
+
fun ReviewButton (){
|
|
15
|
+
Button()
|
|
16
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
package com.momoplatform.nativekits.libs
|
|
2
|
+
|
|
3
|
+
import androidx.compose.foundation.background
|
|
4
|
+
import androidx.compose.foundation.border
|
|
5
|
+
import androidx.compose.foundation.layout.size
|
|
6
|
+
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
7
|
+
import androidx.compose.runtime.Composable
|
|
8
|
+
import androidx.compose.ui.Modifier
|
|
9
|
+
import androidx.compose.ui.draw.clip
|
|
10
|
+
import androidx.compose.ui.draw.shadow
|
|
11
|
+
import androidx.compose.ui.graphics.Color
|
|
12
|
+
import androidx.compose.ui.layout.ContentScale
|
|
13
|
+
import androidx.compose.ui.tooling.preview.Preview
|
|
14
|
+
import androidx.compose.ui.unit.dp
|
|
15
|
+
import coil.compose.AsyncImage
|
|
16
|
+
|
|
17
|
+
@Composable
|
|
18
|
+
fun Logo(
|
|
19
|
+
type: String = "image",
|
|
20
|
+
useShadow:Boolean = true,
|
|
21
|
+
useBorder:Boolean = true,
|
|
22
|
+
useBackground:Boolean = true,
|
|
23
|
+
backgroundColor: Color = Color(0xffd8d8d8),
|
|
24
|
+
shadowColor: Color = Color(0xffd8d8d8),
|
|
25
|
+
borderColor: Color = Color(0xffe2e2e2),
|
|
26
|
+
source: String = ""
|
|
27
|
+
) {
|
|
28
|
+
val radius = if (type == "image") 9.dp else 0.dp
|
|
29
|
+
|
|
30
|
+
var logoModifier = Modifier
|
|
31
|
+
.size(28.dp)
|
|
32
|
+
.clip(RoundedCornerShape(radius))
|
|
33
|
+
|
|
34
|
+
if (useBackground) {
|
|
35
|
+
logoModifier = logoModifier.background(color = backgroundColor)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (useBorder && type != "icon") {
|
|
39
|
+
logoModifier = logoModifier.border(width = 2.dp, color = borderColor, shape = RoundedCornerShape(9.dp))
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (useShadow) {
|
|
43
|
+
logoModifier = logoModifier.shadow(2.dp, ambientColor = shadowColor)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
AsyncImage(
|
|
47
|
+
model = source,
|
|
48
|
+
contentDescription = null,
|
|
49
|
+
modifier = logoModifier,
|
|
50
|
+
contentScale = ContentScale.Fit
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@Composable
|
|
55
|
+
@Preview
|
|
56
|
+
fun LogoPreview() {
|
|
57
|
+
Logo(
|
|
58
|
+
source = "https://static.momocdn.net/app/img/paylater/static/ic_service_vts_30kb.png",
|
|
59
|
+
useShadow = false,
|
|
60
|
+
shadowColor = Color.Green,
|
|
61
|
+
type = "icon"
|
|
62
|
+
)
|
|
63
|
+
}
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
package com.momoplatform.nativekits.libs
|
|
2
|
+
|
|
3
|
+
import androidx.compose.foundation.background
|
|
4
|
+
import androidx.compose.foundation.border
|
|
5
|
+
import androidx.compose.foundation.clickable
|
|
6
|
+
import androidx.compose.foundation.layout.Arrangement
|
|
7
|
+
import androidx.compose.foundation.layout.Column
|
|
8
|
+
import androidx.compose.foundation.layout.Row
|
|
9
|
+
import androidx.compose.foundation.layout.fillMaxWidth
|
|
10
|
+
import androidx.compose.foundation.layout.height
|
|
11
|
+
import androidx.compose.foundation.layout.padding
|
|
12
|
+
import androidx.compose.foundation.layout.size
|
|
13
|
+
import androidx.compose.foundation.layout.width
|
|
14
|
+
import androidx.compose.foundation.shape.CircleShape
|
|
15
|
+
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
16
|
+
import androidx.compose.material.Text
|
|
17
|
+
import androidx.compose.runtime.Composable
|
|
18
|
+
import androidx.compose.runtime.mutableStateOf
|
|
19
|
+
import androidx.compose.ui.Alignment
|
|
20
|
+
import androidx.compose.ui.Modifier
|
|
21
|
+
import androidx.compose.ui.draw.clip
|
|
22
|
+
import androidx.compose.ui.graphics.Color
|
|
23
|
+
import androidx.compose.ui.layout.ContentScale
|
|
24
|
+
import androidx.compose.ui.unit.dp
|
|
25
|
+
import androidx.compose.ui.unit.sp
|
|
26
|
+
import coil.compose.AsyncImage
|
|
27
|
+
import okhttp3.OkHttpClient
|
|
28
|
+
import okhttp3.Request
|
|
29
|
+
import kotlinx.coroutines.*
|
|
30
|
+
import androidx.compose.runtime.*
|
|
31
|
+
import com.google.gson.Gson
|
|
32
|
+
import com.google.gson.annotations.SerializedName
|
|
33
|
+
|
|
34
|
+
val defaultBanner = TrustBanner(
|
|
35
|
+
content = mapOf(
|
|
36
|
+
"vi" to "Bảo mật thông tin & An toàn tài sản của bạn là ưu tiên hàng đầu của MoMo.",
|
|
37
|
+
"en" to "Your data security and money safety are MoMo's top priorities."
|
|
38
|
+
),
|
|
39
|
+
pciImage = "https://static.momocdn.net/app/img/kits/trustBanner/pci.png",
|
|
40
|
+
sslImage = "https://static.momocdn.net/app/img/kits/trustBanner/ssl.png",
|
|
41
|
+
urlConfig = "https://momo.vn/an-toan-bao-mat",
|
|
42
|
+
featureCode = "login_and_security",
|
|
43
|
+
icons = listOf(
|
|
44
|
+
"https://static.momocdn.net/app/img/kits/trustBanner/ic_viettinbank.png",
|
|
45
|
+
"https://static.momocdn.net/app/img/kits/trustBanner/ic_agribank.png",
|
|
46
|
+
"https://static.momocdn.net/app/img/kits/trustBanner/ic_vietcombank.png",
|
|
47
|
+
"https://static.momocdn.net/app/img/kits/trustBanner/ic_bidv.png"
|
|
48
|
+
),
|
|
49
|
+
momoImage = "https://static.momocdn.net/app/img/kits/trustBanner/ic_momo_secu.png"
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
val defaultData = TrustBannerData(trustBanner = defaultBanner)
|
|
53
|
+
|
|
54
|
+
const val borderColor = 0xFFE8E8E8
|
|
55
|
+
const val tonalColor = 0xFFFDEAF4
|
|
56
|
+
const val backgroundBlue = 0xFFF2F8FF
|
|
57
|
+
const val contentColor = 0xFF484848
|
|
58
|
+
const val primaryColor = 0xFFEB2F96
|
|
59
|
+
const val jsonUrl = "https://static.momocdn.net/app/json/component-kits/design_system.json"
|
|
60
|
+
|
|
61
|
+
data class TrustBannerData(
|
|
62
|
+
val trustBanner: TrustBanner
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
data class TrustBanner (
|
|
66
|
+
val content: Map<String, String>,
|
|
67
|
+
|
|
68
|
+
val pciImage: String,
|
|
69
|
+
val sslImage: String,
|
|
70
|
+
val icons: List<String>,
|
|
71
|
+
val momoImage: String,
|
|
72
|
+
|
|
73
|
+
@SerializedName("url_config")
|
|
74
|
+
val urlConfig: String,
|
|
75
|
+
|
|
76
|
+
@SerializedName("feature_code")
|
|
77
|
+
val featureCode: String,
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
fun fetchJsonData(url: String, onFailure: (Exception) -> Unit) {
|
|
81
|
+
val client = OkHttpClient()
|
|
82
|
+
|
|
83
|
+
CoroutineScope(Dispatchers.IO).launch {
|
|
84
|
+
try {
|
|
85
|
+
val request = Request.Builder().url(url).build()
|
|
86
|
+
val response = client.newCall(request).execute()
|
|
87
|
+
|
|
88
|
+
if (!response.isSuccessful) {
|
|
89
|
+
onFailure(Exception("Unexpected code $response"))
|
|
90
|
+
} else {
|
|
91
|
+
response.body?.string()?.let { jsonString ->
|
|
92
|
+
withContext(Dispatchers.Main) {
|
|
93
|
+
Gson().fromJson(jsonString, TrustBannerData::class.java)
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
} catch (e: Exception) {
|
|
98
|
+
withContext(Dispatchers.Main) {
|
|
99
|
+
onFailure(e)
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@Composable
|
|
106
|
+
fun Avatar(iconURL: String) {
|
|
107
|
+
AsyncImage(
|
|
108
|
+
model = iconURL,
|
|
109
|
+
contentDescription = null,
|
|
110
|
+
modifier = Modifier
|
|
111
|
+
.size(24.dp)
|
|
112
|
+
.background(Color.White, CircleShape)
|
|
113
|
+
.border(width = 1.dp, color = Color(borderColor), CircleShape),
|
|
114
|
+
contentScale = ContentScale.Fit
|
|
115
|
+
)
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
@Composable
|
|
119
|
+
fun TrustBannerView(serviceName: String = "", screenName: String = "",onPress: ((Map<String, String>)->Unit)?, trackEvent: ((String, Map<String, String>)->Unit)?, language: String = "vi") {
|
|
120
|
+
var trustBannerData by remember { mutableStateOf<TrustBannerData?>(defaultData) }
|
|
121
|
+
var error by remember { mutableStateOf<String?>(null) }
|
|
122
|
+
|
|
123
|
+
LaunchedEffect(Unit) {
|
|
124
|
+
if (trackEvent != null) {
|
|
125
|
+
trackEvent("service_component_displayed",mapOf(
|
|
126
|
+
"service_name" to serviceName,
|
|
127
|
+
"screen_name" to screenName,
|
|
128
|
+
"component_name" to "logo_trust"
|
|
129
|
+
))
|
|
130
|
+
}
|
|
131
|
+
fetchJsonData(
|
|
132
|
+
url = jsonUrl,
|
|
133
|
+
onFailure = { exception ->
|
|
134
|
+
error = exception.message
|
|
135
|
+
}
|
|
136
|
+
)
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
when {
|
|
140
|
+
trustBannerData != null -> {
|
|
141
|
+
if (onPress != null) {
|
|
142
|
+
TrustBannerContent(trustBannerData!!.trustBanner,serviceName, screenName,onPress,trackEvent,language)
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
@Composable
|
|
149
|
+
fun TrustBannerContent(
|
|
150
|
+
trustBanner: TrustBanner,
|
|
151
|
+
serviceName: String,
|
|
152
|
+
screenName: String,
|
|
153
|
+
onPress: ((Map<String, String>) -> Unit)?,
|
|
154
|
+
trackEvent: ((String,Map<String, String>) -> Unit)?,
|
|
155
|
+
language: String
|
|
156
|
+
) {
|
|
157
|
+
Row(
|
|
158
|
+
modifier = Modifier
|
|
159
|
+
.clip(RoundedCornerShape(12.dp))
|
|
160
|
+
.background(color = Color(backgroundBlue))
|
|
161
|
+
.padding(12.dp)
|
|
162
|
+
.clickable {
|
|
163
|
+
if (trackEvent != null) {
|
|
164
|
+
trackEvent("service_component_clicked",mapOf(
|
|
165
|
+
"service_name" to serviceName,
|
|
166
|
+
"screen_name" to screenName,
|
|
167
|
+
"component_name" to "logo_trust",
|
|
168
|
+
"url_config" to trustBanner.urlConfig
|
|
169
|
+
))
|
|
170
|
+
}
|
|
171
|
+
if (onPress != null) {
|
|
172
|
+
onPress(mapOf(
|
|
173
|
+
"service_name" to serviceName,
|
|
174
|
+
"screen_name" to screenName,
|
|
175
|
+
"url_config" to trustBanner.urlConfig,
|
|
176
|
+
"feature_code" to trustBanner.featureCode
|
|
177
|
+
))
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
) {
|
|
181
|
+
AsyncImage(
|
|
182
|
+
model = trustBanner.momoImage,
|
|
183
|
+
contentDescription = "Momo mascot",
|
|
184
|
+
modifier = Modifier
|
|
185
|
+
.width(64.dp)
|
|
186
|
+
.height(64.dp)
|
|
187
|
+
.padding(end = 8.dp)
|
|
188
|
+
)
|
|
189
|
+
Column {
|
|
190
|
+
Text(
|
|
191
|
+
text = trustBanner.content[language] ?: "",
|
|
192
|
+
modifier = Modifier.padding(bottom = 8.dp),
|
|
193
|
+
lineHeight = 16.sp,
|
|
194
|
+
fontSize = 12.sp,
|
|
195
|
+
color = Color(contentColor),
|
|
196
|
+
maxLines = 2
|
|
197
|
+
)
|
|
198
|
+
Row(modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.SpaceBetween) {
|
|
199
|
+
Row {
|
|
200
|
+
AsyncImage(
|
|
201
|
+
model = trustBanner.pciImage, contentDescription = "PCI image", modifier = Modifier
|
|
202
|
+
.padding(end = 4.dp)
|
|
203
|
+
.width(52.dp)
|
|
204
|
+
.height(20.dp)
|
|
205
|
+
)
|
|
206
|
+
AsyncImage(
|
|
207
|
+
model = trustBanner.sslImage, contentDescription = "PCI image", modifier = Modifier
|
|
208
|
+
.width(52.dp)
|
|
209
|
+
.height(20.dp)
|
|
210
|
+
)
|
|
211
|
+
}
|
|
212
|
+
Row(
|
|
213
|
+
modifier = Modifier
|
|
214
|
+
.width(96.dp)
|
|
215
|
+
.height(24.dp),
|
|
216
|
+
horizontalArrangement = Arrangement.spacedBy((-6).dp)
|
|
217
|
+
) {
|
|
218
|
+
trustBanner.icons.forEach { iconURL ->
|
|
219
|
+
Avatar(iconURL = iconURL)
|
|
220
|
+
}
|
|
221
|
+
Row(
|
|
222
|
+
modifier = Modifier
|
|
223
|
+
.size(24.dp)
|
|
224
|
+
.background(color = Color(tonalColor), CircleShape)
|
|
225
|
+
.border(width = 1.dp, color = Color(borderColor), CircleShape),
|
|
226
|
+
verticalAlignment = Alignment.CenterVertically,
|
|
227
|
+
horizontalArrangement = Arrangement.Center
|
|
228
|
+
) {
|
|
229
|
+
Text(
|
|
230
|
+
text = "36+",
|
|
231
|
+
color = Color(primaryColor),
|
|
232
|
+
lineHeight = 14.sp,
|
|
233
|
+
fontSize = 10.sp
|
|
234
|
+
)
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
//@Preview
|
|
243
|
+
//@Composable
|
|
244
|
+
//fun TrustBannerPreview() {
|
|
245
|
+
//// TrustBannerView()
|
|
246
|
+
//}
|