fix
16
Weather/.gitignore
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
*.iml
|
||||
.gradle
|
||||
/local.properties
|
||||
/.idea/caches
|
||||
/.idea/libraries
|
||||
/.idea/modules.xml
|
||||
/.idea/workspace.xml
|
||||
/.idea/navEditor.xml
|
||||
/.idea/assetWizardSettings.xml
|
||||
.DS_Store
|
||||
/build
|
||||
/captures
|
||||
.externalNativeBuild
|
||||
/entry/.preview
|
||||
.cxx
|
||||
/node_modules
|
||||
3
Weather/.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
6
Weather/.idea/compiler.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="11" />
|
||||
</component>
|
||||
</project>
|
||||
23
Weather/.idea/gradle.xml
generated
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="PLATFORM" />
|
||||
<option name="distributionType" value="LOCAL" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleHome" value="$APPLICATION_HOME_DIR$/tools/gradle" />
|
||||
<option name="gradleJvm" value="#JAVA_INTERNAL" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/entry" />
|
||||
</set>
|
||||
</option>
|
||||
<option name="resolveModulePerSourceSet" value="false" />
|
||||
<option name="useQualifiedModuleNames" value="false" />
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
36
Weather/.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
@@ -0,0 +1,36 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="JavaDoc" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="TOP_LEVEL_CLASS_OPTIONS">
|
||||
<value>
|
||||
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
|
||||
<option name="REQUIRED_TAGS" value="" />
|
||||
</value>
|
||||
</option>
|
||||
<option name="INNER_CLASS_OPTIONS">
|
||||
<value>
|
||||
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
|
||||
<option name="REQUIRED_TAGS" value="" />
|
||||
</value>
|
||||
</option>
|
||||
<option name="METHOD_OPTIONS">
|
||||
<value>
|
||||
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
|
||||
<option name="REQUIRED_TAGS" value="@return@param@throws or @exception" />
|
||||
</value>
|
||||
</option>
|
||||
<option name="FIELD_OPTIONS">
|
||||
<value>
|
||||
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
|
||||
<option name="REQUIRED_TAGS" value="" />
|
||||
</value>
|
||||
</option>
|
||||
<option name="IGNORE_DEPRECATED" value="false" />
|
||||
<option name="IGNORE_JAVADOC_PERIOD" value="true" />
|
||||
<option name="IGNORE_DUPLICATED_THROWS" value="false" />
|
||||
<option name="IGNORE_POINT_TO_ITSELF" value="false" />
|
||||
<option name="myAdditionalJavadocTags" value="date" />
|
||||
</inspection_tool>
|
||||
</profile>
|
||||
</component>
|
||||
204
Weather/.idea/intellij-javadocs-4.0.1.xml
generated
Normal file
@@ -0,0 +1,204 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="JavaDocConfiguration">
|
||||
<GENERAL>
|
||||
<MODE>UPDATE</MODE>
|
||||
<OVERRIDDEN_METHODS>false</OVERRIDDEN_METHODS>
|
||||
<SPLITTED_CLASS_NAME>true</SPLITTED_CLASS_NAME>
|
||||
<LEVELS>
|
||||
<LEVEL>FIELD</LEVEL>
|
||||
<LEVEL>TYPE</LEVEL>
|
||||
<LEVEL>METHOD</LEVEL>
|
||||
</LEVELS>
|
||||
<VISIBILITIES>
|
||||
<VISIBILITY>PUBLIC</VISIBILITY>
|
||||
<VISIBILITY>PROTECTED</VISIBILITY>
|
||||
<VISIBILITY>DEFAULT</VISIBILITY>
|
||||
</VISIBILITIES>
|
||||
</GENERAL>
|
||||
<TEMPLATES>
|
||||
<CLASSES>
|
||||
<CLASS>
|
||||
<KEY>^.*(public|protected|private)*.+interface\s+\w+.*</KEY>
|
||||
<VALUE>/**\n
|
||||
* The interface ${name}.\n
|
||||
<#if element.typeParameters?has_content> * \n
|
||||
</#if>
|
||||
<#list element.typeParameters as typeParameter>
|
||||
* @param <${typeParameter.name}> the type parameter\n
|
||||
</#list>
|
||||
*/</VALUE>
|
||||
</CLASS>
|
||||
<CLASS>
|
||||
<KEY>^.*(public|protected|private)*.+enum\s+\w+.*</KEY>
|
||||
<VALUE>/**\n
|
||||
* The enum ${name}.\n
|
||||
*/</VALUE>
|
||||
</CLASS>
|
||||
<CLASS>
|
||||
<KEY>^.*(public|protected|private)*.+class\s+\w+.*</KEY>
|
||||
<VALUE>/**\n
|
||||
* The type ${name}.\n
|
||||
<#if element.typeParameters?has_content> * \n
|
||||
</#if>
|
||||
<#list element.typeParameters as typeParameter>
|
||||
* @param <${typeParameter.name}> the type parameter\n
|
||||
</#list>
|
||||
*/</VALUE>
|
||||
</CLASS>
|
||||
<CLASS>
|
||||
<KEY>.+</KEY>
|
||||
<VALUE>/**\n
|
||||
* The type ${name}.\n
|
||||
*/</VALUE>
|
||||
</CLASS>
|
||||
</CLASSES>
|
||||
<CONSTRUCTORS>
|
||||
<CONSTRUCTOR>
|
||||
<KEY>.+</KEY>
|
||||
<VALUE>/**\n
|
||||
* Instantiates a new ${name}.\n
|
||||
<#if element.parameterList.parameters?has_content>
|
||||
*\n
|
||||
</#if>
|
||||
<#list element.parameterList.parameters as parameter>
|
||||
* @param ${parameter.name} the ${paramNames[parameter.name]}\n
|
||||
</#list>
|
||||
<#if element.throwsList.referenceElements?has_content>
|
||||
*\n
|
||||
</#if>
|
||||
<#list element.throwsList.referenceElements as exception>
|
||||
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
|
||||
</#list>
|
||||
*/</VALUE>
|
||||
</CONSTRUCTOR>
|
||||
</CONSTRUCTORS>
|
||||
<METHODS>
|
||||
<METHOD>
|
||||
<KEY>^.*(public|protected|private)*\s*.*(\w(\s*<.+>)*)+\s+get\w+\s*\(.*\).+</KEY>
|
||||
<VALUE>/**\n
|
||||
* Gets ${partName}.\n
|
||||
<#if element.typeParameters?has_content> * \n
|
||||
</#if>
|
||||
<#list element.typeParameters as typeParameter>
|
||||
* @param <${typeParameter.name}> the type parameter\n
|
||||
</#list>
|
||||
<#if element.parameterList.parameters?has_content>
|
||||
*\n
|
||||
</#if>
|
||||
<#list element.parameterList.parameters as parameter>
|
||||
* @param ${parameter.name} the ${paramNames[parameter.name]}\n
|
||||
</#list>
|
||||
<#if isNotVoid>
|
||||
*\n
|
||||
* @return the ${partName}\n
|
||||
</#if>
|
||||
<#if element.throwsList.referenceElements?has_content>
|
||||
*\n
|
||||
</#if>
|
||||
<#list element.throwsList.referenceElements as exception>
|
||||
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
|
||||
</#list>
|
||||
*/</VALUE>
|
||||
</METHOD>
|
||||
<METHOD>
|
||||
<KEY>^.*(public|protected|private)*\s*.*(void|\w(\s*<.+>)*)+\s+set\w+\s*\(.*\).+</KEY>
|
||||
<VALUE>/**\n
|
||||
* Sets ${partName}.\n
|
||||
<#if element.typeParameters?has_content> * \n
|
||||
</#if>
|
||||
<#list element.typeParameters as typeParameter>
|
||||
* @param <${typeParameter.name}> the type parameter\n
|
||||
</#list>
|
||||
<#if element.parameterList.parameters?has_content>
|
||||
*\n
|
||||
</#if>
|
||||
<#list element.parameterList.parameters as parameter>
|
||||
* @param ${parameter.name} the ${paramNames[parameter.name]}\n
|
||||
</#list>
|
||||
<#if isNotVoid>
|
||||
*\n
|
||||
* @return the ${partName}\n
|
||||
</#if>
|
||||
<#if element.throwsList.referenceElements?has_content>
|
||||
*\n
|
||||
</#if>
|
||||
<#list element.throwsList.referenceElements as exception>
|
||||
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
|
||||
</#list>
|
||||
*/</VALUE>
|
||||
</METHOD>
|
||||
<METHOD>
|
||||
<KEY>^.*((public\s+static)|(static\s+public))\s+void\s+main\s*\(\s*String\s*(\[\s*\]|\.\.\.)\s+\w+\s*\).+</KEY>
|
||||
<VALUE>/**\n
|
||||
* The entry point of application.\n
|
||||
|
||||
<#if element.parameterList.parameters?has_content>
|
||||
*\n
|
||||
</#if>
|
||||
* @param ${element.parameterList.parameters[0].name} the input arguments\n
|
||||
<#if element.throwsList.referenceElements?has_content>
|
||||
*\n
|
||||
</#if>
|
||||
<#list element.throwsList.referenceElements as exception>
|
||||
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
|
||||
</#list>
|
||||
*/</VALUE>
|
||||
</METHOD>
|
||||
<METHOD>
|
||||
<KEY>.+</KEY>
|
||||
<VALUE>/**\n
|
||||
* ${name}<#if isNotVoid> ${return}</#if>.\n
|
||||
<#if element.typeParameters?has_content> * \n
|
||||
</#if>
|
||||
<#list element.typeParameters as typeParameter>
|
||||
* @param <${typeParameter.name}> the type parameter\n
|
||||
</#list>
|
||||
<#if element.parameterList.parameters?has_content>
|
||||
*\n
|
||||
</#if>
|
||||
<#list element.parameterList.parameters as parameter>
|
||||
* @param ${parameter.name} the ${paramNames[parameter.name]}\n
|
||||
</#list>
|
||||
<#if isNotVoid>
|
||||
*\n
|
||||
* @return the ${return}\n
|
||||
</#if>
|
||||
<#if element.throwsList.referenceElements?has_content>
|
||||
*\n
|
||||
</#if>
|
||||
<#list element.throwsList.referenceElements as exception>
|
||||
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
|
||||
</#list>
|
||||
*/</VALUE>
|
||||
</METHOD>
|
||||
</METHODS>
|
||||
<FIELDS>
|
||||
<FIELD>
|
||||
<KEY>^.*(public|protected|private)*.+static.*(\w\s\w)+.+</KEY>
|
||||
<VALUE>/**\n
|
||||
* The constant ${element.getName()}.\n
|
||||
*/</VALUE>
|
||||
</FIELD>
|
||||
<FIELD>
|
||||
<KEY>^.*(public|protected|private)*.*(\w\s\w)+.+</KEY>
|
||||
<VALUE>/**\n
|
||||
<#if element.parent.isInterface()>
|
||||
* The constant ${element.getName()}.\n
|
||||
<#else>
|
||||
* The ${name}.\n
|
||||
</#if> */</VALUE>
|
||||
</FIELD>
|
||||
<FIELD>
|
||||
<KEY>.+</KEY>
|
||||
<VALUE>/**\n
|
||||
<#if element.parent.isEnum()>
|
||||
*${name} ${typeName}.\n
|
||||
<#else>
|
||||
* The ${name}.\n
|
||||
</#if>*/</VALUE>
|
||||
</FIELD>
|
||||
</FIELDS>
|
||||
</TEMPLATES>
|
||||
</component>
|
||||
</project>
|
||||
40
Weather/.idea/jarRepositories.xml
generated
Normal file
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RemoteRepositoriesConfiguration">
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Maven Central repository" />
|
||||
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="jboss.community" />
|
||||
<option name="name" value="JBoss Community repository" />
|
||||
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="maven2" />
|
||||
<option name="name" value="maven2" />
|
||||
<option name="url" value="https://developer.huawei.com/repo/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="maven" />
|
||||
<option name="name" value="maven" />
|
||||
<option name="url" value="https://repo.huaweicloud.com/repository/maven/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="maven3" />
|
||||
<option name="name" value="maven3" />
|
||||
<option name="url" value="https://mirrors.huaweicloud.com/repository/maven/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="BintrayJCenter" />
|
||||
<option name="name" value="BintrayJCenter" />
|
||||
<option name="url" value="https://jcenter.bintray.com/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="MavenRepo" />
|
||||
<option name="name" value="MavenRepo" />
|
||||
<option name="url" value="https://repo.maven.apache.org/maven2/" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
||||
4
Weather/.idea/misc.xml
generated
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
|
||||
</project>
|
||||
6
Weather/.idea/sonarlint/issuestore/0/7/0774814162e422c76bce232de8fbe7aa73482fb1
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
j
|
||||
java:S1104
|
||||
"TMake cityName a static final constant or non-public and provide accessors if needed.(<28>Ɵ<EFBFBD>
|
||||
o
|
||||
java:S1104"TMake cityCode a static final constant or non-public and provide accessors if needed.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
9
Weather/.idea/sonarlint/issuestore/0/9/0967d9173abdcb01da65265c8e154e9a37034a67
generated
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
E
|
||||
java:S20933"*Change this "try" to a try-with-resources.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
C
|
||||
java:S1604&"(Make this anonymous inner class a lambda(<28>̒<EFBFBD><CC92><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
>
|
||||
java:S1604E"(Make this anonymous inner class a lambda(<28><>Ż
|
||||
]
|
||||
java:S22599"HA "NullPointerException" could be thrown; "connection" is nullable here.(<28><><EFBFBD>H
|
||||
0
Weather/.idea/sonarlint/issuestore/0/c/0c1945d7443c2e154bd3e421c0d438bd4086d8c3
generated
Normal file
0
Weather/.idea/sonarlint/issuestore/1/0/10f965cf51fe14a5ef0ca2ebefb1bd7e4607eeb2
generated
Normal file
0
Weather/.idea/sonarlint/issuestore/2/d/2de47c4a3a933c03f3a50b5cca0f22761d46d3d4
generated
Normal file
6
Weather/.idea/sonarlint/issuestore/4/2/42a85d72c6c5bb50c094790894e8cef757c01d01
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
P
|
||||
java:S1118
|
||||
":Add a private constructor to hide the implicit public one.(<28><><EFBFBD><EFBFBD>
|
||||
J
|
||||
java:S2864"4Iterate over the "entrySet" instead of the "keySet".(<28><><EFBFBD><EFBFBD>
|
||||
0
Weather/.idea/sonarlint/issuestore/4/9/496a238a6afa168dbaf6efd37bb459331589579c
generated
Normal file
0
Weather/.idea/sonarlint/issuestore/6/a/6a6b1c750d19dd7877d9984c3de755233f64900b
generated
Normal file
4
Weather/.idea/sonarlint/issuestore/7/5/750f76477761fe96654f7734d0ff1b7bb1be5876
generated
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
C
|
||||
java:S1185
|
||||
"(Remove this method to simply inherit it.(<28><>Ί<EFBFBD><CE8A><EFBFBD><EFBFBD><EFBFBD>
|
||||
3
Weather/.idea/sonarlint/issuestore/8/f/8f423886990ce6638a830fe4e6a70e23f267f22a
generated
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
P
|
||||
java:S1118 ":Add a private constructor to hide the implicit public one.(<28><><EFBFBD><EFBFBD>
|
||||
17
Weather/.idea/sonarlint/issuestore/a/b/aba7d9f4dd5aeef95a00381e20cef7a825179e38
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
q java:S116"\Rename this field "temperature_1Text" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(<28><><EFBFBD><EFBFBD>
|
||||
m java:S116"XRename this field "weather_1Text" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(<28><><EFBFBD><EFBFBD>
|
||||
j java:S116"URename this field "tips_1Text" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(<28><><EFBFBD><EFBFBD>
|
||||
s java:S116 "YRename this field "weatherImage_1" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
^
|
||||
java:S1659"HDeclare "weatherText" and all following declarations on a separate line.(<28><><EFBFBD><EFBFBD>
|
||||
G
|
||||
java:S1659 ",Declare "weatherImage_1" on a separate line.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
V java:S125`"<This block of commented-out lines of code should be removed.(<28>ׯ<EFBFBD><D7AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
Q java:S125g"<This block of commented-out lines of code should be removed.(<28><><EFBFBD><EFBFBD>
|
||||
V java:S125u"<This block of commented-out lines of code should be removed.(<28>ׯ<EFBFBD><D7AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
Q java:S125|"<This block of commented-out lines of code should be removed.(<28><><EFBFBD><EFBFBD>
|
||||
F
|
||||
java:S1068"+Remove this unused "mLayout" private field.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
f
|
||||
java:S1192_"KDefine a constant instead of duplicating this literal "WeatherApp" 4 times.(<28>ȇ<EFBFBD><C887><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
0
Weather/.idea/sonarlint/issuestore/a/d/ad38b2dea33752cac233aa09d7dfbe582e9dded6
generated
Normal file
0
Weather/.idea/sonarlint/issuestore/c/4/c4d7c06613adb8c5404d09c42a94f8ad8bcc9664
generated
Normal file
9
Weather/.idea/sonarlint/issuestore/d/5/d515ec7324135962f492b6cd82deaeda948f45d6
generated
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
Q
|
||||
java:S1874";Remove this use of "RecycleItemProvider"; it is deprecated.(<28><><EFBFBD><EFBFBD>
|
||||
c java:S100a"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(<28>ĉ<EFBFBD>
|
||||
<EFBFBD>
|
||||
java:S1319!"gThe type of "cityMos" should be an interface such as "List" rather than the implementation "ArrayList".(<28>ɯ<EFBFBD><C9AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
k java:S117C"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
C
|
||||
java:S1604M"(Make this anonymous inner class a lambda(<28>ϓ<EFBFBD><CF93><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
7
Weather/.idea/sonarlint/issuestore/d/b/dbba308765e22bdac0f7ce0d766cd240fae5658f
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
<EFBFBD>
|
||||
java:S1319"gThe type of "cityMos" should be an interface such as "List" rather than the implementation "ArrayList".(ɣ<><C9A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD>
|
||||
java:S1319"gThe type of "cityMos" should be an interface such as "List" rather than the implementation "ArrayList".(<28>ΰ<EFBFBD><CEB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
n
|
||||
java:S1104"SMake cityMos a static final constant or non-public and provide accessors if needed.(ɣ<><C9A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
0
Weather/.idea/sonarlint/issuestore/f/0/f07866736216be0ee2aba49e392191aeae700a35
generated
Normal file
33
Weather/.idea/sonarlint/issuestore/index.pb
generated
Normal file
@@ -0,0 +1,33 @@
|
||||
|
||||
\
|
||||
,.idea/inspectionProfiles/Project_Default.xml,4\9\496a238a6afa168dbaf6efd37bb459331589579c
|
||||
<
|
||||
build.gradle,f\0\f07866736216be0ee2aba49e392191aeae700a35
|
||||
v
|
||||
Fentry/src/ohosTest/java/com/example/myapplication/ExampleOhosTest.java,6\a\6a6b1c750d19dd7877d9984c3de755233f64900b
|
||||
j
|
||||
:entry/src/main/java/com/example/weather/MyApplication.java,7\5\750f76477761fe96654f7734d0ff1b7bb1be5876
|
||||
f
|
||||
6entry/src/main/java/com/example/weather/net/HiNet.java,0\9\0967d9173abdcb01da65265c8e154e9a37034a67
|
||||
j
|
||||
:entry/src/main/java/com/example/weather/net/HiNetUtil.java,4\2\42a85d72c6c5bb50c094790894e8cef757c01d01
|
||||
g
|
||||
7entry/src/main/java/com/example/weather/net/IHiNet.java,2\d\2de47c4a3a933c03f3a50b5cca0f22761d46d3d4
|
||||
h
|
||||
8entry/src/main/java/com/example/weather/data/CityMo.java,0\7\0774814162e422c76bce232de8fbe7aa73482fb1
|
||||
h
|
||||
8entry/src/main/java/com/example/weather/data/DataMo.java,d\b\dbba308765e22bdac0f7ce0d766cd240fae5658f
|
||||
r
|
||||
Bentry/src/main/java/com/example/weather/data/ListItemProvider.java,d\5\d515ec7324135962f492b6cd82deaeda948f45d6
|
||||
9
|
||||
Readme.md,0\c\0c1945d7443c2e154bd3e421c0d438bd4086d8c3
|
||||
B
|
||||
entry/build.gradle,a\d\ad38b2dea33752cac233aa09d7dfbe582e9dded6
|
||||
l
|
||||
<entry/src/main/java/com/example/weather/util/HiExecutor.java,8\f\8f423886990ce6638a830fe4e6a70e23f267f22a
|
||||
h
|
||||
8entry/src/main/java/com/example/weather/MainAbility.java,c\4\c4d7c06613adb8c5404d09c42a94f8ad8bcc9664
|
||||
s
|
||||
Centry/src/main/java/com/example/weather/slice/MainAbilitySlice.java,a\b\aba7d9f4dd5aeef95a00381e20cef7a825179e38
|
||||
J
|
||||
entry/src/main/config.json,1\0\10f965cf51fe14a5ef0ca2ebefb1bd7e4607eeb2
|
||||
6
Weather/.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
5
Weather/Readme.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# 天气应用
|
||||
|
||||
这是一个简单的鸿蒙天气应用,支持鸿蒙手机以及鸿蒙手表; 采用org.devio.hi.json:hijson来解析网络请求数据, 使用时请自行替换和风天气的API密钥,已适配SDK6.0
|
||||
|
||||
2022.03.04更新
|
||||
44
Weather/build.gradle
Normal file
@@ -0,0 +1,44 @@
|
||||
// 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/ide_debug_device-0000001053822404#section1112183053510
|
||||
ohos {
|
||||
signingConfigs {
|
||||
debug {
|
||||
storeFile file('C:\\Users\\root\\.ohos\\config\\auto_debug_weather_56657123.p12')
|
||||
storePassword '000000187DE4CD73AB3F545F3009872FD4763F6AB8D06B7705E4EBCA1BA2A45626EDE2179E1647A2'
|
||||
keyAlias = 'debugKey'
|
||||
keyPassword '000000182EDE2103DCE4593ED3E2AF84945F54EF3974DE0E5CA971B60A4D225BD1440F3EBC498B84'
|
||||
signAlg = 'SHA256withECDSA'
|
||||
profile file('C:\\Users\\root\\.ohos\\config\\auto_debug_weather_56657123.p7b')
|
||||
certpath file('C:\\Users\\root\\.ohos\\config\\auto_debug_weather_56657123.cer')
|
||||
}
|
||||
}
|
||||
compileSdkVersion 6
|
||||
}
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
maven {
|
||||
url 'https://repo.huaweicloud.com/repository/maven/'
|
||||
}
|
||||
maven {
|
||||
url 'https://developer.huawei.com/repo/'
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.huawei.ohos:hap:3.0.5.2'
|
||||
classpath 'com.huawei.ohos:decctest:1.2.7.2'
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
maven {
|
||||
url 'https://repo.huaweicloud.com/repository/maven/'
|
||||
}
|
||||
maven {
|
||||
url 'https://developer.huawei.com/repo/'
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Weather/entry/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/build
|
||||
/node_modules
|
||||
54
Weather/entry/build.gradle
Normal file
@@ -0,0 +1,54 @@
|
||||
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/ide_debug_device-0000001053822404#section1112183053510
|
||||
ohos {
|
||||
compileSdkVersion 6
|
||||
defaultConfig {
|
||||
compatibleSdkVersion 6
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
proguardOpt {
|
||||
proguardEnabled false
|
||||
rulesFiles 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'org.devio.hi.json:hijson:1.0.0'
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])
|
||||
testImplementation 'junit:junit:4.13.1'
|
||||
ohosTestImplementation 'com.huawei.ohos.testkit:runner:1.0.0.200'
|
||||
}
|
||||
decc {
|
||||
supportType = ['html', 'xml']
|
||||
}
|
||||
buildscript {
|
||||
repositories {
|
||||
maven {
|
||||
url 'https://mirrors.huaweicloud.com/repository/maven/'
|
||||
}
|
||||
maven {
|
||||
url 'https://developer.huawei.com/repo/'
|
||||
}
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.huawei.ohos:hap:3.0.3.2'
|
||||
classpath 'com.huawei.ohos:decctest:1.2.7.2'
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
maven {
|
||||
url 'https://mirrors.huaweicloud.com/repository/maven/'
|
||||
}
|
||||
maven {
|
||||
url 'https://developer.huawei.com/repo/'
|
||||
}
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
1
Weather/entry/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1 @@
|
||||
# config module specific ProGuard rules here.
|
||||
60
Weather/entry/src/main/config.json
Normal file
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"app": {
|
||||
"bundleName": "com.example.test.weather",
|
||||
"vendor": "xcl",
|
||||
"version": {
|
||||
"code": 1000000,
|
||||
"name": "1.0.0"
|
||||
}
|
||||
},
|
||||
"deviceConfig": {},
|
||||
"module": {
|
||||
"package": "com.example.weather",
|
||||
"name": ".MyApplication",
|
||||
"mainAbility": "com.example.weather.MainAbility",
|
||||
"deviceType": [
|
||||
"phone",
|
||||
"tablet"
|
||||
],
|
||||
"reqPermissions": [
|
||||
{
|
||||
"name": "ohos.permission.INTERNET"
|
||||
},
|
||||
{
|
||||
"name": "ohos.permission.GET_NETWORK_INFO"
|
||||
},
|
||||
{
|
||||
"name": "ohos.permission.SET_NETWORK_INFO"
|
||||
}
|
||||
],
|
||||
"distro": {
|
||||
"deliveryWithInstall": true,
|
||||
"moduleName": "entry",
|
||||
"moduleType": "entry",
|
||||
"installationFree": false
|
||||
},
|
||||
"abilities": [
|
||||
{
|
||||
"skills": [
|
||||
{
|
||||
"entities": [
|
||||
"entity.system.home"
|
||||
],
|
||||
"actions": [
|
||||
"action.system.home"
|
||||
]
|
||||
}
|
||||
],
|
||||
"orientation": "unspecified",
|
||||
"visible": true,
|
||||
"name": "com.example.weather.MainAbility",
|
||||
"icon": "$media:icon",
|
||||
"description": "$string:mainability_description",
|
||||
"formsEnabled": true,
|
||||
"label": "$string:entry_MainAbility",
|
||||
"type": "page",
|
||||
"launchType": "standard"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.example.weather;
|
||||
|
||||
import com.example.weather.slice.MainAbilitySlice;
|
||||
import ohos.aafwk.ability.Ability;
|
||||
import ohos.aafwk.content.Intent;
|
||||
|
||||
/**
|
||||
* The type Main ability.
|
||||
*/
|
||||
public class MainAbility extends Ability {
|
||||
@Override
|
||||
public void onStart(Intent intent) {
|
||||
super.onStart(intent);
|
||||
super.setMainRoute(MainAbilitySlice.class.getName());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.example.weather;
|
||||
|
||||
import ohos.aafwk.ability.AbilityPackage;
|
||||
|
||||
/**
|
||||
* The type My application.
|
||||
*/
|
||||
public class MyApplication extends AbilityPackage {
|
||||
@Override
|
||||
public void onInitialize() {
|
||||
super.onInitialize();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.example.weather.data;
|
||||
|
||||
/**
|
||||
* The type City mo.
|
||||
*/
|
||||
public class CityMo {
|
||||
/**
|
||||
* The City name.
|
||||
*/
|
||||
public String cityName;
|
||||
/**
|
||||
* The City code.
|
||||
*/
|
||||
public String cityCode;
|
||||
|
||||
/**
|
||||
* Instantiates a new City mo.
|
||||
*
|
||||
* @param cityName the city name
|
||||
* @param cityCode the city code
|
||||
*/
|
||||
public CityMo(String cityName, String cityCode) {
|
||||
this.cityName = cityName;
|
||||
this.cityCode = cityCode;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.example.weather.data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* The type Data mo.
|
||||
*/
|
||||
public class DataMo {
|
||||
/**
|
||||
* The City mos.
|
||||
*/
|
||||
public ArrayList<CityMo> cityMos;
|
||||
|
||||
/**
|
||||
* Instantiates a new Data mo.
|
||||
*
|
||||
* @param cityMos the city mos
|
||||
*/
|
||||
public DataMo(ArrayList<CityMo> cityMos) {
|
||||
this.cityMos = cityMos;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.example.weather.data;
|
||||
|
||||
import com.example.weather.ResourceTable;
|
||||
import ohos.aafwk.ability.AbilitySlice;
|
||||
import ohos.agp.components.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* The type List item provider.
|
||||
*/
|
||||
public class ListItemProvider extends RecycleItemProvider {
|
||||
private AbilitySlice mSlice;
|
||||
private OnItemClickListener listener;
|
||||
private ArrayList<DataMo> dataMos = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Instantiates a new List item provider.
|
||||
*
|
||||
* @param abilitySlice the ability slice
|
||||
* @param listener the listener
|
||||
*/
|
||||
public ListItemProvider(AbilitySlice abilitySlice, OnItemClickListener listener) {
|
||||
this.mSlice = abilitySlice;
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set data.
|
||||
*
|
||||
* @param cityMos the city mos
|
||||
*/
|
||||
public void setData(ArrayList<CityMo> cityMos) {
|
||||
this.dataMos.clear();
|
||||
int i = 0;
|
||||
ArrayList<CityMo> tempList = new ArrayList<>();
|
||||
for (CityMo mo : cityMos) {
|
||||
if (i == 3) {
|
||||
i = 0;
|
||||
dataMos.add(new DataMo(tempList));
|
||||
tempList = new ArrayList<>();
|
||||
}
|
||||
tempList.add(mo);
|
||||
i++;
|
||||
}
|
||||
dataMos.add(new DataMo(tempList));
|
||||
this.notifyDataChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return dataMos.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getItem(int i) {
|
||||
return dataMos.get(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int i) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Component getComponent(int i, Component component, ComponentContainer componentContainer) {
|
||||
Component component_item = LayoutScatter.getInstance(mSlice).parse(ResourceTable.Layout_list_item, null, false);
|
||||
if (!(component_item instanceof ComponentContainer)) {
|
||||
return null;
|
||||
}
|
||||
ComponentContainer rootLayout = (ComponentContainer) component_item;
|
||||
DataMo dataMo = dataMos.get(i);
|
||||
for (CityMo mo : dataMo.cityMos) {
|
||||
Text titleItem = (Text) LayoutScatter.getInstance(mSlice).parse(ResourceTable.Layout_item_title, null, false);
|
||||
titleItem.setText(mo.cityName);
|
||||
rootLayout.addComponent(titleItem);
|
||||
titleItem.setClickedListener(new Component.ClickedListener() {
|
||||
@Override
|
||||
public void onClick(Component component) {
|
||||
listener.OnItemClick(mo, i);
|
||||
}
|
||||
});
|
||||
}
|
||||
return component_item;
|
||||
}
|
||||
|
||||
/**
|
||||
* The interface On item click listener.
|
||||
*/
|
||||
public interface OnItemClickListener {
|
||||
/**
|
||||
* On item click.
|
||||
*
|
||||
* @param cityMo the city mo
|
||||
* @param position the position
|
||||
*/
|
||||
void OnItemClick(CityMo cityMo, int position);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.example.weather.net;
|
||||
|
||||
import com.example.weather.util.HiExecutor;
|
||||
import ohos.hiviewdfx.HiLog;
|
||||
import ohos.hiviewdfx.HiLogLabel;
|
||||
import ohos.net.NetHandle;
|
||||
import ohos.net.NetManager;
|
||||
import org.devio.hi.json.HiJson;
|
||||
import org.devio.hi.json.JSONException;
|
||||
import org.devio.hi.json.JSONObject;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.Proxy;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* The type Hi net.
|
||||
*/
|
||||
public class HiNet implements IHiNet {
|
||||
private NetManager netManager;
|
||||
private HiLogLabel logLabel = new HiLogLabel(0, 0, HiNet.class.getSimpleName());
|
||||
|
||||
/**
|
||||
* Instantiates a new Hi net.
|
||||
*/
|
||||
public HiNet() {
|
||||
netManager = NetManager.getInstance(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void get(String url, Map<String, String> params, NetListener listener) {
|
||||
String finalUrl = HiNetUtil.buildParams(url, params);
|
||||
HiLog.debug(logLabel, "finalUrl:" + finalUrl);
|
||||
HiExecutor.runBG(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
doGet(finalUrl, listener);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void doGet(String finalUrl, NetListener listener) {
|
||||
NetHandle netHandle = netManager.getDefaultNet();
|
||||
HttpURLConnection connection = null;
|
||||
InputStream inputStream = null;
|
||||
ByteArrayOutputStream baos = null;
|
||||
try {
|
||||
URL url = new URL(finalUrl);
|
||||
URLConnection urlConnection = netHandle.openConnection(url, Proxy.NO_PROXY);
|
||||
if (urlConnection instanceof HttpURLConnection) {
|
||||
connection = (HttpURLConnection) urlConnection;
|
||||
}
|
||||
connection.setRequestMethod("GET");
|
||||
connection.connect();
|
||||
HiLog.debug(logLabel, "connect...");
|
||||
if (connection.getResponseCode() == 200) {
|
||||
inputStream = connection.getInputStream();
|
||||
baos = new ByteArrayOutputStream();
|
||||
int readLen;
|
||||
byte[] bytes = new byte[1024];
|
||||
while ((readLen = inputStream.read(bytes)) != -1) {
|
||||
baos.write(bytes, 0, readLen);
|
||||
}
|
||||
String result = baos.toString();
|
||||
HiExecutor.runUI(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
HiJson res = new HiJson(new JSONObject(result));
|
||||
listener.onSuccess(res);
|
||||
HiLog.debug(logLabel, "success.");
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
listener.onFail("data parse error, msg" + e.toString());
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
HiLog.debug(logLabel, "Request fail, code:" + connection.getResponseCode());
|
||||
listener.onFail("Request fail, code:" + connection.getResponseCode());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
HiLog.debug(logLabel, "Request fail, msg:" + e.toString());
|
||||
listener.onFail("Request fail, msg:" + e.toString());
|
||||
} finally {
|
||||
if (connection != null) {
|
||||
connection.disconnect();
|
||||
}
|
||||
HiNetUtil.close(inputStream);
|
||||
HiNetUtil.close(baos);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.example.weather.net;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* The type Hi net util.
|
||||
*/
|
||||
public class HiNetUtil {
|
||||
|
||||
/**
|
||||
* Build params string.
|
||||
*
|
||||
* @param url the url
|
||||
* @param params the params
|
||||
* @return the string
|
||||
*/
|
||||
public static String buildParams(String url, Map<String, String> params) {
|
||||
if (params == null) return null;
|
||||
StringBuilder builder = new StringBuilder(url);
|
||||
boolean isFirst = true;
|
||||
for (String key : params.keySet()) {
|
||||
String value = params.get(key);
|
||||
if (key != null && value != null) {
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
builder.append("?");
|
||||
} else {
|
||||
builder.append("&");
|
||||
}
|
||||
builder.append(key)
|
||||
.append("=")
|
||||
.append(value);
|
||||
}
|
||||
}
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Close.
|
||||
*
|
||||
* @param closeable the closeable
|
||||
*/
|
||||
public static void close(Closeable closeable) {
|
||||
if (closeable != null) {
|
||||
try {
|
||||
closeable.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.example.weather.net;
|
||||
|
||||
import org.devio.hi.json.HiJson;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* The interface Hi net.
|
||||
*/
|
||||
public interface IHiNet {
|
||||
/**
|
||||
* Get.
|
||||
*
|
||||
* @param url the url
|
||||
* @param params the params
|
||||
* @param listener the listener
|
||||
*/
|
||||
void get(String url, Map<String, String> params, NetListener listener);
|
||||
|
||||
/**
|
||||
* The interface Net listener.
|
||||
*/
|
||||
interface NetListener {
|
||||
/**
|
||||
* On success.
|
||||
*
|
||||
* @param res the res
|
||||
*/
|
||||
void onSuccess(HiJson res);
|
||||
|
||||
/**
|
||||
* On fail.
|
||||
*
|
||||
* @param message the message
|
||||
*/
|
||||
void onFail(String message);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,184 @@
|
||||
package com.example.weather.slice;
|
||||
|
||||
import com.example.weather.ResourceTable;
|
||||
import com.example.weather.data.CityMo;
|
||||
import com.example.weather.data.ListItemProvider;
|
||||
import com.example.weather.net.HiNet;
|
||||
import com.example.weather.net.IHiNet;
|
||||
import ohos.aafwk.ability.AbilitySlice;
|
||||
import ohos.aafwk.content.Intent;
|
||||
import ohos.agp.components.DirectionalLayout;
|
||||
import ohos.agp.components.Image;
|
||||
import ohos.agp.components.ListContainer;
|
||||
import ohos.agp.components.Text;
|
||||
import ohos.hiviewdfx.HiLog;
|
||||
import ohos.hiviewdfx.HiLogLabel;
|
||||
import org.devio.hi.json.HiJson;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* The type Main ability slice.
|
||||
*/
|
||||
public class MainAbilitySlice extends AbilitySlice implements ListItemProvider.OnItemClickListener {
|
||||
private DirectionalLayout mLayout = new DirectionalLayout(this);
|
||||
private ListContainer listContainer;
|
||||
private ListItemProvider listItemProvider;
|
||||
private ArrayList<CityMo> cities = new ArrayList<>();
|
||||
private HiNet hiNet;
|
||||
private Text temperatureText, weatherText, tipsText, temperature_1Text, weather_1Text, tips_1Text;
|
||||
private Image weatherImage, weatherImage_1;
|
||||
|
||||
@Override
|
||||
public void onStart(Intent intent) {
|
||||
super.onStart(intent);
|
||||
super.setUIContent(ResourceTable.Layout_ability_main);
|
||||
hiNet = new HiNet();
|
||||
initLayout();
|
||||
initLayout1();
|
||||
intCity();
|
||||
loadData(new CityMo("深圳", "114.03,22.32"));/*此处的地址应由API根据经纬度解的,而经纬度应有设备自身获取*/
|
||||
loadData1(new CityMo("太原", "112.45,38.02"));
|
||||
}
|
||||
|
||||
private void initLayout1() {
|
||||
listContainer = (ListContainer) findComponentById(ResourceTable.Id_list);
|
||||
listItemProvider = new ListItemProvider(this, this);
|
||||
listContainer.setItemProvider(listItemProvider);
|
||||
temperatureText = (Text) findComponentById(ResourceTable.Id_temperature_1);
|
||||
weatherText = (Text) findComponentById(ResourceTable.Id_weather_1);
|
||||
tipsText = (Text) findComponentById(ResourceTable.Id_tips_1);
|
||||
weatherImage = (Image) findComponentById(ResourceTable.Id_weather_icon_1);
|
||||
}
|
||||
|
||||
private void intCity() {
|
||||
listItemProvider.setData(cities);
|
||||
}
|
||||
|
||||
|
||||
private void initLayout() {
|
||||
listContainer = (ListContainer) findComponentById(ResourceTable.Id_list);
|
||||
listItemProvider = new ListItemProvider(this, this);
|
||||
listContainer.setItemProvider(listItemProvider);
|
||||
temperature_1Text = (Text) findComponentById(ResourceTable.Id_temperature);
|
||||
weather_1Text = (Text) findComponentById(ResourceTable.Id_weather);
|
||||
tips_1Text = (Text) findComponentById(ResourceTable.Id_tips);
|
||||
weatherImage_1 = (Image) findComponentById(ResourceTable.Id_weather_icon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActive() {
|
||||
super.onActive();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onForeground(Intent intent) {
|
||||
super.onForeground(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void OnItemClick(CityMo cityMo, int position) {
|
||||
|
||||
loadData(cityMo);
|
||||
}
|
||||
|
||||
private void loadData(CityMo mo) {
|
||||
//https://devapi.qweather.com/v7/weather/now?location=114.03,22.32&key=<用户key:18418bf60e874597abf85b7906d03e48>
|
||||
Map<String, String> params = new HashMap<>();
|
||||
params.put("location", mo.cityCode);
|
||||
params.put("key", "你的和风天气API密钥");
|
||||
hiNet.get("https://devapi.qweather.com/v7/weather/now", params, new IHiNet.NetListener() {
|
||||
@Override
|
||||
public void onSuccess(HiJson res) {
|
||||
HiLog.info(new HiLogLabel(HiLog.LOG_APP, 0x00201, "WeatherApp"), "Get success:" + res.toString());
|
||||
//System.out.println("WeatherApp onSuccess:"+ res);
|
||||
bindData(res, mo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(String message) {
|
||||
HiLog.info(new HiLogLabel(HiLog.LOG_APP, 0x00201, "WeatherApp"), "Get fail:" + message);
|
||||
//System.out.println("WeatherApp onSuccess:"+ message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void loadData1(CityMo mo) {
|
||||
//https://devapi.qweather.com/v7/weather/now?location=114.03,22.32&key=<用户key:18418bf60e874597abf85b7906d03e48>
|
||||
Map<String, String> params = new HashMap<>();
|
||||
params.put("location", mo.cityCode);
|
||||
params.put("key", "你的和风天气API密钥");
|
||||
hiNet.get("https://devapi.qweather.com/v7/weather/now", params, new IHiNet.NetListener() {
|
||||
@Override
|
||||
public void onSuccess(HiJson res) {
|
||||
HiLog.info(new HiLogLabel(HiLog.LOG_APP, 0x00201, "WeatherApp"), "Get success:" + res.toString());
|
||||
//System.out.println("WeatherApp onSuccess:"+ res);
|
||||
bindData1(res, mo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(String message) {
|
||||
HiLog.info(new HiLogLabel(HiLog.LOG_APP, 0x00201, "WeatherApp"), "Get fail:" + message);
|
||||
//System.out.println("WeatherApp onSuccess:"+ message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void bindData(HiJson res, CityMo mo) {
|
||||
HiJson hiJson = res.get("now");
|
||||
String temperature = hiJson.value("temp");
|
||||
String weather = hiJson.value("text");
|
||||
String winddirection = hiJson.value("windDir");
|
||||
String windpower = hiJson.value("windScale");
|
||||
String humidity = hiJson.value("humidity");
|
||||
/*
|
||||
*上方为对于获取到的JSON数据的读取处理,可加异常抛出
|
||||
*/
|
||||
temperatureText.setText(temperature + "℃");
|
||||
weatherText.setText(weather);
|
||||
tipsText.setText(mo.cityName + ":" + winddirection + " 最大风力:" + windpower + "级" + " 空气湿度" + humidity + "%");
|
||||
int id = ResourceTable.Media_sunshine;
|
||||
if (weather.contains("阴")) {
|
||||
id = ResourceTable.Media_overcast;
|
||||
} else if (weather.contains("雨")) {
|
||||
id = ResourceTable.Media_rain;
|
||||
} else if (weather.contains("雪")) {
|
||||
id = ResourceTable.Media_snow;
|
||||
} else if (weather.contains("雷电")) {
|
||||
id = ResourceTable.Media_thunder;
|
||||
} else if (weather.contains("多云")) {
|
||||
id = ResourceTable.Media_cloudy;
|
||||
}/*此处的天气详情待完善*/
|
||||
weatherImage.setImageAndDecodeBounds(id);
|
||||
}
|
||||
|
||||
private void bindData1(HiJson res, CityMo mo) {
|
||||
HiJson hiJson = res.get("now");
|
||||
String temperature = hiJson.value("temp");
|
||||
String weather = hiJson.value("text");
|
||||
String winddirection = hiJson.value("windDir");
|
||||
String windpower = hiJson.value("windScale");
|
||||
String humidity = hiJson.value("humidity");
|
||||
/*
|
||||
*上方为对于获取到的JSON数据的读取处理,可加异常抛出
|
||||
*/
|
||||
temperature_1Text.setText(temperature + "℃");
|
||||
weather_1Text.setText(weather);
|
||||
tips_1Text.setText(mo.cityName + ":" + winddirection + " 最大风力:" + windpower + "级" + " 空气湿度" + humidity + "%");
|
||||
int id = ResourceTable.Media_sunshine;
|
||||
if (weather.contains("阴")) {
|
||||
id = ResourceTable.Media_overcast;
|
||||
} else if (weather.contains("雨")) {
|
||||
id = ResourceTable.Media_rain;
|
||||
} else if (weather.contains("雪")) {
|
||||
id = ResourceTable.Media_snow;
|
||||
} else if (weather.contains("雷电")) {
|
||||
id = ResourceTable.Media_thunder;
|
||||
} else if (weather.contains("多云")) {
|
||||
id = ResourceTable.Media_cloudy;
|
||||
}/*此处的天气详情待完善*/
|
||||
weatherImage_1.setImageAndDecodeBounds(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.example.weather.util;
|
||||
|
||||
import ohos.eventhandler.EventHandler;
|
||||
import ohos.eventhandler.EventRunner;
|
||||
|
||||
/**
|
||||
* The type Hi executor.
|
||||
*/
|
||||
public class HiExecutor {
|
||||
/**
|
||||
* Run ui.
|
||||
*
|
||||
* @param runnable the runnable
|
||||
*/
|
||||
/*
|
||||
* 切换任务到主线程执行
|
||||
* @param runnable
|
||||
* */
|
||||
public static void runUI(Runnable runnable) {
|
||||
// 切换到主线程
|
||||
EventRunner runner = EventRunner.getMainEventRunner();
|
||||
EventHandler eventHandler = new EventHandler(runner);
|
||||
//切换任务
|
||||
eventHandler.postSyncTask(runnable);
|
||||
}
|
||||
|
||||
/**
|
||||
* Run bg.
|
||||
*
|
||||
* @param runnable the runnable
|
||||
*/
|
||||
/*
|
||||
* 在子线程执行任务
|
||||
* @param runnable
|
||||
* */
|
||||
public static void runBG(Runnable runnable) {
|
||||
//开启一个线程
|
||||
EventRunner runner = EventRunner.create(true);
|
||||
EventHandler eventHandler = new EventHandler(runner);
|
||||
// 执行任务
|
||||
eventHandler.postTask(runnable, 0, EventHandler.Priority.IMMEDIATE);
|
||||
}
|
||||
}
|
||||
20
Weather/entry/src/main/resources/base/element/string.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<shape
|
||||
xmlns:ohos="http://schemas.huawei.com/res/ohos"
|
||||
ohos:shape="rectangle">
|
||||
|
||||
<solid
|
||||
ohos:color="#FFFFFF"/>
|
||||
</shape>
|
||||
114
Weather/entry/src/main/resources/base/layout/ability_main.xml
Normal file
@@ -0,0 +1,114 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<DirectionalLayout
|
||||
xmlns:ohos="http://schemas.huawei.com/res/ohos"
|
||||
ohos:id="$+id:root"
|
||||
ohos:height="match_parent"
|
||||
ohos:width="match_parent"
|
||||
ohos:alignment="horizontal_center"
|
||||
ohos:orientation="vertical"
|
||||
ohos:padding="32">
|
||||
|
||||
<DirectionalLayout
|
||||
ohos:height="match_content"
|
||||
ohos:width="match_parent"
|
||||
ohos:alignment="horizontal_center"
|
||||
ohos:orientation="horizontal">
|
||||
|
||||
<Image
|
||||
ohos:id="$+id:weather_icon"
|
||||
ohos:height="60vp"
|
||||
ohos:width="60vp"
|
||||
ohos:image_src="$media:sunshine"
|
||||
ohos:padding="5vp"
|
||||
ohos:scale_mode="inside"
|
||||
/>
|
||||
|
||||
<Text
|
||||
ohos:id="$+id:weather"
|
||||
ohos:height="match_content"
|
||||
ohos:width="match_content"
|
||||
ohos:right_margin="10vp"
|
||||
ohos:text="1保留"
|
||||
ohos:text_color="#FF000000"
|
||||
ohos:text_size="12fp"
|
||||
/>
|
||||
|
||||
<Text
|
||||
ohos:id="$+id:temperature"
|
||||
ohos:height="match_content"
|
||||
ohos:width="match_content"
|
||||
ohos:text="1保留"
|
||||
ohos:text_color="#FF000000"
|
||||
ohos:text_size="20fp"
|
||||
ohos:top_padding="8vp"
|
||||
/>
|
||||
</DirectionalLayout>
|
||||
|
||||
<Text
|
||||
ohos:id="$+id:tips"
|
||||
ohos:height="match_content"
|
||||
ohos:width="match_content"
|
||||
ohos:layout_alignment="horizontal_center"
|
||||
ohos:left_margin="10vp"
|
||||
ohos:right_margin="10vp"
|
||||
ohos:text="1保留"
|
||||
ohos:text_color="#FF3A6B53"
|
||||
ohos:text_size="12vp"
|
||||
/>
|
||||
|
||||
<DirectionalLayout
|
||||
ohos:height="match_content"
|
||||
ohos:width="match_parent"
|
||||
ohos:alignment="horizontal_center"
|
||||
ohos:orientation="horizontal">
|
||||
|
||||
<Image
|
||||
ohos:id="$+id:weather_icon_1"
|
||||
ohos:height="60vp"
|
||||
ohos:width="60vp"
|
||||
ohos:image_src="$media:sunshine"
|
||||
ohos:padding="5vp"
|
||||
ohos:scale_mode="inside"
|
||||
/>
|
||||
|
||||
<Text
|
||||
ohos:id="$+id:weather_1"
|
||||
ohos:height="match_content"
|
||||
ohos:width="match_content"
|
||||
ohos:right_margin="10vp"
|
||||
ohos:text="2保留"
|
||||
ohos:text_color="#FF000000"
|
||||
ohos:text_size="12fp"
|
||||
/>
|
||||
|
||||
<Text
|
||||
ohos:id="$+id:temperature_1"
|
||||
ohos:height="match_content"
|
||||
ohos:width="match_content"
|
||||
ohos:text="2保留"
|
||||
ohos:text_color="#FF000000"
|
||||
ohos:text_size="20fp"
|
||||
ohos:top_padding="8vp"
|
||||
/>
|
||||
</DirectionalLayout>
|
||||
|
||||
<Text
|
||||
ohos:id="$+id:tips_1"
|
||||
ohos:height="match_content"
|
||||
ohos:width="match_content"
|
||||
ohos:layout_alignment="horizontal_center"
|
||||
ohos:left_margin="10vp"
|
||||
ohos:right_margin="10vp"
|
||||
ohos:text="2保留"
|
||||
ohos:text_color="#FF3A6B53"
|
||||
ohos:text_size="12vp"
|
||||
/>
|
||||
|
||||
<ListContainer
|
||||
ohos:id="$+id:list"
|
||||
ohos:height="match_parent"
|
||||
ohos:width="match_parent"
|
||||
ohos:top_margin="20vp"
|
||||
/>
|
||||
|
||||
</DirectionalLayout>
|
||||
11
Weather/entry/src/main/resources/base/layout/item_title.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Text
|
||||
xmlns:ohos="http://schemas.huawei.com/res/ohos"
|
||||
ohos:id="$+id:city_item"
|
||||
ohos:height="match_content"
|
||||
ohos:width="match_content"
|
||||
ohos:background_element="#70000000"
|
||||
ohos:margin="2vp"
|
||||
ohos:padding="6vp"
|
||||
ohos:text_color="#3fffff"
|
||||
ohos:text_size="12vp"/>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<DirectionalLayout
|
||||
xmlns:ohos="http://schemas.huawei.com/res/ohos"
|
||||
ohos:height="match_content"
|
||||
ohos:width="match_parent"
|
||||
ohos:alignment="horizontal_center"
|
||||
ohos:orientation="horizontal"/>
|
||||
BIN
Weather/entry/src/main/resources/base/media/bg1.png
Normal file
|
After Width: | Height: | Size: 368 KiB |
BIN
Weather/entry/src/main/resources/base/media/cloudy.png
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
Weather/entry/src/main/resources/base/media/icon.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
Weather/entry/src/main/resources/base/media/overcast.png
Normal file
|
After Width: | Height: | Size: 31 KiB |
BIN
Weather/entry/src/main/resources/base/media/rain.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
Weather/entry/src/main/resources/base/media/snow.png
Normal file
|
After Width: | Height: | Size: 37 KiB |
BIN
Weather/entry/src/main/resources/base/media/sunshine.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
BIN
Weather/entry/src/main/resources/base/media/thunder.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
@@ -0,0 +1,14 @@
|
||||
package com.example.myapplication;
|
||||
|
||||
import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
public class ExampleOhosTest {
|
||||
@Test
|
||||
public void testBundleName() {
|
||||
final String actualBundleName = AbilityDelegatorRegistry.getArguments().getTestBundleName();
|
||||
assertEquals("com.example.myapplication", actualBundleName);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.example.myapplication;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class ExampleTest {
|
||||
@Test
|
||||
public void onStart() {
|
||||
}
|
||||
}
|
||||
13
Weather/gradle.properties
Normal file
@@ -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
Weather/gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
5
Weather/gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
@@ -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
|
||||
183
Weather/gradlew
vendored
Normal file
@@ -0,0 +1,183 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
#
|
||||
# Copyright 2015 the original author or 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 UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$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 "$*"
|
||||
}
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# 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
|
||||
;;
|
||||
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" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=`expr $i + 1`
|
||||
done
|
||||
case $i in
|
||||
0) set -- ;;
|
||||
1) set -- "$args0" ;;
|
||||
2) set -- "$args0" "$args1" ;;
|
||||
3) set -- "$args0" "$args1" "$args2" ;;
|
||||
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=`save "$@"`
|
||||
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
103
Weather/gradlew.bat
vendored
Normal file
@@ -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
Weather/package.json
Normal file
@@ -0,0 +1 @@
|
||||
{}
|
||||
1
Weather/settings.gradle
Normal file
@@ -0,0 +1 @@
|
||||
include ':entry'
|
||||