linee 1 week ago
commit
d6dcd748cc
77 changed files with 4820 additions and 0 deletions
  1. 2 0
      .gitattributes
  2. 14 0
      .gitignore
  3. BIN
      EntryCard/entry/base/snapshot/widget-2x2.png
  4. 53 0
      build.gradle
  5. 52 0
      cert/fsmobile.cer
  6. 9 0
      cert/fsmobile.csr
  7. BIN
      cert/fsmobile.p12
  8. BIN
      cert/fsmobileDebug.p7b
  9. 52 0
      cert/fsmobile_release.cer
  10. BIN
      cert/fsmobile_releaseRelease.p7b
  11. 1 0
      cert/material/ac/e8b67a219383456c819d1a8b4b47937f
  12. BIN
      cert/material/ce/8b1052431ce24d3c94269d85acfca049
  13. 1 0
      cert/material/fd/0/dceca77d59b040c49ef95cfbd9e077d4
  14. 1 0
      cert/material/fd/1/ace0a047f5c04ab5ac866f38987fa4cd
  15. 1 0
      cert/material/fd/2/37106718cce9456ea0b37fd92ee8bb70
  16. 3 0
      cert/readme.txt
  17. 3 0
      entry/.gitignore
  18. 40 0
      entry/build.gradle
  19. 9 0
      entry/proguard-rules.pro
  20. 131 0
      entry/src/main/config.json
  21. 143 0
      entry/src/main/java/com/fujica/abk/MainAbility.java
  22. 10 0
      entry/src/main/java/com/fujica/abk/MyApplication.java
  23. 235 0
      entry/src/main/java/com/fujica/abk/slice/CircleDemoSlice.java
  24. 92 0
      entry/src/main/java/com/fujica/abk/slice/CodeLayoutSlice.java
  25. 129 0
      entry/src/main/java/com/fujica/abk/slice/GestureDemoSlice.java
  26. 149 0
      entry/src/main/java/com/fujica/abk/slice/HuaweiMapOptionsDemoSlice.java
  27. 646 0
      entry/src/main/java/com/fujica/abk/slice/MainAbilitySlice.java
  28. 162 0
      entry/src/main/java/com/fujica/abk/slice/MapEventsDemoSlice.java
  29. 136 0
      entry/src/main/java/com/fujica/abk/slice/MapTypeDemoSlice.java
  30. 195 0
      entry/src/main/java/com/fujica/abk/slice/MapViewCameraDemoSlice.java
  31. 105 0
      entry/src/main/java/com/fujica/abk/slice/MapViewDemoSlice.java
  32. 222 0
      entry/src/main/java/com/fujica/abk/slice/MarkerDemoSlice.java
  33. 216 0
      entry/src/main/java/com/fujica/abk/slice/PolygonDemoSlice.java
  34. 190 0
      entry/src/main/java/com/fujica/abk/slice/PolylineDemoSlice.java
  35. 24 0
      entry/src/main/java/com/fujica/abk/slice/XmlLayoutSlice.java
  36. 31 0
      entry/src/main/java/com/fujica/abk/utils/ScreenUtil.java
  37. 97 0
      entry/src/main/java/com/fujica/abk/widget/controller/FormController.java
  38. 183 0
      entry/src/main/java/com/fujica/abk/widget/controller/FormControllerManager.java
  39. 32 0
      entry/src/main/java/com/fujica/abk/widget/widget/WidgetImpl.java
  40. BIN
      entry/src/main/js/widget/common/ic_default_image@3x.png
  41. 6 0
      entry/src/main/js/widget/i18n/en-US.json
  42. 6 0
      entry/src/main/js/widget/i18n/zh-CN.json
  43. 61 0
      entry/src/main/js/widget/pages/index/index.css
  44. 11 0
      entry/src/main/js/widget/pages/index/index.hml
  45. 17 0
      entry/src/main/js/widget/pages/index/index.json
  46. 36 0
      entry/src/main/resources/base/element/string.json
  47. 6 0
      entry/src/main/resources/base/graphic/background_ability_main.xml
  48. 10 0
      entry/src/main/resources/base/graphic/background_button.xml
  49. 10 0
      entry/src/main/resources/base/graphic/background_circle_16.xml
  50. 9 0
      entry/src/main/resources/base/graphic/container_body.xml
  51. 15 0
      entry/src/main/resources/base/graphic/container_bottom.xml
  52. 12 0
      entry/src/main/resources/base/graphic/container_top.xml
  53. 225 0
      entry/src/main/resources/base/layout/ability_main.xml
  54. 199 0
      entry/src/main/resources/base/layout/ability_main_1.xml
  55. 15 0
      entry/src/main/resources/base/layout/button_layout.xml
  56. 249 0
      entry/src/main/resources/base/layout/layout_find_parking.xml
  57. 40 0
      entry/src/main/resources/base/layout/layout_my.xml
  58. 40 0
      entry/src/main/resources/base/layout/layout_reserve_parking.xml
  59. 53 0
      entry/src/main/resources/base/layout/xml_layout.xml
  60. BIN
      entry/src/main/resources/base/media/fee.png
  61. BIN
      entry/src/main/resources/base/media/fee_1.png
  62. BIN
      entry/src/main/resources/base/media/icon.png
  63. BIN
      entry/src/main/resources/base/media/location.png
  64. BIN
      entry/src/main/resources/base/media/my.png
  65. BIN
      entry/src/main/resources/base/media/my_1.png
  66. BIN
      entry/src/main/resources/base/media/park.png
  67. BIN
      entry/src/main/resources/base/media/park_1.png
  68. 36 0
      entry/src/main/resources/en_US/element/string.json
  69. 1 0
      entry/src/main/resources/rawfile/agconnect-services.json
  70. 36 0
      entry/src/main/resources/zh_CN/element/string.json
  71. 13 0
      gradle.properties
  72. BIN
      gradle/wrapper/gradle-wrapper.jar
  73. 5 0
      gradle/wrapper/gradle-wrapper.properties
  74. 234 0
      gradlew
  75. 103 0
      gradlew.bat
  76. 1 0
      package.json
  77. 2 0
      settings.gradle

+ 2 - 0
.gitattributes

@@ -0,0 +1,2 @@
+# Auto detect text files and perform LF normalization
+* text=auto

+ 14 - 0
.gitignore

@@ -0,0 +1,14 @@
+*.iml
+.gradle
+/local.properties
+/.idea
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+/entry/.preview
+.cxx
+/node_modules
+/.clangd
+/.clang-format
+/.clang-tidy

BIN
EntryCard/entry/base/snapshot/widget-2x2.png


+ 53 - 0
build.gradle

@@ -0,0 +1,53 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+apply plugin: 'com.huawei.ohos.app'
+
+//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides-V3/ide_debug_device-0000001053822404-V3#section1112183053510
+ohos {
+    signingConfigs {
+        debug {
+            storeFile file('C:\\Project\\fshwcar\\cert\\fsmobile.p12')
+            storePassword '0000001CEB4F303C1F917FACE40E54DD903DAA244F6A85060C3FBAEC885209376287140446F77782D72C24F0'
+            keyAlias = 'fsmobile'
+            keyPassword '0000001CBE3220C5D71E86C99668352AB197DCF86E6D275EA7BD5BD0F70F16E7EFA6946C2EFED89A953A5CA7'
+            signAlg = 'SHA256withECDSA'
+            profile file('C:\\Project\\fshwcar\\cert\\fsmobileDebug.p7b')
+            certpath file('C:\\Project\\fshwcar\\cert\\fsmobile.cer')
+        }
+        release {
+            storeFile file('C:\\Project\\fshwcar\\cert\\fsmobile.p12')
+            storePassword '0000001CDEEA99995A093DEA9454BB200B4DD2F0FFB42D52D31AC3A74E107843E37DE0BBE78BE6C3B1FFCF40'
+            keyAlias = 'fsmobile'
+            keyPassword '0000001C7B5E761A4B6B36B1E677BC59C92B651CE8E82EBDB4ACE8CC966905A80BA9E616D5B32F160163903E'
+            signAlg = 'SHA256withECDSA'
+            profile file('C:\\Project\\fshwcar\\cert\\fsmobile_releaseRelease.p7b')
+            certpath file('C:\\Project\\fshwcar\\cert\\fsmobile_release.cer')
+        }
+    }
+    compileSdkVersion 7
+}
+
+buildscript {
+    repositories {
+        maven {
+            url 'https://repo.huaweicloud.com/repository/maven/'
+        }
+        maven {
+            url 'https://developer.huawei.com/repo/'
+        }
+    }
+    dependencies {
+        classpath 'com.huawei.ohos:hap:3.1.5.0'
+        classpath 'com.huawei.ohos:decctest:1.2.7.20'
+    }
+}
+
+allprojects {
+    repositories {
+        maven {
+            url 'https://repo.huaweicloud.com/repository/maven/'
+        }
+        maven {
+            url 'https://developer.huawei.com/repo/'
+        }
+    }
+}

+ 52 - 0
cert/fsmobile.cer

@@ -0,0 +1,52 @@
+-----BEGIN CERTIFICATE-----
+MIICGjCCAaGgAwIBAgIIShhpn519jNAwCgYIKoZIzj0EAwMwUzELMAkGA1UEBhMC
+Q04xDzANBgNVBAoMBkh1YXdlaTETMBEGA1UECwwKSHVhd2VpIENCRzEeMBwGA1UE
+AwwVSHVhd2VpIENCRyBSb290IENBIEcyMB4XDTIwMDMxNjAzMDQzOVoXDTQ5MDMx
+NjAzMDQzOVowUzELMAkGA1UEBhMCQ04xDzANBgNVBAoMBkh1YXdlaTETMBEGA1UE
+CwwKSHVhd2VpIENCRzEeMBwGA1UEAwwVSHVhd2VpIENCRyBSb290IENBIEcyMHYw
+EAYHKoZIzj0CAQYFK4EEACIDYgAEWidkGnDSOw3/HE2y2GHl+fpWBIa5S+IlnNrs
+GUvwC1I2QWvtqCHWmwFlFK95zKXiM8s9yV3VVXh7ivN8ZJO3SC5N1TCrvB2lpHMB
+wcz4DA0kgHCMm/wDec6kOHx1xvCRo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0T
+AQH/BAUwAwEB/zAdBgNVHQ4EFgQUo45a9Vq8cYwqaiVyfkiS4pLcIAAwCgYIKoZI
+zj0EAwMDZwAwZAIwMypeB7P0IbY7c6gpWcClhRznOJFj8uavrNu2PIoz9KIqr3jn
+BlBHJs0myI7ntYpEAjBbm8eDMZY5zq5iMZUC6H7UzYSix4Uy1YlsLVV738PtKP9h
+FTjgDHctXJlC5L7+ZDY=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDATCCAoigAwIBAgIIXmuDXbWpOB8wCgYIKoZIzj0EAwMwUzELMAkGA1UEBhMC
+Q04xDzANBgNVBAoMBkh1YXdlaTETMBEGA1UECwwKSHVhd2VpIENCRzEeMBwGA1UE
+AwwVSHVhd2VpIENCRyBSb290IENBIEcyMB4XDTIwMDcwOTAyMDQyNFoXDTMwMDcw
+NzAyMDQyNFowYjELMAkGA1UEBgwCQ04xDzANBgNVBAoMBkh1YXdlaTETMBEGA1UE
+CwwKSHVhd2VpIENCRzEtMCsGA1UEAwwkSHVhd2VpIENCRyBEZXZlbG9wZXIgUmVs
+YXRpb25zIENBIEcyMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE65LdoIZh1hlpZ2gP
+bJ6gPhHsvYSRe22KETgdqeVeYnrbRHI9wsPT6RGYS+pU4mPl6wxzgDMqN6SY/BoZ
+luhkE1PzaHoPoNIWIq0O33hpyKyyYwAacIUEjYurkw1E9r9no4IBGDCCARQwHwYD
+VR0jBBgwFoAUo45a9Vq8cYwqaiVyfkiS4pLcIAAwHQYDVR0OBBYEFNtek7Ij6NDk
+/nF6Zumkc0dbf/NeMEYGA1UdIAQ/MD0wOwYEVR0gADAzMDEGCCsGAQUFBwIBFiVo
+dHRwOi8vY3BraS1jYXdlYi5odWF3ZWkuY29tL2Nwa2kvY3BzMBIGA1UdEwEB/wQI
+MAYBAf8CAQAwDgYDVR0PAQH/BAQDAgEGMGYGA1UdHwRfMF0wW6BZoFeGVWh0dHA6
+Ly9jcGtpLWNhd2ViLmh1YXdlaS5jb20vY3BraS9zZXJ2bGV0L2NybEZpbGVEb3du
+LmNybD9jZXJ0eXBlPTEwJi9yb290X2cyX2NybC5jcmwwCgYIKoZIzj0EAwMDZwAw
+ZAIwWO1X5q2MdfpR1Q237GpUHGbL1C13rGyFg2p3AYo44FpZ2/A9ss0wOHKM4KDl
+ZPqdAjBLkf8NPZy7KVog98+iCTLq35DJ2ZVxkCxknA9YhiHVyXf4HPm4JlT7rW7o
+Q+FzM3c=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDAzCCAoigAwIBAgIOCfwJdPTbOCp6ybxuPKgwCgYIKoZIzj0EAwMwYjELMAkG
+A1UEBgwCQ04xDzANBgNVBAoMBkh1YXdlaTETMBEGA1UECwwKSHVhd2VpIENCRzEt
+MCsGA1UEAwwkSHVhd2VpIENCRyBEZXZlbG9wZXIgUmVsYXRpb25zIENBIEcyMB4X
+DTI1MTAxMTAxNDMyNFoXDTI2MDQwOTAxNDMyNFowgbExCzAJBgNVBAYTAkNOMTAw
+LgYDVQQKDCfmt7HlnLPluILlr4zlo6vmmbrog73ogqHku73mnInpmZDlhazlj7gx
+HDAaBgNVBAsMEzE2Mzg0NjAyODEyMzMzODUxNTMxUjBQBgNVBAMMSea3seWcs+W4
+guWvjOWjq+aZuuiDveiCoeS7veaciemZkOWFrOWPuCgxNjM4NDYwMjgxMjMzMzg1
+MTUzKVwsRGV2ZWxvcG1lbnQwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAATQOjxJ
+0wAtt5kZlUbXv3Bw29dnyNP7lBx0DTczPaGa9rvCZxXIYM3GXPjDkGgXq1Z+ONwO
+eLBqBeAXCD9+vAv2o4HRMIHOMB0GA1UdDgQWBBQsUjnWv/MFHB/hXNdscvRHYHMs
+7TAMBgNVHRMBAf8EAjAAMB8GA1UdIwQYMBaAFNtek7Ij6NDk/nF6Zumkc0dbf/Ne
+MFkGA1UdHwRSMFAwTqBMoEqGSGh0dHA6Ly9oNWhvc3RpbmctZHJjbi5kYmFua2Nk
+bi5jbi9jY2g1L2NybC9oZHJjYWcyL0h1YXdlaUNCR0hEUkcyY3JsLmNybDAOBgNV
+HQ8BAf8EBAMCB4AwEwYDVR0lBAwwCgYIKwYBBQUHAwMwCgYIKoZIzj0EAwMDaQAw
+ZgIxAPm1pBSLQ00rVmvoLMiTlH17iJgYeuoTyjEppsjVdXmHq2MHRWRF468TZy3d
+062A5AIxAO3UADSFBV7YFntvrS1O47EFb1OAcGfkRwV5DyDWC++ZJQUJQlHgZwBd
+8JxsBec5mw==
+-----END CERTIFICATE-----

+ 9 - 0
cert/fsmobile.csr

@@ -0,0 +1,9 @@
+-----BEGIN NEW CERTIFICATE REQUEST-----
+MIIBNTCB3AIBADBKMQkwBwYDVQQGEwAxCTAHBgNVBAgTADEJMAcGA1UEBxMAMQkw
+BwYDVQQKEwAxCTAHBgNVBAsTADERMA8GA1UEAxMIZnNtb2JpbGUwWTATBgcqhkjO
+PQIBBggqhkjOPQMBBwNCAATQOjxJ0wAtt5kZlUbXv3Bw29dnyNP7lBx0DTczPaGa
+9rvCZxXIYM3GXPjDkGgXq1Z+ONwOeLBqBeAXCD9+vAv2oDAwLgYJKoZIhvcNAQkO
+MSEwHzAdBgNVHQ4EFgQULFI51r/zBRwf4VzXbHL0R2BzLO0wCgYIKoZIzj0EAwID
+SAAwRQIhAKXlQb7zRyqvmtGWsqQvkHgs/DG3v+p/0qEXwHriLqevAiAto8va7Wke
+K15mCWDau+Kg85jH9n6F3oB7COrYyzyigQ==
+-----END NEW CERTIFICATE REQUEST-----

BIN
cert/fsmobile.p12


BIN
cert/fsmobileDebug.p7b


+ 52 - 0
cert/fsmobile_release.cer

@@ -0,0 +1,52 @@
+-----BEGIN CERTIFICATE-----
+MIICGjCCAaGgAwIBAgIIShhpn519jNAwCgYIKoZIzj0EAwMwUzELMAkGA1UEBhMC
+Q04xDzANBgNVBAoMBkh1YXdlaTETMBEGA1UECwwKSHVhd2VpIENCRzEeMBwGA1UE
+AwwVSHVhd2VpIENCRyBSb290IENBIEcyMB4XDTIwMDMxNjAzMDQzOVoXDTQ5MDMx
+NjAzMDQzOVowUzELMAkGA1UEBhMCQ04xDzANBgNVBAoMBkh1YXdlaTETMBEGA1UE
+CwwKSHVhd2VpIENCRzEeMBwGA1UEAwwVSHVhd2VpIENCRyBSb290IENBIEcyMHYw
+EAYHKoZIzj0CAQYFK4EEACIDYgAEWidkGnDSOw3/HE2y2GHl+fpWBIa5S+IlnNrs
+GUvwC1I2QWvtqCHWmwFlFK95zKXiM8s9yV3VVXh7ivN8ZJO3SC5N1TCrvB2lpHMB
+wcz4DA0kgHCMm/wDec6kOHx1xvCRo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0T
+AQH/BAUwAwEB/zAdBgNVHQ4EFgQUo45a9Vq8cYwqaiVyfkiS4pLcIAAwCgYIKoZI
+zj0EAwMDZwAwZAIwMypeB7P0IbY7c6gpWcClhRznOJFj8uavrNu2PIoz9KIqr3jn
+BlBHJs0myI7ntYpEAjBbm8eDMZY5zq5iMZUC6H7UzYSix4Uy1YlsLVV738PtKP9h
+FTjgDHctXJlC5L7+ZDY=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDATCCAoigAwIBAgIIXmuDXbWpOB8wCgYIKoZIzj0EAwMwUzELMAkGA1UEBhMC
+Q04xDzANBgNVBAoMBkh1YXdlaTETMBEGA1UECwwKSHVhd2VpIENCRzEeMBwGA1UE
+AwwVSHVhd2VpIENCRyBSb290IENBIEcyMB4XDTIwMDcwOTAyMDQyNFoXDTMwMDcw
+NzAyMDQyNFowYjELMAkGA1UEBgwCQ04xDzANBgNVBAoMBkh1YXdlaTETMBEGA1UE
+CwwKSHVhd2VpIENCRzEtMCsGA1UEAwwkSHVhd2VpIENCRyBEZXZlbG9wZXIgUmVs
+YXRpb25zIENBIEcyMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE65LdoIZh1hlpZ2gP
+bJ6gPhHsvYSRe22KETgdqeVeYnrbRHI9wsPT6RGYS+pU4mPl6wxzgDMqN6SY/BoZ
+luhkE1PzaHoPoNIWIq0O33hpyKyyYwAacIUEjYurkw1E9r9no4IBGDCCARQwHwYD
+VR0jBBgwFoAUo45a9Vq8cYwqaiVyfkiS4pLcIAAwHQYDVR0OBBYEFNtek7Ij6NDk
+/nF6Zumkc0dbf/NeMEYGA1UdIAQ/MD0wOwYEVR0gADAzMDEGCCsGAQUFBwIBFiVo
+dHRwOi8vY3BraS1jYXdlYi5odWF3ZWkuY29tL2Nwa2kvY3BzMBIGA1UdEwEB/wQI
+MAYBAf8CAQAwDgYDVR0PAQH/BAQDAgEGMGYGA1UdHwRfMF0wW6BZoFeGVWh0dHA6
+Ly9jcGtpLWNhd2ViLmh1YXdlaS5jb20vY3BraS9zZXJ2bGV0L2NybEZpbGVEb3du
+LmNybD9jZXJ0eXBlPTEwJi9yb290X2cyX2NybC5jcmwwCgYIKoZIzj0EAwMDZwAw
+ZAIwWO1X5q2MdfpR1Q237GpUHGbL1C13rGyFg2p3AYo44FpZ2/A9ss0wOHKM4KDl
+ZPqdAjBLkf8NPZy7KVog98+iCTLq35DJ2ZVxkCxknA9YhiHVyXf4HPm4JlT7rW7o
+Q+FzM3c=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIC/zCCAoSgAwIBAgIOCfvy1z4yGQuLcHIAr5gwCgYIKoZIzj0EAwMwYjELMAkG
+A1UEBgwCQ04xDzANBgNVBAoMBkh1YXdlaTETMBEGA1UECwwKSHVhd2VpIENCRzEt
+MCsGA1UEAwwkSHVhd2VpIENCRyBEZXZlbG9wZXIgUmVsYXRpb25zIENBIEcyMB4X
+DTI1MDMxMTA4MDkwOFoXDTI4MDMxMTA4MDkwOFowga0xCzAJBgNVBAYTAkNOMTAw
+LgYDVQQKDCfmt7HlnLPluILlr4zlo6vmmbrog73ogqHku73mnInpmZDlhazlj7gx
+HDAaBgNVBAsMEzE2Mzg0NjAyODEyMzMzODUxNTMxTjBMBgNVBAMMRea3seWcs+W4
+guWvjOWjq+aZuuiDveiCoeS7veaciemZkOWFrOWPuCgxNjM4NDYwMjgxMjMzMzg1
+MTUzKVwsUmVsZWFzZTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABNA6PEnTAC23
+mRmVRte/cHDb12fI0/uUHHQNNzM9oZr2u8JnFchgzcZc+MOQaBerVn443A54sGoF
+4BcIP368C/ajgdEwgc4wHQYDVR0OBBYEFCxSOda/8wUcH+Fc12xy9EdgcyztMAwG
+A1UdEwEB/wQCMAAwHwYDVR0jBBgwFoAU216TsiPo0OT+cXpm6aRzR1t/814wWQYD
+VR0fBFIwUDBOoEygSoZIaHR0cDovL2g1aG9zdGluZy1kcmNuLmRiYW5rY2RuLmNu
+L2NjaDUvY3JsL2hkcmNhZzIvSHVhd2VpQ0JHSERSRzJjcmwuY3JsMA4GA1UdDwEB
+/wQEAwIHgDATBgNVHSUEDDAKBggrBgEFBQcDAzAKBggqhkjOPQQDAwNpADBmAjEA
+l1b+5LMtkCAmC/LQdnP52jdokIg2CE7ZajuaobfSxL+aRut3KrnFdyMvpQg0uMZI
+AjEAr7sc+CoE9qLRm6FjBDqHPotsh685xikUfTQp6t1jPuiP6r69oFSo8k2tKW/S
+lA9v
+-----END CERTIFICATE-----

BIN
cert/fsmobile_releaseRelease.p7b


+ 1 - 0
cert/material/ac/e8b67a219383456c819d1a8b4b47937f

@@ -0,0 +1 @@
+тО=рЉ�чm+���­С%

BIN
cert/material/ce/8b1052431ce24d3c94269d85acfca049


+ 1 - 0
cert/material/fd/0/dceca77d59b040c49ef95cfbd9e077d4

@@ -0,0 +1 @@
++Wnx.�霮植鷸r�

+ 1 - 0
cert/material/fd/1/ace0a047f5c04ab5ac866f38987fa4cd

@@ -0,0 +1 @@
+JëÊ­O¸¬ÈA¤¾¯œKÃ

+ 1 - 0
cert/material/fd/2/37106718cce9456ea0b37fd92ee8bb70

@@ -0,0 +1 @@
+нО╞o?ъдVRL╦╙©░8

+ 3 - 0
cert/readme.txt

@@ -0,0 +1,3 @@
+file: fsmobile
+alias: fsmobile
+password: fujica123abk

+ 3 - 0
entry/.gitignore

@@ -0,0 +1,3 @@
+/build
+/node_modules
+/.cxx

+ 40 - 0
entry/build.gradle

@@ -0,0 +1,40 @@
+apply plugin: 'com.huawei.ohos.hap'
+apply plugin: 'com.huawei.ohos.decctest'
+//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides-V3/ide_debug_device-0000001053822404-V3#section1112183053510
+ohos {
+    signingConfigs {
+        debug {
+            storeFile file('C:\\Users\\PC-ZH\\.ohos\\config\\auto_debug_fshwcar_com.fujica.abk_2850086000523307485.p12')
+            storePassword '0000001B0F03428055BB9C18944B18A4411F9CA525E39C37AC552959797457213E23D65A3C840C5B27AC9D'
+            keyAlias = 'debugKey'
+            keyPassword '0000001BE861C837E8575F16DFDFDC1A9DF87DA297E31AD085280889BA1405C4427529138496CCF7452060'
+            signAlg = 'SHA256withECDSA'
+            profile file('C:\\Users\\PC-ZH\\.ohos\\config\\auto_debug_fshwcar_com.fujica.abk_2850086000523307485.p7b')
+            certpath file('C:\\Users\\PC-ZH\\.ohos\\config\\auto_debug_fshwcar_com.fujica.abk_2850086000523307485.cer')
+        }
+    }
+    compileSdkVersion 7
+    defaultConfig {
+        compatibleSdkVersion 7
+    }
+    showInServiceCenter true
+    buildTypes {
+        release {
+            proguardOpt {
+                proguardEnabled false
+                rulesFiles 'proguard-rules.pro'
+            }
+        }
+    }
+}
+
+dependencies {
+    implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])
+    // 华为地图 SDK 依赖
+    implementation 'com.huawei.hms:maps-harmony:6.4.0.300'
+    testImplementation 'junit:junit:4.13.1'
+    ohosTestImplementation 'com.huawei.ohos.testkit:runner:2.0.0.400'
+}
+decc {
+    supportType = ['html', 'xml']
+}

+ 9 - 0
entry/proguard-rules.pro

@@ -0,0 +1,9 @@
+-ignorewarnings
+-keepattributes *Annotation*
+-keepattributes Exceptions
+-keepattributes InnerClasses
+-keepattributes Signature
+-keepattributes SourceFile,LineNumberTable
+-keep class com.huawei.hianalytics.**{*;}
+-keep class com.huawei.updatesdk.**{*;}
+-keep class com.huawei.hms.**{*;}

+ 131 - 0
entry/src/main/config.json

@@ -0,0 +1,131 @@
+{
+  "app": {
+    "vendor": "example",
+    "bundleName": "com.fujica.abk",
+    "version": {
+      "code": 1000000,
+      "name": "1.0.0"
+    }
+  },
+  "deviceConfig": {},
+  "module": {
+    "allowClassMap": true,
+    "reqPermissions": [
+      {
+        "name": "ohos.permission.LOCATION",
+        "reason": "需要定位权限以在地图上显示当前位置",
+        "usedScene": {
+          "ability": [
+            "com.fujica.abk.MainAbility"
+          ],
+          "when": "inuse"
+        }
+      },
+      {
+        "name": "ohos.permission.APPROXIMATELY_LOCATION",
+        "reason": "需要大致位置权限",
+        "usedScene": {
+          "ability": [
+            "com.fujica.abk.MainAbility"
+          ],
+          "when": "inuse"
+        }
+      },
+      {
+        "name": "ohos.permission.INTERNET",
+        "reason": "access internet",
+        "usedScene": {
+          "ability": [
+            "com.fujica.abk.MainAbility"
+          ],
+          "when": "always"
+        }
+      },
+      {
+        "name": "ohos.permission.GET_NETWORK_INFO",
+        "reason": "GET_NETWORK_INFO",
+        "usedScene": {
+          "ability": [
+            "com.fujica.abk.MainAbility"
+          ],
+          "when": "always"
+        }
+      }
+    ],
+    "metaData":{
+      "customizeData":[
+        {
+          "name": "hwc-theme",
+          "value": "androidhwext:style/Theme.Emui.Light.NoTitleBar",
+          "extra": ""
+        }
+      ]
+    },
+    "mainAbility": "com.fujica.abk.MainAbility",
+    "deviceType": [
+      "car","phone"
+    ],
+    "abilities": [
+      {
+        "skills": [
+          {
+            "entities": [
+              "entity.system.home"
+            ],
+            "actions": [
+              "action.system.home"
+            ]
+          }
+        ],
+        "orientation": "landscape",
+        "visible": true,
+        "name": "com.fujica.abk.MainAbility",
+        "icon": "$media:icon",
+        "description": "$string:mainability_description",
+        "formsEnabled": true,
+        "label": "$string:entry_MainAbility",
+        "type": "page",
+        "forms": [
+          {
+            "jsComponentName": "widget",
+            "isDefault": true,
+            "scheduledUpdateTime": "10:30",
+            "defaultDimension": "2*2",
+            "name": "widget",
+            "description": "This is a service widget.",
+            "colorMode": "auto",
+            "type": "JS",
+            "supportDimensions": [
+              "2*2"
+            ],
+            "updateEnabled": true,
+            "updateDuration": 1
+          }
+        ],
+        "launchType": "standard"
+      }
+    ],
+    "distro": {
+      "moduleType": "entry",
+      "installationFree": true,
+      "deliveryWithInstall": true,
+      "moduleName": "entry"
+    },
+    "package": "com.fujica.abk",
+    "name": ".MyApplication",
+    "js": [
+      {
+        "pages": [
+          "pages/index/index"
+        ],
+        "name": "widget",
+        "window": {
+          "designWidth": 720,
+          "autoDesignWidth": true
+        },
+        "type": "form"
+      }
+    ]
+  }
+
+}

+ 143 - 0
entry/src/main/java/com/fujica/abk/MainAbility.java

@@ -0,0 +1,143 @@
+package com.fujica.abk;
+
+import com.fujica.abk.slice.MainAbilitySlice;
+import ohos.aafwk.ability.Ability;
+import ohos.aafwk.content.Intent;
+import com.fujica.abk.widget.controller.FormController;
+import com.fujica.abk.widget.controller.FormControllerManager;
+import ohos.aafwk.ability.AbilitySlice;
+import ohos.aafwk.ability.ProviderFormInfo;
+import ohos.agp.window.service.WindowManager;
+import ohos.hiviewdfx.HiLog;
+import ohos.hiviewdfx.HiLogLabel;
+import ohos.agp.window.service.Window;
+
+public class MainAbility extends Ability {
+    public static final int DEFAULT_DIMENSION_2X2 = 2; //System-defined constant. Do not change its value.
+    private static final int INVALID_FORM_ID = -1;
+    private static final HiLogLabel TAG = new HiLogLabel(HiLog.DEBUG, 0x0, MainAbility.class.getName());
+    private String topWidgetSlice;
+
+    @Override
+    public void onStart(Intent intent) {
+        super.onStart(intent);
+        // 设置全屏显示
+        setFullScreen();
+        super.setMainRoute(MainAbilitySlice.class.getName());
+        if (intentFromWidget(intent)) {
+            topWidgetSlice = getRoutePageSlice(intent);
+            if (topWidgetSlice != null) {
+                setMainRoute(topWidgetSlice);
+            }
+        }
+    }
+
+    /**
+     * 设置全屏显示
+     */
+    private void setFullScreen() {
+        try {
+            // 设置窗口全屏
+            Window window = getWindow();
+            if (window != null) {
+                // 获取当前的布局配置
+                WindowManager.LayoutConfig layoutConfig = window.getLayoutConfig().orElse(null);
+                if (layoutConfig == null) {
+                    // 如果配置不存在,创建新的配置
+                    layoutConfig = new WindowManager.LayoutConfig();
+                }
+                // 设置全屏模式,这会隐藏状态栏和标题栏
+                layoutConfig.type = WindowManager.LayoutConfig.MARK_FULL_SCREEN;
+                // 应用配置
+                window.setLayoutConfig(layoutConfig);
+            }
+        } catch (Exception e) {
+            HiLog.error(TAG, "设置全屏失败: " + e.getMessage());
+        }
+    }
+
+    @Override
+    protected ProviderFormInfo onCreateForm(Intent intent) {
+        HiLog.info(TAG, "onCreateForm");
+        long formId = intent.getLongParam(AbilitySlice.PARAM_FORM_IDENTITY_KEY, INVALID_FORM_ID);
+        String formName = intent.getStringParam(AbilitySlice.PARAM_FORM_NAME_KEY);
+        int dimension = intent.getIntParam(AbilitySlice.PARAM_FORM_DIMENSION_KEY, DEFAULT_DIMENSION_2X2);
+        HiLog.info(TAG, "onCreateForm: formId=" + formId + ",formName=" + formName);
+        FormControllerManager formControllerManager = FormControllerManager.getInstance(this);
+        FormController formController = formControllerManager.getController(formId);
+        formController = (formController == null) ? formControllerManager.createFormController(formId,
+                formName, dimension) : formController;
+        if (formController == null) {
+            HiLog.error(TAG, "Get null controller. formId: " + formId + ", formName: " + formName);
+            return null;
+        }
+        return formController.bindFormData(formId);
+    }
+
+    @Override
+    protected void onUpdateForm(long formId) {
+        HiLog.info(TAG, "onUpdateForm");
+        super.onUpdateForm(formId);
+        FormControllerManager formControllerManager = FormControllerManager.getInstance(this);
+        FormController formController = formControllerManager.getController(formId);
+        formController.onUpdateFormData(formId);
+    }
+
+    @Override
+    protected void onDeleteForm(long formId) {
+        HiLog.info(TAG, "onDeleteForm: formId=" + formId);
+        super.onDeleteForm(formId);
+        FormControllerManager formControllerManager = FormControllerManager.getInstance(this);
+        FormController formController = formControllerManager.getController(formId);
+        formController.onDeleteForm(formId);
+        formControllerManager.deleteFormController(formId);
+    }
+
+    @Override
+    protected void onTriggerFormEvent(long formId, String message) {
+        HiLog.info(TAG, "onTriggerFormEvent: " + message);
+        super.onTriggerFormEvent(formId, message);
+        FormControllerManager formControllerManager = FormControllerManager.getInstance(this);
+        FormController formController = formControllerManager.getController(formId);
+        formController.onTriggerFormEvent(formId, message);
+    }
+
+    @Override
+    public void onNewIntent(Intent intent) {
+        // Only response to it when starting from a service widget.
+        if (intentFromWidget(intent)) {
+            String newWidgetSlice = getRoutePageSlice(intent);
+            if (topWidgetSlice == null || !topWidgetSlice.equals(newWidgetSlice)) {
+                topWidgetSlice = newWidgetSlice;
+                restart();
+            }
+        } else {
+            if (topWidgetSlice != null) {
+                topWidgetSlice = null;
+                restart();
+            }
+        }
+    }
+
+    private boolean intentFromWidget(Intent intent) {
+        long formId = intent.getLongParam(AbilitySlice.PARAM_FORM_IDENTITY_KEY, INVALID_FORM_ID);
+        return formId != INVALID_FORM_ID;
+    }
+
+    private String getRoutePageSlice(Intent intent) {
+        long formId = intent.getLongParam(AbilitySlice.PARAM_FORM_IDENTITY_KEY, INVALID_FORM_ID);
+        if (formId == INVALID_FORM_ID) {
+            return null;
+        }
+        FormControllerManager formControllerManager = FormControllerManager.getInstance(this);
+        FormController formController = formControllerManager.getController(formId);
+        if (formController == null) {
+            return null;
+        }
+        Class<? extends AbilitySlice> clazz = formController.getRoutePageSlice(intent);
+        if (clazz == null) {
+            return null;
+        }
+        return clazz.getName();
+    }
+}

+ 10 - 0
entry/src/main/java/com/fujica/abk/MyApplication.java

@@ -0,0 +1,10 @@
+package com.fujica.abk;
+
+import ohos.aafwk.ability.AbilityPackage;
+
+public class MyApplication extends AbilityPackage {
+    @Override
+    public void onInitialize() {
+        super.onInitialize();
+    }
+}

+ 235 - 0
entry/src/main/java/com/fujica/abk/slice/CircleDemoSlice.java

@@ -0,0 +1,235 @@
+/*
+ * Copyright (c) Huawei Technologies Co., Ltd. 2008-2021. All rights reserved.
+ */
+
+package com.fujica.abk.slice;
+
+import com.fujica.abk.ResourceTable;
+import com.fujica.abk.utils.ScreenUtil;
+import com.huawei.hms.maps.harmony.HuaweiMap;
+import com.huawei.hms.maps.harmony.OnMapReadyCallback;
+import com.huawei.hms.maps.harmony.CameraUpdateFactory;
+import com.huawei.hms.maps.harmony.MapView;
+import com.huawei.hms.maps.harmony.CommonContext;
+import com.huawei.hms.maps.harmony.model.LatLng;
+import com.huawei.hms.maps.harmony.model.Circle;
+import com.huawei.hms.maps.harmony.model.CircleOptions;
+import ohos.aafwk.ability.AbilitySlice;
+import ohos.aafwk.content.Intent;
+import ohos.agp.colors.RgbColor;
+import ohos.agp.components.Button;
+import ohos.agp.components.Component;
+import ohos.agp.components.ComponentContainer;
+import ohos.agp.components.PositionLayout;
+import ohos.agp.components.LayoutScatter;
+import ohos.agp.components.element.ShapeElement;
+import ohos.agp.utils.Color;
+
+public class CircleDemoSlice extends AbilitySlice{
+    private HuaweiMap mHuaweiMap;
+
+    /**
+     * Declare a MapView object.
+     */
+    private MapView mMapView;
+
+    /**
+     * Declare a Circle object.
+     */
+    private Circle mCircle;
+
+    private boolean fillColorStatus = true;
+
+    private boolean strokeColorStatus = true;
+
+    /**
+     * the layout
+     */
+    private PositionLayout rootLayout;
+
+    @Override
+    public void onStart(Intent intent) {
+        super.onStart(intent);
+        initPositionLayout();
+        initMapView();
+        addButtons();
+        super.setUIContent(this.rootLayout);
+    }
+
+    private void initPositionLayout() {
+        rootLayout = new PositionLayout(this);
+        this.rootLayout.setContentPosition(0, 0);
+        this.rootLayout.setWidth(ComponentContainer.LayoutConfig.MATCH_PARENT);
+        this.rootLayout.setHeight(ComponentContainer.LayoutConfig.MATCH_PARENT);
+
+        ShapeElement element = new ShapeElement();
+        element.setShape(ShapeElement.RECTANGLE);
+        element.setRgbColor(new RgbColor(255, 255, 255));
+        this.rootLayout.setBackground(element);
+    }
+
+    private void initMapView() {
+        CommonContext.setContext(this);
+
+        // Initialize MapView Object.
+        mMapView = new MapView(this);
+        mMapView.onCreate();
+
+        // Obtain a HuaweiMap object.
+        mMapView.getMapAsync(new OnMapReadyCallback() {
+            @Override
+            public void onMapReady(HuaweiMap huaweiMap) {
+                mHuaweiMap = huaweiMap;
+
+                // If mHuaweiMap is null, the program stops running.
+                if (null == mHuaweiMap) {
+                    return;
+                }
+
+                if (null != mCircle) {
+                    mCircle.remove();
+                    mCircle = null;
+                }
+
+                mCircle = mHuaweiMap.addCircle(new CircleOptions()
+                        .center(new LatLng(48.893478, 2.334595))
+                        .radius(500)
+                        .fillColor(Color.GREEN.getValue()));
+
+                int strokeColor = Color.RED.getValue();
+                float strokeWidth = 15.0f;
+
+                // Set the edge color of a circle
+                mCircle.setStrokeColor(strokeColor);
+
+                // Sets the edge width of a circle
+                mCircle.setStrokeWidth(strokeWidth);
+
+                // move camera
+                mHuaweiMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(48.893478, 2.334595), 12));
+            }
+        });
+
+        this.rootLayout.addComponent(mMapView);
+    }
+
+    private void addButtons() {
+        int height = ScreenUtil.getScreenHeight(this);
+
+        Button buttonHollowCircle = createButton();
+        buttonHollowCircle.setText("HollowCircle");
+        buttonHollowCircle.setContentPosition(50, (float) height / 2 - 100);
+        this.rootLayout.addComponent(buttonHollowCircle);
+
+        Button buttonStrokeColor = createButton();
+        buttonStrokeColor.setText("StrokeColor");
+        buttonStrokeColor.setContentPosition(50, (float) height / 2);
+        this.rootLayout.addComponent(buttonStrokeColor);
+
+        Button buttonFillColor = createButton();
+        buttonFillColor.setText("FillColor");
+        buttonFillColor.setContentPosition(50, (float) height / 2 + 100);
+        this.rootLayout.addComponent(buttonFillColor);
+
+        buttonHollowCircle.setClickedListener(new Component.ClickedListener() {
+            @Override
+            public void onClick(Component component) {
+                // Set a hollow circle.
+                if (null != mCircle) {
+                    // Set the fill color of the circle to transparent.
+                    mCircle.setFillColor(Color.TRANSPARENT.getValue());
+                    // Set the stroke color of the circle.
+                    mCircle.setStrokeColor(Color.RED.getValue());
+                    // Set the stroke width of the circle.
+                    mCircle.setStrokeWidth(15.0f);
+                }
+            }
+        });
+
+        buttonStrokeColor.setClickedListener(new Component.ClickedListener() {
+            @Override
+            public void onClick(Component component) {
+                if (null == mCircle) {
+                    return;
+                }
+                if (strokeColorStatus) {
+                    // Set the stroke color of the circle (mCircle) to red.
+                    mCircle.setStrokeColor(Color.RED.getValue());
+                } else {
+                    // Set the stroke color of the circle (mCircle) to green.
+                    mCircle.setStrokeColor(Color.GREEN.getValue());
+                }
+                strokeColorStatus = !strokeColorStatus;
+            }
+        });
+
+        buttonFillColor.setClickedListener(new Component.ClickedListener() {
+            @Override
+            public void onClick(Component component) {
+                if (null == mCircle) {
+                    return;
+                }
+                if (fillColorStatus) {
+                    // Set the fill color of the circle (mCircle) to red.
+                    mCircle.setFillColor(Color.RED.getValue());
+                } else {
+                    // Set the fill color of the circle (mCircle) to green.
+                    mCircle.setFillColor(Color.GREEN.getValue());
+                }
+                fillColorStatus = !fillColorStatus;
+            }
+        });
+    }
+
+    /**
+     * Create button
+     *
+     * @return Button
+     */
+    private Button createButton() {
+        Component component = LayoutScatter.getInstance(getContext())
+                .parse(ResourceTable.Layout_button_layout, null, false);
+        return (Button) component;
+    }
+
+    @Override
+    protected void onActive() {
+        super.onActive();
+        if (mMapView != null) {
+            mMapView.onResume();
+        }
+    }
+
+    @Override
+    protected void onInactive() {
+        super.onInactive();
+        if (mMapView != null) {
+            mMapView.onPause();
+        }
+    }
+
+    @Override
+    protected void onBackground() {
+        super.onBackground();
+        if (mMapView != null) {
+            mMapView.onStop();
+        }
+    }
+
+    @Override
+    protected void onForeground(Intent intent) {
+        super.onForeground(intent);
+        if (mMapView != null) {
+            mMapView.onStart();
+        }
+    }
+
+    @Override
+    protected void onStop() {
+        super.onStop();
+        if (mMapView != null) {
+            mMapView.onDestroy();
+        }
+    }
+}
+

+ 92 - 0
entry/src/main/java/com/fujica/abk/slice/CodeLayoutSlice.java

@@ -0,0 +1,92 @@
+package com.fujica.abk.slice;
+
+import ohos.aafwk.ability.AbilitySlice;
+import ohos.aafwk.content.Intent;
+import ohos.agp.components.*;
+import ohos.agp.utils.TextAlignment;
+
+public class CodeLayoutSlice extends AbilitySlice {
+    @Override
+    public void onStart(Intent intent) {
+        super.onStart(intent);
+        
+        // 创建主布局 - 垂直方向布局
+        DirectionalLayout mainLayout = new DirectionalLayout(this);
+        mainLayout.setWidth(ComponentContainer.LayoutConfig.MATCH_PARENT);
+        mainLayout.setHeight(ComponentContainer.LayoutConfig.MATCH_PARENT);
+        mainLayout.setOrientation(Component.VERTICAL);
+        mainLayout.setPadding(32, 32, 32, 32);
+        
+        // 创建标题文本
+        Text titleText = new Text(this);
+        titleText.setText("代码布局页面");
+        titleText.setTextSize(30);
+        titleText.setTextAlignment(TextAlignment.CENTER);
+        DirectionalLayout.LayoutConfig titleConfig = new DirectionalLayout.LayoutConfig(
+            ComponentContainer.LayoutConfig.MATCH_PARENT,
+            ComponentContainer.LayoutConfig.MATCH_CONTENT
+        );
+        titleConfig.setMargins(0, 0, 0, 40);
+        titleText.setLayoutConfig(titleConfig);
+        mainLayout.addComponent(titleText);
+        
+        // 创建输入框
+        TextField textField = new TextField(this);
+        textField.setHint("请输入内容");
+        DirectionalLayout.LayoutConfig textFieldConfig = new DirectionalLayout.LayoutConfig(
+            ComponentContainer.LayoutConfig.MATCH_PARENT,
+            ComponentContainer.LayoutConfig.MATCH_CONTENT
+        );
+        textFieldConfig.setMargins(0, 0, 0, 30);
+        textField.setLayoutConfig(textFieldConfig);
+        mainLayout.addComponent(textField);
+        
+        // 创建复选框
+        Checkbox checkbox = new Checkbox(this);
+        checkbox.setText("选择项");
+        DirectionalLayout.LayoutConfig checkboxConfig = new DirectionalLayout.LayoutConfig(
+            ComponentContainer.LayoutConfig.MATCH_CONTENT,
+            ComponentContainer.LayoutConfig.MATCH_CONTENT
+        );
+        checkboxConfig.setMargins(0, 0, 0, 30);
+        checkbox.setLayoutConfig(checkboxConfig);
+        mainLayout.addComponent(checkbox);
+        
+        // 创建单选按钮
+        RadioButton radioButton = new RadioButton(this);
+        radioButton.setText("单选按钮");
+        DirectionalLayout.LayoutConfig radioConfig = new DirectionalLayout.LayoutConfig(
+            ComponentContainer.LayoutConfig.MATCH_CONTENT,
+            ComponentContainer.LayoutConfig.MATCH_CONTENT
+        );
+        radioConfig.setMargins(0, 0, 0, 30);
+        radioButton.setLayoutConfig(radioConfig);
+        mainLayout.addComponent(radioButton);
+        
+        // 创建滑块
+        Slider slider = new Slider(this);
+        slider.setMinValue(0);
+        slider.setMaxValue(100);
+        slider.setProgressValue(50);
+        DirectionalLayout.LayoutConfig sliderConfig = new DirectionalLayout.LayoutConfig(
+            ComponentContainer.LayoutConfig.MATCH_PARENT,
+            ComponentContainer.LayoutConfig.MATCH_CONTENT
+        );
+        slider.setLayoutConfig(sliderConfig);
+        mainLayout.addComponent(slider);
+        
+        // 设置布局
+        super.setUIContent(mainLayout);
+    }
+
+    @Override
+    public void onActive() {
+        super.onActive();
+    }
+
+    @Override
+    public void onForeground(Intent intent) {
+        super.onForeground(intent);
+    }
+}
+

+ 129 - 0
entry/src/main/java/com/fujica/abk/slice/GestureDemoSlice.java

@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) Huawei Technologies Co., Ltd. 2008-2021. All rights reserved.
+ */
+
+package com.fujica.abk.slice;
+
+import com.huawei.hms.maps.harmony.MapView;
+import com.huawei.hms.maps.harmony.model.LatLng;
+import com.huawei.hms.maps.harmony.HuaweiMap;
+import com.huawei.hms.maps.harmony.OnMapReadyCallback;
+import com.huawei.hms.maps.harmony.OnMapClickListener;
+import com.huawei.hms.maps.harmony.CommonContext;
+import ohos.aafwk.ability.AbilitySlice;
+import ohos.aafwk.content.Intent;
+import ohos.agp.colors.RgbColor;
+import ohos.agp.components.ComponentContainer;
+import ohos.agp.components.PositionLayout;
+import ohos.agp.components.element.ShapeElement;
+import ohos.agp.window.dialog.ToastDialog;
+
+public class GestureDemoSlice extends AbilitySlice {
+    private HuaweiMap mHuaweiMap;
+
+    /**
+     * Declare a MapView object.
+     */
+    private MapView mMapView;
+
+    @Override
+    public void onStart(Intent intent) {
+        super.onStart(intent);
+        CommonContext.setContext(this);
+
+        // Initialize MapView Object.
+        mMapView = new MapView(this);
+        mMapView.onCreate();
+
+        // Obtains the HuaweiMap object.
+        mMapView.getMapAsync(new OnMapReadyCallback() {
+            @Override
+            public void onMapReady(HuaweiMap huaweiMap) {
+                mHuaweiMap = huaweiMap;
+
+                // If mHuaweiMap is null, the program stops running.
+                if (null == mHuaweiMap) {
+                    return;
+                }
+
+                mHuaweiMap.setOnMapClickListener(new  OnMapClickListener() {
+                    @Override
+                    public void onMapClick(LatLng latLng) {
+                        new ToastDialog(CommonContext.getContext()).setText("onMapClick ").show();
+                    }
+                });
+
+                // Set whether to enable the compass.
+                mHuaweiMap.getUiSettings().setCompassEnabled(true);
+
+                // Set whether to enable the zoom controls.
+                mHuaweiMap.getUiSettings().setZoomControlsEnabled(true);
+
+                // Set whether to enable the zoom gestures.
+                mHuaweiMap.getUiSettings().setZoomGesturesEnabled(true);
+
+                // Set whether to enable the scroll gestures.
+                mHuaweiMap.getUiSettings().setScrollGesturesEnabled(true);
+
+                // Set whether to enable the tilt gestures.
+                mHuaweiMap.getUiSettings().setTiltGesturesEnabled(true);
+
+                // Set whether to enable the rotation gestures.
+                mHuaweiMap.getUiSettings().setRotateGesturesEnabled(true);
+            }
+        });
+
+        // Create a layout.
+        ComponentContainer.LayoutConfig config = new ComponentContainer.LayoutConfig(ComponentContainer.LayoutConfig.MATCH_PARENT, ComponentContainer.LayoutConfig.MATCH_PARENT);
+        PositionLayout myLayout = new PositionLayout(this);
+        myLayout.setLayoutConfig(config);
+        ShapeElement element = new ShapeElement();
+        element.setShape(ShapeElement.RECTANGLE);
+        element.setRgbColor(new RgbColor(255, 255, 255));
+
+        // Load the MapView object.
+        myLayout.addComponent(mMapView);
+        super.setUIContent(myLayout);
+    }
+
+    @Override
+    protected void onActive() {
+        super.onActive();
+        if (mMapView != null) {
+            mMapView.onResume();
+        }
+    }
+
+    @Override
+    protected void onInactive() {
+        super.onInactive();
+        if (mMapView != null) {
+            mMapView.onPause();
+        }
+    }
+
+    @Override
+    protected void onBackground() {
+        super.onBackground();
+        if (mMapView != null) {
+            mMapView.onStop();
+        }
+    }
+
+    @Override
+    protected void onForeground(Intent intent) {
+        super.onForeground(intent);
+        if (mMapView != null) {
+            mMapView.onStart();
+        }
+    }
+
+    @Override
+    protected void onStop() {
+        super.onStop();
+        if (mMapView != null) {
+            mMapView.onDestroy();
+        }
+    }
+}
+

+ 149 - 0
entry/src/main/java/com/fujica/abk/slice/HuaweiMapOptionsDemoSlice.java

@@ -0,0 +1,149 @@
+/*
+ * Copyright (c) Huawei Technologies Co., Ltd. 2008-2021. All rights reserved.
+ */
+
+package com.fujica.abk.slice;
+
+import com.huawei.hms.maps.harmony.HuaweiMap;
+import com.huawei.hms.maps.harmony.MapView;
+import com.huawei.hms.maps.harmony.OnMapReadyCallback;
+import com.huawei.hms.maps.harmony.OnMapClickListener;
+import com.huawei.hms.maps.harmony.CommonContext;
+import com.huawei.hms.maps.harmony.HuaweiMapOptions;
+import com.huawei.hms.maps.harmony.model.LatLngBounds;
+import com.huawei.hms.maps.harmony.model.CameraPosition;
+import com.huawei.hms.maps.harmony.model.LatLng;
+import ohos.aafwk.ability.AbilitySlice;
+import ohos.aafwk.content.Intent;
+import ohos.agp.colors.RgbColor;
+import ohos.agp.components.ComponentContainer;
+import ohos.agp.components.PositionLayout;
+import ohos.agp.components.element.ShapeElement;
+import ohos.agp.window.dialog.ToastDialog;
+
+public class HuaweiMapOptionsDemoSlice extends AbilitySlice {
+    private HuaweiMap mHuaweiMap;
+
+    /**
+     * Declare a MapView object.
+     */
+    private MapView mMapView;
+
+    @Override
+    public void onStart(Intent intent) {
+        super.onStart(intent);
+        CommonContext.setContext(this);
+
+        // Set initial camera attributes.
+        CameraPosition cameraPosition = new CameraPosition(new LatLng(48.893478, 2.334595), 3, 45, 20);
+
+        // Construct the target area of the camera.
+        LatLng southwest = new LatLng(47.893478, 3.334595);
+        LatLng northeast = new LatLng(49.893478, 1.334595);
+
+        LatLngBounds latLngBounds = new LatLngBounds(southwest, northeast);
+        HuaweiMapOptions options = new HuaweiMapOptions();
+        options
+                // Set camera attributes.
+                .camera(cameraPosition)
+                // Set whether to enable the zoom function. It is enabled by default.
+                .zoomControlsEnabled(false)
+                // Set whether to enable the compass. It is enabled by default.
+                .compassEnabled(true)
+                // Set whether to enable zoom gestures. They are enabled by default.
+                .zoomGesturesEnabled(true)
+                // Set whether to enable scroll gestures. They are enabled by default.
+                .scrollGesturesEnabled(true)
+                // Set whether to enable rotation gestures. They are enabled by default.
+                .rotateGesturesEnabled(false)
+                // Set whether to enable tilt gestures. They are enabled by default.
+                .tiltGesturesEnabled(true)
+                // Set whether to place the map view on the top of the map window. The default value is false.
+                .zOrderOnTop(true)
+                // Set whether to enable the lite mode for the map. It is disabled by default.
+                .liteMode(false)
+                // Set the preferred minimum zoom level.
+                .minZoomPreference(3)
+                // Set the preferred maximum zoom level.
+                .maxZoomPreference(13)
+                // Set an area to constrain the camera target so that the camera target does not move outside the bounds when a user scrolls the map camera.
+                .latLngBoundsForCameraTarget(latLngBounds);
+
+        // Initialize MapView Object.
+        mMapView = new MapView(this, options);
+        mMapView.onCreate();
+
+        // Obtains the HuaweiMap object.
+        mMapView.getMapAsync(new OnMapReadyCallback() {
+            @Override
+            public void onMapReady(HuaweiMap huaweiMap) {
+                mHuaweiMap = huaweiMap;
+
+                // If mHuaweiMap is null, the program stops running.
+                if (null == mHuaweiMap) {
+                    return;
+                }
+
+                mHuaweiMap.setOnMapClickListener(new  OnMapClickListener() {
+                    @Override
+                    public void onMapClick(LatLng latLng) {
+                        new ToastDialog(CommonContext.getContext()).setText("onMapClick ").show();
+                    }
+                });
+            }
+        });
+
+        // Create a layout.
+        ComponentContainer.LayoutConfig config = new ComponentContainer.LayoutConfig(ComponentContainer.LayoutConfig.MATCH_PARENT, ComponentContainer.LayoutConfig.MATCH_PARENT);
+        PositionLayout myLayout = new PositionLayout(this);
+        myLayout.setLayoutConfig(config);
+        ShapeElement element = new ShapeElement();
+        element.setShape(ShapeElement.RECTANGLE);
+        element.setRgbColor(new RgbColor(255, 255, 255));
+
+        // Load the MapView object.
+        myLayout.addComponent(mMapView);
+        super.setUIContent(myLayout);
+    }
+
+    @Override
+    protected void onActive() {
+        super.onActive();
+        if (mMapView != null) {
+            mMapView.onResume();
+        }
+    }
+
+    @Override
+    protected void onInactive() {
+        super.onInactive();
+        if (mMapView != null) {
+            mMapView.onPause();
+        }
+    }
+
+    @Override
+    protected void onBackground() {
+        super.onBackground();
+        if (mMapView != null) {
+            mMapView.onStop();
+        }
+    }
+
+    @Override
+    protected void onForeground(Intent intent) {
+        super.onForeground(intent);
+        if (mMapView != null) {
+            mMapView.onStart();
+        }
+    }
+
+    @Override
+    protected void onStop() {
+        super.onStop();
+        if (mMapView != null) {
+            mMapView.onDestroy();
+        }
+    }
+}
+

+ 646 - 0
entry/src/main/java/com/fujica/abk/slice/MainAbilitySlice.java

@@ -0,0 +1,646 @@
+package com.fujica.abk.slice;
+
+import com.fujica.abk.ResourceTable;
+import ohos.aafwk.ability.AbilitySlice;
+import ohos.aafwk.content.Intent;
+import com.huawei.hms.maps.harmony.HuaweiMap;
+import com.huawei.hms.maps.harmony.MapView;
+import com.huawei.hms.maps.harmony.HuaweiMapOptions;
+import com.huawei.hms.maps.harmony.OnMapClickListener;
+import com.huawei.hms.maps.harmony.OnInfoWindowClickListener;
+import com.huawei.hms.maps.harmony.OnMarkerClickListener;
+import com.huawei.hms.maps.harmony.CameraUpdate;
+import com.huawei.hms.maps.harmony.CameraUpdateFactory;
+import com.huawei.hms.maps.harmony.CommonContext;
+import com.huawei.hms.maps.harmony.model.CameraPosition;
+import com.huawei.hms.maps.harmony.model.LatLng;
+import com.huawei.hms.maps.harmony.model.Marker;
+import com.huawei.hms.maps.harmony.model.MarkerOptions;
+import ohos.agp.components.*;
+import ohos.agp.colors.RgbColor;
+import ohos.agp.components.element.ShapeElement;
+import ohos.agp.utils.Color;
+import ohos.agp.window.dialog.ToastDialog;
+import ohos.agp.window.service.Window;
+import ohos.agp.window.service.WindowManager;
+import ohos.hiviewdfx.HiLog;
+import ohos.hiviewdfx.HiLogLabel;
+import ohos.location.Location;
+import ohos.location.Locator;
+import ohos.location.LocatorCallback;
+import ohos.location.RequestParam;
+import ohos.global.resource.NotExistException;
+import ohos.global.resource.Resource;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+public class MainAbilitySlice extends AbilitySlice {
+    private static final HiLogLabel TAG = new HiLogLabel(HiLog.DEBUG, 0x0, MainAbilitySlice.class.getName());
+
+    // PageSlider相关
+    private PageSlider pageSlider;
+    private PageSliderProvider pageSliderProvider;
+
+    // 底部导航栏组件
+    private DirectionalLayout navMy;
+    private DirectionalLayout navFindParking;
+    private DirectionalLayout navReserveParking;
+    private DirectionalLayout navCurrentLocation;
+
+    // 底部导航栏文字和图标
+    private Text textMy;
+    private Text textPark;
+    private Text textFee;
+    private Image iconPark;
+    private Image iconPark1;
+    private Image iconMy;
+    private Image iconMy1;
+    private Image iconFee;
+    private Image iconFee1;
+
+    // 当前选中的 tab
+    private int currentTab = 1; // 0: 我的, 1: 找车位, 2: 预约停车
+
+    // 定位相关
+    private Locator locator;
+    private LocatorCallback locatorCallback;
+    private Location currentLocation; // 当前定位坐标
+
+    // 地图相关 - 完全按照 MarkerDemo 的方式
+    private HuaweiMap mHuaweiMap;
+    /**
+     * Declare a MapView object.
+     */
+    private MapView mMapView;
+    /**
+     * Declare a Marker object.
+     */
+    private Marker mMarker;
+    /**
+     * 当前位置标记
+     */
+    private Marker currentLocationMarker;
+
+    @Override
+    public void onStart(Intent intent) {
+        super.onStart(intent);
+
+        // 设置全屏显示
+        setFullScreen();
+
+        // 设置 CommonContext,华为地图需要 - 完全按照示例代码
+        CommonContext.setContext(this);
+
+        // 设置布局
+        super.setUIContent(ResourceTable.Layout_ability_main);
+
+        // 初始化组件
+        initComponents();
+
+        // 初始化地图 - 完全按照 MarkerDemo 的方式
+        initMap();
+
+        // 设置事件监听
+        setupListeners();
+
+        // 初始化定位
+        initLocation();
+    }
+
+    /**
+     * 设置全屏显示
+     */
+    private void setFullScreen() {
+        try {
+            Window window = getWindow();
+            if (window != null) {
+                WindowManager.LayoutConfig layoutConfig = window.getLayoutConfig().orElse(null);
+                if (layoutConfig == null) {
+                    layoutConfig = new WindowManager.LayoutConfig();
+                }
+                layoutConfig.type = WindowManager.LayoutConfig.MARK_FULL_SCREEN;
+                window.setLayoutConfig(layoutConfig);
+            }
+        } catch (Exception e) {
+            HiLog.error(TAG, "设置全屏失败: " + e.getMessage());
+        }
+    }
+
+    /**
+     * 初始化组件
+     */
+    private void initComponents() {
+        // 初始化PageSlider
+        pageSlider = (PageSlider) findComponentById(ResourceTable.Id_page_slider);
+        if (pageSlider != null) {
+            // 创建PageSliderProvider
+            pageSliderProvider = new PageSliderProvider() {
+                private List<Component> pages = new ArrayList<>();
+
+                @Override
+                public int getCount() {
+                    return 3; // 三个页面:我的、找车位、预约停车
+                }
+
+                @Override
+                public Object createPageInContainer(ComponentContainer componentContainer, int position) {
+                    Component page = null;
+                    try {
+                        switch (position) {
+                            case 0: // 我的
+                                page = LayoutScatter.getInstance(MainAbilitySlice.this)
+                                        .parse(ResourceTable.Layout_layout_my, null, false);
+                                break;
+                            case 1: // 找车位
+                                page = LayoutScatter.getInstance(MainAbilitySlice.this)
+                                        .parse(ResourceTable.Layout_layout_find_parking, null, false);
+                                break;
+                            case 2: // 预约停车
+                                page = LayoutScatter.getInstance(MainAbilitySlice.this)
+                                        .parse(ResourceTable.Layout_layout_reserve_parking, null, false);
+                                break;
+                        }
+                        if (page != null) {
+                            componentContainer.addComponent(page);
+                            pages.add(page);
+                        }
+                    } catch (Exception e) {
+                        HiLog.error(TAG, "创建页面失败: " + e.getMessage());
+                        e.printStackTrace();
+                    }
+                    return page;
+                }
+
+                @Override
+                public void destroyPageFromContainer(ComponentContainer componentContainer, int position, Object object) {
+                    if (object instanceof Component) {
+                        componentContainer.removeComponent((Component) object);
+                        pages.remove(object);
+                    }
+                }
+
+                @Override
+                public boolean isPageMatchToObject(Component component, Object object) {
+                    return component == object;
+                }
+            };
+
+            pageSlider.setProvider(pageSliderProvider);
+            // 默认显示找车位页面(索引1)
+            pageSlider.setCurrentPage(1);
+
+            // 添加页面切换监听
+            pageSlider.addPageChangedListener(new PageSlider.PageChangedListener() {
+                @Override
+                public void onPageChosen(int index) {
+                    // 页面切换完成
+                    currentTab = index;
+                    updateBottomNavState(index);
+                    HiLog.info(TAG, "切换到页面: " + index);
+                }
+
+                @Override
+                public void onPageSliding(int state, float v, int index) {
+
+                }
+
+                @Override
+                public void onPageSlideStateChanged(int state) {
+                    // 滑动状态变化
+                }
+            });
+        }
+
+        // 初始化底部导航栏
+        initBottomNavigation();
+    }
+
+    /**
+     * 初始化底部导航栏
+     */
+    private void initBottomNavigation() {
+        navMy = findComponentById(ResourceTable.Id_nav_my);
+        navFindParking = findComponentById(ResourceTable.Id_nav_find_parking);
+        navReserveParking = findComponentById(ResourceTable.Id_nav_reserve_parking);
+        navCurrentLocation = findComponentById(ResourceTable.Id_nav_current_location);
+
+        textMy = findComponentById(ResourceTable.Id_text_my);
+        textPark = findComponentById(ResourceTable.Id_text_park);
+        textFee = findComponentById(ResourceTable.Id_text_fee);
+        iconPark = findComponentById(ResourceTable.Id_icon_park);
+        iconPark1 = findComponentById(ResourceTable.Id_icon_park_1);
+        iconMy = findComponentById(ResourceTable.Id_icon_my);
+        iconMy1 = findComponentById(ResourceTable.Id_icon_my_1);
+        iconFee = findComponentById(ResourceTable.Id_icon_fee);
+        iconFee1 = findComponentById(ResourceTable.Id_icon_fee_1);
+
+        // 设置点击事件
+        if (navMy != null) {
+            navMy.setClickedListener(component -> switchToPage(0));
+        }
+        if (navFindParking != null) {
+            navFindParking.setClickedListener(component -> switchToPage(1));
+        }
+        if (navReserveParking != null) {
+            navReserveParking.setClickedListener(component -> switchToPage(2));
+        }
+        if (navCurrentLocation != null) {
+            navCurrentLocation.setClickedListener(component -> {
+                HiLog.info(TAG, "点击了当前位置按钮");
+                locateCurrentPosition();
+            });
+        }
+
+        // 默认选中找车位
+        updateBottomNavState(1);
+    }
+
+    /**
+     * 切换到指定页面
+     */
+    private void switchToPage(int index) {
+        if (pageSlider != null && index >= 0 && index < 3) {
+            pageSlider.setCurrentPage(index);
+        }
+    }
+
+    /**
+     * 更新底部导航栏状态
+     */
+    private void updateBottomNavState(int index) {
+        // 重置所有导航项样式
+        Color grayColor = new Color(Color.getIntColor("#FF666666"));
+        Color blueColor = new Color(Color.getIntColor("#FA6332"));
+
+        if (textMy != null) {
+            textMy.setTextColor(grayColor);
+        }
+        if (textPark != null) {
+            textPark.setTextColor(grayColor);
+        }
+        if (textFee != null) {
+            textFee.setTextColor(grayColor);
+        }
+
+        iconPark.setImageAndDecodeBounds(ResourceTable.Media_park);
+        iconMy.setImageAndDecodeBounds(ResourceTable.Media_my);
+//        iconReserveParking.setImageAndDecodeBounds(ResourceTable.Media_fee);
+
+        // 设置选中状态
+        switch (index) {
+            case 0: // 我的
+                textMy.setTextColor(blueColor);
+                iconMy.setImageAndDecodeBounds(ResourceTable.Media_my_1);
+
+                iconMy.setVisibility(Component.HIDE);
+                iconMy1.setVisibility(Component.VISIBLE);
+                iconFee.setVisibility(Component.VISIBLE);
+                iconFee1.setVisibility(Component.HIDE);
+                iconPark.setVisibility(Component.VISIBLE);
+                iconPark1.setVisibility(Component.HIDE);
+                break;
+            case 1: // 找车位
+                textPark.setTextColor(blueColor);
+                iconPark.setImageAndDecodeBounds(ResourceTable.Media_park_1);
+
+                iconMy.setVisibility(Component.VISIBLE);
+                iconMy1.setVisibility(Component.HIDE);
+                iconFee.setVisibility(Component.VISIBLE);
+                iconFee1.setVisibility(Component.HIDE);
+                iconPark.setVisibility(Component.HIDE);
+                iconPark1.setVisibility(Component.VISIBLE);
+                break;
+            case 2: // 预约停车
+                textFee.setTextColor(blueColor);
+
+                iconMy.setVisibility(Component.VISIBLE);
+                iconMy1.setVisibility(Component.HIDE);
+                iconFee.setVisibility(Component.HIDE);
+                iconFee1.setVisibility(Component.VISIBLE);
+                iconPark.setVisibility(Component.VISIBLE);
+                iconPark1.setVisibility(Component.HIDE);
+                break;
+        }
+    }
+
+    /**
+     * 初始化地图 - 完全按照 MarkerDemo 的方式
+     */
+    private void initMap() {
+        try {
+            // Declaring and Initializing the HuaweiMapOptions Object - 完全按照 MarkerDemo
+            HuaweiMapOptions huaweiMapOptions = new HuaweiMapOptions();
+
+            // Initialize Camera Properties
+            CameraPosition cameraPosition =
+                    new CameraPosition(new LatLng(48.893478, 2.334595), 6, 0, 0);
+
+            huaweiMapOptions
+                    // Set Camera Properties
+                    .camera(cameraPosition)
+                    // Enables or disables the zoom function. By default, the zoom function is enabled.
+                    .zoomControlsEnabled(false)
+                    // Sets whether the compass is available. The compass is available by default.
+                    .compassEnabled(true)
+                    // Specifies whether the zoom gesture is available. By default, the zoom gesture is available.
+                    .zoomGesturesEnabled(true)
+                    // Specifies whether to enable the scrolling gesture. By default, the scrolling gesture is enabled.
+                    .scrollGesturesEnabled(true)
+                    // Specifies whether the rotation gesture is available. By default, the rotation gesture is available.
+                    .rotateGesturesEnabled(false)
+                    // Specifies whether the tilt gesture is available. By default, the tilt gesture is available.
+                    .tiltGesturesEnabled(true)
+                    // Sets whether the map is in lite mode. The default value is No.
+                    .liteMode(false)
+                    // Set Preference Minimum Zoom Level
+                    .minZoomPreference(3)
+                    // Set Preference Maximum Zoom Level
+                    .maxZoomPreference(13);
+
+            // Initialize MapView Object. - 完全按照 MarkerDemo
+            mMapView = new MapView(this, huaweiMapOptions);
+            mMapView.onCreate();
+
+            // Obtains the HuaweiMap object. - 完全按照 MarkerDemo
+            mMapView.getMapAsync(huaweiMap -> {
+                mHuaweiMap = huaweiMap;
+
+                // If mHuaweiMap is null, the program stops running. - 完全按照 MarkerDemo
+                if (null == mHuaweiMap) {
+                    HiLog.error(TAG, "mHuaweiMap 为 null");
+                    return;
+                }
+
+                HiLog.info(TAG, "地图已就绪,开始获取定位");
+
+                mHuaweiMap.setOnMapClickListener(new OnMapClickListener() {
+                    @Override
+                    public void onMapClick(LatLng latLng) {
+                        new ToastDialog(CommonContext.getContext()).setText("onMapClick ").show();
+                    }
+                });
+
+                // If mMarker is not null, remove it from the map and then set it to null. - 完全按照 MarkerDemo
+                if (null != mMarker) {
+                    mMarker.remove();
+                    mMarker = null;
+                }
+
+                // Add a marker to the map. - 完全按照 MarkerDemo
+                MarkerOptions options = new MarkerOptions()
+                        .position(new LatLng(48.893478, 2.334595))
+                        .title("Hello Huawei Map")
+                        .snippet("This is a snippet!");
+                mMarker = mHuaweiMap.addMarker(options);
+
+                // Set the marker title. - 完全按照 MarkerDemo
+                if (mMarker != null) {
+                    mMarker.setTitle("Marker title");
+                }
+
+                // Set whether the marker can be dragged. - 完全按照 MarkerDemo
+                if (mMarker != null) {
+                    mMarker.setDraggable(true);
+                }
+
+                // Set the marker anchor point. - 完全按照 MarkerDemo
+                if (mMarker != null) {
+                    mMarker.setMarkerAnchor(0.9F, 0.9F);
+                }
+
+                // Customizing the Marker Icon - 完全按照 MarkerDemo
+                addCustomMarker();
+
+                mHuaweiMap.setOnMarkerClickListener(new OnMarkerClickListener() {
+                    @Override
+                    public boolean onMarkerClick(Marker marker) {
+                        new ToastDialog(CommonContext.getContext()).setText("onMarkerClick: " + marker.getTitle()).show();
+                        return false;
+                    }
+                });
+
+                mHuaweiMap.setOnInfoWindowClickListener(new OnInfoWindowClickListener() {
+                    @Override
+                    public void onInfoWindowClick(Marker marker) {
+                        new ToastDialog(CommonContext.getContext()).setText("onInfoWindowClick:").show();
+                    }
+                });
+
+                // 地图就绪后,自动获取当前位置
+                if (locator != null && locatorCallback != null) {
+                    locateCurrentPosition();
+                }
+            });
+
+//            ComponentContainer.LayoutConfig config = new ComponentContainer.LayoutConfig(ComponentContainer.LayoutConfig.MATCH_PARENT, ComponentContainer.LayoutConfig.MATCH_PARENT);
+//            PositionLayout myLayout = new PositionLayout(this);
+//            myLayout.setLayoutConfig(config);
+
+            PositionLayout myLayout = findComponentById(ResourceTable.Id_main_body);
+
+            ShapeElement element = new ShapeElement();
+            element.setShape(ShapeElement.RECTANGLE);
+            element.setRgbColor(new RgbColor(255, 255, 255));
+
+            // 加载MapView
+            myLayout.addComponent(mMapView);
+        } catch (Exception e) {
+            HiLog.error(TAG, "初始化地图失败: " + e.getMessage());
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * addCustomMarker - 完全按照 MarkerDemo
+     */
+    private void addCustomMarker() {
+        Resource resource = null;
+        try {
+            resource = getResourceManager().getResource(ResourceTable.Media_icon);
+        } catch (IOException e) {
+            e.printStackTrace();
+        } catch (NotExistException e) {
+            e.printStackTrace();
+        }
+
+        if (resource != null && mHuaweiMap != null) {
+            mHuaweiMap.addMarker(new MarkerOptions()
+                    .position(new LatLng(47.8333, 2.8333))
+                    .icon(resource));
+        }
+    }
+
+    /**
+     * 设置事件监听
+     */
+    private void setupListeners() {
+        // 事件监听已在initBottomNavigation中设置
+    }
+
+    /**
+     * 初始化定位服务
+     */
+    private void initLocation() {
+        try {
+            locator = new Locator(this);
+            locatorCallback = new LocatorCallback() {
+                @Override
+                public void onLocationReport(Location location) {
+                    // 保存当前位置坐标
+                    currentLocation = location;
+                    double latitude = location.getLatitude();
+                    double longitude = location.getLongitude();
+
+                    HiLog.info(TAG, "定位成功: " + latitude + ", " + longitude);
+
+                    // 将坐标传递给地图
+                    updateMapWithLocation(location);
+                }
+
+                @Override
+                public void onStatusChanged(int type) {
+                    HiLog.info(TAG, "定位状态变化: " + type);
+                }
+
+                @Override
+                public void onErrorReport(int errorCode) {
+                    HiLog.error(TAG, "定位错误: " + errorCode);
+                    new ToastDialog(CommonContext.getContext())
+                            .setText("定位失败,错误码: " + errorCode)
+                            .show();
+                }
+            };
+        } catch (Exception e) {
+            HiLog.error(TAG, "初始化定位服务失败: " + e.getMessage());
+        }
+    }
+
+    /**
+     * 定位到当前位置
+     */
+    private void locateCurrentPosition() {
+        if (locator == null || locatorCallback == null) {
+            HiLog.error(TAG, "定位服务未初始化");
+            return;
+        }
+
+        try {
+            // 请求定位
+            RequestParam requestParam = new RequestParam(RequestParam.PRIORITY_ACCURACY, 0, 0);
+            locator.startLocating(requestParam, locatorCallback);
+            HiLog.info(TAG, "开始定位...");
+        } catch (Exception e) {
+            HiLog.error(TAG, "定位失败: " + e.getMessage());
+        }
+    }
+
+    /**
+     * 将定位坐标传递给地图并更新地图显示
+     */
+    private void updateMapWithLocation(Location location) {
+        if (mHuaweiMap == null) {
+            HiLog.warn(TAG, "地图未初始化完成,等待地图就绪");
+            return;
+        }
+
+        try {
+            double latitude = location.getLatitude();
+            double longitude = location.getLongitude();
+
+            HiLog.info(TAG, "更新地图位置: " + latitude + ", " + longitude);
+
+            // 创建坐标点
+            LatLng latLng = new LatLng(latitude, longitude);
+
+            // 移除旧的当前位置标记
+            if (currentLocationMarker != null) {
+                currentLocationMarker.remove();
+                currentLocationMarker = null;
+            }
+
+            // 在地图上添加当前位置标记
+            MarkerOptions currentLocationOptions = new MarkerOptions()
+                    .position(latLng)
+                    .title("当前位置")
+                    .snippet("纬度: " + latitude + ", 经度: " + longitude);
+            currentLocationMarker = mHuaweiMap.addMarker(currentLocationOptions);
+
+            // Method 8: Set the center point and zoom level of the camera. - 完全按照示例代码
+            float zoom = 15.0f;
+            CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngZoom(latLng, zoom);
+
+            // move camera - 完全按照示例代码
+            mHuaweiMap.moveCamera(cameraUpdate);
+
+            HiLog.info(TAG, "地图已更新到当前位置");
+
+            // 显示提示
+            new ToastDialog(CommonContext.getContext())
+                    .setText("已定位到当前位置")
+                    .show();
+
+        } catch (Exception e) {
+            HiLog.error(TAG, "更新地图位置失败: " + e.getMessage());
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 移动地图到当前位置 - 完全按照 MapViewCameraDemo 的方式
+     */
+    private void moveToCurrentLocation(Location location) {
+        updateMapWithLocation(location);
+    }
+
+    // 生命周期管理 - 完全按照示例代码 MapViewDemo.java 的方式
+    @Override
+    protected void onActive() {
+        super.onActive();
+        if (mMapView != null) {
+            mMapView.onResume();
+        }
+    }
+
+    @Override
+    protected void onInactive() {
+        super.onInactive();
+        if (mMapView != null) {
+            mMapView.onPause();
+        }
+    }
+
+    @Override
+    protected void onBackground() {
+        super.onBackground();
+        if (mMapView != null) {
+            mMapView.onStop();
+        }
+    }
+
+    @Override
+    protected void onForeground(Intent intent) {
+        super.onForeground(intent);
+        if (mMapView != null) {
+            mMapView.onStart();
+        }
+    }
+
+    @Override
+    protected void onStop() {
+        super.onStop();
+        // 停止定位
+        if (locator != null && locatorCallback != null) {
+            try {
+                locator.stopLocating(locatorCallback);
+            } catch (Exception e) {
+                HiLog.error(TAG, "停止定位失败: " + e.getMessage());
+            }
+        }
+        // 销毁地图 - 完全按照示例代码
+        if (mMapView != null) {
+            mMapView.onDestroy();
+        }
+    }
+}

+ 162 - 0
entry/src/main/java/com/fujica/abk/slice/MapEventsDemoSlice.java

@@ -0,0 +1,162 @@
+/*
+ * Copyright (c) Huawei Technologies Co., Ltd. 2008-2021. All rights reserved.
+ */
+
+package com.fujica.abk.slice;
+
+import com.huawei.hms.maps.harmony.HuaweiMap;
+import com.huawei.hms.maps.harmony.MapView;
+import com.huawei.hms.maps.harmony.OnMapReadyCallback;
+import com.huawei.hms.maps.harmony.OnMapClickListener;
+import com.huawei.hms.maps.harmony.OnCameraMoveStartedListener;
+import com.huawei.hms.maps.harmony.OnCameraMoveListener;
+import com.huawei.hms.maps.harmony.OnCameraIdleListener;
+import com.huawei.hms.maps.harmony.OnMapLoadedCallback;
+import com.huawei.hms.maps.harmony.OnMapLongClickListener;
+import com.huawei.hms.maps.harmony.model.LatLng;
+import com.huawei.hms.maps.harmony.CommonContext;
+import ohos.aafwk.ability.AbilitySlice;
+import ohos.aafwk.content.Intent;
+import ohos.agp.colors.RgbColor;
+import ohos.agp.components.ComponentContainer;
+import ohos.agp.components.PositionLayout;
+import ohos.agp.components.element.ShapeElement;
+import ohos.agp.window.dialog.ToastDialog;
+import ohos.hiviewdfx.HiLog;
+import ohos.hiviewdfx.HiLogLabel;
+
+public class MapEventsDemoSlice extends AbilitySlice implements OnMapReadyCallback {
+    private static final HiLogLabel LABEL = new HiLogLabel(HiLog.DEBUG, 0x011, "MapEventsDemo");
+
+    private HuaweiMap mHuaweiMap;
+
+    /**
+     * Declare a MapView object.
+     */
+    private MapView mMapView;
+
+    @Override
+    public void onStart(Intent intent) {
+        super.onStart(intent);
+        CommonContext.setContext(this);
+
+        // Initialize MapView Object.
+        mMapView = new MapView(this);
+        mMapView.onCreate();
+
+        // Obtains the HuaweiMap object.
+        mMapView.getMapAsync(this);
+
+        // Create a layout.
+        ComponentContainer.LayoutConfig config = new ComponentContainer.LayoutConfig(ComponentContainer.LayoutConfig.MATCH_PARENT, ComponentContainer.LayoutConfig.MATCH_PARENT);
+        PositionLayout myLayout = new PositionLayout(this);
+        myLayout.setLayoutConfig(config);
+        ShapeElement element = new ShapeElement();
+        element.setShape(ShapeElement.RECTANGLE);
+        element.setRgbColor(new RgbColor(255, 255, 255));
+
+        // Load the MapView object.
+        myLayout.addComponent(mMapView);
+        super.setUIContent(myLayout);
+    }
+
+    @Override
+    public void onMapReady(HuaweiMap huaweiMap) {
+        mHuaweiMap = huaweiMap;
+
+        // If mHuaweiMap is null, the program stops running.
+        if (null == mHuaweiMap) {
+            return;
+        }
+
+        mHuaweiMap.setOnCameraMoveStartedListener(new OnCameraMoveStartedListener() {
+            @Override
+            public void onCameraMoveStarted(int i) {
+                HiLog.debug(LABEL, "onCameraMoveStarted.");
+            }
+        });
+
+        mHuaweiMap.setOnCameraMoveListener(new OnCameraMoveListener() {
+            @Override
+            public void onCameraMove() {
+                HiLog.debug(LABEL, "onCameraMove.");
+            }
+        });
+
+        mHuaweiMap.setOnCameraIdleListener(new OnCameraIdleListener() {
+            @Override
+            public void onCameraIdle() {
+                HiLog.debug(LABEL, "onCameraIdle.");
+            }
+        });
+
+        mHuaweiMap.setOnMapLoadedCallback(new OnMapLoadedCallback() {
+            @Override
+            public void onMapLoaded() {
+                new ToastDialog(CommonContext.getContext()).setText("onMapLoaded:").show();
+            }
+        });
+
+        mHuaweiMap.setOnMapClickListener(new OnMapClickListener() {
+            @Override
+            public void onMapClick(LatLng latLng) {
+                new ToastDialog(CommonContext.getContext()).setText("onMapClick:").show();
+            }
+        });
+
+        mHuaweiMap.setOnMapLongClickListener(new OnMapLongClickListener() {
+            @Override
+            public void onMapLongClick(LatLng latLng) {
+                new ToastDialog(CommonContext.getContext()).setText("onMapLongClick:").show();
+            }
+        });
+
+        // 设置最小偏好缩放级别,范围为[3,20]
+        mHuaweiMap.setMinZoomPreference(3);
+        // 设置最大偏好缩放级别,范围为[3,20]
+        mHuaweiMap.setMaxZoomPreference(14);
+        // 重置最大最小缩放级别
+        mHuaweiMap.resetMinMaxZoomPreference();
+    }
+
+    @Override
+    protected void onActive() {
+        super.onActive();
+        if (mMapView != null) {
+            mMapView.onResume();
+        }
+    }
+
+    @Override
+    protected void onInactive() {
+        super.onInactive();
+        if (mMapView != null) {
+            mMapView.onPause();
+        }
+    }
+
+    @Override
+    protected void onBackground() {
+        super.onBackground();
+        if (mMapView != null) {
+            mMapView.onStop();
+        }
+    }
+
+    @Override
+    protected void onForeground(Intent intent) {
+        super.onForeground(intent);
+        if (mMapView != null) {
+            mMapView.onStart();
+        }
+    }
+
+    @Override
+    protected void onStop() {
+        super.onStop();
+        if (mMapView != null) {
+            mMapView.onDestroy();
+        }
+    }
+}
+

+ 136 - 0
entry/src/main/java/com/fujica/abk/slice/MapTypeDemoSlice.java

@@ -0,0 +1,136 @@
+/*
+ * Copyright (c) Huawei Technologies Co., Ltd. 2008-2021. All rights reserved.
+ */
+
+package com.fujica.abk.slice;
+
+import com.huawei.hms.maps.harmony.HuaweiMap;
+import com.huawei.hms.maps.harmony.MapView;
+import com.huawei.hms.maps.harmony.HuaweiMapOptions;
+import com.huawei.hms.maps.harmony.OnMapReadyCallback;
+import com.huawei.hms.maps.harmony.OnMapClickListener;
+import com.huawei.hms.maps.harmony.model.LatLng;
+import com.huawei.hms.maps.harmony.CommonContext;
+import ohos.aafwk.ability.AbilitySlice;
+import ohos.aafwk.content.Intent;
+import ohos.agp.colors.RgbColor;
+import ohos.agp.components.ComponentContainer;
+import ohos.agp.components.PositionLayout;
+import ohos.agp.components.element.ShapeElement;
+import ohos.agp.window.dialog.ToastDialog;
+import com.huawei.hms.maps.harmony.OnMapLongClickListener;
+
+public class MapTypeDemoSlice extends AbilitySlice {
+    private int longClickCounter = 0;
+
+    private HuaweiMap mHuaweiMap;
+
+    /**
+     * Declare a MapView object.
+     */
+    private MapView mMapView;
+
+    @Override
+    public void onStart(Intent intent) {
+        super.onStart(intent);
+        CommonContext.setContext(this);
+
+        // Declaring and Initializing the HuaweiMapOptions Object
+        HuaweiMapOptions huaweiMapOptions = new HuaweiMapOptions();
+
+        // Enable the lite mode map.
+        huaweiMapOptions.liteMode(true);
+
+        // Initialize MapView Object.
+        mMapView = new MapView(this, huaweiMapOptions);
+        mMapView.onCreate();
+
+        // Obtains the HuaweiMap object.
+        mMapView.getMapAsync(new OnMapReadyCallback() {
+            @Override
+            public void onMapReady(HuaweiMap huaweiMap) {
+                mHuaweiMap = huaweiMap;
+
+                // If mHuaweiMap is null, the program stops running.
+                if (null == mHuaweiMap) {
+                    return;
+                }
+
+                mHuaweiMap.setOnMapClickListener(new  OnMapClickListener() {
+                    @Override
+                    public void onMapClick(LatLng latLng) {
+                        new ToastDialog(CommonContext.getContext()).setText("onMapClick ").show();
+                    }
+                });
+
+                mHuaweiMap.setOnMapLongClickListener(new OnMapLongClickListener() {
+                    @Override
+                    public void onMapLongClick(LatLng latLng) {
+                        if (longClickCounter % 2 ==0 ) {
+                            mHuaweiMap.setMapType(HuaweiMap.MAP_TYPE_NONE);
+                            new ToastDialog(CommonContext.getContext()).setText("HuaweiMap.MAP_TYPE_NONE ").show();
+                            longClickCounter++;
+                        } else {
+                            mHuaweiMap.setMapType(HuaweiMap.MAP_TYPE_NORMAL);
+                            new ToastDialog(CommonContext.getContext()).setText("HuaweiMap.MAP_TYPE_NORMAL ").show();
+                            longClickCounter++;
+                        }
+                    }
+                });
+            }
+        });
+
+        // Create a layout.
+        ComponentContainer.LayoutConfig config = new ComponentContainer.LayoutConfig(ComponentContainer.LayoutConfig.MATCH_PARENT, ComponentContainer.LayoutConfig.MATCH_PARENT);
+        PositionLayout myLayout = new PositionLayout(this);
+        myLayout.setLayoutConfig(config);
+        ShapeElement element = new ShapeElement();
+        element.setShape(ShapeElement.RECTANGLE);
+        element.setRgbColor(new RgbColor(255, 255, 255));
+
+        // Load the MapView object.
+        myLayout.addComponent(mMapView);
+        super.setUIContent(myLayout);
+    }
+
+    @Override
+    protected void onActive() {
+        super.onActive();
+        if (mMapView != null) {
+            mMapView.onResume();
+        }
+    }
+
+    @Override
+    protected void onInactive() {
+        super.onInactive();
+        if (mMapView != null) {
+            mMapView.onPause();
+        }
+    }
+
+    @Override
+    protected void onBackground() {
+        super.onBackground();
+        if (mMapView != null) {
+            mMapView.onStop();
+        }
+    }
+
+    @Override
+    protected void onForeground(Intent intent) {
+        super.onForeground(intent);
+        if (mMapView != null) {
+            mMapView.onStart();
+        }
+    }
+
+    @Override
+    protected void onStop() {
+        super.onStop();
+        if (mMapView != null) {
+            mMapView.onDestroy();
+        }
+    }
+}
+

+ 195 - 0
entry/src/main/java/com/fujica/abk/slice/MapViewCameraDemoSlice.java

@@ -0,0 +1,195 @@
+/*
+ * Copyright (c) Huawei Technologies Co., Ltd. 2008-2021. All rights reserved.
+ */
+
+package com.fujica.abk.slice;
+
+import com.huawei.hms.maps.harmony.HuaweiMap;
+import com.huawei.hms.maps.harmony.MapView;
+import com.huawei.hms.maps.harmony.CameraUpdate;
+import com.huawei.hms.maps.harmony.CameraUpdateFactory;
+import com.huawei.hms.maps.harmony.OnMapReadyCallback;
+import com.huawei.hms.maps.harmony.OnMapClickListener;
+import com.huawei.hms.maps.harmony.model.LatLng;
+import com.huawei.hms.maps.harmony.model.CameraPosition;
+import com.huawei.hms.maps.harmony.model.LatLngBounds;
+import com.huawei.hms.maps.harmony.model.Point;
+import com.huawei.hms.maps.harmony.OnMapLongClickListener;
+import com.huawei.hms.maps.harmony.CommonContext;
+import ohos.aafwk.ability.AbilitySlice;
+import ohos.aafwk.content.Intent;
+import ohos.agp.colors.RgbColor;
+import ohos.agp.components.ComponentContainer;
+import ohos.agp.components.PositionLayout;
+import ohos.agp.components.element.ShapeElement;
+import ohos.agp.window.dialog.ToastDialog;
+
+public class MapViewCameraDemoSlice extends AbilitySlice {
+    private HuaweiMap mHuaweiMap;
+
+    /**
+     * Declare a MapView object.
+     */
+    private MapView mMapView;
+
+    @Override
+    public void onStart(Intent intent) {
+        super.onStart(intent);
+        CommonContext.setContext(this);
+
+        // Initialize MapView Object.
+        mMapView = new MapView(this);
+
+        // Creating a MapView
+        mMapView.onCreate();
+
+        // Obtains the HuaweiMap object.
+        mMapView.getMapAsync(new OnMapReadyCallback() {
+            @Override
+            public void onMapReady(HuaweiMap huaweiMap) {
+                mHuaweiMap = huaweiMap;
+
+                // If mHuaweiMap is null, the program stops running.
+                if (null == mHuaweiMap) {
+                    return;
+                }
+
+                mHuaweiMap.setOnMapClickListener(new OnMapClickListener() {
+                    @Override
+                    public void onMapClick(LatLng latLng) {
+                        new ToastDialog(CommonContext.getContext()).setText("onMapClick:").show();
+                    }
+                });
+
+                mHuaweiMap.setOnMapLongClickListener(new OnMapLongClickListener() {
+                    @Override
+                    public void onMapLongClick(LatLng latLng) {
+                        new ToastDialog(CommonContext.getContext()).setText("onMapLongClick:").show();
+                    }
+                });
+
+                // move camera
+                CameraUpdate cameraUpdate = buildCameraUpdate();
+                mHuaweiMap.moveCamera(cameraUpdate);
+
+                // Sets the minimum preferred zoom level. The value ranges from 3 to 20.
+                mHuaweiMap.setMinZoomPreference(3);
+                // Sets the maximum preferred zoom level. The value ranges from 3 to 20.
+                mHuaweiMap.setMaxZoomPreference(14);
+                // Reset maximum and minimum zoom levels
+                mHuaweiMap.resetMinMaxZoomPreference();
+            }
+        });
+
+        // Create a layout.
+        ComponentContainer.LayoutConfig config = new ComponentContainer.LayoutConfig(ComponentContainer.LayoutConfig.MATCH_PARENT, ComponentContainer.LayoutConfig.MATCH_PARENT);
+        PositionLayout myLayout = new PositionLayout(this);
+        myLayout.setLayoutConfig(config);
+        ShapeElement element = new ShapeElement();
+        element.setShape(ShapeElement.RECTANGLE);
+        element.setRgbColor(new RgbColor(255, 255, 255));
+
+        // Load the MapView object.
+        myLayout.addComponent(mMapView);
+        super.setUIContent(myLayout);
+    }
+
+    /**
+     * new CameraUpdate
+     *
+     * @return CameraUpdate
+     */
+    private CameraUpdate buildCameraUpdate() {
+        // Method 1: Increase the camera zoom level by 1 and retain other attribute settings.
+        CameraUpdate cameraUpdate = CameraUpdateFactory.zoomIn();
+
+        // Method 2: Decrease the camera zoom level by 1 and retain other attribute settings.
+        CameraUpdate cameraUpdate1 = CameraUpdateFactory.zoomOut();
+
+        // Method 3: Set the camera zoom level to a specified value and retain other attribute settings.
+        float zoom = 8.0f;
+        CameraUpdate cameraUpdate2 = CameraUpdateFactory.zoomTo(zoom);
+
+        // Method 4: Increase or decrease the camera zoom level by a specified value.
+        float amount = 2.0f;
+        CameraUpdate cameraUpdate3 = CameraUpdateFactory.zoomBy(amount);
+
+        // Method 5: Move the camera to the specified center point and increase or decrease the camera zoom level
+        // by a specified value.
+        Point point = new Point(31, 118);
+        float amount2 = 2.0f;
+        CameraUpdate cameraUpdate4 = CameraUpdateFactory.zoomBy(amount2, point);
+
+        // Method 6: Set the latitude and longitude of the camera and retain other attribute settings.
+        LatLng latLng = new LatLng(31.5, 118.9);
+        CameraUpdate cameraUpdate5 = CameraUpdateFactory.newLatLng(latLng);
+
+        // Method 7: Set the visible region and padding.
+        int padding = 100;
+        LatLng latLng1 = new LatLng(31.5, 118.9);
+        LatLng latLng2 = new LatLng(32.5, 119.9);
+        LatLngBounds latLngBounds = new LatLngBounds(latLng1, latLng2);
+        CameraUpdate cameraUpdate6 = CameraUpdateFactory.newLatLngBounds(latLngBounds, padding);
+
+        // Method 8: Set the center point and zoom level of the camera.
+        float zoom2 = 0.0f;
+        LatLng latLng3 = new LatLng(32.5, 119.9);
+        CameraUpdate cameraUpdate7 = CameraUpdateFactory.newLatLngZoom(latLng3, zoom2);
+
+        // Method 9: Scroll the camera by specified number of pixels.
+        float x = 100.0f;
+        float y = 100.0f;
+        CameraUpdate cameraUpdate8 = CameraUpdateFactory.scrollBy(x, y);
+
+        // Method 10: Specify the camera position.
+        // Set the tilt.
+        float tilt = 2.2f;
+        // Set the bearing.
+        float bearing = 31.5f;
+        CameraPosition cameraPosition = new CameraPosition(latLng1, zoom, tilt, bearing);
+        CameraUpdate cameraUpdate9 = CameraUpdateFactory.newCameraPosition(cameraPosition);
+
+        return cameraUpdate9;
+    }
+
+    @Override
+    protected void onActive() {
+        super.onActive();
+        if (mMapView != null) {
+            mMapView.onResume();
+        }
+    }
+
+    @Override
+    protected void onInactive() {
+        super.onInactive();
+        if (mMapView != null) {
+            mMapView.onPause();
+        }
+    }
+
+    @Override
+    protected void onBackground() {
+        super.onBackground();
+        if (mMapView != null) {
+            mMapView.onStop();
+        }
+    }
+
+    @Override
+    protected void onForeground(Intent intent) {
+        super.onForeground(intent);
+        if (mMapView != null) {
+            mMapView.onStart();
+        }
+    }
+
+    @Override
+    protected void onStop() {
+        super.onStop();
+        if (mMapView != null) {
+            mMapView.onDestroy();
+        }
+    }
+}
+

+ 105 - 0
entry/src/main/java/com/fujica/abk/slice/MapViewDemoSlice.java

@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) Huawei Technologies Co., Ltd. 2008-2021. All rights reserved.
+ */
+
+package com.fujica.abk.slice;
+
+import com.huawei.hms.maps.harmony.HuaweiMap;
+import com.huawei.hms.maps.harmony.MapView;
+import com.huawei.hms.maps.harmony.OnMapReadyCallback;
+import com.huawei.hms.maps.harmony.OnMapClickListener;
+import com.huawei.hms.maps.harmony.model.LatLng;
+import com.huawei.hms.maps.harmony.CommonContext;
+import ohos.aafwk.ability.AbilitySlice;
+import ohos.aafwk.content.Intent;
+import ohos.agp.colors.RgbColor;
+import ohos.agp.components.ComponentContainer;
+import ohos.agp.components.PositionLayout;
+import ohos.agp.components.element.ShapeElement;
+import ohos.agp.window.dialog.ToastDialog;
+
+public class MapViewDemoSlice extends AbilitySlice {
+    /**
+     * Declare a MapView object.
+     */
+    private MapView mMapView;
+
+    @Override
+    public void onStart(Intent intent) {
+        super.onStart(intent);
+        CommonContext.setContext(this);
+
+        // Initialize MapView Object.
+        mMapView = new MapView(this);
+
+        // Creating a MapView
+        mMapView.onCreate();
+
+        // Obtains the HuaweiMap object.
+        mMapView.getMapAsync(new OnMapReadyCallback() {
+            @Override
+            public void onMapReady(HuaweiMap huaweiMap) {
+                HuaweiMap mHuaweiMap = huaweiMap;
+                mHuaweiMap.setOnMapClickListener(new  OnMapClickListener() {
+                    @Override
+                    public void onMapClick(LatLng latLng) {
+                        new ToastDialog(CommonContext.getContext()).setText("onMapClick ").show();
+                    }
+                });
+            }
+        });
+
+        // Create a layout.
+        ComponentContainer.LayoutConfig config = new ComponentContainer.LayoutConfig(ComponentContainer.LayoutConfig.MATCH_PARENT, ComponentContainer.LayoutConfig.MATCH_PARENT);
+        PositionLayout myLayout = new PositionLayout(this);
+        myLayout.setLayoutConfig(config);
+        ShapeElement element = new ShapeElement();
+        element.setShape(ShapeElement.RECTANGLE);
+        element.setRgbColor(new RgbColor(255, 255, 255));
+
+        // Load the MapView object.
+        myLayout.addComponent(mMapView);
+        super.setUIContent(myLayout);
+    }
+
+    @Override
+    protected void onActive() {
+        super.onActive();
+        if (mMapView != null) {
+            mMapView.onResume();
+        }
+    }
+
+    @Override
+    protected void onInactive() {
+        super.onInactive();
+        if (mMapView != null) {
+            mMapView.onPause();
+        }
+    }
+
+    @Override
+    protected void onBackground() {
+        super.onBackground();
+        if (mMapView != null) {
+            mMapView.onStop();
+        }
+    }
+
+    @Override
+    protected void onForeground(Intent intent) {
+        super.onForeground(intent);
+        if (mMapView != null) {
+            mMapView.onStart();
+        }
+    }
+
+    @Override
+    protected void onStop() {
+        super.onStop();
+        if (mMapView != null) {
+            mMapView.onDestroy();
+        }
+    }
+}
+

+ 222 - 0
entry/src/main/java/com/fujica/abk/slice/MarkerDemoSlice.java

@@ -0,0 +1,222 @@
+/*
+ * Copyright (c) Huawei Technologies Co., Ltd. 2008-2021. All rights reserved.
+ */
+
+package com.fujica.abk.slice;
+
+import com.fujica.abk.ResourceTable;
+import com.huawei.hms.maps.harmony.HuaweiMap;
+import com.huawei.hms.maps.harmony.MapView;
+import com.huawei.hms.maps.harmony.HuaweiMapOptions;
+import com.huawei.hms.maps.harmony.OnMapReadyCallback;
+import com.huawei.hms.maps.harmony.OnMapClickListener;
+import com.huawei.hms.maps.harmony.OnInfoWindowClickListener;
+import com.huawei.hms.maps.harmony.OnMarkerClickListener;
+import com.huawei.hms.maps.harmony.model.CameraPosition;
+import com.huawei.hms.maps.harmony.model.LatLng;
+import com.huawei.hms.maps.harmony.model.Marker;
+import com.huawei.hms.maps.harmony.model.MarkerOptions;
+import com.huawei.hms.maps.harmony.CommonContext;
+import ohos.aafwk.ability.AbilitySlice;
+import ohos.aafwk.content.Intent;
+import ohos.agp.colors.RgbColor;
+import ohos.agp.components.ComponentContainer;
+import ohos.agp.components.PositionLayout;
+import ohos.agp.components.element.ShapeElement;
+import ohos.agp.window.dialog.ToastDialog;
+import ohos.global.resource.NotExistException;
+import ohos.global.resource.Resource;
+
+import java.io.IOException;
+
+public class MarkerDemoSlice extends AbilitySlice {
+    private HuaweiMap mHuaweiMap;
+
+    /**
+     * Declare a MapView object.
+     */
+    private MapView mMapView;
+
+    /**
+     * Declare a Polyline object.
+     */
+    private Marker mMarker;
+
+    @Override
+    public void onStart(Intent intent) {
+        super.onStart(intent);
+        CommonContext.setContext(this);
+
+        // Declaring and Initializing the HuaweiMapOptions Object
+        HuaweiMapOptions huaweiMapOptions = new HuaweiMapOptions();
+
+        // Initialize Camera Properties
+        CameraPosition cameraPosition =
+                new CameraPosition(new LatLng(48.893478, 2.334595), 6, 0, 0);
+
+        huaweiMapOptions
+                // Set Camera Properties
+                .camera(cameraPosition)
+                // Enables or disables the zoom function. By default, the zoom function is enabled.
+                .zoomControlsEnabled(false)
+                // Sets whether the compass is available. The compass is available by default.
+                .compassEnabled(true)
+                // Specifies whether the zoom gesture is available. By default, the zoom gesture is available.
+                .zoomGesturesEnabled(true)
+                // Specifies whether to enable the scrolling gesture. By default, the scrolling gesture is enabled.
+                .scrollGesturesEnabled(true)
+                // Specifies whether the rotation gesture is available. By default, the rotation gesture is available.
+                .rotateGesturesEnabled(false)
+                // Specifies whether the tilt gesture is available. By default, the tilt gesture is available.
+                .tiltGesturesEnabled(true)
+                // Sets whether the map is in lite mode. The default value is No.
+                .liteMode(false)
+                // Set Preference Minimum Zoom Level
+                .minZoomPreference(3)
+                // Set Preference Maximum Zoom Level
+                .maxZoomPreference(13);
+
+        // Initialize MapView Object.
+        mMapView = new MapView(this, huaweiMapOptions);
+        mMapView.onCreate();
+
+        // Obtains the HuaweiMap object.
+        mMapView.getMapAsync(new OnMapReadyCallback() {
+            @Override
+            public void onMapReady(HuaweiMap huaweiMap) {
+                mHuaweiMap = huaweiMap;
+
+                // If mHuaweiMap is null, the program stops running.
+                if (null == mHuaweiMap) {
+                    return;
+                }
+
+                mHuaweiMap.setOnMapClickListener(new  OnMapClickListener() {
+                    @Override
+                    public void onMapClick(LatLng latLng) {
+                        new ToastDialog(CommonContext.getContext()).setText("onMapClick ").show();
+                    }
+                });
+
+                // If mMarker is not null, remove it from the map and then set it to null.
+                if (null != mMarker) {
+                    mMarker.remove();
+                    mMarker = null;
+                }
+
+                // Add a marker to the map.
+                MarkerOptions options = new MarkerOptions()
+                        .position(new LatLng(48.893478, 2.334595))
+                        .title("Hello Huawei Map")
+                        .snippet("This is a snippet!");
+                mMarker = mHuaweiMap.addMarker(options);
+
+                // Set the marker title.
+                if (mMarker != null) {
+                    mMarker.setTitle("Marker title");
+                }
+
+                // Set whether the marker can be dragged.
+                if (mMarker != null) {
+                    mMarker.setDraggable(true);
+                }
+
+                // Set the marker anchor point.
+                if (mMarker != null) {
+                    mMarker.setMarkerAnchor(0.9F, 0.9F);
+                }
+
+                // Customizing the Marker Icon
+                addCustomMarker();
+
+                mHuaweiMap.setOnMarkerClickListener(new OnMarkerClickListener() {
+                    @Override
+                    public boolean onMarkerClick(Marker marker) {
+                        new ToastDialog(CommonContext.getContext()).setText("onMarkerClick: " + marker.getTitle()).show();
+                        return false;
+                    }
+                });
+
+                mHuaweiMap.setOnInfoWindowClickListener(new OnInfoWindowClickListener() {
+                    @Override
+                    public void onInfoWindowClick(Marker marker) {
+                        new ToastDialog(CommonContext.getContext()).setText("onInfoWindowClick:").show();
+                    }
+                });
+            }
+        });
+
+        // Create a layout.
+        ComponentContainer.LayoutConfig config = new ComponentContainer.LayoutConfig(ComponentContainer.LayoutConfig.MATCH_PARENT, ComponentContainer.LayoutConfig.MATCH_PARENT);
+        PositionLayout myLayout = new PositionLayout(this);
+        myLayout.setLayoutConfig(config);
+        ShapeElement element = new ShapeElement();
+        element.setShape(ShapeElement.RECTANGLE);
+        element.setRgbColor(new RgbColor(255, 255, 255));
+
+        // Load the MapView object.
+        myLayout.addComponent(mMapView);
+        super.setUIContent(myLayout);
+    }
+
+    /**
+     * addCustomMarker
+     */
+    private void addCustomMarker() {
+        Resource resource = null;
+        try {
+            resource = getResourceManager().getResource(ResourceTable.Media_icon);
+        } catch (IOException e) {
+            e.printStackTrace();
+        } catch (NotExistException e) {
+            e.printStackTrace();
+        }
+
+        if (resource != null) {
+            mHuaweiMap.addMarker(new MarkerOptions()
+                    .position(new LatLng(47.8333, 2.8333))
+                    .icon(resource));
+        }
+    }
+
+    @Override
+    protected void onActive() {
+        super.onActive();
+        if (mMapView != null) {
+            mMapView.onResume();
+        }
+    }
+
+    @Override
+    protected void onInactive() {
+        super.onInactive();
+        if (mMapView != null) {
+            mMapView.onPause();
+        }
+    }
+
+    @Override
+    protected void onBackground() {
+        super.onBackground();
+        if (mMapView != null) {
+            mMapView.onStop();
+        }
+    }
+
+    @Override
+    protected void onForeground(Intent intent) {
+        super.onForeground(intent);
+        if (mMapView != null) {
+            mMapView.onStart();
+        }
+    }
+
+    @Override
+    protected void onStop() {
+        super.onStop();
+        if (mMapView != null) {
+            mMapView.onDestroy();
+        }
+    }
+}
+

+ 216 - 0
entry/src/main/java/com/fujica/abk/slice/PolygonDemoSlice.java

@@ -0,0 +1,216 @@
+/*
+ * Copyright (c) Huawei Technologies Co., Ltd. 2008-2021. All rights reserved.
+ */
+
+package com.fujica.abk.slice;
+
+import com.fujica.abk.ResourceTable;
+import com.fujica.abk.utils.ScreenUtil;
+import com.huawei.hms.maps.harmony.HuaweiMap;
+import com.huawei.hms.maps.harmony.MapView;
+import com.huawei.hms.maps.harmony.OnMapReadyCallback;
+import com.huawei.hms.maps.harmony.CameraUpdateFactory;
+import com.huawei.hms.maps.harmony.CommonContext;
+import com.huawei.hms.maps.harmony.model.LatLng;
+import ohos.aafwk.ability.AbilitySlice;
+import ohos.aafwk.content.Intent;
+import ohos.agp.colors.RgbColor;
+import ohos.agp.components.Button;
+import ohos.agp.components.Component;
+import ohos.agp.components.ComponentContainer;
+import ohos.agp.components.PositionLayout;
+import ohos.agp.components.LayoutScatter;
+import ohos.agp.components.element.ShapeElement;
+import com.huawei.hms.maps.harmony.model.Polygon;
+import com.huawei.hms.maps.harmony.model.PolygonOptions;
+import ohos.agp.utils.Color;
+
+public class PolygonDemoSlice extends AbilitySlice {
+    private HuaweiMap mHuaweiMap;
+
+    /**
+     * Declare a MapView object.
+     */
+    private MapView mMapView;
+
+    /**
+     * Declare a Polygon object.
+     */
+    private Polygon mPolygon;
+
+    private boolean fillColorStatus = true;
+
+    private boolean strokeColorStatus = true;
+
+    /**
+     * the layout
+     */
+    private PositionLayout rootLayout;
+
+    @Override
+    public void onStart(Intent intent) {
+        super.onStart(intent);
+        initPositionLayout();
+        initMapView();
+        addButtons();
+        super.setUIContent(this.rootLayout);
+    }
+
+    private void initPositionLayout() {
+        rootLayout = new PositionLayout(this);
+        this.rootLayout.setContentPosition(0, 0);
+        this.rootLayout.setWidth(ComponentContainer.LayoutConfig.MATCH_PARENT);
+        this.rootLayout.setHeight(ComponentContainer.LayoutConfig.MATCH_PARENT);
+
+        ShapeElement element = new ShapeElement();
+        element.setShape(ShapeElement.RECTANGLE);
+        element.setRgbColor(new RgbColor(255, 255, 255));
+        this.rootLayout.setBackground(element);
+    }
+
+    private void initMapView() {
+        CommonContext.setContext(this);
+
+        // Initialize MapView Object.
+        mMapView = new MapView(this);
+        mMapView.onCreate();
+
+        // Obtains the HuaweiMap object.
+        mMapView.getMapAsync(new OnMapReadyCallback() {
+            @Override
+            public void onMapReady(HuaweiMap huaweiMap) {
+                mHuaweiMap = huaweiMap;
+
+                // If mHuaweiMap is null, the program stops running.
+                if (null == mHuaweiMap) {
+                    return;
+                }
+
+                // If mPolygon is not null, remove it from the map and then set it to null.
+                if (null != mPolygon) {
+                    mPolygon.remove();
+                    mPolygon = null;
+                }
+
+                LatLng center = new LatLng(48.893478, 2.334595);
+                double halfHeight = 0.1;
+                double halfWidth = 0.1;
+
+                mPolygon = mHuaweiMap
+                        .addPolygon(new PolygonOptions().add(
+                                new LatLng(center.mLatitude - halfHeight, center.mLongitude - halfWidth),
+                                new LatLng(center.mLatitude - halfHeight, center.mLongitude + halfWidth),
+                                new LatLng(center.mLatitude + halfHeight, center.mLongitude + halfWidth),
+                                new LatLng(center.mLatitude + halfHeight, center.mLongitude - halfWidth))
+                                .fillColor(Color.GREEN.getValue())
+                                .strokeColor(Color.BLACK.getValue()));
+
+                // move camera
+                mHuaweiMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(48.893478, 2.334595), 8));
+            }
+        });
+
+        this.rootLayout.addComponent(mMapView);
+    }
+
+    private void addButtons() {
+        int height = ScreenUtil.getScreenHeight(this);
+
+        Button buttonStrokeColor = createButton();
+        buttonStrokeColor.setText("StrokeColor");
+        buttonStrokeColor.setContentPosition(50, (float) height / 2 - 100);
+        this.rootLayout.addComponent(buttonStrokeColor);
+
+        Button buttonFillColor = createButton();
+        buttonFillColor.setText("FillColor");
+        buttonFillColor.setContentPosition(50, (float) height / 2);
+        this.rootLayout.addComponent(buttonFillColor);
+
+
+        buttonStrokeColor.setClickedListener(new Component.ClickedListener() {
+            @Override
+            public void onClick(Component component) {
+                if (null == mPolygon) {
+                    return;
+                }
+                if (strokeColorStatus) {
+                    // Set the stroke color of the polygon (mPolygon) to red.
+                    mPolygon.setStrokeColor(Color.RED.getValue());
+                } else {
+                    // Set the stroke color of the polygon (mPolygon) to green.
+                    mPolygon.setStrokeColor(Color.GREEN.getValue());
+                }
+                strokeColorStatus = !strokeColorStatus;
+            }
+        });
+
+        buttonFillColor.setClickedListener(new Component.ClickedListener() {
+            @Override
+            public void onClick(Component component) {
+                if (null == mPolygon) {
+                    return;
+                }
+                if (fillColorStatus) {
+                    // Set the fill color of the polygon (mCircle) to red.
+                    mPolygon.setFillColor(Color.RED.getValue());
+                } else {
+                    // Set the fill color of the polygon (mPolygon) to green.
+                    mPolygon.setFillColor(Color.GREEN.getValue());
+                }
+                fillColorStatus = !fillColorStatus;
+            }
+        });
+    }
+
+    /**
+     * Create button
+     *
+     * @return Button
+     */
+    private Button createButton() {
+        Component component = LayoutScatter.getInstance(getContext())
+                .parse(ResourceTable.Layout_button_layout, null, false);
+        return (Button) component;
+    }
+
+    @Override
+    protected void onActive() {
+        super.onActive();
+        if (mMapView != null) {
+            mMapView.onResume();
+        }
+    }
+
+    @Override
+    protected void onInactive() {
+        super.onInactive();
+        if (mMapView != null) {
+            mMapView.onPause();
+        }
+    }
+
+    @Override
+    protected void onBackground() {
+        super.onBackground();
+        if (mMapView != null) {
+            mMapView.onStop();
+        }
+    }
+
+    @Override
+    protected void onForeground(Intent intent) {
+        super.onForeground(intent);
+        if (mMapView != null) {
+            mMapView.onStart();
+        }
+    }
+
+    @Override
+    protected void onStop() {
+        super.onStop();
+        if (mMapView != null) {
+            mMapView.onDestroy();
+        }
+    }
+}
+

+ 190 - 0
entry/src/main/java/com/fujica/abk/slice/PolylineDemoSlice.java

@@ -0,0 +1,190 @@
+/*
+ * Copyright (c) Huawei Technologies Co., Ltd. 2008-2021. All rights reserved.
+ */
+
+package com.fujica.abk.slice;
+
+import com.fujica.abk.ResourceTable;
+import com.fujica.abk.utils.ScreenUtil;
+import com.huawei.hms.maps.harmony.HuaweiMap;
+import com.huawei.hms.maps.harmony.MapView;
+import com.huawei.hms.maps.harmony.OnMapReadyCallback;
+import com.huawei.hms.maps.harmony.CameraUpdateFactory;
+import com.huawei.hms.maps.harmony.CommonContext;
+import com.huawei.hms.maps.harmony.model.LatLng;
+import ohos.aafwk.ability.AbilitySlice;
+import ohos.aafwk.content.Intent;
+import ohos.agp.colors.RgbColor;
+import ohos.agp.components.Button;
+import ohos.agp.components.Component;
+import ohos.agp.components.ComponentContainer;
+import ohos.agp.components.PositionLayout;
+import ohos.agp.components.LayoutScatter;
+import ohos.agp.components.element.ShapeElement;
+import com.huawei.hms.maps.harmony.model.Polyline;
+import com.huawei.hms.maps.harmony.model.PolylineOptions;
+import ohos.agp.utils.Color;
+
+public class PolylineDemoSlice extends AbilitySlice {
+    private HuaweiMap mHuaweiMap;
+
+    /**
+     * Declare a MapView object.
+     */
+    private MapView mMapView;
+
+    /**
+     * Declare a Polyline object.
+     */
+    private Polyline mPolyline;
+
+    private boolean strokeColorStatus = true;
+
+    /**
+     * the layout
+     */
+    private PositionLayout rootLayout;
+
+    @Override
+    public void onStart(Intent intent) {
+        super.onStart(intent);
+        initPositionLayout();
+        initMapView();
+        addButtons();
+        super.setUIContent(this.rootLayout);
+    }
+
+    private void initPositionLayout() {
+        rootLayout = new PositionLayout(this);
+        this.rootLayout.setContentPosition(0, 0);
+        this.rootLayout.setWidth(ComponentContainer.LayoutConfig.MATCH_PARENT);
+        this.rootLayout.setHeight(ComponentContainer.LayoutConfig.MATCH_PARENT);
+
+        ShapeElement element = new ShapeElement();
+        element.setShape(ShapeElement.RECTANGLE);
+        element.setRgbColor(new RgbColor(255, 255, 255));
+        this.rootLayout.setBackground(element);
+    }
+
+    private void initMapView() {
+        CommonContext.setContext(this);
+
+        // Initialize MapView Object.
+        mMapView = new MapView(this);
+        mMapView.onCreate();
+
+        // Obtains the HuaweiMap object.
+        mMapView.getMapAsync(new OnMapReadyCallback() {
+            @Override
+            public void onMapReady(HuaweiMap huaweiMap) {
+                mHuaweiMap = huaweiMap;
+
+                // If mHuaweiMap is null, the program stops running.
+                if (null == mHuaweiMap) {
+                    return;
+                }
+
+                // If mPolyline is not null, remove it from the map and then set it to null.
+                if (null != mPolyline) {
+                    mPolyline.remove();
+                    mPolyline = null;
+                }
+
+                // Add a polyline to a map.
+                mPolyline = mHuaweiMap.addPolyline(new PolylineOptions()
+                        // polyline coordinate
+                        .add(new LatLng(47.893478, 2.334595), new LatLng(48.993478, 3.434595),
+                                new LatLng(48.693478, 2.134595), new LatLng(48.793478, 2.334595))
+                        // Polyline Color
+                        .color(Color.BLUE.getValue())
+                        // Polyline Width
+                        .width(3));
+
+                // move camera
+                mHuaweiMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(48.893478, 2.334595), 6));
+            }
+        });
+
+        this.rootLayout.addComponent(mMapView);
+    }
+
+    private void addButtons() {
+        int height = ScreenUtil.getScreenHeight(this);
+
+        Button buttonStrokeColor = createButton();
+        buttonStrokeColor.setText("StrokeColor");
+        buttonStrokeColor.setContentPosition(50, (float) height / 2);
+        this.rootLayout.addComponent(buttonStrokeColor);
+
+        buttonStrokeColor.setClickedListener(new Component.ClickedListener() {
+            @Override
+            public void onClick(Component component) {
+                if (null == mPolyline) {
+                    return;
+                }
+                if (strokeColorStatus) {
+                    // Set the color of the polyline (mPolyline) to red.
+                    mPolyline.setColor(Color.RED.getValue());
+                } else {
+                    // Set the color of the polyline (mPolyline) to green.
+                    mPolyline.setColor(Color.GREEN.getValue());
+                }
+                // Set the width of the polyline (mPolyline) to 10 pixels.
+                mPolyline.setWidth(10);
+                strokeColorStatus = !strokeColorStatus;
+            }
+        });
+    }
+
+    /**
+     * Create button
+     *
+     * @return Button
+     */
+    private Button createButton() {
+        Component component = LayoutScatter.getInstance(getContext())
+                .parse(ResourceTable.Layout_button_layout, null, false);
+        return (Button) component;
+    }
+
+    @Override
+    protected void onActive() {
+        super.onActive();
+        if (mMapView != null) {
+            mMapView.onResume();
+        }
+    }
+
+    @Override
+    protected void onInactive() {
+        super.onInactive();
+        if (mMapView != null) {
+            mMapView.onPause();
+        }
+    }
+
+    @Override
+    protected void onBackground() {
+        super.onBackground();
+        if (mMapView != null) {
+            mMapView.onStop();
+        }
+    }
+
+    @Override
+    protected void onForeground(Intent intent) {
+        super.onForeground(intent);
+        if (mMapView != null) {
+            mMapView.onStart();
+        }
+    }
+
+    @Override
+    protected void onStop() {
+        super.onStop();
+        if (mMapView != null) {
+            mMapView.onDestroy();
+        }
+    }
+}
+

+ 24 - 0
entry/src/main/java/com/fujica/abk/slice/XmlLayoutSlice.java

@@ -0,0 +1,24 @@
+package com.fujica.abk.slice;
+
+import com.fujica.abk.ResourceTable;
+import ohos.aafwk.ability.AbilitySlice;
+import ohos.aafwk.content.Intent;
+
+public class XmlLayoutSlice extends AbilitySlice {
+    @Override
+    public void onStart(Intent intent) {
+        super.onStart(intent);
+        super.setUIContent(ResourceTable.Layout_xml_layout);
+    }
+
+    @Override
+    public void onActive() {
+        super.onActive();
+    }
+
+    @Override
+    public void onForeground(Intent intent) {
+        super.onForeground(intent);
+    }
+}
+

+ 31 - 0
entry/src/main/java/com/fujica/abk/utils/ScreenUtil.java

@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) Huawei Technologies Co., Ltd. 2008-2021. All rights reserved.
+ */
+
+package com.fujica.abk.utils;
+
+import ohos.agp.window.service.DisplayManager;
+import ohos.app.Context;
+
+public class ScreenUtil {
+    /**
+     * Obtains the screen width.
+     *
+     * @param context Context
+     * @return device width
+     */
+    public static int getScreenWidth(Context context) {
+        return DisplayManager.getInstance().getDefaultDisplay(context).get().getAttributes().width;
+    }
+
+    /**
+     * Obtains the screen height.
+     *
+     * @param context Context
+     * @return device height
+     */
+    public static int getScreenHeight(Context context) {
+        return DisplayManager.getInstance().getDefaultDisplay(context).get().getAttributes().height;
+    }
+}
+

+ 97 - 0
entry/src/main/java/com/fujica/abk/widget/controller/FormController.java

@@ -0,0 +1,97 @@
+package com.fujica.abk.widget.controller;
+
+import ohos.aafwk.ability.AbilitySlice;
+import ohos.aafwk.ability.ProviderFormInfo;
+import ohos.aafwk.content.Intent;
+import ohos.app.Context;
+
+/**
+ * The api set for form controller.
+ */
+public abstract class FormController {
+    /**
+     * Context of ability
+     */
+    protected final Context context;
+
+    /**
+     * The name of current form service widget
+     */
+    protected final String formName;
+
+    /**
+     * The dimension of current form service widget
+     */
+    protected final int dimension;
+
+    public FormController(Context context, String formName, Integer dimension) {
+        this.context = context;
+        this.formName = formName;
+        this.dimension = dimension;
+    }
+
+    /**
+     * Bind data for a form
+     *
+     * @return ProviderFormInfo
+     */
+    public abstract ProviderFormInfo bindFormData(long formId);
+
+    /**
+     * Update form data
+     *
+     * @param formId the id of service widget to be updated
+     * @param vars   the data to update for service widget, this parameter is optional
+     */
+    public abstract void updateFormData(long formId, Object... vars);
+
+    /**
+     * Update form data on time, this update time is set in config.json by scheduledUpdateTime property
+     *
+     * @param formId the id of service widget to be updated
+     */
+    public void onUpdateFormData(long formId) {
+    }
+
+    /**
+     * Called when receive service widget message event
+     *
+     * @param formId  form id
+     * @param message the message context sent by service widget message event
+     */
+    public abstract void onTriggerFormEvent(long formId, String message);
+
+    /**
+     * Get the destination ability slice to route
+     *
+     * @param intent intent of current page slice
+     * @return the destination ability slice name to route
+     */
+    public abstract Class<? extends AbilitySlice> getRoutePageSlice(Intent intent);
+
+    /**
+     * Delete the resource related to current service widget
+     *
+     * @param formId form id
+     */
+    public void onDeleteForm(long formId) {
+    }
+
+    /**
+     * Get the dimension of current service widget
+     *
+     * @return the dimension of current service widget
+     */
+    public int getDimension() {
+        return dimension;
+    }
+
+    /**
+     * Get the name of current service widget
+     *
+     * @return the name of current service widget
+     */
+    public String getFormName() {
+        return formName;
+    }
+}

+ 183 - 0
entry/src/main/java/com/fujica/abk/widget/controller/FormControllerManager.java

@@ -0,0 +1,183 @@
+package com.fujica.abk.widget.controller;
+
+import ohos.app.Context;
+import ohos.data.DatabaseHelper;
+import ohos.data.preferences.Preferences;
+import ohos.hiviewdfx.HiLog;
+import ohos.hiviewdfx.HiLogLabel;
+import ohos.utils.zson.ZSONObject;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * Form controller manager.
+ */
+public class FormControllerManager {
+    private static final HiLogLabel TAG = new HiLogLabel(HiLog.DEBUG, 0x0, FormControllerManager.class.getName());
+    private static final String PACKAGE_PATH = "com.fujica.abk.widget";
+    private static final String SHARED_SP_NAME = "form_info_sp.xml";
+    private static final String FORM_NAME = "formName";
+    private static final String DIMENSION = "dimension";
+    private volatile static FormControllerManager managerInstance = null;
+    private final HashMap<Long, FormController> controllerHashMap = new HashMap<>();
+
+    private final Context context;
+
+    private final Preferences preferences;
+
+    /**
+     * Constructor with context.
+     *
+     * @param context instance of Context.
+     */
+    private FormControllerManager(Context context) {
+        this.context = context;
+        DatabaseHelper databaseHelper = new DatabaseHelper(this.context.getApplicationContext());
+        preferences = databaseHelper.getPreferences(SHARED_SP_NAME);
+    }
+
+    /**
+     * Singleton mode.
+     *
+     * @param context instance of Context.
+     * @return FormControllerManager instance.
+     */
+    public static FormControllerManager getInstance(Context context) {
+        if (managerInstance == null) {
+            synchronized (FormControllerManager.class) {
+                if (managerInstance == null) {
+                    managerInstance = new FormControllerManager(context);
+                }
+            }
+        }
+        return managerInstance;
+    }
+
+    /**
+     * Save the form id and form name.
+     *
+     * @param formId    form id.
+     * @param formName  form name.
+     * @param dimension form dimension
+     * @return FormController form controller
+     */
+    public FormController createFormController(long formId, String formName, int dimension) {
+        synchronized (controllerHashMap) {
+            if (formId < 0 || formName.isEmpty()) {
+                return null;
+            }
+            HiLog.info(TAG,
+                    "saveFormId() formId: " + formId + ", formName: " + formName + ", preferences: " + preferences);
+            if (preferences != null) {
+                ZSONObject formObj = new ZSONObject();
+                formObj.put(FORM_NAME, formName);
+                formObj.put(DIMENSION, dimension);
+                preferences.putString(Long.toString(formId), ZSONObject.toZSONString(formObj));
+                preferences.flushSync();
+            }
+
+            // Create controller instance.
+            FormController controller = newInstance(formName, dimension, context);
+
+            // Cache the controller.
+            if (controller != null) {
+                if (!controllerHashMap.containsKey(formId)) {
+                    controllerHashMap.put(formId, controller);
+                }
+            }
+
+            return controller;
+        }
+    }
+
+    /**
+     * Get the form controller instance.
+     *
+     * @param formId form id.
+     * @return the instance of form controller.
+     */
+    public FormController getController(long formId) {
+        synchronized (controllerHashMap) {
+            if (controllerHashMap.containsKey(formId)) {
+                return controllerHashMap.get(formId);
+            }
+            Map<String, ?> forms = preferences.getAll();
+            String formIdString = Long.toString(formId);
+            if (forms.containsKey(formIdString)) {
+                ZSONObject formObj = ZSONObject.stringToZSON((String) forms.get(formIdString));
+                String formName = formObj.getString(FORM_NAME);
+                int dimension = formObj.getIntValue(DIMENSION);
+                FormController controller = newInstance(formName, dimension, context);
+                controllerHashMap.put(formId, controller);
+            }
+            return controllerHashMap.get(formId);
+        }
+    }
+
+    private FormController newInstance(String formName, int dimension, Context context) {
+        FormController ctrInstance = null;
+        if (formName == null || formName.isEmpty()) {
+            HiLog.error(TAG, "newInstance() get empty form name");
+            return ctrInstance;
+        }
+        try {
+            String className = PACKAGE_PATH + "." + formName.toLowerCase(Locale.ROOT) + "."
+                    + getClassNameByFormName(formName);
+            Class<?> clazz = Class.forName(className);
+            if (clazz != null) {
+                Object controllerInstance = clazz.getConstructor(Context.class, String.class, Integer.class)
+                        .newInstance(context, formName, dimension);
+                if (controllerInstance instanceof FormController) {
+                    ctrInstance = (FormController) controllerInstance;
+                }
+            }
+        } catch (NoSuchMethodException | InstantiationException | IllegalArgumentException | InvocationTargetException
+                 | IllegalAccessException | ClassNotFoundException | SecurityException exception) {
+            HiLog.error(TAG, "newInstance() get exception: " + exception.getMessage());
+        }
+        return ctrInstance;
+    }
+
+    /**
+     * Get all form id from the share preference
+     *
+     * @return form id list
+     */
+    public List<Long> getAllFormIdFromSharePreference() {
+        List<Long> result = new ArrayList<>();
+        Map<String, ?> forms = preferences.getAll();
+        for (String formId : forms.keySet()) {
+            result.add(Long.parseLong(formId));
+        }
+        return result;
+    }
+
+    /**
+     * Delete a form controller
+     *
+     * @param formId form id
+     */
+    public void deleteFormController(long formId) {
+        synchronized (controllerHashMap) {
+            preferences.delete(Long.toString(formId));
+            preferences.flushSync();
+            controllerHashMap.remove(formId);
+        }
+    }
+
+    private String getClassNameByFormName(String formName) {
+        String[] strings = formName.split("_");
+        StringBuilder result = new StringBuilder();
+        for (String string : strings) {
+            result.append(string);
+        }
+        char[] charResult = result.toString().toCharArray();
+        charResult[0] = (charResult[0] >= 'a' && charResult[0] <= 'z') ? (char) (charResult[0] - 32) : charResult[0];
+        return String.copyValueOf(charResult) + "Impl";
+    }
+}

+ 32 - 0
entry/src/main/java/com/fujica/abk/widget/widget/WidgetImpl.java

@@ -0,0 +1,32 @@
+package com.fujica.abk.widget.widget;
+
+import com.fujica.abk.widget.controller.FormController;
+import ohos.aafwk.ability.AbilitySlice;
+import ohos.aafwk.ability.ProviderFormInfo;
+import ohos.aafwk.content.Intent;
+import ohos.app.Context;
+
+public class WidgetImpl extends FormController {
+
+    public WidgetImpl(Context context, String formName, Integer dimension) {
+        super(context, formName, dimension);
+    }
+
+    @Override
+    public ProviderFormInfo bindFormData(long formId) {
+        return null;
+    }
+
+    @Override
+    public void updateFormData(long formId, Object... vars) {
+    }
+
+    @Override
+    public void onTriggerFormEvent(long formId, String message) {
+    }
+
+    @Override
+    public Class<? extends AbilitySlice> getRoutePageSlice(Intent intent) {
+        return null;
+    }
+}

BIN
entry/src/main/js/widget/common/ic_default_image@3x.png


+ 6 - 0
entry/src/main/js/widget/i18n/en-US.json

@@ -0,0 +1,6 @@
+{
+  "strings": {
+    "title": "Today's delicious food",
+    "detail": "A bowl of fragrant fried noodles, back to childhood memories"
+  }
+}

+ 6 - 0
entry/src/main/js/widget/i18n/zh-CN.json

@@ -0,0 +1,6 @@
+{
+  "strings": {
+    "title": "今日美食推荐",
+    "detail": "一碗香喷喷的炸酱面,回到儿时的青涩回忆"
+  }
+}

+ 61 - 0
entry/src/main/js/widget/pages/index/index.css

@@ -0,0 +1,61 @@
+.container {
+    flex-direction: column;
+    justify-content: center;
+    align-items: center;
+}
+.bg-img{
+    flex-shrink: 0;
+    height: 100%;
+}
+.container-inner {
+    flex-direction: column;
+    justify-content: flex-end;
+    align-items: flex-start;
+    height: 100%;
+    width: 100%;
+    padding: 12px;
+}
+.title {
+    font-size: 19px;
+    font-weight: bold;
+    color: white;
+    text-overflow: ellipsis;
+    max-lines: 1;
+}
+.detail_text {
+    font-size: 16px;
+    color: white;
+    opacity: 0.66;
+    text-overflow: ellipsis;
+    max-lines: 1;
+    margin-top: 6px;
+}
+@media (device-type: tablet) {
+    .bg-img {
+        object-fit: fill;
+    }
+}
+@media (device-type: wearable) {
+    .container-inner {
+        justify-content: center;
+        align-items: center;
+        margin: 40px 26px;
+        padding: 0;
+    }
+    .title {
+        text-align: center;
+    }
+    .detail_text {
+        max-lines: 2;
+        text-align: center;
+    }
+}
+
+@media (device-type: tv) {
+    .title {
+        font-size: 16px;
+    }
+    .detail_text {
+        font-size: 12px;
+    }
+}

+ 11 - 0
entry/src/main/js/widget/pages/index/index.hml

@@ -0,0 +1,11 @@
+<div class="container">
+    <stack>
+        <div class="container-img">
+            <image src="/common/ic_default_image@3x.png" class="bg-img" onclick="routerEvent"></image>
+        </div>
+        <div class="container-inner">
+            <text class="title">{{ $t('strings.title') }}</text>
+            <text class="detail_text">{{ $t('strings.detail') }}</text>
+        </div>
+    </stack>
+</div>

+ 17 - 0
entry/src/main/js/widget/pages/index/index.json

@@ -0,0 +1,17 @@
+{
+  "data": {
+    "title": "Title",
+    "detail": "Text",
+    "iconTitle": "Picture"
+  },
+  "actions": {
+    "routerEvent": {
+      "action": "router",
+      "bundleName": "com.fujica.abk",
+      "abilityName": "com.fujica.abk.MainAbility",
+      "params": {
+        "message": "add detail"
+      }
+    }
+  }
+}

+ 36 - 0
entry/src/main/resources/base/element/string.json

@@ -0,0 +1,36 @@
+{
+  "string": [
+    {
+      "name": "entry_MainAbility",
+      "value": "entry_MainAbility"
+    },
+    {
+      "name": "mainability_description",
+      "value": "Java_Empty Ability"
+    },
+    {
+      "name": "mainability_HelloWorld",
+      "value": "Hello World"
+    },
+    {
+      "name": "widget_ability_description",
+      "value": "This is a WidgetAbility"
+    },
+    {
+      "name": "btn_xml_layout",
+      "value": "跳转到XML布局页面"
+    },
+    {
+      "name": "btn_code_layout",
+      "value": "跳转到代码布局页面"
+    },
+    {
+      "name": "xml_layout_title",
+      "value": "XML布局页面"
+    },
+    {
+      "name": "code_layout_title",
+      "value": "代码布局页面"
+    }
+  ]
+}

+ 6 - 0
entry/src/main/resources/base/graphic/background_ability_main.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<shape xmlns:ohos="http://schemas.huawei.com/res/ohos"
+       ohos:shape="rectangle">
+    <solid
+        ohos:color="#FFFFFF"/>
+</shape>

+ 10 - 0
entry/src/main/resources/base/graphic/background_button.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape
+    xmlns:ohos="http://schemas.huawei.com/res/ohos"
+    ohos:shape="rectangle">
+    <corners
+        ohos:radius="100"/>
+    <solid
+        ohos:color="#007DFF"/>
+</shape>
+

+ 10 - 0
entry/src/main/resources/base/graphic/background_circle_16.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape
+    xmlns:ohos="http://schemas.huawei.com/res/ohos"
+    ohos:shape="rectangle">
+    <corners
+        ohos:radius="16vp"/>
+    <solid
+        ohos:color="#FFFFFFFF"/>
+</shape>
+

+ 9 - 0
entry/src/main/resources/base/graphic/container_body.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape
+    xmlns:ohos="http://schemas.huawei.com/res/ohos"
+    ohos:shape="rectangle">
+    <stroke
+        ohos:width="1vp"
+        ohos:color="#FFEFEFEF"/>
+</shape>
+

+ 15 - 0
entry/src/main/resources/base/graphic/container_bottom.xml

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape
+    xmlns:ohos="http://schemas.huawei.com/res/ohos"
+    ohos:shape="rectangle">
+    <corners
+        ohos:left_top_x="0"
+        ohos:right_top_x="0"
+        ohos:radius="12vp"/>
+
+    <stroke
+        ohos:width="1vp"
+        ohos:color="#FFEFEFEF"
+        />
+</shape>
+

+ 12 - 0
entry/src/main/resources/base/graphic/container_top.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape
+    xmlns:ohos="http://schemas.huawei.com/res/ohos"
+    ohos:shape="rectangle">
+    <corners
+        ohos:left_bottom_x="0"
+        ohos:right_bottom_x="0"
+        ohos:radius="12vp"/>
+    <solid
+        ohos:color="#FA6332"/>
+</shape>
+

+ 225 - 0
entry/src/main/resources/base/layout/ability_main.xml

@@ -0,0 +1,225 @@
+<?xml version="1.0" encoding="utf-8"?>
+<StackLayout
+    xmlns:ohos="http://schemas.huawei.com/res/ohos"
+    ohos:height="match_parent"
+    ohos:width="match_parent"
+    ohos:orientation="horizontal">
+
+    <PositionLayout
+        xmlns:ohos="http://schemas.huawei.com/res/ohos"
+        ohos:id="$+id:main_body"
+        ohos:height="match_parent"
+        ohos:width="match_parent">
+    </PositionLayout>
+
+    <!-- 主内容区域 - 垂直布局 -->
+    <DirectionalLayout
+        ohos:margin="5vp"
+        ohos:id="$+id:main_content"
+        ohos:height="match_parent"
+        ohos:width="400vp"
+        ohos:background_element="#FFFFFFFF"
+        ohos:orientation="vertical">
+
+        <DirectionalLayout
+            ohos:id="$+id:header_bar"
+            ohos:height="56vp"
+            ohos:width="match_parent"
+            ohos:alignment="left"
+            ohos:background_element="$graphic:container_top"
+            ohos:end_padding="16vp"
+            ohos:orientation="horizontal"
+            ohos:start_padding="16vp">
+
+            <DirectionalLayout
+                ohos:layout_alignment="center"
+                ohos:height="match_content"
+                ohos:width="match_content"
+                ohos:alignment="center"
+                ohos:orientation="horizontal">
+
+                <!-- P图标圆圈 -->
+                <Text
+                    ohos:id="$+id:icon_parking"
+                    ohos:height="22vp"
+                    ohos:width="22vp"
+                    ohos:background_element="$graphic:background_circle_16"
+                    ohos:end_margin="8vp"
+                    ohos:text="P"
+                    ohos:text_alignment="center"
+                    ohos:text_color="#FA6332"
+                    ohos:text_size="18fp"/>
+
+                <!-- 标题文字 -->
+                <Text
+                    ohos:id="$+id:title_text"
+                    ohos:height="match_content"
+                    ohos:width="match_content"
+                    ohos:text="爱泊客 - 停车缴费"
+                    ohos:text_color="#FFFFFFFF"
+                    ohos:text_size="18fp"/>
+            </DirectionalLayout>
+        </DirectionalLayout>
+
+        <!-- 页面滑动容器 -->
+        <DirectionalLayout
+            ohos:height="0vp"
+            ohos:width="match_parent"
+            ohos:background_element="$graphic:container_body"
+            ohos:left_padding="1vp"
+            ohos:right_padding="1vp"
+            ohos:weight="1">
+
+            <PageSlider
+                ohos:id="$+id:page_slider"
+                ohos:height="match_parent"
+                ohos:width="match_parent"/>
+        </DirectionalLayout>
+
+        <!-- 底部导航栏 -->
+        <DirectionalLayout
+            ohos:height="64vp"
+            ohos:width="match_parent">
+
+            <DirectionalLayout
+                ohos:top_margin="-1vp"
+                ohos:height="64vp"
+                ohos:width="match_parent"
+                ohos:background_element="$graphic:container_bottom"
+                ohos:bottom_padding="8vp"
+                ohos:orientation="horizontal"
+                ohos:top_padding="8vp">
+                <!-- 我的 -->
+                <DirectionalLayout
+                    ohos:id="$+id:nav_my"
+                    ohos:height="match_parent"
+                    ohos:width="0vp"
+                    ohos:alignment="center"
+                    ohos:orientation="vertical"
+                    ohos:weight="1">
+
+                    <Image
+                        ohos:id="$+id:icon_my"
+                        ohos:height="24vp"
+                        ohos:width="24vp"
+                        ohos:scale_mode="stretch"
+                        ohos:bottom_margin="4vp"
+                        ohos:image_src="$media:my"/>
+
+                    <Image
+                        ohos:id="$+id:icon_my_1"
+                        ohos:height="24vp"
+                        ohos:width="24vp"
+                        ohos:scale_mode="stretch"
+                        ohos:bottom_margin="4vp"
+                        ohos:visibility="hide"
+                        ohos:image_src="$media:my_1"/>
+
+                    <Text
+                        ohos:id="$+id:text_my"
+                        ohos:height="match_content"
+                        ohos:width="match_content"
+                        ohos:text="我的"
+                        ohos:text_color="#FF666666"
+                        ohos:text_size="12fp"/>
+                </DirectionalLayout>
+
+                <!-- 找车位 -->
+                <DirectionalLayout
+                    ohos:id="$+id:nav_find_parking"
+                    ohos:height="match_parent"
+                    ohos:width="0vp"
+                    ohos:alignment="center"
+                    ohos:orientation="vertical"
+                    ohos:weight="1">
+
+                    <Image
+                        ohos:id="$+id:icon_park"
+                        ohos:height="24vp"
+                        ohos:width="24vp"
+                        ohos:scale_mode="stretch"
+                        ohos:bottom_margin="4vp"
+                        ohos:visibility="hide"
+                        ohos:image_src="$media:park"/>
+
+                    <Image
+                        ohos:id="$+id:icon_park_1"
+                        ohos:height="24vp"
+                        ohos:width="24vp"
+                        ohos:scale_mode="stretch"
+                        ohos:bottom_margin="4vp"
+                        ohos:image_src="$media:park_1"/>
+
+                    <Text
+                        ohos:id="$+id:text_park"
+                        ohos:height="match_content"
+                        ohos:width="match_content"
+                        ohos:text="找车位"
+                        ohos:text_color="#FA6332"
+                        ohos:text_size="12fp"/>
+                </DirectionalLayout>
+
+                <!-- 预约停车 -->
+                <DirectionalLayout
+                    ohos:id="$+id:nav_reserve_parking"
+                    ohos:height="match_parent"
+                    ohos:width="0vp"
+                    ohos:alignment="center"
+                    ohos:orientation="vertical"
+                    ohos:weight="1">
+
+                    <Image
+                        ohos:id="$+id:icon_fee"
+                        ohos:scale_mode="stretch"
+                        ohos:height="24vp"
+                        ohos:width="24vp"
+                        ohos:bottom_margin="4vp"
+                        ohos:image_src="$media:fee"/>
+                    <Image
+                        ohos:id="$+id:icon_fee_1"
+                        ohos:scale_mode="stretch"
+                        ohos:height="24vp"
+                        ohos:width="24vp"
+                        ohos:bottom_margin="4vp"
+                        ohos:visibility="hide"
+                        ohos:image_src="$media:fee_1"/>
+
+                    <Text
+                        ohos:id="$+id:text_fee"
+                        ohos:height="match_content"
+                        ohos:width="match_content"
+                        ohos:text="预约停车"
+                        ohos:text_color="#FF666666"
+                        ohos:text_size="12fp"/>
+                </DirectionalLayout>
+
+                <!-- 当前位置 -->
+                <DirectionalLayout
+                    ohos:id="$+id:nav_current_location"
+                    ohos:height="match_parent"
+                    ohos:width="0vp"
+                    ohos:alignment="center"
+                    ohos:orientation="vertical"
+                    ohos:weight="1">
+
+                    <Image
+                        ohos:id="$+id:icon_current_location"
+                        ohos:scale_mode="stretch"
+                        ohos:height="24vp"
+                        ohos:width="24vp"
+                        ohos:bottom_margin="4vp"
+                        ohos:image_src="$media:location"/>
+
+                    <Text
+                        ohos:id="$+id:text_current_location"
+                        ohos:height="match_content"
+                        ohos:width="match_content"
+                        ohos:text="当前位置"
+                        ohos:text_color="#FF666666"
+                        ohos:text_size="12fp"/>
+                </DirectionalLayout>
+            </DirectionalLayout>
+        </DirectionalLayout>
+    </DirectionalLayout>
+
+</StackLayout>

+ 199 - 0
entry/src/main/resources/base/layout/ability_main_1.xml

@@ -0,0 +1,199 @@
+<?xml version="1.0" encoding="utf-8"?>
+<DirectionalLayout
+    xmlns:ohos="http://schemas.huawei.com/res/ohos"
+    ohos:width="match_parent"
+    ohos:height="match_parent">
+
+    <ScrollView
+        ohos:id="$+id:scrollview"
+        ohos:height="match_parent"
+        ohos:width="match_parent"
+        ohos:background_element="#FFDEAD"
+        ohos:bottom_padding="16vp"
+        ohos:layout_alignment="horizontal_center">
+
+        <DirectionalLayout
+            ohos:height="match_content"
+            ohos:width="match_parent">
+
+            <Button
+                ohos:id="$+id:button_toMapViewDemo"
+                ohos:width="match_parent"
+                ohos:height="match_parent"
+                ohos:layout_alignment="center"
+                ohos:text="MapViewDemo"
+                ohos:text_size="19fp"
+                ohos:text_color="#FFFFFF"
+                ohos:top_padding="6vp"
+                ohos:bottom_padding="6vp"
+                ohos:right_padding="10vp"
+                ohos:left_padding="10vp"
+                ohos:center_in_parent="true"
+                ohos:margin="10vp"
+                ohos:background_element="$graphic:background_button"/>
+
+            <Button
+                ohos:id="$+id:button_toMapViewCameraDemo"
+                ohos:width="match_parent"
+                ohos:height="match_parent"
+                ohos:layout_alignment="center"
+                ohos:text="MapViewCameraDemo"
+                ohos:text_size="19fp"
+                ohos:text_color="#FFFFFF"
+                ohos:top_padding="6vp"
+                ohos:bottom_padding="6vp"
+                ohos:right_padding="10vp"
+                ohos:left_padding="10vp"
+                ohos:center_in_parent="true"
+                ohos:margin="10vp"
+                ohos:background_element="$graphic:background_button"/>
+
+            <Button
+                ohos:id="$+id:button_toLiteModeDemo"
+                ohos:width="match_parent"
+                ohos:height="match_content"
+                ohos:layout_alignment="center"
+                ohos:text="LiteModeDemo"
+                ohos:text_size="19fp"
+                ohos:text_color="#FFFFFF"
+                ohos:top_padding="6vp"
+                ohos:bottom_padding="6vp"
+                ohos:right_padding="10vp"
+                ohos:left_padding="10vp"
+                ohos:center_in_parent="true"
+                ohos:margin="10vp"
+                ohos:background_element="$graphic:background_button"/>
+
+            <Button
+                ohos:id="$+id:button_toMapTypeDemo"
+                ohos:width="match_parent"
+                ohos:height="match_content"
+                ohos:layout_alignment="center"
+                ohos:text="MapTypeDemo"
+                ohos:text_size="19fp"
+                ohos:text_color="#FFFFFF"
+                ohos:top_padding="6vp"
+                ohos:bottom_padding="6vp"
+                ohos:right_padding="10vp"
+                ohos:left_padding="10vp"
+                ohos:center_in_parent="true"
+                ohos:margin="10vp"
+                ohos:background_element="$graphic:background_button"/>
+
+            <Button
+                ohos:id="$+id:button_toCircleDemo"
+                ohos:width="match_parent"
+                ohos:height="match_content"
+                ohos:layout_alignment="center"
+                ohos:text="CircleDemo"
+                ohos:text_size="19fp"
+                ohos:text_color="#FFFFFF"
+                ohos:top_padding="6vp"
+                ohos:bottom_padding="6vp"
+                ohos:right_padding="10vp"
+                ohos:left_padding="10vp"
+                ohos:center_in_parent="true"
+                ohos:margin="10vp"
+                ohos:background_element="$graphic:background_button"/>
+
+            <Button
+                ohos:id="$+id:button_toPolylineDemo"
+                ohos:width="match_parent"
+                ohos:height="match_content"
+                ohos:layout_alignment="center"
+                ohos:text="PolylineDemo"
+                ohos:text_size="19fp"
+                ohos:text_color="#FFFFFF"
+                ohos:top_padding="6vp"
+                ohos:bottom_padding="6vp"
+                ohos:right_padding="10vp"
+                ohos:left_padding="10vp"
+                ohos:center_in_parent="true"
+                ohos:margin="10vp"
+                ohos:background_element="$graphic:background_button"/>
+
+            <Button
+                ohos:id="$+id:button_toPolygonDemo"
+                ohos:width="match_parent"
+                ohos:height="match_content"
+                ohos:layout_alignment="center"
+                ohos:text="PolygonDemo"
+                ohos:text_size="19fp"
+                ohos:text_color="#FFFFFF"
+                ohos:top_padding="6vp"
+                ohos:bottom_padding="6vp"
+                ohos:right_padding="10vp"
+                ohos:left_padding="10vp"
+                ohos:center_in_parent="true"
+                ohos:margin="10vp"
+                ohos:background_element="$graphic:background_button"/>
+
+            <Button
+                ohos:id="$+id:button_toMarkerDemo"
+                ohos:width="match_parent"
+                ohos:height="match_content"
+                ohos:layout_alignment="center"
+                ohos:text="MarkerDemo"
+                ohos:text_size="19fp"
+                ohos:text_color="#FFFFFF"
+                ohos:top_padding="6vp"
+                ohos:bottom_padding="6vp"
+                ohos:right_padding="10vp"
+                ohos:left_padding="10vp"
+                ohos:center_in_parent="true"
+                ohos:margin="10vp"
+                ohos:background_element="$graphic:background_button"/>
+
+            <Button
+                ohos:id="$+id:button_toGestureDemo"
+                ohos:width="match_parent"
+                ohos:height="match_content"
+                ohos:layout_alignment="center"
+                ohos:text="GestureDemo"
+                ohos:text_size="19fp"
+                ohos:text_color="#FFFFFF"
+                ohos:top_padding="6vp"
+                ohos:bottom_padding="6vp"
+                ohos:right_padding="10vp"
+                ohos:left_padding="10vp"
+                ohos:center_in_parent="true"
+                ohos:margin="10vp"
+                ohos:background_element="$graphic:background_button"/>
+
+            <Button
+                ohos:id="$+id:button_toHuaweiMapOptionsDemo"
+                ohos:width="match_parent"
+                ohos:height="match_content"
+                ohos:layout_alignment="center"
+                ohos:text="HuaweiMapOptionsDemo"
+                ohos:text_size="19fp"
+                ohos:text_color="#FFFFFF"
+                ohos:top_padding="6vp"
+                ohos:bottom_padding="6vp"
+                ohos:right_padding="10vp"
+                ohos:left_padding="10vp"
+                ohos:center_in_parent="true"
+                ohos:margin="10vp"
+                ohos:background_element="$graphic:background_button"/>
+
+            <Button
+                ohos:id="$+id:button_toMapEventsDemo"
+                ohos:width="match_parent"
+                ohos:height="match_content"
+                ohos:layout_alignment="center"
+                ohos:text="MapEventsDemo"
+                ohos:text_size="19fp"
+                ohos:text_color="#FFFFFF"
+                ohos:top_padding="6vp"
+                ohos:bottom_padding="6vp"
+                ohos:right_padding="10vp"
+                ohos:left_padding="10vp"
+                ohos:center_in_parent="true"
+                ohos:margin="10vp"
+                ohos:background_element="$graphic:background_button"/>
+
+        </DirectionalLayout>
+
+    </ScrollView>
+
+</DirectionalLayout>

+ 15 - 0
entry/src/main/resources/base/layout/button_layout.xml

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Button
+    xmlns:ohos="http://schemas.huawei.com/res/ohos"
+    ohos:height="match_content"
+    ohos:width="match_content"
+    ohos:background_element="$graphic:background_button"
+    ohos:bottom_padding="3vp"
+    ohos:layout_alignment="vertical_center"
+    ohos:left_padding="3vp"
+    ohos:margin="5vp"
+    ohos:right_padding="3vp"
+    ohos:text_color="#FFFFFF"
+    ohos:text_size="12fp"
+    ohos:top_padding="3vp"/>
+

+ 249 - 0
entry/src/main/resources/base/layout/layout_find_parking.xml

@@ -0,0 +1,249 @@
+<?xml version="1.0" encoding="utf-8"?>
+<DirectionalLayout
+    xmlns:ohos="http://schemas.huawei.com/res/ohos"
+    ohos:height="match_parent"
+    ohos:width="match_parent"
+    ohos:orientation="vertical">
+
+
+    <!-- 停车场列表 -->
+    <ScrollView
+        ohos:id="$+id:parking_list_scroll"
+        ohos:height="0vp"
+        ohos:width="match_parent"
+        ohos:weight="1"
+        ohos:background_element="#FFFFFFFF">
+
+        <DirectionalLayout
+            ohos:id="$+id:parking_list_container"
+            ohos:height="match_content"
+            ohos:width="match_parent"
+            ohos:orientation="vertical"
+            ohos:padding="16vp">
+
+            <!-- 停车场项1:尚美国际停车场 -->
+            <DirectionalLayout
+                ohos:id="$+id:parking_item_1"
+                ohos:height="match_content"
+                ohos:width="match_parent"
+                ohos:orientation="horizontal"
+                ohos:padding="12vp"
+                ohos:bottom_margin="12vp"
+                ohos:background_element="#FFFFFFFF"
+                ohos:border_radius="8vp"
+                ohos:shadow="2">
+
+                <!-- 左侧编号圆圈 -->
+                <Text
+                    ohos:id="$+id:parking_number_1"
+                    ohos:height="32vp"
+                    ohos:width="32vp"
+                    ohos:background_element="#FF2196F3"
+                    ohos:text="18"
+                    ohos:text_color="#FFFFFFFF"
+                    ohos:text_size="14fp"
+                    ohos:text_alignment="center"
+                    ohos:border_radius="16vp"
+                    ohos:end_margin="12vp"/>
+
+                <!-- 中间内容区域 -->
+                <DirectionalLayout
+                    ohos:height="match_content"
+                    ohos:width="0vp"
+                    ohos:weight="1"
+                    ohos:orientation="vertical">
+
+                    <!-- 停车场名称 -->
+                    <Text
+                        ohos:id="$+id:parking_name_1"
+                        ohos:height="match_content"
+                        ohos:width="match_parent"
+                        ohos:text="尚美国际停车场"
+                        ohos:text_color="#FF000000"
+                        ohos:text_size="16fp"
+                        ohos:text_weight="1"
+                        ohos:bottom_margin="8vp"/>
+
+                    <!-- 距离和地址 -->
+                    <Text
+                        ohos:id="$+id:parking_address_1"
+                        ohos:height="match_content"
+                        ohos:width="match_parent"
+                        ohos:text="距您534米 | 桃源街道平山社区留仙大道4168号"
+                        ohos:text_color="#FF666666"
+                        ohos:text_size="12fp"
+                        ohos:bottom_margin="8vp"/>
+
+                    <!-- 余位和价格信息 -->
+                    <Text
+                        ohos:id="$+id:parking_info_1"
+                        ohos:height="match_content"
+                        ohos:width="match_parent"
+                        ohos:text="余位308 · 首小时10元 · 30分钟免费 · 封顶60元"
+                        ohos:text_color="#FF666666"
+                        ohos:text_size="12fp"
+                        ohos:bottom_margin="8vp"/>
+
+                    <!-- 推荐标签 -->
+                    <DirectionalLayout
+                        ohos:height="match_content"
+                        ohos:width="match_content"
+                        ohos:orientation="horizontal"
+                        ohos:alignment="center">
+
+                        <Text
+                            ohos:id="$+id:recommend_icon_1"
+                            ohos:height="16vp"
+                            ohos:width="16vp"
+                            ohos:text="👍"
+                            ohos:text_size="12fp"
+                            ohos:end_margin="4vp"/>
+
+                        <Text
+                            ohos:id="$+id:recommend_text_1"
+                            ohos:height="match_content"
+                            ohos:width="match_content"
+                            ohos:text="推荐车场"
+                            ohos:text_color="#FFFF9800"
+                            ohos:text_size="12fp"/>
+                    </DirectionalLayout>
+                </DirectionalLayout>
+
+                <!-- 右侧导航图标 -->
+                <Image
+                    ohos:id="$+id:navigation_icon_1"
+                    ohos:height="24vp"
+                    ohos:width="24vp"
+                    ohos:image_src="$media:icon"
+                    ohos:start_margin="8vp"
+                    ohos:layout_alignment="center"/>
+            </DirectionalLayout>
+
+            <!-- 停车场项2:丽新花园停车场 -->
+            <DirectionalLayout
+                ohos:id="$+id:parking_item_2"
+                ohos:height="match_content"
+                ohos:width="match_parent"
+                ohos:orientation="horizontal"
+                ohos:padding="12vp"
+                ohos:bottom_margin="12vp"
+                ohos:background_element="#FFFFFFFF"
+                ohos:border_radius="8vp"
+                ohos:shadow="2">
+
+                <Text
+                    ohos:id="$+id:parking_number_2"
+                    ohos:height="32vp"
+                    ohos:width="32vp"
+                    ohos:background_element="#FF2196F3"
+                    ohos:text="19"
+                    ohos:text_color="#FFFFFFFF"
+                    ohos:text_size="14fp"
+                    ohos:text_alignment="center"
+                    ohos:border_radius="16vp"
+                    ohos:end_margin="12vp"/>
+
+                <DirectionalLayout
+                    ohos:height="match_content"
+                    ohos:width="0vp"
+                    ohos:weight="1"
+                    ohos:orientation="vertical">
+
+                    <Text
+                        ohos:id="$+id:parking_name_2"
+                        ohos:height="match_content"
+                        ohos:width="match_parent"
+                        ohos:text="丽新花园停车场"
+                        ohos:text_color="#FF000000"
+                        ohos:text_size="16fp"
+                        ohos:text_weight="1"
+                        ohos:bottom_margin="8vp"/>
+
+                    <Text
+                        ohos:id="$+id:parking_address_2"
+                        ohos:height="match_content"
+                        ohos:width="match_parent"
+                        ohos:text="距您537米 | 沙河西路4011号丽新花园"
+                        ohos:text_color="#FF666666"
+                        ohos:text_size="12fp"
+                        ohos:bottom_margin="8vp"/>
+
+                    <Text
+                        ohos:id="$+id:parking_info_2"
+                        ohos:height="match_content"
+                        ohos:width="match_parent"
+                        ohos:text="余位76"
+                        ohos:text_color="#FF666666"
+                        ohos:text_size="12fp"/>
+                </DirectionalLayout>
+
+                <Image
+                    ohos:id="$+id:navigation_icon_2"
+                    ohos:height="24vp"
+                    ohos:width="24vp"
+                    ohos:image_src="$media:icon"
+                    ohos:start_margin="8vp"
+                    ohos:layout_alignment="center"/>
+            </DirectionalLayout>
+
+            <!-- 停车场项3:众冠红花岭工业区商业... -->
+            <DirectionalLayout
+                ohos:id="$+id:parking_item_3"
+                ohos:height="match_content"
+                ohos:width="match_parent"
+                ohos:orientation="horizontal"
+                ohos:padding="12vp"
+                ohos:bottom_margin="12vp"
+                ohos:background_element="#FFFFFFFF"
+                ohos:border_radius="8vp"
+                ohos:shadow="2">
+
+                <Text
+                    ohos:id="$+id:parking_number_3"
+                    ohos:height="32vp"
+                    ohos:width="32vp"
+                    ohos:background_element="#FF2196F3"
+                    ohos:text="20"
+                    ohos:text_color="#FFFFFFFF"
+                    ohos:text_size="14fp"
+                    ohos:text_alignment="center"
+                    ohos:border_radius="16vp"
+                    ohos:end_margin="12vp"/>
+
+                <DirectionalLayout
+                    ohos:height="match_content"
+                    ohos:width="0vp"
+                    ohos:weight="1"
+                    ohos:orientation="vertical">
+
+                    <Text
+                        ohos:id="$+id:parking_name_3"
+                        ohos:height="match_content"
+                        ohos:width="match_parent"
+                        ohos:text="众冠红花岭工业区商业…"
+                        ohos:text_color="#FF000000"
+                        ohos:text_size="16fp"
+                        ohos:text_weight="1"
+                        ohos:bottom_margin="8vp"/>
+
+                    <Text
+                        ohos:id="$+id:parking_address_3"
+                        ohos:height="match_content"
+                        ohos:width="match_parent"
+                        ohos:text="距您538米 | 留仙大道1213号西门"
+                        ohos:text_color="#FF666666"
+                        ohos:text_size="12fp"/>
+                </DirectionalLayout>
+
+                <Image
+                    ohos:id="$+id:navigation_icon_3"
+                    ohos:height="24vp"
+                    ohos:width="24vp"
+                    ohos:image_src="$media:icon"
+                    ohos:start_margin="8vp"
+                    ohos:layout_alignment="center"/>
+            </DirectionalLayout>
+        </DirectionalLayout>
+    </ScrollView>
+</DirectionalLayout>
+

+ 40 - 0
entry/src/main/resources/base/layout/layout_my.xml

@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<DirectionalLayout
+    xmlns:ohos="http://schemas.huawei.com/res/ohos"
+    ohos:height="match_parent"
+    ohos:width="match_parent"
+    ohos:orientation="vertical"
+    ohos:background_element="#FFFFFFFF">
+
+    <ScrollView
+        ohos:height="0vp"
+        ohos:width="match_parent"
+        ohos:weight="1"
+        ohos:background_element="#FFFFFFFF">
+
+        <DirectionalLayout
+            ohos:height="match_content"
+            ohos:width="match_parent"
+            ohos:orientation="vertical"
+            ohos:padding="16vp"
+            ohos:alignment="center">
+
+            <Text
+                ohos:height="match_content"
+                ohos:width="match_content"
+                ohos:text="我的"
+                ohos:text_size="24fp"
+                ohos:text_color="#FF000000"
+                ohos:margin_top="100vp"/>
+
+            <Text
+                ohos:height="match_content"
+                ohos:width="match_content"
+                ohos:text="个人中心功能开发中..."
+                ohos:text_size="16fp"
+                ohos:text_color="#FF666666"
+                ohos:margin_top="20vp"/>
+        </DirectionalLayout>
+    </ScrollView>
+</DirectionalLayout>
+

+ 40 - 0
entry/src/main/resources/base/layout/layout_reserve_parking.xml

@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<DirectionalLayout
+    xmlns:ohos="http://schemas.huawei.com/res/ohos"
+    ohos:height="match_parent"
+    ohos:width="match_parent"
+    ohos:orientation="vertical"
+    ohos:background_element="#FFFFFFFF">
+
+    <ScrollView
+        ohos:height="0vp"
+        ohos:width="match_parent"
+        ohos:weight="1"
+        ohos:background_element="#FFFFFFFF">
+
+        <DirectionalLayout
+            ohos:height="match_content"
+            ohos:width="match_parent"
+            ohos:orientation="vertical"
+            ohos:padding="16vp"
+            ohos:alignment="center">
+
+            <Text
+                ohos:height="match_content"
+                ohos:width="match_content"
+                ohos:text="预约停车"
+                ohos:text_size="24fp"
+                ohos:text_color="#FF000000"
+                ohos:margin_top="100vp"/>
+
+            <Text
+                ohos:height="match_content"
+                ohos:width="match_content"
+                ohos:text="预约停车功能开发中..."
+                ohos:text_size="16fp"
+                ohos:text_color="#FF666666"
+                ohos:margin_top="20vp"/>
+        </DirectionalLayout>
+    </ScrollView>
+</DirectionalLayout>
+

+ 53 - 0
entry/src/main/resources/base/layout/xml_layout.xml

@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="utf-8"?>
+<DirectionalLayout
+    xmlns:ohos="http://schemas.huawei.com/res/ohos"
+    ohos:height="match_parent"
+    ohos:width="match_parent"
+    ohos:orientation="vertical"
+    ohos:padding="32vp">
+
+    <Text
+        ohos:id="$+id:text_title"
+        ohos:height="match_content"
+        ohos:width="match_parent"
+        ohos:text="$string:xml_layout_title"
+        ohos:text_size="30fp"
+        ohos:text_alignment="center"
+        ohos:margin_bottom="40vp"
+        />
+
+    <TextField
+        ohos:id="$+id:text_field"
+        ohos:height="match_content"
+        ohos:width="match_parent"
+        ohos:hint="请输入内容"
+        ohos:margin_bottom="30vp"
+        />
+
+    <Checkbox
+        ohos:id="$+id:checkbox"
+        ohos:height="match_content"
+        ohos:width="match_content"
+        ohos:text="选择项"
+        ohos:margin_bottom="30vp"
+        />
+
+    <RadioButton
+        ohos:id="$+id:radio_button"
+        ohos:height="match_content"
+        ohos:width="match_content"
+        ohos:text="单选按钮"
+        ohos:margin_bottom="30vp"
+        />
+
+    <Slider
+        ohos:id="$+id:slider"
+        ohos:height="match_content"
+        ohos:width="match_parent"
+        ohos:min_value="0"
+        ohos:max_value="100"
+        ohos:value="50"
+        />
+
+</DirectionalLayout>
+

BIN
entry/src/main/resources/base/media/fee.png


BIN
entry/src/main/resources/base/media/fee_1.png


BIN
entry/src/main/resources/base/media/icon.png


BIN
entry/src/main/resources/base/media/location.png


BIN
entry/src/main/resources/base/media/my.png


BIN
entry/src/main/resources/base/media/my_1.png


BIN
entry/src/main/resources/base/media/park.png


BIN
entry/src/main/resources/base/media/park_1.png


+ 36 - 0
entry/src/main/resources/en_US/element/string.json

@@ -0,0 +1,36 @@
+{
+  "string": [
+    {
+      "name": "entry_MainAbility",
+      "value": "entry_MainAbility"
+    },
+    {
+      "name": "mainability_description",
+      "value": "Java_Empty Ability"
+    },
+    {
+      "name": "mainability_HelloWorld",
+      "value": "Hello World"
+    },
+    {
+      "name": "widget_ability_description",
+      "value": "This is a WidgetAbility"
+    },
+    {
+      "name": "btn_xml_layout",
+      "value": "Go to XML Layout Page"
+    },
+    {
+      "name": "btn_code_layout",
+      "value": "Go to Code Layout Page"
+    },
+    {
+      "name": "xml_layout_title",
+      "value": "XML Layout Page"
+    },
+    {
+      "name": "code_layout_title",
+      "value": "Code Layout Page"
+    }
+  ]
+}

File diff suppressed because it is too large
+ 1 - 0
entry/src/main/resources/rawfile/agconnect-services.json


+ 36 - 0
entry/src/main/resources/zh_CN/element/string.json

@@ -0,0 +1,36 @@
+{
+  "string": [
+    {
+      "name": "entry_MainAbility",
+      "value": "entry_MainAbility"
+    },
+    {
+      "name": "mainability_description",
+      "value": "Java_Empty Ability"
+    },
+    {
+      "name": "mainability_HelloWorld",
+      "value": "你好,世界"
+    },
+    {
+      "name": "widget_ability_description",
+      "value": "服务卡片"
+    },
+    {
+      "name": "btn_xml_layout",
+      "value": "跳转到XML布局页面"
+    },
+    {
+      "name": "btn_code_layout",
+      "value": "跳转到代码布局页面"
+    },
+    {
+      "name": "xml_layout_title",
+      "value": "XML布局页面"
+    },
+    {
+      "name": "code_layout_title",
+      "value": "代码布局页面"
+    }
+  ]
+}

+ 13 - 0
gradle.properties

@@ -0,0 +1,13 @@
+# Project-wide Gradle settings.
+# IDE (e.g. DevEco Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+# If the Chinese output is garbled, please configure the following parameter.
+# This function is enabled by default when the DevEco Studio builds the hap/app,if you need disable gradle parallel,you should set org.gradle.parallel false.
+# more information see https://docs.gradle.org/current/userguide/performance.html
+# org.gradle.parallel=false
+# org.gradle.jvmargs=-Dfile.encoding=GBK

BIN
gradle/wrapper/gradle-wrapper.jar


+ 5 - 0
gradle/wrapper/gradle-wrapper.properties

@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://repo.huaweicloud.com/gradle/gradle-7.3-bin.zip
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists

+ 234 - 0
gradlew

@@ -0,0 +1,234 @@
+#!/bin/sh
+
+#
+# Copyright ? 2015-2021 the original authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##############################################################################
+#
+#   Gradle start up script for POSIX generated by Gradle.
+#
+#   Important for running:
+#
+#   (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
+#       noncompliant, but you have some other compliant shell such as ksh or
+#       bash, then to run this script, type that shell name before the whole
+#       command line, like:
+#
+#           ksh Gradle
+#
+#       Busybox and similar reduced shells will NOT work, because this script
+#       requires all of these POSIX shell features:
+#         * functions;
+#         * expansions ?$var?, ?${var}?, ?${var:-default}?, ?${var+SET}?,
+#           ?${var#prefix}?, ?${var%suffix}?, and ?$( cmd )?;
+#         * compound commands having a testable exit status, especially ?case?;
+#         * various built-in commands including ?command?, ?set?, and ?ulimit?.
+#
+#   Important for patching:
+#
+#   (2) This script targets any POSIX shell, so it avoids extensions provided
+#       by Bash, Ksh, etc; in particular arrays are avoided.
+#
+#       The "traditional" practice of packing multiple parameters into a
+#       space-separated string is a well documented source of bugs and security
+#       problems, so this is (mostly) avoided, by progressively accumulating
+#       options in "$@", and eventually passing that to Java.
+#
+#       Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
+#       and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
+#       see the in-line comments for details.
+#
+#       There are tweaks for specific operating systems such as AIX, CygWin,
+#       Darwin, MinGW, and NonStop.
+#
+#   (3) This script is generated from the Groovy template
+#       https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+#       within the Gradle project.
+#
+#       You can find Gradle at https://github.com/gradle/gradle/.
+#
+##############################################################################
+
+# Attempt to set APP_HOME
+
+# Resolve links: $0 may be a link
+app_path=$0
+
+# Need this for daisy-chained symlinks.
+while
+    APP_HOME=${app_path%"${app_path##*/}"}  # leaves a trailing /; empty if no leading path
+    [ -h "$app_path" ]
+do
+    ls=$( ls -ld "$app_path" )
+    link=${ls#*' -> '}
+    case $link in             #(
+      /*)   app_path=$link ;; #(
+      *)    app_path=$APP_HOME$link ;;
+    esac
+done
+
+APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
+
+APP_NAME="Gradle"
+APP_BASE_NAME=${0##*/}
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD=maximum
+
+warn () {
+    echo "$*"
+} >&2
+
+die () {
+    echo
+    echo "$*"
+    echo
+    exit 1
+} >&2
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "$( uname )" in                #(
+  CYGWIN* )         cygwin=true  ;; #(
+  Darwin* )         darwin=true  ;; #(
+  MSYS* | MINGW* )  msys=true    ;; #(
+  NONSTOP* )        nonstop=true ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+        # IBM's JDK on AIX uses strange locations for the executables
+        JAVACMD=$JAVA_HOME/jre/sh/java
+    else
+        JAVACMD=$JAVA_HOME/bin/java
+    fi
+    if [ ! -x "$JAVACMD" ] ; then
+        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+    fi
+else
+    JAVACMD=java
+    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
+    case $MAX_FD in #(
+      max*)
+        MAX_FD=$( ulimit -H -n ) ||
+            warn "Could not query maximum file descriptor limit"
+    esac
+    case $MAX_FD in  #(
+      '' | soft) :;; #(
+      *)
+        ulimit -n "$MAX_FD" ||
+            warn "Could not set maximum file descriptor limit to $MAX_FD"
+    esac
+fi
+
+# Collect all arguments for the java command, stacking in reverse order:
+#   * args from the command line
+#   * the main class name
+#   * -classpath
+#   * -D...appname settings
+#   * --module-path (only if needed)
+#   * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if "$cygwin" || "$msys" ; then
+    APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
+    CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
+
+    JAVACMD=$( cygpath --unix "$JAVACMD" )
+
+    # Now convert the arguments - kludge to limit ourselves to /bin/sh
+    for arg do
+        if
+            case $arg in                                #(
+              -*)   false ;;                            # don't mess with options #(
+              /?*)  t=${arg#/} t=/${t%%/*}              # looks like a POSIX filepath
+                    [ -e "$t" ] ;;                      #(
+              *)    false ;;
+            esac
+        then
+            arg=$( cygpath --path --ignore --mixed "$arg" )
+        fi
+        # Roll the args list around exactly as many times as the number of
+        # args, so each arg winds up back in the position where it started, but
+        # possibly modified.
+        #
+        # NB: a `for` loop captures its iteration list before it begins, so
+        # changing the positional parameters here affects neither the number of
+        # iterations, nor the values presented in `arg`.
+        shift                   # remove old arg
+        set -- "$@" "$arg"      # push replacement arg
+    done
+fi
+
+# Collect all arguments for the java command;
+#   * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
+#     shell script including quotes and variable substitutions, so put them in
+#     double quotes to make sure that they get re-expanded; and
+#   * put everything else in single quotes, so that it's not re-expanded.
+
+set -- \
+        "-Dorg.gradle.appname=$APP_BASE_NAME" \
+        -classpath "$CLASSPATH" \
+        org.gradle.wrapper.GradleWrapperMain \
+        "$@"
+
+# Use "xargs" to parse quoted args.
+#
+# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
+#
+# In Bash we could simply go:
+#
+#   readarray ARGS < <( xargs -n1 <<<"$var" ) &&
+#   set -- "${ARGS[@]}" "$@"
+#
+# but POSIX shell has neither arrays nor command substitution, so instead we
+# post-process each arg (as a line of input to sed) to backslash-escape any
+# character that might be a shell metacharacter, then use eval to reverse
+# that process (while maintaining the separation between arguments), and wrap
+# the whole thing up as a single "set" statement.
+#
+# This will of course break if any of these variables contains a newline or
+# an unmatched quote.
+#
+
+eval "set -- $(
+        printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
+        xargs -n1 |
+        sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
+        tr '\n' ' '
+    )" '"$@"'
+
+exec "$JAVACMD" "$@"

+ 103 - 0
gradlew.bat

@@ -0,0 +1,103 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem      https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem  Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega

+ 1 - 0
package.json

@@ -0,0 +1 @@
+{}

+ 2 - 0
settings.gradle

@@ -0,0 +1,2 @@
+rootProject.name = 'fshwcar'
+include ':entry'