diff --git a/README.md b/README.md index cd64ca8a7378ec67558a5405ea3cebbe0f3a78b5..f00dbb3b9240579cdc94156d2734affdef48df4c 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ - 项目移植状态:主功能完成 - 调用差异:无 - 开发版本:sdk5,DevEco Studio2.1 beta3 -- 基线版本:tag v2.4.7 +- 基线版本:Release 2.4.7 #### 效果演示 ![输入图片说明](./image/CountryCodePickerProject.gif "gif") diff --git a/app/build.gradle b/app/build.gradle index fc0118fd6613d73f570cda916fdda3200f36af69..c472b243be28b9b75f736833e12bd1d02e83caf8 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,4 +1,6 @@ apply plugin: 'com.huawei.ohos.hap' +apply plugin: 'com.huawei.ohos.decctest' + ohos { compileSdkVersion 5 defaultConfig { @@ -9,8 +11,12 @@ ohos { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) testImplementation 'junit:junit:4.13' + ohosTestImplementation 'com.huawei.ohos.testkit:runner:1.0.0.100' //本地依赖 implementation project(':library') //远程依赖 // implementation('com.gitee.chinasoft_ohos:country_code_picker:0.0.1-SNAPSHOT') } +decc { + supportType = ['html','xml'] +} \ No newline at end of file diff --git a/app/src/main/config.json b/app/src/main/config.json index 36a001e73a975d7623b70cbff924089da1ff41c7..d591570cdde91cdf6d5688551d5e37d0e6423931 100644 --- a/app/src/main/config.json +++ b/app/src/main/config.json @@ -47,7 +47,7 @@ "name": "in.hbb20.countrycodepickerproject.MainAbility", "icon": "$media:ic_ccp_launcher", "description": "$string:mainability_description", - "label": "CCP library features", + "label": "$string:CCPlibrary", "type": "page", "launchType": "standard" }, @@ -56,7 +56,7 @@ "name": "in.hbb20.countrycodepickerproject.ExampleAbility", "icon": "$media:icon", "description": "$string:exampleability_description", - "label": "entry", + "label": "$string:entry", "type": "page", "launchType": "standard" } diff --git a/app/src/main/resources/base/element/string.json b/app/src/main/resources/base/element/string.json index 1a47a70310b9c44daccf9e539b5fde6d6c15917f..9eb221815f78fb80a97e9f5c1d3f5549b1caa212 100644 --- a/app/src/main/resources/base/element/string.json +++ b/app/src/main/resources/base/element/string.json @@ -15,6 +15,14 @@ { "name": "HelloWorld", "value": "Hello World" + }, + { + "name": "CCPlibrary", + "value": "CCP library features" + }, + { + "name": "entry", + "value": "entry" } ] } \ No newline at end of file diff --git a/app/src/test/java/in/hbb20/countrycodepickerproject/ExampleTest.java b/app/src/ohosTest/java/in/hbb20/countrycodepickerproject/CCPCountryTest.java similarity index 30% rename from app/src/test/java/in/hbb20/countrycodepickerproject/ExampleTest.java rename to app/src/ohosTest/java/in/hbb20/countrycodepickerproject/CCPCountryTest.java index ec2e174ccd9358bdc47a57c6ea318eb87b35cece..e35f40300b5ac060fb812b5709a9c9e99a8cf608 100644 --- a/app/src/test/java/in/hbb20/countrycodepickerproject/ExampleTest.java +++ b/app/src/ohosTest/java/in/hbb20/countrycodepickerproject/CCPCountryTest.java @@ -1,20 +1,31 @@ package in.hbb20.countrycodepickerproject; - import com.hbb20.CCPCountry; import org.junit.Test; +import java.util.ArrayList; +import java.util.List; + +/** + * 单元测试 + * + * @时间: 2021/06/10 + * @描述: + **/ +public class CCPCountryTest { -public class ExampleTest { @Test - public void testCCPCountry() { + public void testToString() { CCPCountry ccpCountry = new CCPCountry(); System.out.print(ccpCountry.toString()); + + CCPCountry ccpCountryPar = new CCPCountry("cn", "86", "china", 0); + System.out.print(ccpCountryPar.toString()); } @Test - public void testCCPCountry2() { - CCPCountry ccpCountry = new CCPCountry("cn", "86", "china", 0); - System.out.print(ccpCountry.toString()); + public void getLibraryMasterCountriesEnglish() { + List libraryMasterCountriesEnglish = CCPCountry.getLibraryMasterCountriesEnglish(); + System.out.print(libraryMasterCountriesEnglish.toString()); } -} +} \ No newline at end of file diff --git a/libphonenumber/build.gradle b/libphonenumber/build.gradle index a8fec7b26aa16ce924c14e7160d293a10773b8f1..fd1397701ba42b07eeca5f39abe24de952c15f60 100644 --- a/libphonenumber/build.gradle +++ b/libphonenumber/build.gradle @@ -1,13 +1,6 @@ apply plugin: 'com.huawei.ohos.library' - //apply from: '../upload.gradle' -// -//rootProject.ext { -// CUSTOM_ARTIFACT = '' //是否指定上传的包,指定则填入包的路径,不指定填入空字符串即可。(annotationProcessor相关的jar包需要全依赖,但是通过components.java打出来的jar包默认只包含本模块的源码,因此需要使用自定义的jar包发布) -// DEFAULT_GROUP_ID = 'com.gitee.chinasoft_ohos' //固定 -// DEFAULT_ARTIFACT_ID = 'ohos_libphonenumber' //项目ID,默认填写项目名称。如果有多个模块需要发布,则填写模块名称 -// DEFAULT_VERSION = '0.0.1-SNAPSHOT' //版本号,发新版本时修改。未通过验收的需要发布SNAPSHOT版本,即在版本号末尾带上SNAPSHOT -//} + ohos { compileSdkVersion 5 diff --git a/libphonenumber/src/main/java/io/michaelrocks/libphonenumber/ohos/MetadataLoader.java b/libphonenumber/src/main/java/io/michaelrocks/libphonenumber/ohos/MetadataLoader.java index 62adc9e52aacd6ca75ba7d3803246fc847785945..cad67563dc76f217e003161606838f647129da9e 100644 --- a/libphonenumber/src/main/java/io/michaelrocks/libphonenumber/ohos/MetadataLoader.java +++ b/libphonenumber/src/main/java/io/michaelrocks/libphonenumber/ohos/MetadataLoader.java @@ -26,7 +26,7 @@ public interface MetadataLoader { * concurrently so implementations must be thread-safe. * * @param metadataFileName file name (including path) of metadata to load. File path is an - * absolute class path like /com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto + * * @return the input stream for the metadata file. The library will close this stream * after it is done. Return null in case the metadata file could not be found */ diff --git a/libphonenumber/src/main/java/io/michaelrocks/libphonenumber/ohos/PhoneNumberUtil.java b/libphonenumber/src/main/java/io/michaelrocks/libphonenumber/ohos/PhoneNumberUtil.java index 28490b060e124d9db0d63c63e9ee331b23be5f6e..c88f4698acecfb78f456cff5112869dac989cf42 100644 --- a/libphonenumber/src/main/java/io/michaelrocks/libphonenumber/ohos/PhoneNumberUtil.java +++ b/libphonenumber/src/main/java/io/michaelrocks/libphonenumber/ohos/PhoneNumberUtil.java @@ -43,7 +43,7 @@ import ohos.app.Context; * validation. * *

If you use this library, and want to be notified about important changes, please sign up to - * our mailing list. + * *

* NOTE: A lot of methods in this class require Region Code strings. These must be provided using * CLDR two-letter region-code format. These should be in upper-case. The list of the codes @@ -527,7 +527,7 @@ public class PhoneNumberUtil { *

* Warning: This level might result in lower coverage especially for regions outside of country * code "+1". If you are not sure about which level to use, email the discussion group - * libphonenumber-discuss@googlegroups.com. + * */ STRICT_GROUPING { @Override diff --git a/library/build.gradle b/library/build.gradle index d06231cda78a27936da8c796a5eef7fe9b70085b..cf7ce53de1ecd9dbe5d45b60d1cfdae985cede87 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -1,12 +1,6 @@ apply plugin: 'com.huawei.ohos.library' //apply from: '../upload.gradle' -// -//rootProject.ext { -// CUSTOM_ARTIFACT = '' //是否指定上传的包,指定则填入包的路径,不指定填入空字符串即可。(annotationProcessor相关的jar包需要全依赖,但是通过components.java打出来的jar包默认只包含本模块的源码,因此需要使用自定义的jar包发布) -// DEFAULT_GROUP_ID = 'com.gitee.chinasoft_ohos' //固定 -// DEFAULT_ARTIFACT_ID = 'country_code_picker' //项目ID,默认填写项目名称。如果有多个模块需要发布,则填写模块名称 -// DEFAULT_VERSION = '0.0.1-SNAPSHOT' //版本号,发新版本时修改。未通过验收的需要发布SNAPSHOT版本,即在版本号末尾带上SNAPSHOT -//} + ohos { compileSdkVersion 5 defaultConfig { diff --git a/library/gradle.properties b/library/gradle.properties index 64c5fc197e822a5c873c4914d66482f4b4f6000c..0daf1830fbdef07e50a44d74210c8c82f1b66278 100644 --- a/library/gradle.properties +++ b/library/gradle.properties @@ -1,18 +1,10 @@ -GROUP=com.hbb20 -POM_ARTIFACT_ID=ccp -VERSION_NAME=2.5.1 -POM_NAME=CountryCodePicker -POM_PACKAGING=aar -POM_DESCRIPTION=Country Code Picker (CCP) is an android library which provides an easy way to search and select international country code for the phone number. -POM_INCEPTION_YEAR=2021 -POM_URL=https://github.com/hbb20/CountryCodePickerProject -POM_SCM_URL=https://github.com/hbb20/CountryCodePickerProject -POM_SCM_CONNECTION=scm:git@github.com:hbb20/CountryCodePickerProject.git -POM_SCM_DEV_CONNECTION=scm:git@github.com:hbb20/CountryCodePickerProject.git -POM_LICENCE_NAME=The Apache Software License, Version 2.0 -POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt -POM_LICENCE_DIST=repo -POM_DEVELOPER_ID=hbb20 -POM_DEVELOPER_NAME=Harsh Bhakta -POM_DEVELOPER_URL=https://github.com/hbb20 -# ./gradlew ccp:uploadArchives --no-daemon --no-parallel -i \ No newline at end of file +# 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. +# org.gradle.jvmargs=-Dfile.encoding=GBK diff --git a/library/src/main/resources/base/element/dimens.json b/library/src/main/resources/base/element/dimens.json index 05eb3663e25439760897291e52ba7772cd4662a4..ba19488373a9a9126ee6409b2120bbad61e8c535 100644 --- a/library/src/main/resources/base/element/dimens.json +++ b/library/src/main/resources/base/element/dimens.json @@ -1,7 +1,7 @@ { "string": [ { - "name": "google_1x", + "name": "ohos_1x", "value": "8vp" }, { diff --git a/library/src/main/resources/base/layout/layout_code_picker.xml b/library/src/main/resources/base/layout/layout_code_picker.xml index 76618ca242e5649e799d43fc21eaeb2314fcea74..f581edd7aa1fc6078a3cdd6e4aa81660a167011b 100644 --- a/library/src/main/resources/base/layout/layout_code_picker.xml +++ b/library/src/main/resources/base/layout/layout_code_picker.xml @@ -17,9 +17,9 @@ ohos:id="$+id:linear_flag_holder" ohos:height="match_content" ohos:width="match_content" - ohos:end_margin="$string:google_1x" + ohos:end_margin="$string:ohos_1x" ohos:orientation="vertical" - ohos:right_margin="$string:google_1x" + ohos:right_margin="$string:ohos_1x" ohos:vertical_center="true" > diff --git a/library/src/main/resources/base/layout/layout_full_width_code_picker.xml b/library/src/main/resources/base/layout/layout_full_width_code_picker.xml index f3933f40479b26252f6aba7879e3d470133868ec..80ae94014f0651181b6d632b759ebee1c41d486e 100644 --- a/library/src/main/resources/base/layout/layout_full_width_code_picker.xml +++ b/library/src/main/resources/base/layout/layout_full_width_code_picker.xml @@ -16,9 +16,9 @@ ohos:id="$+id:linear_flag_holder" ohos:height="match_content" ohos:width="match_content" - ohos:end_margin="$string:google_1x" + ohos:end_margin="$string:ohos_1x" ohos:orientation="vertical" - ohos:right_margin="$string:google_1x" + ohos:right_margin="$string:ohos_1x" ohos:vertical_center="true" > diff --git a/library/src/main/resources/base/layout/layout_recycler_country_tile.xml b/library/src/main/resources/base/layout/layout_recycler_country_tile.xml index 1163d56faccaae0ba411d3cd189d9fa67b25226f..1fa62f5acaf8bca11202bf1bfea772de7368c3dd 100644 --- a/library/src/main/resources/base/layout/layout_recycler_country_tile.xml +++ b/library/src/main/resources/base/layout/layout_recycler_country_tile.xml @@ -12,9 +12,9 @@ ohos:width="40vp" ohos:align_parent_left="true" ohos:alignment="center" - ohos:left_margin="$string:google_1x" + ohos:left_margin="$string:ohos_1x" ohos:orientation="vertical" - ohos:start_margin="$string:google_1x" + ohos:start_margin="$string:ohos_1x" ohos:visibility="hide" >