app/.gitignore
app/.idea/.gitignore
a-branch
zhoum 1 year ago
parent ef3f79aca4
commit 2b0849fac2

15
app/.gitignore vendored

@ -0,0 +1,15 @@
*.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
.cxx
local.properties

@ -0,0 +1,3 @@
# 默认忽略的文件
/shelf/
/workspace.xml

@ -0,0 +1,116 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<codeStyleSettings language="XML">
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
</indentOptions>
<arrangement>
<rules>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:android</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:id</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>style</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
<order>ANDROID_ATTRIBUTE_ORDER</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>.*</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
</rules>
</arrangement>
</codeStyleSettings>
</code_scheme>
</component>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="17" />
</component>
</project>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<value>
<entry key="app">
<State />
</entry>
</value>
</component>
</project>

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveExternalAnnotations" value="false" />
</GradleProjectSettings>
</option>
</component>
</project>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectMigrations">
<option name="MigrateToGradleLocalJavaHome">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
</component>
</project>

@ -0,0 +1,8 @@
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>

@ -0,0 +1,15 @@

java:S1192h"FDefine a constant instead of duplicating this literal "ansen" 3 times.(<28>ÂÉÎúÿÿÿÿJ$3766fed1-d9d0-45ba-9ff8-b5cae697bff5
i
java:S1604A"(Make this anonymous inner class a lambda(îÚ‰‡úÿÿÿÿJ$9b2d07a2-23d5-4a02-b138-ad7f5a30cd84

java:S1450 "VRemove the "webView" field and declare it as a local variable in the relevant methods.(„ ¿þÿÿÿÿJ$ff53e3c4-67ba-4014-863c-7ce0f217b3c9
{
java:S1161*":Add the "@Override" annotation above this method signature(î•ÉðûÿÿÿÿJ$faad1e2c-65c8-42ff-b0c9-10ce70ecf5ee
v java:S1258"<This block of commented-out lines of code should be removed.(”¦ƒJ$d377d72f-ba91-4c7f-bf9d-d76a62318c29
w java:S125V"<This block of commented-out lines of code should be removed.(å<>¹‡J$990218b1-6269-46f5-bdf6-3af0eeecb6e4

java:S1874g"JDon't override a deprecated method or explicitly mark it as "@Deprecated".(µÛΰüÿÿÿÿJ$935c752b-1651-4628-8361-d27e6ae3b3b7
|
java:S1874m"@Remove this use of "shouldOverrideUrlLoading"; it is deprecated.(ñ<>éÌJ$f7f41a53-7324-4070-adce-6ad12d78e718

@ -0,0 +1,45 @@

java:S1104"OMake URL a static final constant or non-public and provide accessors if needed.(¨Öð’8àËðŒ­2J$362e03f6-a985-41e0-ad06-050e7653d615

java:S1104"PMake HOST a static final constant or non-public and provide accessors if needed.(ŽÑ•àÿÿÿÿÿJ$c5c32a23-6534-4759-9ef4-eb592774fc0e

java:S1104"SMake isLogin a static final constant or non-public and provide accessors if needed.(Ý<C39D>íÿÿÿÿÿJ$4ae1af07-6ec7-4926-a6f5-074f2561d4e5
Š
java:S1104"NMake sp a static final constant or non-public and provide accessors if needed.(“±ƒ÷J$e7cc7d4d-b0bc-4705-8c5e-9020920bedf3

java:S1104"PMake gson a static final constant or non-public and provide accessors if needed.(ÛˆÛñþÿÿÿÿJ$74e57bb0-8e2c-4b66-ba72-0cee784e9a46

java:S1104"SMake sp_edit a static final constant or non-public and provide accessors if needed.(ž¡·éøÿÿÿÿJ$4b77c962-a702-4361-9c1d-fd54e25481ca

java:S1104"TMake userList a static final constant or non-public and provide accessors if needed.(Ü×ÀñûÿÿÿÿJ$464b914a-0bc9-4852-9baf-d884a23a8b1a
Œ
java:S1104"PMake user a static final constant or non-public and provide accessors if needed.(µ¿<C2B5>J$2beaf178-1808-41a4-bf6b-204710766252
l
java:S1444")Make this "public static URL" field final(¨Öð’8âËðŒ­2J$874d4f27-92e3-410b-865b-66b7ec79526d
k
java:S1444"*Make this "public static HOST" field final(ŽÑ•àÿÿÿÿÿJ$3566135b-2e96-41ab-aa4d-c941a49b0127
n
java:S1444"-Make this "public static isLogin" field final(Ý<C39D>íÿÿÿÿÿJ$6e0b9bef-3bfd-412b-9cf3-af209313f704
d
java:S1444"(Make this "public static sp" field final(“±ƒ÷J$2ff5632b-00d8-4c20-b05b-414d9a58fa34
k
java:S1444"*Make this "public static gson" field final(ÛˆÛñþÿÿÿÿJ$e03849b8-e5be-436c-8c8e-a421e20c0d83
n
java:S1444"-Make this "public static sp_edit" field final(ž¡·éøÿÿÿÿJ$839a7373-12fa-425d-b80a-a84c3a6697ff
o
java:S1444".Make this "public static userList" field final(Ü×ÀñûÿÿÿÿJ$49d65a98-67ed-4865-82ed-fdb2152f97c9
f
java:S1444"*Make this "public static user" field final(µ¿<C2B5>J$3707ab14-33c9-427c-a330-46d36f06f4a3

java:S3008"NRename this field "URL" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(¨Öð’8ðËðŒ­2J$af1c831a-6cca-4497-8a15-95a5a8cece7d
<EFBFBD>
java:S3008"ORename this field "HOST" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ŽÑ•àÿÿÿÿÿJ$043aa245-5b97-4bce-9938-2eb358cb24d3

java:S3008"RRename this field "sp_edit" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ž¡·éøÿÿÿÿJ$2d6679f8-02d9-4fd8-b353-5a4c3e954bd6
w
java:S2696"6Make the enclosing method "static" or remove this set.(•妸ùÿÿÿÿJ$906b9f10-64d4-48b9-be10-c7cc1a861ffb
w
java:S2696"6Make the enclosing method "static" or remove this set.(ÞäÄùÿÿÿÿJ$5ba019b8-faab-4a99-b3fc-3636548aced0
q
java:S2696"6Make the enclosing method "static" or remove this set.(·ðÒoJ$2583a007-ecd1-4800-88af-64eaf506dc32

@ -0,0 +1,19 @@
j
java:S1604["(Make this anonymous inner class a lambda(ô§ê8„ÆÕõ¬2J$6f4c50bf-4724-4840-9fcf-6951c0bda5fd
œ
java:S1450"TRemove the "login" field and declare it as a local variable in the relevant methods.(Ü£è…þÿÿÿÿ8Ò°Õõ¬2J$ce1cd2f0-9e28-4884-bd06-04ada0bc3105
š
java:S1450 "WRemove the "register" field and declare it as a local variable in the relevant methods.(Ô¨¸Ò8Ó°Õõ¬2J$33b02536-1c68-4b7e-8b10-f848e7cc72f3
~ java:S125?"<This block of commented-out lines of code should be removed.(é¸áÐ8žÐ×õ¬2J$6e93e3fc-ed4c-4042-ac67-ad73ace88b9b

java:S1854w"7Remove this useless assignment to local variable "msg".(¡Âª¼ûÿÿÿÿ8þÆÕõ¬2J$be599fa0-cfc5-420c-8d5c-503aeb8983b2
r java:S106t"+Replace this use of System.out by a logger.(ÒŠúÍøÿÿÿÿ8ÿÆÕõ¬2J$a7ee871b-4266-46e9-af7d-401d1105ed9f
p
java:S1481w"(Remove this unused "msg" local variable.(¡Âª¼ûÿÿÿÿ8€ÇÕõ¬2J$cfdde6cb-5082-4aff-9039-692caad3ce44
m java:S106}"+Replace this use of System.out by a logger.(<28>Àä8<>ÇÕõ¬2J$768a011e-99ea-40c8-b76b-80dc507184be
ƒ java:S125z"<This block of commented-out lines of code should be removed.(ߌ§–üÿÿÿÿ8ÇÕõ¬2J$ecb32036-9e89-4f63-a57a-f9370ba6454f

java:S2696"6Make the enclosing method "static" or remove this set.(·»¸ßýÿÿÿÿ8ƒÇÕõ¬2J$61784d19-4007-45f0-b565-ac8ddc5233ea
s java:S106"+Replace this use of System.out by a logger.(¼ËñØúÿÿÿÿ8„ÇÕõ¬2J$9be60fce-a3f9-4c39-9f7c-ba4edb541fbe
s java:S106Ž"+Replace this use of System.out by a logger.(ê‰ñŠûÿÿÿÿ8…ÇÕõ¬2J$62bfe7c8-27f3-4089-9f4b-7dbdb75530b1

@ -0,0 +1,16 @@

java:S1192n"FDefine a constant instead of duplicating this literal "ansen" 3 times.(<28>ÂÉÎúÿÿÿÿJ$370bb078-2ccc-4111-b9ec-faa4346d4627
i
java:S1604G"(Make this anonymous inner class a lambda(îÚ‰‡úÿÿÿÿJ$b2cd7ab0-50de-41dc-81b7-1aa0e4bb26fa

java:S1450%"VRemove the "webView" field and declare it as a local variable in the relevant methods.(„ ¿þÿÿÿÿJ$c599d787-d6f6-4adc-9868-8cccbcf76eaf
{
java:S1161/":Add the "@Override" annotation above this method signature(î•ÉðûÿÿÿÿJ$1f3324d3-1510-4106-834e-a0eb80e89357
w java:S1258"<This block of commented-out lines of code should be removed.(í¶ÿ²J$d4b0faef-6950-4004-9db3-8692281643d0
v java:S125>"<This block of commented-out lines of code should be removed.(”¦ƒJ$570cd87a-f8e0-49f1-b9a9-6a99776f6c9b
w java:S125\"<This block of commented-out lines of code should be removed.(å<>¹‡J$38c8f813-b7c4-4440-b75c-e611b2f6c6a6

java:S1874m"JDon't override a deprecated method or explicitly mark it as "@Deprecated".(µÛΰüÿÿÿÿJ$adedf99f-9a5b-40f8-b71c-1d3b80ddf248
|
java:S1874s"@Remove this use of "shouldOverrideUrlLoading"; it is deprecated.(ñ<>éÌJ$ea24c2a8-d2fa-49f0-abc3-e358350b815b

@ -0,0 +1,16 @@
k
java:S1604"(Make this anonymous inner class a lambda(ô§ê8¡ŸÓõ¬2J$9e30c453-8cff-4938-8289-be6d333fba92
œ
java:S1450!"TRemove the "login" field and declare it as a local variable in the relevant methods.(Ü£è…þÿÿÿÿ8ïŸÓõ¬2J$56a26637-ad1e-452d-a330-0fae57e325c8
š
java:S1450""WRemove the "register" field and declare it as a local variable in the relevant methods.(Ô¨¸Ò8ðŸÓõ¬2J$14f570ce-c533-43f8-8c2b-e200aa84921b

java:S18549"7Remove this useless assignment to local variable "msg".(¡Âª¼ûÿÿÿÿ8ýŸÓõ¬2J$62224c89-b2db-47ed-82c5-70e826c72077
r java:S1065"+Replace this use of System.out by a logger.(ÒŠúÍøÿÿÿÿ8þŸÓõ¬2J$c15e4d4a-01ca-461d-ae32-df93191f07c6
p
java:S14819"(Remove this unused "msg" local variable.(¡Âª¼ûÿÿÿÿ8ÿŸÓõ¬2J$97f5f193-df55-4442-b078-760ba240e2ce
m java:S106?"+Replace this use of System.out by a logger.(Ï€¢è8€ Óõ¬2J$08217325-c09b-44cd-89f5-ba14e473164e
m java:S106G"+Replace this use of System.out by a logger.(­ý†Á8<> Óõ¬2J$90881270-a2e1-4982-8180-f59df79a028f
r java:S106N"+Replace this use of System.out by a logger.(ê‰ñŠûÿÿÿÿ8<> Óõ¬2J$88c451a1-6f30-44de-8ea0-9bcd0b218da1
~ java:S125v"<This block of commented-out lines of code should be removed.(é¸áÐ8³¡Úõ¬2J$e0f401a6-1ddc-4d86-8160-37b49021bbca

@ -0,0 +1,22 @@
i
java:S1604)"(Make this anonymous inner class a lambda(˜³Ê€ýÿÿÿÿJ$078ea2ea-cfa2-4072-a2d1-fb6ccc9787a7

java:S1104>"TMake rootView a static final constant or non-public and provide accessors if needed.(“¾Ê¥øÿÿÿÿJ$4369ed43-185f-4de4-9b27-71e0e6dd86f3

java:S1104?"PMake user a static final constant or non-public and provide accessors if needed.(¶ï<C2B6>¿úÿÿÿÿJ$4b3cc300-d869-467c-ba7c-c8abacd9e7f1

java:S1104@"PMake exit a static final constant or non-public and provide accessors if needed.(†ð<E280A0>oJ$3e1d0bbe-cc18-41cd-964f-3aa19f610207

java:S1450"VRemove the "inflate" field and declare it as a local variable in the relevant methods.(äÆëÎJ$cb049d3b-5b2d-4d1a-b3a6-bc23e1366597
š
java:S1450"YRemove the "viewHolder" field and declare it as a local variable in the relevant methods.(ø§©šýÿÿÿÿJ$e6b1d344-3c08-4c8c-b180-4260309d48a7
w java:S125("<This block of commented-out lines of code should be removed.(ÏÆÜÓJ$7e9d147a-c452-4d73-8174-9d4bef048701
y
java:S2696,"6Make the enclosing method "static" or remove this set.(Ô‡ŽÌ8˜Žžö¬2J$b6d0d59c-5227-40c7-b84f-ae58e49982f5
y
java:S2696-"6Make the enclosing method "static" or remove this set.(€±’Œ8˜Žžö¬2J$76fd3495-a2a7-48c0-b5a5-b430f72dcf13
d
java:S11858"(Remove this method to simply inherit it.(Ö‰ü¼J$6c388cd8-295d-456b-9f79-a551837f1d0a
s
java:S1135:"2Complete the task associated to this TODO comment.(ûìÿÖøÿÿÿÿJ$7a5d4e35-ca53-4064-abb2-a87c547456e1

@ -0,0 +1,3 @@
<EFBFBD>
java:S3252"QUse static access with "android.view.ViewGroup" for "LAYOUT_MODE_OPTICAL_BOUNDS".(ã–ú¯J$9fc7accd-b0f0-467d-bb30-d39c576646a4

@ -0,0 +1,15 @@

java:S1192r"FDefine a constant instead of duplicating this literal "ansen" 3 times.(<28>ÂÉÎúÿÿÿÿJ$a05f0912-eba8-4606-9e7e-a83c8b193f0c
i
java:S1604K"(Make this anonymous inner class a lambda(îÚ‰‡úÿÿÿÿJ$fb9c260d-6ae4-4af8-8a86-34dfb091b628

java:S1450*"VRemove the "webView" field and declare it as a local variable in the relevant methods.(„ ¿þÿÿÿÿJ$abf8a600-a694-43d4-adae-be70cc98f75f
{
java:S11614":Add the "@Override" annotation above this method signature(î•ÉðûÿÿÿÿJ$5ef63366-0888-4f97-b7a5-6765ca4bbe0c
v java:S125B"<This block of commented-out lines of code should be removed.(”¦ƒJ$f8bd6b6f-22d7-4bd8-998e-d32aea2725ce
w java:S125`"<This block of commented-out lines of code should be removed.(å<>¹‡J$03af1c72-fae1-4277-aa27-b7cc2827cb1c

java:S1874q"JDon't override a deprecated method or explicitly mark it as "@Deprecated".(µÛΰüÿÿÿÿJ$b80ff96a-ab13-4387-9c60-0602b655d8a2
|
java:S1874w"@Remove this use of "shouldOverrideUrlLoading"; it is deprecated.(ñ<>éÌJ$b619e858-8882-4a02-98ad-6a06041ca3a8

@ -0,0 +1,49 @@
X
(gradle/wrapper/gradle-wrapper.properties,f\b\fbe448ebfc3eb2d4e308f6b8b043666f5b57235e
[
+app/src/main/java/com/example/code/App.java,3\2\3227a6deda5ec0d18533e18f239162badb05c9bb
@
app/build.gradle,f\4\f4a01d6a4fcb971362ec00a83903fd3902f52164
<
build.gradle,f\0\f07866736216be0ee2aba49e392191aeae700a35
?
settings.gradle,0\5\05efc8b1657769a27696d478ded1e95f38737233
@
local.properties,0\7\0712df971a99ac4d2fccb8e0fb19f377f3374cca
I
gradle/libs.versions.toml,d\7\d7595319a0658be6f1ed500ad590d42e4b28bc4f
P
app/src/main/AndroidManifest.xml,8\c\8c55c3ccc257e5907959013f99656e4c8ec3903e
l
<app/src/main/java/com/example/code/ui/home/HomeFragment.java,5\9\5937d71ddfdde678ca2424ce5289f9b4d9bea651
j
:app/src/main/java/com/example/code/ui/out/OutFragment.java,b\9\b97f66a73c0b084637612e77fb8c141aa2983850
h
8app/src/main/java/com/example/code/ui/sc/ScFragment.java,c\3\c34194b6e731f5de469e53f418fcc0a4e96796ca
h
8app/src/main/java/com/example/code/ui/wd/WdFragment.java,1\d\1dd5236d42b189b5ada41088c8eb5e454a5c6ea3
e
5app/src/main/java/com/example/code/LoginActivity.java,3\8\384771c067bc4c920e5405d7f79080b0987e2afe
d
4app/src/main/java/com/example/code/MainActivity.java,c\2\c2abc9626a3d9855b8aee3f86374a903008fb916
h
8app/src/main/java/com/example/code/RegisterActivity.java,5\b\5b6fbeb61201ce21ca2a95b1502e16260cdf7ece
i
9app/src/main/java/com/example/code/bien/GlobalResult.java,d\6\d64655ca5936f19d63534fc2b4019b16565a12f5
a
1app/src/main/java/com/example/code/bien/User.java,3\7\378c4365f861dece8433011cbdca3214a5b819b4
L
.idea/codeStyles/Project.xml,6\e\6ecd6000a7b6f4a2884412ff19f74193ed089648
Z
*.idea/modules/app/code.app.androidTest.iml,7\5\7500470d2eac01ec8c3d90eebae85d2f68ecce45
N
.idea/modules/app/code.app.iml,5\b\5b261ddf1c5d7152f800b86e9dd051c75a75f161
S
#.idea/modules/app/code.app.main.iml,5\c\5c869ab49432f4c21ed749c76ef3b4e0e54a5ae7
W
'.idea/modules/app/code.app.unitTest.iml,7\c\7cbf6cf43b18d6ff7fb9b48ffd88a6857df08adb
w
G.idea/sonarlint/issuestore/0/5/05efc8b1657769a27696d478ded1e95f38737233,3\c\3c8c56407c35e5f5ebbd6c7250a79af8128a13a6
w
G.idea/sonarlint/issuestore/0/7/0712df971a99ac4d2fccb8e0fb19f377f3374cca,4\1\41b281c57948ff2524af98ff9da00edd5725922c

@ -0,0 +1,49 @@
X
(gradle/wrapper/gradle-wrapper.properties,f\b\fbe448ebfc3eb2d4e308f6b8b043666f5b57235e
[
+app/src/main/java/com/example/code/App.java,3\2\3227a6deda5ec0d18533e18f239162badb05c9bb
@
app/build.gradle,f\4\f4a01d6a4fcb971362ec00a83903fd3902f52164
<
build.gradle,f\0\f07866736216be0ee2aba49e392191aeae700a35
?
settings.gradle,0\5\05efc8b1657769a27696d478ded1e95f38737233
@
local.properties,0\7\0712df971a99ac4d2fccb8e0fb19f377f3374cca
I
gradle/libs.versions.toml,d\7\d7595319a0658be6f1ed500ad590d42e4b28bc4f
P
app/src/main/AndroidManifest.xml,8\c\8c55c3ccc257e5907959013f99656e4c8ec3903e
l
<app/src/main/java/com/example/code/ui/home/HomeFragment.java,5\9\5937d71ddfdde678ca2424ce5289f9b4d9bea651
j
:app/src/main/java/com/example/code/ui/out/OutFragment.java,b\9\b97f66a73c0b084637612e77fb8c141aa2983850
h
8app/src/main/java/com/example/code/ui/sc/ScFragment.java,c\3\c34194b6e731f5de469e53f418fcc0a4e96796ca
h
8app/src/main/java/com/example/code/ui/wd/WdFragment.java,1\d\1dd5236d42b189b5ada41088c8eb5e454a5c6ea3
e
5app/src/main/java/com/example/code/LoginActivity.java,3\8\384771c067bc4c920e5405d7f79080b0987e2afe
d
4app/src/main/java/com/example/code/MainActivity.java,c\2\c2abc9626a3d9855b8aee3f86374a903008fb916
h
8app/src/main/java/com/example/code/RegisterActivity.java,5\b\5b6fbeb61201ce21ca2a95b1502e16260cdf7ece
i
9app/src/main/java/com/example/code/bien/GlobalResult.java,d\6\d64655ca5936f19d63534fc2b4019b16565a12f5
a
1app/src/main/java/com/example/code/bien/User.java,3\7\378c4365f861dece8433011cbdca3214a5b819b4
L
.idea/codeStyles/Project.xml,6\e\6ecd6000a7b6f4a2884412ff19f74193ed089648
Z
*.idea/modules/app/code.app.androidTest.iml,7\5\7500470d2eac01ec8c3d90eebae85d2f68ecce45
N
.idea/modules/app/code.app.iml,5\b\5b261ddf1c5d7152f800b86e9dd051c75a75f161
S
#.idea/modules/app/code.app.main.iml,5\c\5c869ab49432f4c21ed749c76ef3b4e0e54a5ae7
W
'.idea/modules/app/code.app.unitTest.iml,7\c\7cbf6cf43b18d6ff7fb9b48ffd88a6857df08adb
w
G.idea/sonarlint/issuestore/0/5/05efc8b1657769a27696d478ded1e95f38737233,3\c\3c8c56407c35e5f5ebbd6c7250a79af8128a13a6
w
G.idea/sonarlint/issuestore/0/7/0712df971a99ac4d2fccb8e0fb19f377f3374cca,4\1\41b281c57948ff2524af98ff9da00edd5725922c

@ -0,0 +1 @@
/build

@ -0,0 +1,49 @@
plugins {
alias(libs.plugins.androidApplication)
}
android {
namespace 'com.example.vote'
compileSdk 30
// buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.example.vote"
minSdk 16
targetSdk 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
implementation 'androidx.navigation:navigation-fragment:2.2.2'
implementation 'androidx.navigation:navigation-ui:2.2.2'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.2.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation files('libs/gson-2.8.0.jar')
implementation 'com.google.android.gms:play-services-plus:16.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'commons-httpclient:commons-httpclient:3.1'
implementation 'com.alibaba:fastjson:1.1.54.android'
}

Binary file not shown.

@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<!-- To access Google+ APIs: -->
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name="com.example.code.App"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:networkSecurityConfig="@xml/network_security_config"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Vote">
<activity
android:name="com.example.code.LoginActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.example.code.MainActivity" />
<activity android:name="com.example.code.RegisterActivity" />
</application>
</manifest>

@ -0,0 +1,35 @@
package com.example.code;
import android.app.Application;
import android.content.SharedPreferences;
import com.example.code.bien.User;
import com.google.gson.Gson;
import java.util.List;
public class App extends Application {
// public static String URL = "http://192.168.1.4:8026/"; //这个是要修改ip
// public static String URL = "http://10.11.181.239:8026/"; //这个是要修改ip
public static String URL = "http://10.8.39.108:8026/";
public static String HOST = URL + "myproject/app";
public static boolean isLogin = false;
public static SharedPreferences sp;
public static Gson gson;
public static SharedPreferences.Editor sp_edit;
public static List<User> userList;
public static User user;
@Override
public void onCreate() {
super.onCreate();
gson = new Gson();
sp = getSharedPreferences("sd", MODE_PRIVATE);
sp_edit = sp.edit();
sp_edit.putInt("voitId", 0).commit();
}
}

@ -0,0 +1,148 @@
package com.example.code;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Looper;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import androidx.annotation.Nullable;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.example.code.bien.User;
import com.example.code.http.HttpUtlis;
import com.example.code.http.OnResponseListner;
import com.example.vote.R;
import java.util.HashMap;
import java.util.Map;
/**
*
*/
public class LoginActivity extends Activity implements View.OnClickListener {
private EditText username; //用户名输入框
private EditText password; //密码输入框
private Button login; //登陆按钮
private Button register; //注册按钮
//页面创建
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
initView();
}
//页面内容初始化方法
private void initView() {
username = (EditText) findViewById(R.id.username);
password = (EditText) findViewById(R.id.password);
login = (Button) findViewById(R.id.login);
register = (Button) findViewById(R.id.register);
login.setOnClickListener(this);
register.setOnClickListener(this);
}
//按钮点击事件绑定
@Override
public void onClick(View v) {
if (v.getId() == R.id.login){
submit();
}
if (v.getId() == R.id.register){
startActivity(new Intent(getApplicationContext(), RegisterActivity.class));
}
// switch (v.getId()) {
// case R.id.login:
//
// break;
// case R.id.register:
// //跳转注册页面
//
// break;
// }
}
//登陆请求提交
private void submit() {
// validate
String usernameString = username.getText().toString().trim();
//判断用户名是否为空 为空则进行提示 并终止操作
if (TextUtils.isEmpty(usernameString)) {
Toast.makeText(this, "用户名错误", Toast.LENGTH_SHORT).show();
return;
}
//判断密码是否为空
String passwordString = password.getText().toString().trim();
if (TextUtils.isEmpty(passwordString)) {
Toast.makeText(this, "密码错误", Toast.LENGTH_SHORT).show();
return;
}
//使用多线程执行提交操作
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
//在这填上您原来的代码即可
loginSubmit();
finish();
}
});
thread.start();
}
public void loginSubmit() {
//登陆请求地址
String url = App.HOST + "/loginSubmit";
Map<String, String> map = new HashMap<>();
map.put("username", username.getText().toString());
map.put("password", password.getText().toString());
//执行http远程登陆请求
HttpUtlis.postRequest(url, map, new OnResponseListner() {
//http请求成功执行
@Override
public void onSucess(String response) {
//执行登陆请求成功 解析返回json内容
System.out.println("response = " + response);
JSONObject object = JSON.parseObject(response);
Integer status = object.getInteger("status");
String msg = object.getString("msg");
String data = object.getString("data");
if (status == 200) {
/*Looper.prepare();
Toast.makeText(getApplicationContext(), "登录成功", Toast.LENGTH_SHORT).show();
Looper.loop();*/
System.out.println("登录成功");
//更新界面
User user = JSON.parseObject(data, User.class);
App.user = user;
startActivity(new Intent(getApplicationContext(), MainActivity.class));
finish();
} else {
Looper.prepare();
Toast.makeText(getApplicationContext(), "登录失败", Toast.LENGTH_SHORT).show();
Looper.loop();
System.out.println("登录失败");
}
}
//http请求出错执行方法
@Override
public void onError(String error) {
System.out.println("error = " + error);
}
});
}
}

@ -0,0 +1,34 @@
package com.example.code;
import android.annotation.SuppressLint;
import android.os.Bundle;
import com.example.vote.R;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.navigation.NavController;
import androidx.navigation.Navigation;
import androidx.navigation.ui.AppBarConfiguration;
import androidx.navigation.ui.NavigationUI;
public class MainActivity extends AppCompatActivity {
@SuppressLint("WrongConstant")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
BottomNavigationView navView = findViewById(R.id.nav_view);
// Passing each menu ID as a set of Ids because each
// menu should be considered as top level destinations.
navView.setLabelVisibilityMode(BottomNavigationView.LAYOUT_MODE_OPTICAL_BOUNDS);
AppBarConfiguration appBarConfiguration = new AppBarConfiguration.Builder(
R.id.navigation_home, R.id.navigation_sc, R.id.navigation_wd)
.build();
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
NavigationUI.setupActionBarWithNavController(this, navController, appBarConfiguration);
NavigationUI.setupWithNavController(navView, navController);
}
}

@ -0,0 +1,162 @@
package com.example.code;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Looper;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import androidx.annotation.Nullable;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.example.code.http.HttpUtlis;
import com.example.code.http.OnResponseListner;
import java.util.HashMap;
import java.util.Map;
import com.example.vote.R;
/**
*
*/
public class RegisterActivity extends Activity implements View.OnClickListener {
private EditText username; //注册用户名框
private EditText password;//注册密码框
private EditText tlep; //注册电话框
private EditText intro; //简介
private EditText idcard; //身份证
private Button login;//登陆按钮
private Button register;//注册按钮
//执行注册提交方法
public void registerSubmit() {
//注册请求地址
String url = App.HOST + "/registerSubmit";
//使用map集合传递参数
Map<String, String> map = new HashMap<>();
map.put("username", username.getText().toString());
map.put("password", password.getText().toString());
map.put("tlep", tlep.getText().toString());
map.put("intro", intro.getText().toString());
map.put("idcard", idcard.getText().toString());
//执行http注册请求
HttpUtlis.postRequest(url, map, new OnResponseListner() {
//http请求成功
@Override
public void onSucess(String response) {
System.out.println("response = " + response);
//解析返回的json内容
JSONObject object = JSON.parseObject(response);
Integer status = object.getInteger("status");
String msg = object.getString("msg");
//状态为200代表注册成功
if (status == 200) {
Looper.prepare();
Toast.makeText(getApplicationContext(), "注册成功", Toast.LENGTH_SHORT).show();
Looper.loop();
System.out.println("注册成功");
//更新界面
finish();
} else {
Looper.prepare();
Toast.makeText(getApplicationContext(), "注册失败", Toast.LENGTH_SHORT).show();
Looper.loop();
System.out.println("注册失败");
}
}
//http请求失败
@Override
public void onError(String error) {
System.out.println("error = " + error);
}
});
}
//界面创建
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register);
initView();
}
//界面初始化
private void initView() {
username = (EditText) findViewById(R.id.username);
password = (EditText) findViewById(R.id.password);
tlep = (EditText) findViewById(R.id.tlep);
intro = (EditText) findViewById(R.id.intro);
idcard = (EditText) findViewById(R.id.idcard);
login = (Button) findViewById(R.id.login);
register = (Button) findViewById(R.id.register);
login.setOnClickListener(this);
register.setOnClickListener(this);
}
//按钮点击事件绑定
@Override
public void onClick(View v) {
if (v.getId() == R.id.login){
submit();
}
if (v.getId() == R.id.register){
finish();
}
// switch (v.getId()) {
// case R.id.login:
// submit();
// break;
// case R.id.register:
// finish();
// break;
// }
}
//点击注册按钮提交执行方法
private void submit() {
// validate
String usernameString = username.getText().toString().trim();
if (TextUtils.isEmpty(usernameString)) {
Toast.makeText(this, "用户名", Toast.LENGTH_SHORT).show();
return;
}
String passwordString = password.getText().toString().trim();
if (TextUtils.isEmpty(passwordString)) {
Toast.makeText(this, "密码", Toast.LENGTH_SHORT).show();
return;
}
String tlepString = tlep.getText().toString().trim();
if (TextUtils.isEmpty(tlepString)) {
Toast.makeText(this, "手机号", Toast.LENGTH_SHORT).show();
return;
}
//使用多线程进行http请求 防止界面卡死
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
//调用注册提交http请求
registerSubmit();
}
});
thread.start();
}
}

@ -0,0 +1,107 @@
package com.example.code.bien;
/**
* @Description:
* ios
* 使list
*
* 200
* 500msg
* 501beanmap
* 502token
* 555
*/
public class GlobalResult {
// 响应业务状态
private Integer status;
// 响应消息
private String msg;
// 响应中的数据
private Object data;
private String ok; // 不使用
public static GlobalResult build(Integer status, String msg, Object data) {
return new GlobalResult(status, msg, data);
}
public static GlobalResult ok(Object data) {
return new GlobalResult(data);
}
public static GlobalResult ok() {
return new GlobalResult(null);
}
public static GlobalResult errorMsg(String msg) {
return new GlobalResult(500, msg, null);
}
public static GlobalResult errorMap(Object data) {
return new GlobalResult(501, "error", data);
}
public static GlobalResult errorTokenMsg(String msg) {
return new GlobalResult(502, msg, null);
}
public static GlobalResult errorException(String msg) {
return new GlobalResult(555, msg, null);
}
public GlobalResult() {
}
public GlobalResult(Integer status, String msg, Object data) {
this.status = status;
this.msg = msg;
this.data = data;
}
public GlobalResult(Object data) {
this.status = 200;
this.msg = "OK";
this.data = data;
}
public Boolean isOK() {
return this.status == 200;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
public String getOk() {
return ok;
}
public void setOk(String ok) {
this.ok = ok;
}
}

@ -0,0 +1,128 @@
package com.example.code.bien;
import java.io.Serializable;
public class User implements Serializable {
/**
* ID
*/
private Integer id;
/**
*
*/
private String name;
/**
*
*/
private String phone;
/**
*
*/
private String picurl;
/**
*
*/
private String email;
/**
*
*/
private String role;
/**
*
*/
private String sex;
/**
*
*/
private String password;
/**
*
*/
private String intro;
/**
*
*/
private Integer money;
public Integer getMoney() {
return money;
}
public void setMoney(Integer money) {
this.money = money;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getPicurl() {
return picurl;
}
public void setPicurl(String picurl) {
this.picurl = picurl;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getIntro() {
return intro;
}
public void setIntro(String intro) {
this.intro = intro;
}
}

@ -0,0 +1,107 @@
package com.example.code.http;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Map;
public class HttpUtlis {
/**
*get
*/
public static void getRequest(String url, Map<String,String> params, OnResponseListner listner) {
String encode = "utf-8";
System.out.println( "请求地址 url = " + url);
System.out.println(" 发送参数 params = " + params);
StringBuffer sb = new StringBuffer(url);
sb.append("?");
if (params!=null && !params.isEmpty()){
for (Map.Entry<String,String> entry:params.entrySet()) { //增强for遍历循环添加拼接请求内容
sb.append(entry.getKey()).append("=").append(entry.getValue()).append("&");
}
sb.deleteCharAt(sb.length()-1);
if (listner!=null) {
try {
System.out.println(" 请求地址 = " + sb.toString());
URL path = new URL(sb.toString());
if (path!=null) {
HttpURLConnection con = (HttpURLConnection) path.openConnection();
con.setRequestMethod("GET"); //设置请求方式
con.setConnectTimeout(3000); //链接超时3秒
con.setDoOutput(true);
con.setDoInput(true);
OutputStream os = con.getOutputStream();
os.write(sb.toString().getBytes(encode));
os.close();
if (con.getResponseCode() == 200) { //应答码200表示请求成功
onSucessResopond(encode, listner, con);
}
}
} catch (Exception error) {
error.printStackTrace();
onError(listner, error);
}
}
}
}
/**
* POST
*/
public static void postRequest(String url,Map<String,String> params,OnResponseListner listner){
System.out.println( "请求地址 url = " + url);
System.out.println(" 发送参数 params = " + params);
String encode = "utf-8";
StringBuffer sb = new StringBuffer();
if (params!=null && !params.isEmpty()){
for (Map.Entry<String,String> entry: params.entrySet()) {
sb.append(entry.getKey()).append("=").append(entry.getValue()).append("&");
}
sb.deleteCharAt(sb.length()-1);
}
if (listner!=null) {
try {
URL path = new URL(url);
if (path!=null){
HttpURLConnection con = (HttpURLConnection) path.openConnection();
con.setRequestMethod("POST"); //设置请求方法POST
con.setConnectTimeout(3000);
con.setDoOutput(true);
con.setDoInput(true);
byte[] bytes = sb.toString().getBytes();
OutputStream outputStream = con.getOutputStream();
outputStream.write(bytes);
outputStream.close();
if (con.getResponseCode()==200){
onSucessResopond(encode, listner, con);
}
}
} catch (Exception e) {
e.printStackTrace();
onError(listner, e);
}
}
}
private static void onError(OnResponseListner listner,Exception onError) {
listner.onError(onError.toString());
}
private static void onSucessResopond(String encode, OnResponseListner listner, HttpURLConnection con) throws IOException {
InputStream inputStream = con.getInputStream();
ByteArrayOutputStream baos = new ByteArrayOutputStream();//创建内存输出流
int len = 0;
byte[] bytes = new byte[1024];
if (inputStream != null) {
while ((len = inputStream.read(bytes)) != -1) {
baos.write(bytes, 0, len);
}
String str = new String(baos.toByteArray(), encode);
listner.onSucess(str);
}
}
}

@ -0,0 +1,6 @@
package com.example.code.http;
public interface OnResponseListner {
void onSucess(String response);
void onError(String error);
}

@ -0,0 +1,163 @@
package com.example.code.ui.home;
import android.app.AlertDialog;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.DownloadListener;
import android.webkit.JavascriptInterface;
import android.webkit.JsResult;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider;
import com.example.code.App;
import com.example.code.LoginActivity;
import com.example.code.ui.wd.WdFragment;
import com.example.vote.R;
public class HomeFragment extends Fragment {
private WebView webView;
private ProgressBar progressBar;
private void downloadByBrowser(String url) {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.addCategory(Intent.CATEGORY_BROWSABLE);
intent.setData(Uri.parse(url));
startActivity(intent);
}
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
View view = View.inflate(getContext(), R.layout.wd_fragment, null);
progressBar = (ProgressBar) view.findViewById(R.id.progressbar);//进度条
webView = (WebView) view.findViewById(R.id.webview);
// webView.loadUrl("file:///android_asset/test.html");//加载asset文件夹下html
//String url = App.URL + "/myproject/AppIndex?uid=" + App.user.getId() + "&page=productList";
String url = App.URL + "/myproject/AppIndex?uid=" + App.user.getId() + "&page=phone";
webView.loadUrl(url);//加载url
//使用webview显示html代码
// webView.loadDataWithBaseURL(null,"<html><head><title> 欢迎您 </title></head>" +
// "<body><h2>使用webview显示 html代码</h2></body></html>", "text/html" , "utf-8", null);
webView.addJavascriptInterface(this, "android");//添加js监听 这样html就能调用客户端
webView.setWebChromeClient(webChromeClient);
webView.setWebViewClient(webViewClient);
WebSettings webSettings = webView.getSettings();
webSettings.setJavaScriptEnabled(true);//允许使用js
webView.setDownloadListener(new DownloadListener() {
@Override
public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) {
downloadByBrowser(url);
}
});
/**
* LOAD_CACHE_ONLY: 使
* LOAD_DEFAULT: cache-control
* LOAD_NO_CACHE: 使.
* LOAD_CACHE_ELSE_NETWORKno-cache使
*/
webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);//不使用缓存,只从网络获取数据.
//支持屏幕缩放
webSettings.setSupportZoom(true);
webSettings.setBuiltInZoomControls(true);
//不显示webview缩放按钮
// webSettings.setDisplayZoomControls(false);
return view;
}
//WebViewClient主要帮助WebView处理各种通知、请求事件
private WebViewClient webViewClient = new WebViewClient() {
@Override
public void onPageFinished(WebView view, String url) {//页面加载完成
progressBar.setVisibility(View.GONE);
}
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {//页面开始加载
progressBar.setVisibility(View.VISIBLE);
}
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
Log.i("ansen", "拦截url:" + url);
if (url.equals("http://www.google.com/")) {
Toast.makeText(getContext(), "国内不能访问google,拦截该url", Toast.LENGTH_LONG).show();
return true;//表示我已经处理过了
}
return super.shouldOverrideUrlLoading(view, url);
}
};
//WebChromeClient主要辅助WebView处理Javascript的对话框、网站图标、网站title、加载进度等
private WebChromeClient webChromeClient = new WebChromeClient() {
//不支持js的alert弹窗需要自己监听然后通过dialog弹窗
@Override
public boolean onJsAlert(WebView webView, String url, String message, JsResult result) {
AlertDialog.Builder localBuilder = new AlertDialog.Builder(webView.getContext());
localBuilder.setMessage(message).setPositiveButton("确定", null);
localBuilder.setCancelable(false);
localBuilder.create().show();
//注意:
//必须要这一句代码:result.confirm()表示:
//处理结果为确定状态同时唤醒WebCore线程
//否则不能继续点击按钮
result.confirm();
return true;
}
//获取网页标题
@Override
public void onReceivedTitle(WebView view, String title) {
super.onReceivedTitle(view, title);
Log.i("ansen", "网页标题:" + title);
}
//加载进度回调
@Override
public void onProgressChanged(WebView view, int newProgress) {
progressBar.setProgress(newProgress);
}
};
/**
* JSandroid
*
* @param str
* @return
*/
@JavascriptInterface //仍然必不可少
public void getClient(String str) {
Log.i("ansen", "html调用客户端:" + str);
}
}

@ -0,0 +1,73 @@
package com.example.code.ui.out;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import com.example.code.App;
import com.example.code.LoginActivity;
import com.example.code.ui.wd.WdFragment;
import com.example.vote.R;
public class OutFragment extends Fragment {
private View inflate;
private ViewHolder viewHolder;
public static OutFragment newInstance() {
return new OutFragment();
}
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
inflate = inflater.inflate(R.layout.out_fragment, container, false);
viewHolder = new ViewHolder(inflate);
//viewHolder.user.setText("用户名:");
viewHolder.exit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
App.isLogin = false;
App.user = null;
startActivity(new Intent(getContext(), LoginActivity.class));
getActivity().finish();
}
});
return inflate;
}
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
// TODO: Use the ViewModel
}
class ViewHolder {
public View rootView;
public TextView user;
public Button exit;
public ViewHolder(View rootView) {
this.rootView = rootView;
this.user = (TextView) rootView.findViewById(R.id.user);
this.exit = (Button) rootView.findViewById(R.id.exit);
}
}
}

@ -0,0 +1,167 @@
package com.example.code.ui.sc;
import android.app.AlertDialog;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.os.Looper;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.DownloadListener;
import android.webkit.JavascriptInterface;
import android.webkit.JsResult;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ProgressBar;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.example.code.App;
import com.example.code.bien.User;
import com.example.code.http.HttpUtlis;
import com.example.code.http.OnResponseListner;
import com.example.vote.R;
import java.util.HashMap;
import java.util.Map;
public class ScFragment extends Fragment {
private WebView webView;
private ProgressBar progressBar;
private void downloadByBrowser(String url) {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.addCategory(Intent.CATEGORY_BROWSABLE);
intent.setData(Uri.parse(url));
startActivity(intent);
}
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
View view = View.inflate(getContext(), R.layout.wd_fragment, null);
progressBar = (ProgressBar) view.findViewById(R.id.progressbar);//进度条
webView = (WebView) view.findViewById(R.id.webview);
// webView.loadUrl("file:///android_asset/test.html");//加载asset文件夹下html
String url = App.URL + "/myproject/AppIndex?uid=" + App.user.getId() + "&page=infoList";
webView.loadUrl(url);//加载url
//使用webview显示html代码
// webView.loadDataWithBaseURL(null,"<html><head><title> 欢迎您 </title></head>" +
// "<body><h2>使用webview显示 html代码</h2></body></html>", "text/html" , "utf-8", null);
webView.addJavascriptInterface(this, "android");//添加js监听 这样html就能调用客户端
webView.setWebChromeClient(webChromeClient);
webView.setWebViewClient(webViewClient);
WebSettings webSettings = webView.getSettings();
webSettings.setJavaScriptEnabled(true);//允许使用js
webView.setDownloadListener(new DownloadListener() {
@Override
public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) {
downloadByBrowser(url);
}
});
/**
* LOAD_CACHE_ONLY: 使
* LOAD_DEFAULT: cache-control
* LOAD_NO_CACHE: 使.
* LOAD_CACHE_ELSE_NETWORKno-cache使
*/
webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);//不使用缓存,只从网络获取数据.
//支持屏幕缩放
webSettings.setSupportZoom(true);
webSettings.setBuiltInZoomControls(true);
//不显示webview缩放按钮
// webSettings.setDisplayZoomControls(false);
return view;
}
//WebViewClient主要帮助WebView处理各种通知、请求事件
private WebViewClient webViewClient = new WebViewClient() {
@Override
public void onPageFinished(WebView view, String url) {//页面加载完成
progressBar.setVisibility(View.GONE);
}
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {//页面开始加载
progressBar.setVisibility(View.VISIBLE);
}
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
Log.i("ansen", "拦截url:" + url);
if (url.equals("http://www.google.com/")) {
Toast.makeText(getContext(), "国内不能访问google,拦截该url", Toast.LENGTH_LONG).show();
return true;//表示我已经处理过了
}
return super.shouldOverrideUrlLoading(view, url);
}
};
//WebChromeClient主要辅助WebView处理Javascript的对话框、网站图标、网站title、加载进度等
private WebChromeClient webChromeClient = new WebChromeClient() {
//不支持js的alert弹窗需要自己监听然后通过dialog弹窗
@Override
public boolean onJsAlert(WebView webView, String url, String message, JsResult result) {
AlertDialog.Builder localBuilder = new AlertDialog.Builder(webView.getContext());
localBuilder.setMessage(message).setPositiveButton("确定", null);
localBuilder.setCancelable(false);
localBuilder.create().show();
//注意:
//必须要这一句代码:result.confirm()表示:
//处理结果为确定状态同时唤醒WebCore线程
//否则不能继续点击按钮
result.confirm();
return true;
}
//获取网页标题
@Override
public void onReceivedTitle(WebView view, String title) {
super.onReceivedTitle(view, title);
Log.i("ansen", "网页标题:" + title);
}
//加载进度回调
@Override
public void onProgressChanged(WebView view, int newProgress) {
progressBar.setProgress(newProgress);
}
};
/**
* JSandroid
*
* @param str
* @return
*/
@JavascriptInterface //仍然必不可少
public void getClient(String str) {
Log.i("ansen", "html调用客户端:" + str);
}
}

@ -0,0 +1,158 @@
package com.example.code.ui.wd;
import android.app.AlertDialog;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.DownloadListener;
import android.webkit.JavascriptInterface;
import android.webkit.JsResult;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ProgressBar;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import com.example.code.App;
import com.example.code.MainActivity;
import com.example.vote.R;
public class WdFragment extends Fragment {
private WebView webView;
private ProgressBar progressBar;
private void downloadByBrowser(String url) {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.addCategory(Intent.CATEGORY_BROWSABLE);
intent.setData(Uri.parse(url));
startActivity(intent);
}
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
View view = View.inflate(getContext(), R.layout.wd_fragment, null);
progressBar = (ProgressBar) view.findViewById(R.id.progressbar);//进度条
webView = (WebView) view.findViewById(R.id.webview);
// webView.loadUrl("file:///android_asset/test.html");//加载asset文件夹下html
String url = App.URL + "/myproject/AppIndex?uid=" + App.user.getId() + "&page=index";
webView.loadUrl(url);//加载url
//使用webview显示html代码
// webView.loadDataWithBaseURL(null,"<html><head><title> 欢迎您 </title></head>" +
// "<body><h2>使用webview显示 html代码</h2></body></html>", "text/html" , "utf-8", null);
webView.addJavascriptInterface(this, "android");//添加js监听 这样html就能调用客户端
webView.setWebChromeClient(webChromeClient);
webView.setWebViewClient(webViewClient);
WebSettings webSettings = webView.getSettings();
webSettings.setJavaScriptEnabled(true);//允许使用js
webView.setDownloadListener(new DownloadListener() {
@Override
public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) {
downloadByBrowser(url);
}
});
/**
* LOAD_CACHE_ONLY: 使
* LOAD_DEFAULT: cache-control
* LOAD_NO_CACHE: 使.
* LOAD_CACHE_ELSE_NETWORKno-cache使
*/
webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);//不使用缓存,只从网络获取数据.
//支持屏幕缩放
webSettings.setSupportZoom(true);
webSettings.setBuiltInZoomControls(true);
//不显示webview缩放按钮
// webSettings.setDisplayZoomControls(false);
return view;
}
//WebViewClient主要帮助WebView处理各种通知、请求事件
private WebViewClient webViewClient = new WebViewClient() {
@Override
public void onPageFinished(WebView view, String url) {//页面加载完成
progressBar.setVisibility(View.GONE);
}
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {//页面开始加载
progressBar.setVisibility(View.VISIBLE);
}
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
Log.i("ansen", "拦截url:" + url);
if (url.equals("http://www.google.com/")) {
Toast.makeText(getContext(), "国内不能访问google,拦截该url", Toast.LENGTH_LONG).show();
return true;//表示我已经处理过了
}
return super.shouldOverrideUrlLoading(view, url);
}
};
//WebChromeClient主要辅助WebView处理Javascript的对话框、网站图标、网站title、加载进度等
private WebChromeClient webChromeClient = new WebChromeClient() {
//不支持js的alert弹窗需要自己监听然后通过dialog弹窗
@Override
public boolean onJsAlert(WebView webView, String url, String message, JsResult result) {
AlertDialog.Builder localBuilder = new AlertDialog.Builder(webView.getContext());
localBuilder.setMessage(message).setPositiveButton("确定", null);
localBuilder.setCancelable(false);
localBuilder.create().show();
//注意:
//必须要这一句代码:result.confirm()表示:
//处理结果为确定状态同时唤醒WebCore线程
//否则不能继续点击按钮
result.confirm();
return true;
}
//获取网页标题
@Override
public void onReceivedTitle(WebView view, String title) {
super.onReceivedTitle(view, title);
Log.i("ansen", "网页标题:" + title);
}
//加载进度回调
@Override
public void onProgressChanged(WebView view, int newProgress) {
progressBar.setProgress(newProgress);
}
};
/**
* JSandroid
*
* @param str
* @return
*/
@JavascriptInterface //仍然必不可少
public void getClient(String str) {
Log.i("ansen", "html调用客户端:" + str);
}
}

@ -0,0 +1,30 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="85.84757"
android:endY="92.4963"
android:startX="42.9492"
android:startY="49.59793"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<stroke
android:color="#ccc"
android:width="1dp" />
<solid android:color="#fff" />
<corners android:radius="15dp" />
</shape>

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="#2196F3"
android:pathData="M12,12m-8,0a8,8 0,1 1,16 0a8,8 0,1 1,-16 0"/>
</vector>

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="#FFFFFF"
android:pathData="M15.41,16.59L10.83,12l4.58,-4.59L14,6l-6,6 6,6 1.41,-1.41z"/>
</vector>

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="#FFFFFF"
android:pathData="M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM18.92,8h-2.95c-0.32,-1.25 -0.78,-2.45 -1.38,-3.56 1.84,0.63 3.37,1.91 4.33,3.56zM12,4.04c0.83,1.2 1.48,2.53 1.91,3.96h-3.82c0.43,-1.43 1.08,-2.76 1.91,-3.96zM4.26,14C4.1,13.36 4,12.69 4,12s0.1,-1.36 0.26,-2h3.38c-0.08,0.66 -0.14,1.32 -0.14,2 0,0.68 0.06,1.34 0.14,2L4.26,14zM5.08,16h2.95c0.32,1.25 0.78,2.45 1.38,3.56 -1.84,-0.63 -3.37,-1.9 -4.33,-3.56zM8.03,8L5.08,8c0.96,-1.66 2.49,-2.93 4.33,-3.56C8.81,5.55 8.35,6.75 8.03,8zM12,19.96c-0.83,-1.2 -1.48,-2.53 -1.91,-3.96h3.82c-0.43,1.43 -1.08,2.76 -1.91,3.96zM14.34,14L9.66,14c-0.09,-0.66 -0.16,-1.32 -0.16,-2 0,-0.68 0.07,-1.35 0.16,-2h4.68c0.09,0.65 0.16,1.32 0.16,2 0,0.68 -0.07,1.34 -0.16,2zM14.59,19.56c0.6,-1.11 1.06,-2.31 1.38,-3.56h2.95c-0.96,1.65 -2.49,2.93 -4.33,3.56zM16.36,14c0.08,-0.66 0.14,-1.32 0.14,-2 0,-0.68 -0.06,-1.34 -0.14,-2h3.38c0.16,0.64 0.26,1.31 0.26,2s-0.1,1.36 -0.26,2h-3.38z"/>
</vector>

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="#FF000000"
android:pathData="M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM12,20c-4.42,0 -8,-3.58 -8,-8s3.58,-8 8,-8 8,3.58 8,8 -3.58,8 -8,8zM15.5,11c0.83,0 1.5,-0.67 1.5,-1.5S16.33,8 15.5,8 14,8.67 14,9.5s0.67,1.5 1.5,1.5zM8.5,11c0.83,0 1.5,-0.67 1.5,-1.5S9.33,8 8.5,8 7,8.67 7,9.5 7.67,11 8.5,11zM12,17.5c2.33,0 4.31,-1.46 5.11,-3.5L6.89,14c0.8,2.04 2.78,3.5 5.11,3.5z"/>
</vector>

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="#FFFFFF"
android:pathData="M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM12,20c-4.42,0 -8,-3.58 -8,-8s3.58,-8 8,-8 8,3.58 8,8 -3.58,8 -8,8zM15.5,11c0.83,0 1.5,-0.67 1.5,-1.5S16.33,8 15.5,8 14,8.67 14,9.5s0.67,1.5 1.5,1.5zM8.5,11c0.83,0 1.5,-0.67 1.5,-1.5S9.33,8 8.5,8 7,8.67 7,9.5 7.67,11 8.5,11zM12,14c-2.33,0 -4.31,1.46 -5.11,3.5h10.22c-0.8,-2.04 -2.78,-3.5 -5.11,-3.5z"/>
</vector>

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="#ffffff"
android:pathData="M12,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM12,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z"/>
</vector>

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M3,13h8L11,3L3,3v10zM3,21h8v-6L3,15v6zM13,21h8L21,11h-8v10zM13,3v6h8L21,3h-8z" />
</vector>

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="#2196F3"
android:pathData="M12,12m-8,0a8,8 0,1 1,16 0a8,8 0,1 1,-16 0"/>
</vector>

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M10,20v-6h4v6h5v-8h3L12,3 2,12h3v8z" />
</vector>

@ -0,0 +1,170 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M12,22c1.1,0 2,-0.9 2,-2h-4c0,1.1 0.89,2 2,2zM18,16v-5c0,-3.07 -1.64,-5.64 -4.5,-6.32L13.5,4c0,-0.83 -0.67,-1.5 -1.5,-1.5s-1.5,0.67 -1.5,1.5v0.68C7.63,5.36 6,7.92 6,11v5l-2,2v1h16v-1l-2,-2z" />
</vector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#EEEEEE" />
<stroke android:width="3dp" android:color="#EEEEEE" />
<corners android:radius="0dp" />
<padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp" />
</shape>

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/login"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:text="用户登录"
android:textColor="#fff"
android:gravity="center"
android:textSize="18dp"
android:background="#90673AB7"
android:layout_height="50dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
android:paddingLeft="30dp"
android:paddingRight="30dp"
tools:context=".act.LoginActivity"
>
<EditText
android:text="test"
android:id="@+id/username"
android:layout_width="match_parent"
android:layout_height="50dp"
android:hint="用户名"
android:gravity="center"
android:maxLength="16"
android:inputType="text"
android:background="#77dddddd"
android:maxLines="1"
android:singleLine="true" />
<EditText
android:text="123456"
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center"
android:layout_marginTop="20dp"
android:hint="密码"
android:background="#77dddddd"
android:inputType="textPassword"
android:maxLength="16"
android:maxLines="1"
android:singleLine="true" />
<LinearLayout
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_marginTop="30dp"
android:layout_height="wrap_content">
<Button
android:layout_width="wrap_content"
android:layout_weight="1"
android:text="登录"
android:textSize="16dp"
android:id="@+id/login"
android:textColor="#fff"
android:background="#2196F3"
android:layout_height="wrap_content" />
<Button
android:layout_width="wrap_content"
android:layout_weight="1"
android:layout_marginLeft="40dp"
android:textSize="16dp"
android:textColor="#fff"
android:id="@+id/register"
android:text="注册"
android:background="#2196F3"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</LinearLayout>

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#fff">
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/nav_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="0dp"
android:layout_marginEnd="0dp"
android:background="?android:attr/windowBackground"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:menu="@menu/bottom_nav_menu" />
<fragment
android:id="@+id/nav_host_fragment"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:defaultNavHost="true"
app:layout_constraintBottom_toTopOf="@id/nav_view"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:navGraph="@navigation/mobile_navigation" />
</androidx.constraintlayout.widget.ConstraintLayout>

@ -0,0 +1,201 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/login"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:text="用户注册"
android:textColor="#fff"
android:gravity="center"
android:textSize="18dp"
android:background="#673AB7"
android:layout_height="50dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
android:paddingLeft="30dp"
android:paddingRight="30dp"
tools:context=".act.LoginActivity"
>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="50dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:text="编 号:"
android:textColor="#000"
android:textSize="20dp" />
<EditText
android:id="@+id/username"
android:layout_width="match_parent"
android:layout_height="50dp"
android:hint="编号"
android:gravity="center"
android:maxLength="16"
android:inputType="text"
android:background="#77dddddd"
android:maxLines="1"
android:singleLine="true" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_marginTop="10dp"
android:layout_height="50dp">
<TextView
android:text="密 码:"
android:gravity="center"
android:textColor="#000"
android:textSize="20dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"/>
<EditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="50dp"
android:hint="密码"
android:gravity="center"
android:maxLength="16"
android:inputType="textPassword"
android:background="#77dddddd"
android:maxLines="1"
android:singleLine="true" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_marginTop="10dp"
android:layout_height="50dp">
<TextView
android:text="手机号:"
android:gravity="center"
android:textColor="#000"
android:textSize="20dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"/>
<EditText
android:id="@+id/tlep"
android:layout_width="match_parent"
android:layout_height="50dp"
android:hint="手机号"
android:gravity="center"
android:maxLength="11"
android:inputType="number"
android:background="#77dddddd"
android:maxLines="1"
android:singleLine="true" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_marginTop="10dp"
android:layout_height="50dp">
<TextView
android:text="姓 名:"
android:gravity="center"
android:textColor="#000"
android:textSize="20dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"/>
<EditText
android:id="@+id/idcard"
android:layout_width="match_parent"
android:layout_height="50dp"
android:hint="姓名"
android:gravity="center"
android:maxLength="18"
android:inputType="text"
android:background="#77dddddd"
android:maxLines="1"
android:singleLine="true" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_marginTop="10dp"
android:layout_height="50dp">
<TextView
android:text="邮 箱:"
android:gravity="center"
android:textColor="#000"
android:textSize="20dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"/>
<EditText
android:id="@+id/intro"
android:layout_width="match_parent"
android:layout_height="50dp"
android:hint="邮箱"
android:gravity="center"
android:maxLength="100"
android:inputType="text"
android:background="#77dddddd"
android:maxLines="1"
android:singleLine="true" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_marginTop="40dp"
android:layout_height="wrap_content">
<Button
android:layout_width="wrap_content"
android:layout_weight="1"
android:text="确定"
android:textSize="16dp"
android:id="@+id/login"
android:textColor="#fff"
android:background="#2196F3"
android:layout_height="wrap_content" />
<Button
android:layout_width="wrap_content"
android:layout_weight="1"
android:layout_marginLeft="40dp"
android:textSize="16dp"
android:textColor="#fff"
android:id="@+id/register"
android:text="取消"
android:background="#2196F3"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</LinearLayout>

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<WebView
android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<ProgressBar
android:id="@+id/progressbar"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="3dip"
android:max="100"
android:progress="0"
android:visibility="gone"/>
</FrameLayout>

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<ImageView
android:layout_width="70dp"
android:id="@+id/ItemImage"
android:layout_height="70dp"
android:layout_marginRight="10dp"
android:padding="0dp"
android:layout_marginBottom="20dp"
android:layout_centerHorizontal="true"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/ItemImage"
android:textSize="14dp"
android:id="@+id/ItemText"
android:layout_margin="0dp"
android:padding="6dp"
android:layout_marginBottom="20dp"
android:layout_centerHorizontal="true"
/>
</RelativeLayout>

@ -0,0 +1,82 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:orientation="vertical"
android:background="@drawable/bg_20dp_r"
android:layout_margin="10dp"
android:padding="5dp"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="40dp">
<TextView
android:text="sdfasdfadadsfa"
android:textColor="#000"
android:textSize="20dp"
android:id="@+id/tv1"
android:singleLine="true"
android:ellipsize="middle"
android:paddingLeft="10dp"
android:layout_width="match_parent"
android:gravity="center|left"
android:layout_height="match_parent" />
</RelativeLayout>
<View
android:background="#ddd"
android:layout_width="match_parent"
android:layout_height="1dp"/>
<RadioButton
android:text="我是说对方"
android:layout_width="wrap_content"
android:id="@+id/rb1"
android:enabled="false"
android:textSize="18dp"
android:layout_marginLeft="20dp"
android:textColor="#111"
android:layout_height="wrap_content" />
<RadioButton
android:text="我是说对方"
android:layout_width="wrap_content"
android:textSize="18dp"
android:enabled="false"
android:id="@+id/rb2"
android:layout_marginLeft="20dp"
android:textColor="#111"
android:layout_height="wrap_content" />
<View
android:background="#ddd"
android:layout_width="match_parent"
android:layout_height="1dp"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:text="已投票,查看结果"
android:textColor="#00B0FF"
android:textSize="16dp"
android:id="@+id/tv3"
android:layout_width="wrap_content"
android:focusable="false"
android:gravity="center"
android:layout_centerInParent="true"
android:layout_height="30dp" />
</RelativeLayout>
</LinearLayout>

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:background="#fff"
android:layout_height="50dp">
<ImageView
android:id="@+id/img"
android:layout_width="30dp"
android:background="@mipmap/aaa"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_gravity="center"
android:layout_height="30dp" />
<EditText
android:id="@+id/et"
android:layout_width="match_parent"
android:paddingLeft="10dp"
android:lines="1"
android:singleLine="true"
android:hint="选择2"
android:textSize="18dp"
android:layout_height="50dp" />
</LinearLayout>

@ -0,0 +1,91 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/tvshow"
android:layout_width="match_parent"
android:text="当前播放节目"
android:textColor="#fff"
android:textSize="18dp"
android:gravity="center"
android:background="#673AB7"
android:layout_height="30dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
android:orientation="horizontal">
<Button
android:id="@+id/prev"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#2196F3"
android:text="上一节目"
android:textColor="#fff"
android:padding="15dp"
android:textSize="20dp" />
<Button
android:id="@+id/next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="40dp"
android:layout_weight="1"
android:background="#2196F3"
android:text="下一节目"
android:textColor="#fff"
android:padding="15dp"
android:textSize="20dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
android:layout_marginBottom="20dp"
android:orientation="horizontal">
<Button
android:id="@+id/add"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#2196F3"
android:text="音量+"
android:textColor="#fff"
android:padding="15dp"
android:textSize="20dp" />
<Button
android:id="@+id/jian"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="40dp"
android:layout_weight="1"
android:background="#2196F3"
android:text="音量-"
android:textColor="#fff"
android:padding="15dp"
android:textSize="20dp" />
</LinearLayout>
<GridView
android:id="@+id/GridView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_margin="0dp"
android:layout_marginTop="10dp"
android:gravity="center"
android:numColumns="4"
android:layout_marginBottom="20dp"
android:stretchMode="columnWidth"></GridView>
</LinearLayout>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save