master
FinalJcsp 2 years ago
parent 5704471480
commit 43f96491ae

15
.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
/.idea/shelf/

@ -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="11" />
</component>
</project>

@ -0,0 +1,414 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DBNavigator.Project.DataEditorManager">
<record-view-column-sorting-type value="BY_INDEX" />
<value-preview-text-wrapping value="true" />
<value-preview-pinned value="false" />
</component>
<component name="DBNavigator.Project.DatabaseEditorStateManager">
<last-used-providers />
</component>
<component name="DBNavigator.Project.DatabaseFileManager">
<open-files />
</component>
<component name="DBNavigator.Project.Settings">
<connections />
<browser-settings>
<general>
<display-mode value="TABBED" />
<navigation-history-size value="100" />
<show-object-details value="false" />
</general>
<filters>
<object-type-filter>
<object-type name="SCHEMA" enabled="true" />
<object-type name="USER" enabled="true" />
<object-type name="ROLE" enabled="true" />
<object-type name="PRIVILEGE" enabled="true" />
<object-type name="CHARSET" enabled="true" />
<object-type name="TABLE" enabled="true" />
<object-type name="VIEW" enabled="true" />
<object-type name="MATERIALIZED_VIEW" enabled="true" />
<object-type name="NESTED_TABLE" enabled="true" />
<object-type name="COLUMN" enabled="true" />
<object-type name="INDEX" enabled="true" />
<object-type name="CONSTRAINT" enabled="true" />
<object-type name="DATASET_TRIGGER" enabled="true" />
<object-type name="DATABASE_TRIGGER" enabled="true" />
<object-type name="SYNONYM" enabled="true" />
<object-type name="SEQUENCE" enabled="true" />
<object-type name="PROCEDURE" enabled="true" />
<object-type name="FUNCTION" enabled="true" />
<object-type name="PACKAGE" enabled="true" />
<object-type name="TYPE" enabled="true" />
<object-type name="TYPE_ATTRIBUTE" enabled="true" />
<object-type name="ARGUMENT" enabled="true" />
<object-type name="DIMENSION" enabled="true" />
<object-type name="CLUSTER" enabled="true" />
<object-type name="DBLINK" enabled="true" />
</object-type-filter>
</filters>
<sorting>
<object-type name="COLUMN" sorting-type="NAME" />
<object-type name="FUNCTION" sorting-type="NAME" />
<object-type name="PROCEDURE" sorting-type="NAME" />
<object-type name="ARGUMENT" sorting-type="POSITION" />
<object-type name="TYPE ATTRIBUTE" sorting-type="POSITION" />
</sorting>
<default-editors>
<object-type name="VIEW" editor-type="SELECTION" />
<object-type name="PACKAGE" editor-type="SELECTION" />
<object-type name="TYPE" editor-type="SELECTION" />
</default-editors>
</browser-settings>
<navigation-settings>
<lookup-filters>
<lookup-objects>
<object-type name="SCHEMA" enabled="true" />
<object-type name="USER" enabled="false" />
<object-type name="ROLE" enabled="false" />
<object-type name="PRIVILEGE" enabled="false" />
<object-type name="CHARSET" enabled="false" />
<object-type name="TABLE" enabled="true" />
<object-type name="VIEW" enabled="true" />
<object-type name="MATERIALIZED VIEW" enabled="true" />
<object-type name="INDEX" enabled="true" />
<object-type name="CONSTRAINT" enabled="true" />
<object-type name="DATASET TRIGGER" enabled="true" />
<object-type name="DATABASE TRIGGER" enabled="true" />
<object-type name="SYNONYM" enabled="false" />
<object-type name="SEQUENCE" enabled="true" />
<object-type name="PROCEDURE" enabled="true" />
<object-type name="FUNCTION" enabled="true" />
<object-type name="PACKAGE" enabled="true" />
<object-type name="TYPE" enabled="true" />
<object-type name="DIMENSION" enabled="false" />
<object-type name="CLUSTER" enabled="false" />
<object-type name="DBLINK" enabled="true" />
</lookup-objects>
<force-database-load value="false" />
<prompt-connection-selection value="true" />
<prompt-schema-selection value="true" />
</lookup-filters>
</navigation-settings>
<dataset-grid-settings>
<general>
<enable-zooming value="true" />
<enable-column-tooltip value="true" />
</general>
<sorting>
<nulls-first value="true" />
<max-sorting-columns value="4" />
</sorting>
<audit-columns>
<column-names value="" />
<visible value="true" />
<editable value="false" />
</audit-columns>
</dataset-grid-settings>
<dataset-editor-settings>
<text-editor-popup>
<active value="false" />
<active-if-empty value="false" />
<data-length-threshold value="100" />
<popup-delay value="1000" />
</text-editor-popup>
<values-actions-popup>
<show-popup-button value="true" />
<element-count-threshold value="1000" />
<data-length-threshold value="250" />
</values-actions-popup>
<general>
<fetch-block-size value="100" />
<fetch-timeout value="30" />
<trim-whitespaces value="true" />
<convert-empty-strings-to-null value="true" />
<select-content-on-cell-edit value="true" />
<large-value-preview-active value="true" />
</general>
<filters>
<prompt-filter-dialog value="true" />
<default-filter-type value="BASIC" />
</filters>
<qualified-text-editor text-length-threshold="300">
<content-types>
<content-type name="Text" enabled="true" />
<content-type name="Properties" enabled="true" />
<content-type name="XML" enabled="true" />
<content-type name="DTD" enabled="true" />
<content-type name="HTML" enabled="true" />
<content-type name="XHTML" enabled="true" />
<content-type name="Java" enabled="true" />
<content-type name="SQL" enabled="true" />
<content-type name="PL/SQL" enabled="true" />
<content-type name="JSON" enabled="true" />
<content-type name="JSON5" enabled="true" />
<content-type name="Groovy" enabled="true" />
<content-type name="AIDL" enabled="true" />
<content-type name="YAML" enabled="true" />
<content-type name="Manifest" enabled="true" />
</content-types>
</qualified-text-editor>
<record-navigation>
<navigation-target value="VIEWER" />
</record-navigation>
</dataset-editor-settings>
<code-editor-settings>
<general>
<show-object-navigation-gutter value="false" />
<show-spec-declaration-navigation-gutter value="true" />
<enable-spellchecking value="true" />
<enable-reference-spellchecking value="false" />
</general>
<confirmations>
<save-changes value="false" />
<revert-changes value="true" />
</confirmations>
</code-editor-settings>
<code-completion-settings>
<filters>
<basic-filter>
<filter-element type="RESERVED_WORD" id="keyword" selected="true" />
<filter-element type="RESERVED_WORD" id="function" selected="true" />
<filter-element type="RESERVED_WORD" id="parameter" selected="true" />
<filter-element type="RESERVED_WORD" id="datatype" selected="true" />
<filter-element type="RESERVED_WORD" id="exception" selected="true" />
<filter-element type="OBJECT" id="schema" selected="true" />
<filter-element type="OBJECT" id="role" selected="true" />
<filter-element type="OBJECT" id="user" selected="true" />
<filter-element type="OBJECT" id="privilege" selected="true" />
<user-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="false" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</user-schema>
<public-schema>
<filter-element type="OBJECT" id="table" selected="false" />
<filter-element type="OBJECT" id="view" selected="false" />
<filter-element type="OBJECT" id="materialized view" selected="false" />
<filter-element type="OBJECT" id="index" selected="false" />
<filter-element type="OBJECT" id="constraint" selected="false" />
<filter-element type="OBJECT" id="trigger" selected="false" />
<filter-element type="OBJECT" id="synonym" selected="false" />
<filter-element type="OBJECT" id="sequence" selected="false" />
<filter-element type="OBJECT" id="procedure" selected="false" />
<filter-element type="OBJECT" id="function" selected="false" />
<filter-element type="OBJECT" id="package" selected="false" />
<filter-element type="OBJECT" id="type" selected="false" />
<filter-element type="OBJECT" id="dimension" selected="false" />
<filter-element type="OBJECT" id="cluster" selected="false" />
<filter-element type="OBJECT" id="dblink" selected="false" />
</public-schema>
<any-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="true" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</any-schema>
</basic-filter>
<extended-filter>
<filter-element type="RESERVED_WORD" id="keyword" selected="true" />
<filter-element type="RESERVED_WORD" id="function" selected="true" />
<filter-element type="RESERVED_WORD" id="parameter" selected="true" />
<filter-element type="RESERVED_WORD" id="datatype" selected="true" />
<filter-element type="RESERVED_WORD" id="exception" selected="true" />
<filter-element type="OBJECT" id="schema" selected="true" />
<filter-element type="OBJECT" id="user" selected="true" />
<filter-element type="OBJECT" id="role" selected="true" />
<filter-element type="OBJECT" id="privilege" selected="true" />
<user-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="true" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</user-schema>
<public-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="true" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</public-schema>
<any-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="true" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</any-schema>
</extended-filter>
</filters>
<sorting enabled="true">
<sorting-element type="RESERVED_WORD" id="keyword" />
<sorting-element type="RESERVED_WORD" id="datatype" />
<sorting-element type="OBJECT" id="column" />
<sorting-element type="OBJECT" id="table" />
<sorting-element type="OBJECT" id="view" />
<sorting-element type="OBJECT" id="materialized view" />
<sorting-element type="OBJECT" id="index" />
<sorting-element type="OBJECT" id="constraint" />
<sorting-element type="OBJECT" id="trigger" />
<sorting-element type="OBJECT" id="synonym" />
<sorting-element type="OBJECT" id="sequence" />
<sorting-element type="OBJECT" id="procedure" />
<sorting-element type="OBJECT" id="function" />
<sorting-element type="OBJECT" id="package" />
<sorting-element type="OBJECT" id="type" />
<sorting-element type="OBJECT" id="dimension" />
<sorting-element type="OBJECT" id="cluster" />
<sorting-element type="OBJECT" id="dblink" />
<sorting-element type="OBJECT" id="schema" />
<sorting-element type="OBJECT" id="role" />
<sorting-element type="OBJECT" id="user" />
<sorting-element type="RESERVED_WORD" id="function" />
<sorting-element type="RESERVED_WORD" id="parameter" />
</sorting>
<format>
<enforce-code-style-case value="true" />
</format>
</code-completion-settings>
<execution-engine-settings>
<statement-execution>
<fetch-block-size value="100" />
<execution-timeout value="20" />
<debug-execution-timeout value="600" />
<focus-result value="false" />
<prompt-execution value="false" />
</statement-execution>
<script-execution>
<command-line-interfaces />
<execution-timeout value="300" />
</script-execution>
<method-execution>
<execution-timeout value="30" />
<debug-execution-timeout value="600" />
<parameter-history-size value="10" />
</method-execution>
</execution-engine-settings>
<operation-settings>
<transactions>
<uncommitted-changes>
<on-project-close value="ASK" />
<on-disconnect value="ASK" />
<on-autocommit-toggle value="ASK" />
</uncommitted-changes>
<multiple-uncommitted-changes>
<on-commit value="ASK" />
<on-rollback value="ASK" />
</multiple-uncommitted-changes>
</transactions>
<session-browser>
<disconnect-session value="ASK" />
<kill-session value="ASK" />
<reload-on-filter-change value="false" />
</session-browser>
<compiler>
<compile-type value="KEEP" />
<compile-dependencies value="ASK" />
<always-show-controls value="false" />
</compiler>
<debugger>
<debugger-type value="ASK" />
<use-generic-runners value="true" />
</debugger>
</operation-settings>
<ddl-file-settings>
<extensions>
<mapping file-type-id="VIEW" extensions="vw" />
<mapping file-type-id="TRIGGER" extensions="trg" />
<mapping file-type-id="PROCEDURE" extensions="prc" />
<mapping file-type-id="FUNCTION" extensions="fnc" />
<mapping file-type-id="PACKAGE" extensions="pkg" />
<mapping file-type-id="PACKAGE_SPEC" extensions="pks" />
<mapping file-type-id="PACKAGE_BODY" extensions="pkb" />
<mapping file-type-id="TYPE" extensions="tpe" />
<mapping file-type-id="TYPE_SPEC" extensions="tps" />
<mapping file-type-id="TYPE_BODY" extensions="tpb" />
</extensions>
<general>
<lookup-ddl-files value="true" />
<create-ddl-files value="false" />
<synchronize-ddl-files value="true" />
<use-qualified-names value="false" />
<make-scripts-rerunnable value="true" />
</general>
</ddl-file-settings>
<general-settings>
<regional-settings>
<date-format value="MEDIUM" />
<number-format value="UNGROUPED" />
<locale value="SYSTEM_DEFAULT" />
<use-custom-formats value="false" />
</regional-settings>
<environment>
<environment-types>
<environment-type id="development" name="Development" description="Development environment" color="-2430209/-12296320" readonly-code="false" readonly-data="false" />
<environment-type id="integration" name="Integration" description="Integration environment" color="-2621494/-12163514" readonly-code="true" readonly-data="false" />
<environment-type id="production" name="Production" description="Productive environment" color="-11574/-10271420" readonly-code="true" readonly-data="true" />
<environment-type id="other" name="Other" description="" color="-1576/-10724543" readonly-code="false" readonly-data="false" />
</environment-types>
<visibility-settings>
<connection-tabs value="true" />
<dialog-headers value="true" />
<object-editor-tabs value="true" />
<script-editor-tabs value="false" />
<execution-result-tabs value="true" />
</visibility-settings>
</environment>
</general-settings>
</component>
</project>

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<runningDeviceTargetSelectedWithDropDown>
<Target>
<type value="RUNNING_DEVICE_TARGET" />
<deviceKey>
<Key>
<type value="SERIAL_NUMBER" />
<value value="emulator-5554" />
</Key>
</deviceKey>
</Target>
</runningDeviceTargetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2023-05-29T04:56:35.121693200Z" />
</component>
</project>

@ -0,0 +1,20 @@
<?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="GRADLE" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="Android Studio default JDK" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
</GradleProjectSettings>
</option>
</component>
</project>

@ -0,0 +1,85 @@
<?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="BintrayJCenter" />
<option name="name" value="BintrayJCenter" />
<option name="url" value="https://jcenter.bintray.com/" />
</remote-repository>
<remote-repository>
<option name="id" value="Google" />
<option name="name" value="Google" />
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven10" />
<option name="name" value="maven10" />
<option name="url" value="https://maven.aliyun.com/nexus/content/groups/public" />
</remote-repository>
<remote-repository>
<option name="id" value="maven4" />
<option name="name" value="maven4" />
<option name="url" value="https://maven.aliyun.com/nexus/content/repositories/google" />
</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>
<remote-repository>
<option name="id" value="maven" />
<option name="name" value="maven" />
<option name="url" value="file:/$MAVEN_REPOSITORY$/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven6" />
<option name="name" value="maven6" />
<option name="url" value="https://www.jitpack.io" />
</remote-repository>
<remote-repository>
<option name="id" value="maven7" />
<option name="name" value="maven7" />
<option name="url" value="https://jitpack.io" />
</remote-repository>
<remote-repository>
<option name="id" value="maven2" />
<option name="name" value="maven2" />
<option name="url" value="https://maven.aliyun.com/nexus/content/groups/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven8" />
<option name="name" value="maven8" />
<option name="url" value="https://maven.aliyun.com/repository/google" />
</remote-repository>
<remote-repository>
<option name="id" value="Alibaba" />
<option name="name" value="Alibaba" />
<option name="url" value="https://maven.aliyun.com/repository/public" />
</remote-repository>
<remote-repository>
<option name="id" value="maven9" />
<option name="name" value="maven9" />
<option name="url" value="https://maven.aliyun.com/repository/jcenter" />
</remote-repository>
<remote-repository>
<option name="id" value="maven5" />
<option name="name" value="maven5" />
<option name="url" value="https://maven.aliyun.com/nexus/content/repositories/gradle-plugin" />
</remote-repository>
<remote-repository>
<option name="id" value="maven3" />
<option name="name" value="maven3" />
<option name="url" value="https://maven.aliyun.com/nexus/content/repositories/jcenter" />
</remote-repository>
</component>
</project>

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DesignSurface">
<option name="filePathToZoomLevelMap">
<map>
<entry key="..\:/Desktop/abc/AndroidTermWork/app/src/main/res/layout/activity_4.xml" value="0.3333333333333333" />
<entry key="..\:/Desktop/abc/AndroidTermWork/app/src/main/res/layout/activity_5.xml" value="0.27236580516898606" />
<entry key="..\:/androidStudio/AndroidTermWork/app/src/main/res/layout/activity_web_view.xml" value="0.21875" />
</map>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="jbr-11" 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,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

1
app/.gitignore vendored

@ -0,0 +1 @@
/build

@ -0,0 +1,48 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 31
buildToolsVersion "31.0.0"
defaultConfig {
applicationId "com.example.androidtermwork"
minSdkVersion 21
targetSdkVersion 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
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 fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.vectordrawable:vectordrawable:1.0.1'
implementation 'androidx.navigation:navigation-fragment:2.3.5'
implementation 'androidx.navigation:navigation-ui:2.3.5'
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
implementation 'com.android.volley:volley:1.1.1'
implementation 'com.scwang.smart:refresh-layout-kernel:2.0.1' //
implementation 'com.scwang.smart:refresh-header-classics:2.0.1' //
implementation 'com.scwang.smart:refresh-footer-classics:2.0.1' //
implementation 'cn.jzvd:jiaozivideoplayer:7.7.0'
implementation 'de.hdodenhof:circleimageview:3.1.0'
}

@ -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,27 @@
package com.example.androidtermwork;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.example.androidtermwork", appContext.getPackageName());
}
}

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.androidtermwork">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:icon="@mipmap/appicon"
android:label="@string/app_name"
android:roundIcon="@mipmap/iconcirred"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning"
android:networkSecurityConfig="@xml/network_security_config"
tools:targetApi="n">
<activity
android:name=".ChatActivity"
android:exported="false" />
<activity
android:name=".MinePage"
android:exported="false" />
<activity
android:name=".Activity5"
android:exported="false" />
<activity
android:name=".Activity1"
android:exported="false" />
<activity
android:name=".Activity2"
android:exported="false" />
<activity
android:name=".Activity3"
android:exported="false" />
<activity
android:name=".Activity4"
android:exported="false" />
<activity
android:name=".MainActivity"
android:theme="@style/RedTheme" />
<activity android:name=".ResetPasswordPage" />
<activity android:name=".RegisterThirdPage" />
<activity android:name=".RegisterSecondPage" />
<activity android:name=".RegisterFirstPage" />
<activity android:name=".RetrievePasswordPage" />
<activity android:name=".LossPage" />
<activity android:name=".webView"/>
<activity android:name=".WelcomePage">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".LoginPage" />
<activity android:name=".PointsPage" />
<activity android:name=".TvStationPlayPage"/>
</application>
</manifest>

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 700 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 774 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 484 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 676 B

@ -0,0 +1,129 @@
body {
background-color: rgb(250, 251, 253);
padding: 0 10px;
}
.top {
width: 90%;
height: 90px;
display: flex;
justify-content: space-between;
border-bottom: 2px solid rgb(213, 215, 216);
position: fixed;
top: -2px;
background-color: rgb(250, 251, 253);
}
.top img {
height: 30px;
width: 30px;
margin-top: 10px;
}
.top>div {
display: flex;
flex-direction: column;
}
.top .topIcon {
background-color: rgb(228, 36, 23);
height: fit-content;
width: fit-content;
padding: 10px 20px;
}
#time {
font-size: 9px;
color: rgb(116, 116, 117);
margin-top: 5px;
}
.container {
margin-top: 100px;
margin-bottom: 100px;
}
#resource {
font-size: 8px;
color: rgb(116, 116, 117);
margin-top: 5px;
}
#title {
margin-top: 15px;
}
#title2 {
margin-top: 10px;
}
#article {
margin-top: 10px;
font-size: 16px;
line-height: 1.5em;
text-indent: 2em;
}
#editor {
margin-top: 10px;
font-size: 13px;
float: right;
}
.bottom {
width: 90%;
height: 40px;
display: flex;
justify-content: space-between;
align-items: center;
border-top: 1px solid rgb(213, 215, 216);
position: fixed;
bottom: -2px;
background-color: rgb(250, 251, 253);
}
#input {
padding: 2px 8px;
font-size: 10px;
background-color: rgb(212, 211, 211);
width: 200px;
height: 20px;
border: rgb(212, 211, 211);
border-radius: 2px;
}
.bottom img {
height: 20px;
width: 20px;
}
.player {
position: fixed;
bottom: 120px;
display: flex;
align-items: center;
justify-content: space-around;
border: 1px solid rgb(212, 211, 211);
background-color: rgb(241, 243, 244);
border-radius: 5px;
}
.player img {
margin-left: 5px;
height: 20px;
width: 20px;
}
#zhankai {
position: fixed;
bottom: 131px;
left: 0px;
margin-left: 5px;
height: 20px;
width: 20px;
}
#audio {
width: 230px;
height: 40px;
}

@ -0,0 +1,42 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<title>demo</title>
<link rel="stylesheet" type="text/css" href="./index.css">
</head>
<body>
<div class="top">
<img src="./images/back.png" id="goback" />
<div>
<img src="./images/iconwhite.png" class="topIcon" />
<div id="time"></div>
</div>
<img src="./images/broad.png" id="play" onclick="fun()" />
</div>
<div class="container">
<h2 id="title"></h2>
<div id="resource"></div>
<h4 id="title2"></h4>
<div id="article"></div>
<div id="editor"></div>
</div>
<div class="bottom">
<input placeholder="欢迎发表你的观点" id="input" />
<img src="./images/duanxin.png" id="messege" />
<img src="./images/shoucang.png" id="shoucang" />
<img src="./images/share.png" id="share" style="height: 15px; width: 15px;" />
</div>
<div class="player" id="player"></div>
<script type="text/javascript" src="./index.js"></script>
</body>
</html>

@ -0,0 +1,94 @@
// var result = JavaScriptInterface.jsontohtml();
// var obj = eval("(" + result + ")"); //解析json字符串
// function showAndroidToast(toast) {
// JavaScriptInterface.showToast(toast);
// }
var title = document.getElementById('title');
var title2 = document.getElementById('title2');
var time = document.getElementById('time');
var resource = document.getElementById('resource');
var article = document.getElementById('article');
var editor = document.getElementById('editor');
var player = document.getElementById('player');
getjsonData();
function getjsonData() {
// var result = JavaScriptInterface.jsontohtml();
// var obj = eval("("+result+")");//解析json字符串
var news = {
title: '中国共产党第十九届中央委员会第六次全体会议公报',
title2: '中国共产党第十九届中央委员会第六次全体会议公报2021年11月11日中国共产党第十九届中央委员会第六次全体会议通过',
time: '2021 年 11 月 12 日',
resource: '“学习强国”学习平台',
article: '中国共产党第十九届中央委员会第六次全体会议于2021年11月8日至11日在北京举行。\n' +
'出席这次全会的有中央委员197人候补中央委员151人。中央纪律检查委员会常务委员会委员和有关方面负责同志列席会议。\n' +
'全会由中央政治局主持。中央委员会总书记习近平作了重要讲话。\n' +
'全会听取和讨论了习近平受中央政治局委托作的工作报告,审议通过了《中共中央关于党的百年奋斗重大成就和历史经验的决议》,审议通过了《关于召开党的第二十次全国代表大会的决议》。习近平就《中共中央关于党的百年奋斗重大成就和历史经验的决议(讨论稿)》向全会作了说明。\n' +
'全会认为,总结党的百年奋斗重大成就和历史经验,是在建党百年历史条件下开启全面建设社会主义现代化国家新征程、在新时代坚持和发展中国特色社会主义的需要;是增强政治意识、大局意识、核心意识、看齐意识,坚定道路自信、理论自信、制度自信、文化自信,做到坚决维护习近平同志党中央的核心、全党的核心地位,坚决维护党中央权威和集中统一领导,确保全党步调一致向前进的需要;是推进党的自我革命、提高全党斗争本领和应对风险挑战能力、永葆党的生机活力、团结带领全国各族人民为实现中华民族伟大复兴的中国梦而继续奋斗的需要。全党要坚持唯物史观和正确党史观,从党的百年奋斗中看清楚过去我们为什么能够成功、弄明白未来我们怎样才能继续成功,从而更加坚定、更加自觉地践行初心使命,在新时代更好坚持和发展中国特色社会主义。',
editor: '秦辰宇',
}
showData(news);
}
function showData(news) {
console.log(news)
title.innerHTML = news.title;
title2.innerHTML = news.title2;
time.innerHTML = news.time;
resource.innerHTML = `来源:${news.resource}`;
//按照换行符分隔成数组
const tempArr = news.article.split(/[(\r\n)\r\n]+/);
//删除空项
tempArr.forEach((item, index) => {
if (!item) {
snsArr.splice(index, 1);
}
});
//循环添加单个段落
tempArr.forEach((item, index) => {
var p = document.createElement('div');
console.log(item)
p.id = `p${index}`;
p.innerText = item;
article.appendChild(p);
});
editor.innerHTML = `责任编辑:${news.editor}`;
}
function changeBroadIcon(flag) {
if (flag) {
var play = document.getElementById('play');
play.src = './images/onplay.png';
play.onclick = () => {
stop();
}
} else {
var play = document.getElementById('play');
play.src = './images/broad.png';
play.onclick = () => {
fun();
}
}
}
function fun() {
const values = title.innerText + title2.innerText + time.innerText + article.innerText + editor.innerText;
console.log(values);
var url = "http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&text=" + encodeURI(values);
var div = document.createElement('div');
div.innerHTML = `<audio controls id="audio"><source src="${url}" type="audio/mpeg"></audio>`
player.appendChild(div);
var audio = document.getElementById('audio');
audio.play();
changeBroadIcon(true);
}
function stop() {
var audio = document.getElementById('audio');
//停止音频
audio.currentTime = 0;
audio.pause();
//删除dom
player.removeChild(player.children[0]);
changeBroadIcon(false);
}

@ -0,0 +1,62 @@
[
{
"id": 1,
"videoSource": "http://asdasdqqw.6655.la/video/0.mp4",
"cover": "http://asdasdqqw.6655.la/img/0.jpg",
"title": "我们的背后,就是祖国",
"timeLength": 171,
"itemType": 0,
"author": "人民日报",
"date": "2021-10-25"
},
{
"id": 2,
"videoSource": "http://asdasdqqw.6655.la/video/1.mp4",
"cover": "http://asdasdqqw.6655.la/img/1.jpg",
"title": "\u3010\u65b0\u95fb\u8054\u64ad\u3011\u78cb\u5546\u4e25\u91cd\u53d7\u632b \u8d23\u4efb\u5b8c\u5168\u5728\u7f8e\u65b9",
"timeLength": 33,
"itemType": 1,
"author": "\u4e2d\u592e\u7535\u89c6\u53f0",
"date": "2021-10-27"
},
{
"id": 3,
"videoSource": "http://asdasdqqw.6655.la/video/2.mp4",
"cover": "http://asdasdqqw.6655.la/img/2.jpg",
"title": "\u3010\u65b0\u95fb\u8054\u64ad\u3011\u4e60\u8fd1\u5e73\u5bf9\u65b0\u578b\u51a0\u72b6\u75c5\u6bd2\u611f\u67d3\u7684\u80ba\u708e\u75ab\u60c5\u4f5c\u51fa\u91cd\u8981\u6307\u793a",
"timeLength": 33,
"itemType": 0,
"author": "\u4e2d\u592e\u7535\u89c6\u53f0",
"date": "2021-10-27"
},
{
"id": 4,
"videoSource": "http://asdasdqqw.6655.la/video/3.mp4",
"cover": "http://asdasdqqw.6655.la/img/3.jpg",
"title": "\u3010\u65b0\u95fb\u8054\u64ad5\u8054\u5f39\u3011\u4e2d\u56fd\u7ecf\u6d4e\u7684\u5e95\u6c14\u4ece\u4f55\u800c\u6765\uff1f\u5173\u7a0e\u5927\u68d2\u635f\u4eba\u5bb3\u5df1\uff01\u7f8e\u65b9\u5728\u8c08\u5224\u4e2d\u4e0d\u8bb2\u89c4\u5219\u86ee\u6a2a\u65e0\u7406",
"timeLength": 33,
"itemType": 0,
"author": "\u4e2d\u592e\u7535\u89c6\u53f0",
"date": "2021-10-27"
},
{
"id": 5,
"videoSource": "http://asdasdqqw.6655.la/video/4.mp4",
"cover": "http://asdasdqqw.6655.la/img/4.jpg",
"title": "\u65b0\u95fb\u8054\u64ad\uff1a\u541b\u5b50\u4e4b\u56fd \u5148\u793c\u540e\u5175",
"timeLength": 33,
"itemType": 0,
"author": "\u4e2d\u592e\u7535\u89c6\u53f0",
"date": "2021-10-27"
},
{
"id": 6,
"videoSource": "http://asdasdqqw.6655.la/video/5.mp4",
"cover": "http://asdasdqqw.6655.la/img/5.jpg",
"title": "\u65b0\u95fb\u8054\u64ad\uff1a\u4e2d\u529e \u56fd\u529e\u5370\u53d1\u300a\u5173\u4e8e\u8fdb\u4e00\u6b65\u51cf\u8f7b\u4e49\u52a1\u6559\u80b2\u9636\u6bb5\u5b66\u751f\u4f5c\u4e1a\u8d1f\u62c5\u548c\u6821\u5916\u57f9\u8bad\u8d1f\u62c5\u7684\u610f\u89c1\u300b",
"timeLength": 33,
"itemType": 1,
"author": "\u4e2d\u592e\u7535\u89c6\u53f0",
"date": "2021-10-27"
}
]

@ -0,0 +1,52 @@
[
{
"id": "7",
"videoSource": "http://asdasdqqw.6655.la/video/10.mp4",
"cover": "http://asdasdqqw.6655.la/img/10.jpg",
"title": "\u4e2d\u5171\u4e2d\u592e\u5173\u4e8e\u5236\u5b9a\u56fd\u6c11\u7ecf\u6d4e\u548c\u793e\u4f1a\u53d1\u5c55\u7b2c\u5341\u56db\u4e2a\u4e94\u5e74\u89c4\u5212\u548c\u4e8c\u3007\u4e09\u4e94\u5e74\u8fdc\u666f\u76ee\u6807\u7684\u5efa\u8bae",
"timeLength": 33,
"itemType": 1,
"author": "\u592e\u89c6\u65b0\u95fb",
"date": "2021-10-30"
},
{
"id": "8",
"videoSource": "http://asdasdqqw.6655.la/video/6.mp4",
"cover": "http://asdasdqqw.6655.la/img/6.jpg",
"title": "\u3010\u65b0\u95fb\u8054\u64ad\u3011\u5341\u4e8c\u8fde\u53d1\uff01\u6279\u7f8e\u56fd\u63d2\u624b\u9999\u6e2f\u4e8b\u52a1",
"timeLength": 33,
"itemType": 1,
"author": "\u592e\u89c6\u65b0\u95fb",
"date": "2021-10-30"
},
{
"id": "9",
"videoSource": "http://asdasdqqw.6655.la/video/7.mp4",
"cover": "http://asdasdqqw.6655.la/img/7.jpg",
"title": "\u3010\u65b0\u95fb\u8054\u64ad\u3011\u4ed6\u56fd\u9a9a\u4e71\u662f\u201c\u7f8e\u4e3d\u7684\u98ce\u666f\u7ebf\u201d\uff1f\u865a\u4f2a\u53cc\u6807 \u4ee4\u4eba\u4f5c\u5455\uff01",
"timeLength": 33,
"itemType": 0,
"author": "\u592e\u89c6\u65b0\u95fb",
"date": "2021-10-30"
},
{
"id": "10",
"videoSource": "http://asdasdqqw.6655.la/video/8.mp4",
"cover": "http://asdasdqqw.6655.la/img/8.jpg",
"title": "\u65b0\u95fb\u8054\u64ad\uff1a\u7f8e\u56fd\u6ee1\u5634\u8dd1\u706b\u8f66\uff0c\u6028\u5987\u5fc3\u6001\uff01",
"timeLength": 33,
"itemType": 1,
"author": "\u592e\u89c6\u65b0\u95fb",
"date": "2021-10-30"
},
{
"id": "11",
"videoSource": "http://asdasdqqw.6655.la/video/9.mp4",
"cover": "http://asdasdqqw.6655.la/img/9.jpg",
"title": "\u3010\u65b0\u95fb\u8054\u64ad\u3011\u534e\u4e3a\u7edd\u5730\u53cd\u51fb \u4e2d\u56fd\u5c45\u5b89\u601d\u5371",
"timeLength": 33,
"itemType": 0,
"author": "\u592e\u89c6\u65b0\u95fb",
"date": "2021-10-30"
}
]

@ -0,0 +1,42 @@
[
{
"userId": 342284102,
"userName": "头像我女神438",
"feelGoodCounts": 16592,
"isFeelGood": false,
"commentDate": "2021-10-25",
"commentContent": "197653不是冰冷的数字是鲜活的生命和滚烫的热血。"
},
{
"userId": 268085226,
"userName": "努力_上岸",
"feelGoodCounts": 10599,
"isFeelGood": false,
"commentDate": "2021-10-25",
"commentContent": "我工作就要去基层了 我会用自己的方式去为群众服务"
},
{
"userId": 138408320,
"userName": "懿维我祖",
"feelGoodCounts": 9599,
"isFeelGood": false,
"commentDate": "2021-10-25",
"commentContent": "我希望大家把197653喊成197654 多那个1代表所有未被统计的英烈不知牺牲在战俘营里的英烈在不在统计范围"
},
{
"userId": 987423234,
"userName": "杜甫几句堆积思思",
"feelGoodCounts": 7642,
"isFeelGood": false,
"commentDate": "2021-10-25",
"commentContent": "我外公打过抗美援朝,参加过上甘岭和三八线"
},
{
"userId": 887635213,
"userName": "安丘一中学生会",
"feelGoodCounts": 5557,
"isFeelGood": false,
"commentDate": "2021-10-25",
"commentContent": "\"什么叫祖国,当我们跨过鸭绿江,看到战火的时候,我后边就是祖国\""
}
]

@ -0,0 +1,8 @@
{
"playCounts": 1089906,
"feelGoodCounts": 82615,
"introduction": "“黄继光”“杨根思”“到”……这一声声“到”跨越71年。纪念中国人民志愿军抗美援朝出国作战71周年致敬每一位最可爱的人。山河无恙如您所愿",
"isFeelGood": false,
"moreInfo": "责任编辑:...\n校对...",
"isCollect": false
}

@ -0,0 +1,37 @@
[
{
"name": "登录",
"description": "1分/每日首次登录",
"todayPoints": 1,
"pointsLimit": 1,
"goAction": "def"
},
{
"name": "我要选读文章",
"description": "1分/每有效阅读/播报一篇上限6分\n1分/有效阅读或播报文章累计1分钟上限6分",
"todayPoints": 11,
"pointsLimit": 12,
"goAction": "res_article"
},
{
"name": "视听学习",
"description": "1分/每有效收听/观看一个",
"todayPoints": 4,
"pointsLimit": 6,
"goAction": "res_tv"
},
{
"name": "每日答题",
"description": "每组答题每答对1道积1分",
"todayPoints": 1,
"pointsLimit": 6,
"goAction": "new_dailyQ"
},
{
"name": "每周答题",
"description": "每组答题每答对1道积1分同组答题不重复积分",
"todayPoints": 6,
"pointsLimit": 6,
"goAction": "new_weeklyQ"
}
]

@ -0,0 +1,5 @@
{
"points": 9000,
"dan": 9,
"pointsToday": 20
}

@ -0,0 +1,39 @@
package com.example.androidtermwork;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.text.Html;
import android.view.View;
import android.widget.TextView;
import com.example.androidtermwork.util.StatusBarUtil;
public class Activity1 extends AppCompatActivity {
@RequiresApi(api = Build.VERSION_CODES.M)
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_1);
StatusBarUtil.setAndroidNativeLightStatusBar(this, true);
TextView tv=(TextView)findViewById(R.id.text3);
String str="来源:《中国共产党简史》<font color='#313DC3'>人民出版社、中国共产党史出版社2021年版</font>";
tv.setTextSize(16);
tv.setText(Html.fromHtml(str));
}
public void ts(View view){
Intent intent = new Intent();
intent.setClass(Activity1.this,Activity2.class);
startActivity(intent);
}
public void next(View view){
Intent intent = new Intent();
intent.setClass(Activity1.this,Activity3.class);
startActivity(intent);
finish();
}
}

@ -0,0 +1,25 @@
package com.example.androidtermwork;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Build;
import android.os.Bundle;
import android.text.Html;
import android.widget.TextView;
import com.example.androidtermwork.util.StatusBarUtil;
public class Activity2 extends AppCompatActivity {
@RequiresApi(api = Build.VERSION_CODES.M)
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_2);
StatusBarUtil.setAndroidNativeLightStatusBar(this, true);
TextView da =(TextView) findViewById(R.id.daan);
String str2="中华苏维埃第一次全国代表大会于1931年11月在江西<font color='#FE0101'>瑞金</font>召开,中华苏维埃共和国临时中央政府宣布成立。</font>";
da.setText(Html.fromHtml(str2));
}
}

@ -0,0 +1,34 @@
package com.example.androidtermwork;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.text.Html;
import android.view.View;
import android.widget.TextView;
import com.example.androidtermwork.util.StatusBarUtil;
public class Activity3 extends AppCompatActivity {
@RequiresApi(api = Build.VERSION_CODES.M)
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_3);
StatusBarUtil.setAndroidNativeLightStatusBar(this, true);
TextView tv=(TextView)findViewById(R.id.from3);
String str3="来源:《中国共产党简史》<font color='#313DC3'>人民出版社、中国共产党史出版社2021年版</font>";
tv.setTextSize(16);
tv.setText(Html.fromHtml(str3));
}
public void next2(View view){
Intent intent = new Intent();
intent.setClass(Activity3.this,Activity4.class);
startActivity(intent);
finish();
}
}

@ -0,0 +1,33 @@
package com.example.androidtermwork;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.text.Html;
import android.view.View;
import android.widget.TextView;
import com.example.androidtermwork.util.StatusBarUtil;
public class Activity4 extends AppCompatActivity {
@RequiresApi(api = Build.VERSION_CODES.M)
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_4);
StatusBarUtil.setAndroidNativeLightStatusBar(this, true);
TextView tv=(TextView)findViewById(R.id.from4);
String str4="来源:《中国共产党简史》<font color='#313DC3'>人民出版社、中国共产党史出版社2021年版</font>";
tv.setTextSize(16);
tv.setText(Html.fromHtml(str4));
}
public void next1(View view){
Intent intent =new Intent(Activity4.this,Activity5.class);
startActivity(intent);
finish();
}
}

@ -0,0 +1,32 @@
package com.example.androidtermwork;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import com.example.androidtermwork.util.StatusBarUtil;
public class Activity5 extends AppCompatActivity {
private Button btn;
@RequiresApi(api = Build.VERSION_CODES.M)
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_5);
StatusBarUtil.setAndroidNativeLightStatusBar(this, true);
btn = (Button) findViewById(R.id.btn2);
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Activity5.this,PointsPage.class);
startActivity(intent);
finish();
}
});
}
}

@ -0,0 +1,45 @@
package com.example.androidtermwork;
import android.content.Context;
import android.widget.Toast;
import org.json.JSONException;
import org.json.JSONObject;
public class AndroidToastForJs {
public static String title;
public static String resource;
public static String title2;
public static String time;
public static String article;
public static String editor;
private Context mContext;
public AndroidToastForJs(Context context) {
this.mContext = context;
}
//webview中调用toast原生组件
public void showToast(String toast) {
Toast.makeText(mContext, toast, Toast.LENGTH_SHORT).show();
}
//以json实现webview与js之间的数据交互
public String jsontohtml() {
JSONObject map = null;
try {
map = new JSONObject();
map.put("title", title);
map.put("resource", resource);
map.put("title2", title2);
map.put("time", time);
map.put("article", article);
map.put("editor", editor);
} catch (JSONException e) {
e.printStackTrace();
}
return map.toString();
}
}

@ -0,0 +1,155 @@
package com.example.androidtermwork;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.content.Context;
import android.os.Build;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import com.example.androidtermwork.util.StatusBarUtil;
import java.util.ArrayList;
import java.util.List;
public class ChatActivity extends AppCompatActivity {
private ListView msgListView;
private EditText inputText;
private Button send;
private MsgAdapter adapter;
private List<Msg> msgList = new ArrayList<Msg>();
private Toolbar toolbar;
@RequiresApi(api = Build.VERSION_CODES.M)
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);//设置窗口没有标题栏
StatusBarUtil.setAndroidNativeLightStatusBar(this, true);
setContentView(R.layout.activity_chat);
toolbar = findViewById(R.id.chat_toolbar);
eventListener();
initMsg();
adapter = new MsgAdapter(ChatActivity.this, R.layout.msg_item, msgList);
inputText = (EditText) findViewById(R.id.input_text);
send = (Button) findViewById(R.id.send);
msgListView = (ListView) findViewById(R.id.msg_list_view);
msgListView.setAdapter(adapter);
send.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
String content = inputText.getText().toString();
if(!"".equals(content)){
Msg msg = new Msg(content, Msg.SENT);
msgList.add(msg);
adapter.notifyDataSetChanged();//有新消息时刷新ListView中的显示
msgListView.setSelection(msgList.size());//将ListView定位到最后一行
inputText.setText("");//清空输入框的内容
}
}
});
}
private void eventListener() {
//右上角返回
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish(); // 返回
}
});
}
private void initMsg() {
Msg msg1 = new Msg("全国党史知识竞赛总决赛",Msg.RECEIVED);
msgList.add(msg1);
Msg msg2 = new Msg("收到",Msg.SENT);
msgList.add(msg2);
Msg msg3 = new Msg("关注进博会,游世界展馆,看全球展品",Msg.RECEIVED);
msgList.add(msg3);
}
public class Msg{
public static final int RECEIVED = 0;//收到一条消息
public static final int SENT = 1;//发出一条消息
private String content;//消息的内容
private int type;//消息的类型
public Msg(String content,int type){
this.content = content;
this.type = type;
}
public String getContent(){
return content;
}
public int getType(){
return type;
}
}
public class MsgAdapter extends ArrayAdapter<Msg> {
private int resourceId;
public MsgAdapter(Context context, int textViewresourceId, List<Msg> objects) {
super(context, textViewresourceId, objects);
resourceId = textViewresourceId;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
Msg msg = getItem(position);
View view;
ViewHolder viewHolder;
if(convertView == null){
view = LayoutInflater.from(getContext()).inflate(resourceId, null);
viewHolder = new ViewHolder();
viewHolder.leftLayout = (LinearLayout)view.findViewById(R.id.left_layout);
viewHolder.rightLayout = (LinearLayout)view.findViewById(R.id.right_Layout);
viewHolder.leftMsg = (TextView)view.findViewById(R.id.left_msg);
viewHolder.rightMsg = (TextView)view.findViewById(R.id.right_msg);
viewHolder.lefthead = (ImageView)view.findViewById(R.id.head_left);
viewHolder.righthead = (ImageView)view.findViewById(R.id.head_right);
view.setTag(viewHolder);
}else{
view = convertView;
viewHolder = (ViewHolder) view.getTag();
}
if(msg.getType()==Msg.RECEIVED){
//如果是收到的消息,则显示左边消息布局,将右边消息布局隐藏
viewHolder.leftLayout.setVisibility(View.VISIBLE);
viewHolder.lefthead.setVisibility(View.VISIBLE);
viewHolder.rightLayout.setVisibility(View.GONE);
viewHolder.righthead.setVisibility(View.GONE);
viewHolder.leftMsg.setText(msg.getContent());
}else if(msg.getType()==Msg.SENT){
//如果是发出去的消息,显示右边布局的消息布局,将左边的消息布局隐藏
viewHolder.rightLayout.setVisibility(View.VISIBLE);
viewHolder.righthead.setVisibility(View.VISIBLE);
viewHolder.leftLayout.setVisibility(View.GONE);
viewHolder.lefthead.setVisibility(View.GONE);
viewHolder.rightMsg.setText(msg.getContent());
}
return view;
}
class ViewHolder{
LinearLayout leftLayout;
LinearLayout rightLayout;
TextView leftMsg;
TextView rightMsg;
ImageView lefthead;
ImageView righthead;
}
}
}

@ -0,0 +1,277 @@
package com.example.androidtermwork;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import android.annotation.SuppressLint;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.Editable;
import android.text.InputType;
import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.text.TextPaint;
import android.text.TextWatcher;
import android.text.method.HideReturnsTransformationMethod;
import android.text.method.LinkMovementMethod;
import android.text.method.PasswordTransformationMethod;
import android.text.method.TransformationMethod;
import android.text.style.ClickableSpan;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.example.androidtermwork.util.StatusBarUtil;
@RequiresApi(api = Build.VERSION_CODES.M)
public class LoginPage extends AppCompatActivity {
private AlertDialog.Builder builder;
private boolean isHideFirst = true;// 输入框密码是否是隐藏的默认为true
private ImageView imageView_password;
private ImageView inputDel; //一键清除输入内容
public static ProgressDialog mDefaultDialog; //加载中对话框
//加载中对话框:正在进行网络请求
/**
* setCancelabletrue退false使退
* setCanceledOnTouchOutside truefalse退退退
*/
public static void showCommonDialog(Context context) {
mDefaultDialog = new ProgressDialog(context);
//默认就是小圆圈的那种形式
mDefaultDialog.setProgressStyle(android.app.ProgressDialog.STYLE_SPINNER);
mDefaultDialog.setMessage("正在进行网络请求...");
// mDefaultDialog.setCancelable(true);
mDefaultDialog.setCanceledOnTouchOutside(false);
mDefaultDialog.show();
}
//延时关闭加载中对话框
@SuppressLint("HandlerLeak")
public static Handler dialogHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
mDefaultDialog.dismiss();
super.handleMessage(msg);
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login_page);
//登录
OnButtonToLogin();
//注册
OnButtonToRegister();
//初始化页面底部可点击文本
initView();
//密码显示或隐藏
showOrHide();
//清空输入框
inputClear();
}
/**
*
*/
private void showOrHide() {
final EditText password = findViewById(R.id.userPassword);
imageView_password = findViewById(R.id.imageView);
imageView_password.setImageResource(R.mipmap.visibleoff);
imageView_password.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (isHideFirst == true) {
imageView_password.setImageResource(R.mipmap.visibleon);
//密文
HideReturnsTransformationMethod method1 = HideReturnsTransformationMethod.getInstance();
password.setTransformationMethod(method1);
isHideFirst = false;
} else {
imageView_password.setImageResource(R.mipmap.visibleoff);
//密文
TransformationMethod method = PasswordTransformationMethod.getInstance();
password.setTransformationMethod(method);
isHideFirst = true;
}
// 光标的位置
int index = password.getText().toString().length();
password.setSelection(index);
}
});
}
/**
*
*/
private void inputClear() {
//设置监听器
final EditText input = findViewById(R.id.userPhone);
inputDel = findViewById(R.id.del);
input.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void afterTextChanged(Editable editable) {
if (input.getEditableText().length() >= 1) {
inputDel.setVisibility(View.VISIBLE);
} else {
inputDel.setVisibility(View.GONE);
}
}
});
inputDel.setOnClickListener(new View.OnClickListener() {
@Override
//点击事件(清空)
public void onClick(View view) {
input.setText("");
}
});
}
public void OnButtonToLogin() {
final EditText phoneEdit = findViewById(R.id.userPhone);
final EditText passwordEdit = findViewById(R.id.userPassword);
final Button btn_login = findViewById(R.id.submit);
btn_login.setOnClickListener(new View.OnClickListener() {
public void onClick(View arg0) {
final String input_phone = phoneEdit.getText().toString().trim();
String input_password = passwordEdit.getText().toString().trim();
// 不为空
if (input_phone.length() != 0 && input_password.length() != 0) {
// 密码长度大于等于6且小于等于20
if (input_password.length() >= 6 && input_password.length() <= 20) {
// 通过接口判断密码是否正确
if (input_password.length() != 0) {
//加载中对话框
showCommonDialog(LoginPage.this);
try {
Intent intent = new Intent(LoginPage.this, MainActivity.class);
startActivity(intent);
} catch (Exception e) {
e.printStackTrace();
}
dialogHandler.sendEmptyMessageDelayed(0, 1000);
} else {
builder = new AlertDialog.Builder(LoginPage.this)
.setMessage("号码或者密码不正确")
.setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
//ToDo: 关闭弹窗
dialogInterface.dismiss();
}
});
builder.create().show();
}
} else {
builder = new AlertDialog.Builder(LoginPage.this)
.setMessage("普通成员的密码需要6~20位字符为保证安全性请在大写英文字母小写英文字母数字和特殊符号中选中至少两项组合为密码。")
.setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
//ToDo: 关闭弹窗
dialogInterface.dismiss();
}
});
builder.create().show();
}
} else {
Toast.makeText(LoginPage.this, "用户名或密码不能为空!", Toast.LENGTH_SHORT).show();
}
}
});
}
public void OnButtonToRegister() {
Button regis = findViewById(R.id.register);
regis.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(LoginPage.this, RegisterFirstPage.class);
startActivity(intent);
}
});
}
//初始化页面底部可点击文本
public void initView() {
TextView textView1 = findViewById(R.id.retrieve);
TextView textView2 = findViewById(R.id.loss);
SpannableStringBuilder stringBuilder1 = new SpannableStringBuilder("找回密码");
SpannableStringBuilder stringBuilder2 = new SpannableStringBuilder("账号挂失");
TextViewSpan1 span1 = new TextViewSpan1();
TextViewSpan2 span2 = new TextViewSpan2();
//找回密码
stringBuilder1.setSpan(span1, 0, 4, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
textView1.setText(stringBuilder1);
//账号挂失
stringBuilder2.setSpan(span2, 0, 4, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
textView2.setText(stringBuilder2);
//一定要记得设置这个方法 不然不起作用
textView1.setMovementMethod(LinkMovementMethod.getInstance());
textView2.setMovementMethod(LinkMovementMethod.getInstance());
//取消文本的点击背景
textView1.setHighlightColor(getResources().getColor(android.R.color.transparent));
textView2.setHighlightColor(getResources().getColor(android.R.color.transparent));
//修改状态栏字体为黑色
StatusBarUtil.setAndroidNativeLightStatusBar(this, true);
}
//找回密码
private class TextViewSpan1 extends ClickableSpan {
@Override
public void updateDrawState(TextPaint ds) {
//设置是否有下划线
ds.setUnderlineText(false);
}
@Override
public void onClick(View widget) {
//点击事件
Intent intent = new Intent(LoginPage.this, RetrievePasswordPage.class);
startActivity(intent);
//点击后设置可点击文本的字体颜色
// TextView textView = findViewById(R.id.retrieve);
// textView.setTextColor(Color.parseColor("#6495ED"));
}
}
//账号挂失
private class TextViewSpan2 extends ClickableSpan {
@Override
public void updateDrawState(TextPaint ds) {
//设置是否有下划线
ds.setUnderlineText(false);
}
@Override
public void onClick(View widget) {
//点击事件
Intent intent = new Intent(LoginPage.this, LossPage.class);
startActivity(intent);
}
}
}

@ -0,0 +1,21 @@
package com.example.androidtermwork;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Build;
import android.os.Bundle;
import android.view.WindowManager;
import com.example.androidtermwork.util.StatusBarUtil;
public class LossPage extends AppCompatActivity {
@RequiresApi(api = Build.VERSION_CODES.M)
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_loss_page);
StatusBarUtil.setAndroidNativeLightStatusBar(this, true);
}
}

@ -0,0 +1,129 @@
package com.example.androidtermwork;
import android.content.Intent;
import android.os.Bundle;
import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.text.TextPaint;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import androidx.annotation.Nullable;
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 {
static final int POINTS_PAGE = 0x36f2;
private NavController navController;
@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.
AppBarConfiguration appBarConfiguration = new AppBarConfiguration.Builder(
R.id.navigation_home, R.id.navigation_dashboard, R.id.navigation_notifications)
.build();
navController = Navigation.findNavController(this, R.id.nav_host_fragment);
//顶部菜单栏
// NavigationUI.setupActionBarWithNavController(this, navController, appBarConfiguration);
NavigationUI.setupWithNavController(navView, navController);
initView();
}
//初始化可点击文本
public void initView() {
int score = 9000;
TextView scoreText = findViewById(R.id.score);
TextView ownText = findViewById(R.id.own);
scoreText.setText(String.valueOf(score));
SpannableStringBuilder stringBuilder1 = new SpannableStringBuilder(scoreText.getText());
SpannableStringBuilder stringBuilder2 = new SpannableStringBuilder(ownText.getText());
MainActivity.TextViewSpan1 span1 = new MainActivity.TextViewSpan1();
MainActivity.TextViewSpan2 span2 = new MainActivity.TextViewSpan2();
//积分
stringBuilder1.setSpan(span1, 0, scoreText.getText().length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
scoreText.setText(stringBuilder1);
scoreText.setMovementMethod(LinkMovementMethod.getInstance());
//我的
stringBuilder2.setSpan(span2, 0, ownText.getText().length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
ownText.setText(stringBuilder2);
ownText.setMovementMethod(LinkMovementMethod.getInstance());
//取消文本的点击背景
scoreText.setHighlightColor(getResources().getColor(android.R.color.transparent));
ownText.setHighlightColor(getResources().getColor(android.R.color.transparent));
}
//积分
private class TextViewSpan1 extends ClickableSpan {
@Override
public void updateDrawState(TextPaint ds) {
//设置是否有下划线
ds.setUnderlineText(false);
}
@Override
public void onClick(View widget) {
//点击事件
//Toast.makeText(MainActivity.this, "点击积分", Toast.LENGTH_SHORT).show();
Intent intent = new Intent(MainActivity.this, PointsPage.class);
startActivityForResult(intent, POINTS_PAGE);
}
}
//我的
private class TextViewSpan2 extends ClickableSpan {
@Override
public void updateDrawState(TextPaint ds) {
//设置是否有下划线
ds.setUnderlineText(false);
}
@Override
public void onClick(View widget) {
//点击事件
Intent intent = new Intent(MainActivity.this,MinePage.class);
startActivity(intent);
}
}
/**
* Activity
* @param requestCode
* @param resultCode
* @param data
*/
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == RESULT_CANCELED || data == null)
return;
if (requestCode == POINTS_PAGE){
handlePointsPageResult(data.getStringExtra("goAction"));
}
}
/**
* ActivityTab
* @param goAction
*/
private void handlePointsPageResult(String goAction)
{
switch (goAction){
//如果点击的是“我要选读文章”的去做任务则导航到第二个Tab
case "res_article":navController.navigate(R.id.navigation_dashboard);break;
case "res_tv":navController.navigate(R.id.navigation_notifications);break;
}
}
}

@ -0,0 +1,34 @@
package com.example.androidtermwork;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import com.example.androidtermwork.util.StatusBarUtil;
public class MinePage extends AppCompatActivity {
private Toolbar toolbar;
@RequiresApi(api = Build.VERSION_CODES.M)
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_mine_page);
StatusBarUtil.setAndroidNativeLightStatusBar(this, true);
toolbar = findViewById(R.id.mine_toolbar);
eventListener();
}
private void eventListener() {
//右上角返回
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish(); // 返回
}
});
}
}

@ -0,0 +1,92 @@
package com.example.androidtermwork;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;
import com.example.androidtermwork.adpter.PointsItemAdapter;
import com.example.androidtermwork.pojo.PointSummary;
import com.example.androidtermwork.pojo.PointTask;
import com.example.androidtermwork.util.ResourceUtil;
import com.example.androidtermwork.util.StatusBarUtil;
import com.example.androidtermwork.util.TestUtil;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import java.util.List;
@RequiresApi(api = Build.VERSION_CODES.M)
public class PointsPage extends AppCompatActivity {
private Gson gson;
private Toolbar toolbar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_points_page);
initInstance();
//setToolbar();
bindListViewData();
StatusBarUtil.setAndroidNativeLightStatusBar(this, true);
eventListener();
}
/**
* ()
*/
private void initInstance() {
gson = new Gson();
toolbar = findViewById(R.id.points_toolbar);
}
/**
*
*/
private void eventListener() {
//右上角返回
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish(); // 返回
}
});
}
/**
* ListView
*/
private void bindListViewData() {
PointSummary pointSummary =
gson.fromJson(
TestUtil.getJson("mock_user_points.json", this),
PointSummary.class);
int dan = pointSummary.getDan();
pointSummary.setDanName(getResources().getStringArray(R.array.dan_name_array)[dan]);
pointSummary.setDanStar(
ResourceUtil.getIdentifier(this, getString(R.string.dan_star_prefix) + dan, "mipmap")
);
List<PointTask> pointTasks = gson.fromJson(
TestUtil.getJson("mock_list_task.json", this),
new TypeToken<List<PointTask>>() {
}.getType()
);
ListView listView = findViewById(R.id.contentListView);
listView.setAdapter(new PointsItemAdapter(this, pointSummary, pointTasks));
}
/**
* ToolBar
*/
private void setToolbar() {
setSupportActionBar(toolbar);
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
}

@ -0,0 +1,104 @@
package com.example.androidtermwork;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import com.example.androidtermwork.util.StatusBarUtil;
public class RegisterFirstPage extends AppCompatActivity {
private AlertDialog.Builder builder;
private ImageView inputDel; //一键清除输入内容
private Button next; //下一步
@RequiresApi(api = Build.VERSION_CODES.M)
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_retrieve_password_page);
//复用找回密码页面,将“请输入手机号”替换为“新用户注册”
TextView textView = findViewById(R.id.fontText);
textView.setText("新用户注册");
OnButtonToNext();
//清空输入框
inputClear();
//设置状态栏字体为黑色
StatusBarUtil.setAndroidNativeLightStatusBar(this, true);
}
public void OnButtonToNext() {
final EditText phoneNumber = findViewById(R.id.userPhone);
next = findViewById(R.id.submit_next);
next.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String input_phoneNumber = phoneNumber.getText().toString().trim();
// 密码长度大于等于6且小于等于20
if (input_phoneNumber.length() == 11) {
// 通过接口设置密码
Intent intent = new Intent(RegisterFirstPage.this, RegisterSecondPage.class);
startActivity(intent);
} else {
builder = new AlertDialog.Builder(RegisterFirstPage.this)
.setMessage("请输入11位手机号。")
.setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
//ToDo: 关闭弹窗
dialogInterface.dismiss();
}
});
builder.create().show();
}
}
});
}
/**
*
*/
private void inputClear() {
//设置监听器
final EditText input = findViewById(R.id.userPhone);
inputDel = findViewById(R.id.del);
input.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void afterTextChanged(Editable editable) {
if (input.getEditableText().length() >= 1) {
inputDel.setVisibility(View.VISIBLE);
} else {
inputDel.setVisibility(View.GONE);
}
}
});
inputDel.setOnClickListener(new View.OnClickListener() {
@Override
//点击事件(清空)
public void onClick(View view) {
input.setText("");
}
});
}
}

@ -0,0 +1,98 @@
package com.example.androidtermwork;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.text.method.HideReturnsTransformationMethod;
import android.text.method.PasswordTransformationMethod;
import android.text.method.TransformationMethod;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import com.example.androidtermwork.util.StatusBarUtil;
public class RegisterSecondPage extends AppCompatActivity {
private AlertDialog.Builder builder;
private Button next; //下一步
private boolean isHideFirst = true;// 输入框密码是否是隐藏的默认为true
private ImageView imageView_password;
@RequiresApi(api = Build.VERSION_CODES.M)
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_reset_password_page);
OnButtonToNext();
//密码显示或隐藏
showOrHide();
//设置状态栏字体为黑色
StatusBarUtil.setAndroidNativeLightStatusBar(this, true);
}
public void OnButtonToNext() {
final EditText passwordEdit = findViewById(R.id.userPassword);
next = findViewById(R.id.submit_next);
next.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String input_password = passwordEdit.getText().toString().trim();
// 密码长度大于等于6且小于等于20
if (input_password.length() >= 6 && input_password.length() <= 20) {
// 通过接口设置密码
Intent intent = new Intent(RegisterSecondPage.this, RegisterThirdPage.class);
startActivity(intent);
} else {
builder = new AlertDialog.Builder(RegisterSecondPage.this)
.setMessage("普通成员的密码需要6~20位字符为保证安全性请在大写英文字母小写英文字母数字和特殊符号中选中至少两项组合为密码。")
.setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
//ToDo: 关闭弹窗
dialogInterface.dismiss();
}
});
builder.create().show();
}
}
});
}
/**
*
*/
private void showOrHide() {
final EditText password = findViewById(R.id.userPassword);
imageView_password = findViewById(R.id.imageView);
imageView_password.setImageResource(R.mipmap.visibleoff);
imageView_password.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (isHideFirst == true) {
imageView_password.setImageResource(R.mipmap.visibleon);
//密文
HideReturnsTransformationMethod method1 = HideReturnsTransformationMethod.getInstance();
password.setTransformationMethod(method1);
isHideFirst = false;
} else {
imageView_password.setImageResource(R.mipmap.visibleoff);
//密文
TransformationMethod method = PasswordTransformationMethod.getInstance();
password.setTransformationMethod(method);
isHideFirst = true;
}
// 光标的位置
int index = password.getText().toString().length();
password.setSelection(index);
}
});
}
}

@ -0,0 +1,89 @@
package com.example.androidtermwork;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import com.example.androidtermwork.util.StatusBarUtil;
public class RegisterThirdPage extends AppCompatActivity {
private ImageView inputDel; //一键清除输入内容
private Button intoApp; //进入学习强国
@RequiresApi(api = Build.VERSION_CODES.M)
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register_third_page);
OnButtonIntoApp();
//清空输入框
inputClear();
//设置状态栏字体为黑色
StatusBarUtil.setAndroidNativeLightStatusBar(this, true);
}
//点击进入学习强国
public void OnButtonIntoApp() {
intoApp = findViewById(R.id.submit_intoApp);
intoApp.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
LoginPage.showCommonDialog(RegisterThirdPage.this);
try {
Intent intent = new Intent(RegisterThirdPage.this, LoginPage.class);
startActivity(intent);
} catch (Exception e) {
e.printStackTrace();
}
LoginPage.dialogHandler.sendEmptyMessageDelayed(0,1000);
}
});
}
/**
*
*/
private void inputClear() {
//设置监听器
final EditText input = findViewById(R.id.userName);
inputDel = findViewById(R.id.del);
input.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void afterTextChanged(Editable editable) {
if (input.getEditableText().length() >= 1) {
inputDel.setVisibility(View.VISIBLE);
} else {
inputDel.setVisibility(View.GONE);
}
}
});
inputDel.setOnClickListener(new View.OnClickListener() {
@Override
//点击事件(清空)
public void onClick(View view) {
input.setText("");
}
});
}
}

@ -0,0 +1,99 @@
package com.example.androidtermwork;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.text.method.HideReturnsTransformationMethod;
import android.text.method.PasswordTransformationMethod;
import android.text.method.TransformationMethod;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Toast;
import com.example.androidtermwork.util.StatusBarUtil;
public class ResetPasswordPage extends AppCompatActivity {
private AlertDialog.Builder builder;
private Button next; //下一步
private boolean isHideFirst = true;// 输入框密码是否是隐藏的默认为true
private ImageView imageView_password;
@RequiresApi(api = Build.VERSION_CODES.M)
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_reset_password_page);
OnButtonToNext();
//密码显示或隐藏
showOrHide();
//设置状态栏字体为黑色
StatusBarUtil.setAndroidNativeLightStatusBar(this, true);
}
public void OnButtonToNext() {
final EditText passwordEdit = findViewById(R.id.userPassword);
next = findViewById(R.id.submit_next);
next.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String input_password = passwordEdit.getText().toString().trim();
// 密码长度大于等于6且小于等于20
if (input_password.length() >= 6 && input_password.length() <= 20) {
// 通过接口设置密码
Intent intent = new Intent(ResetPasswordPage.this, LoginPage.class);
startActivity(intent);
} else {
builder = new AlertDialog.Builder(ResetPasswordPage.this)
.setMessage("普通成员的密码需要6~20位字符为保证安全性请在大写英文字母小写英文字母数字和特殊符号中选中至少两项组合为密码。")
.setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
//ToDo: 关闭弹窗
dialogInterface.dismiss();
}
});
builder.create().show();
}
}
});
}
/**
*
*/
private void showOrHide() {
final EditText password = findViewById(R.id.userPassword);
imageView_password = findViewById(R.id.imageView);
imageView_password.setImageResource(R.mipmap.visibleoff);
imageView_password.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (isHideFirst == true) {
imageView_password.setImageResource(R.mipmap.visibleon);
//密文
HideReturnsTransformationMethod method1 = HideReturnsTransformationMethod.getInstance();
password.setTransformationMethod(method1);
isHideFirst = false;
} else {
imageView_password.setImageResource(R.mipmap.visibleoff);
//密文
TransformationMethod method = PasswordTransformationMethod.getInstance();
password.setTransformationMethod(method);
isHideFirst = true;
}
// 光标的位置
int index = password.getText().toString().length();
password.setSelection(index);
}
});
}
}

@ -0,0 +1,98 @@
package com.example.androidtermwork;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import com.example.androidtermwork.util.StatusBarUtil;
public class RetrievePasswordPage extends AppCompatActivity {
private AlertDialog.Builder builder;
private ImageView inputDel; //一键清除输入内容
private Button next; //下一步
@RequiresApi(api = Build.VERSION_CODES.M)
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_retrieve_password_page);
OnButtonToNext();
inputClear();
//设置状态栏字体为黑色
StatusBarUtil.setAndroidNativeLightStatusBar(this, true);
}
public void OnButtonToNext() {
final EditText phoneNumber = findViewById(R.id.userPhone);
next = findViewById(R.id.submit_next);
next.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String input_phoneNumber = phoneNumber.getText().toString().trim();
// 密码长度大于等于6且小于等于20
if (input_phoneNumber.length() == 11) {
// 通过接口设置密码
Intent intent = new Intent(RetrievePasswordPage.this, ResetPasswordPage.class);
startActivity(intent);
} else {
builder = new AlertDialog.Builder(RetrievePasswordPage.this)
.setMessage("请输入11位手机号。")
.setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
//ToDo: 关闭弹窗
dialogInterface.dismiss();
}
});
builder.create().show();
}
}
});
}
/**
*
*/
private void inputClear() {
//设置监听器
final EditText input = findViewById(R.id.userPhone);
inputDel = findViewById(R.id.del);
input.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void afterTextChanged(Editable editable) {
if (input.getEditableText().length() >= 1) {
inputDel.setVisibility(View.VISIBLE);
} else {
inputDel.setVisibility(View.GONE);
}
}
});
inputDel.setOnClickListener(new View.OnClickListener() {
@Override
//点击事件(清空)
public void onClick(View view) {
input.setText("");
}
});
}
}

@ -0,0 +1,177 @@
package com.example.androidtermwork;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.LinearSmoothScroller;
import androidx.recyclerview.widget.RecyclerView;
import com.example.androidtermwork.adpter.TVDetailsCommentsAdapter;
import com.example.androidtermwork.pojo.TvComment;
import com.example.androidtermwork.pojo.TvDetails;
import com.example.androidtermwork.util.StatusBarUtil;
import com.example.androidtermwork.util.TestUtil;
import com.example.androidtermwork.view.JzvdPlayer;
import com.google.gson.reflect.TypeToken;
import com.scwang.smart.refresh.layout.SmartRefreshLayout;
import java.util.ArrayList;
import java.util.List;
import cn.jzvd.Jzvd;
public class TvStationPlayPage extends AppCompatActivity {
private TvDetails tvDetails;
private List<TvComment> tvComments;
private RecyclerView detailsCommentsView;
private JzvdPlayer playerStandard;
private Intent startIntent;
private SmartRefreshLayout refreshLayout;
@RequiresApi(api = Build.VERSION_CODES.M)
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_tv_station_play);
//设置状态栏字体为黑色
StatusBarUtil.setAndroidNativeLightStatusBar(this, true);
startIntent = getIntent();
prepareTestData();
buildDetailsData();
initPlayer();
loadDetailsAndComments();
buildCommentIcon();
}
/**
*
*/
private void prepareTestData() {
//第一个视频有测试数据
if (startIntent.getLongExtra("id", 0) == 1){
tvDetails =
TestUtil.getMockData("mock_data_tv_details.json",
new TypeToken<TvDetails>(){}, this);
tvComments = TestUtil.getMockData("mock_data_tv_comments.json",
new TypeToken<List<TvComment>>(){}, this);
} else {
tvDetails = new TvDetails();
tvComments = new ArrayList<>();
tvDetails.setPlayCounts((long)(Math.random() * 1005));
tvDetails.setFeelGoodCounts((long)(Math.random() * 105));
tvDetails.setCollect((Math.random() + 0.5) > 1.0d);
tvDetails.setFeelGood((Math.random() + 0.5) > 1.0d);
tvDetails.setIntroduction("暂无简介");
closeLoadMore();
}
}
/**
*
*/
private void closeLoadMore(){
if (refreshLayout == null)
refreshLayout = findViewById(R.id.videoInfoRefreshLayout);
refreshLayout.setEnableLoadMore(false);
}
/**
*
*/
private void loadDetailsAndComments() {
detailsCommentsView = findViewById(R.id.play_recyclerView);
TVDetailsCommentsAdapter dataAdapter = new TVDetailsCommentsAdapter(this);
dataAdapter.setTvDetails(tvDetails);
dataAdapter.setTvComments(tvComments);
LinearLayoutManager layoutManager = new LinearLayoutManager(this);
detailsCommentsView.setLayoutManager(layoutManager);
detailsCommentsView.setAdapter(dataAdapter);
}
/**
*
*
*/
private void buildDetailsData(){
tvDetails.setId(startIntent.getLongExtra("id", 0));
tvDetails.setTitle(startIntent.getStringExtra("title"));
tvDetails.setAuthor(startIntent.getStringExtra("author"));
tvDetails.setDate(startIntent.getStringExtra("date"));
tvDetails.setSourceUrl(startIntent.getStringExtra("sourceUrl"));
}
/**
*
*/
private void initPlayer(){
playerStandard = findViewById(R.id.play_playerStandard);
playerStandard.setUp(tvDetails.getSourceUrl(),"");
playerStandard.startVideo();
}
/**
*
*/
private void buildCommentIcon() {
ImageView icon = findViewById(R.id.icComment);
TextView commentCount = findViewById(R.id.tvCommentCount);
if (tvComments.size() > 0){
commentCount.setText(String.valueOf(tvComments.size()));
icon.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
scrollItemToTop(1);
}
});
} else {
commentCount.setVisibility(View.GONE);
}
}
@Override
public void onBackPressed() {
if (Jzvd.backPress()) {
return;
}
super.onBackPressed();
}
@Override
protected void onPause() {
super.onPause();
Jzvd.releaseAllVideos();
}
@Override
protected void onDestroy() {
super.onDestroy();
}
private void scrollItemToTop(int position){
LinearSmoothScroller smoothScroller = new LinearTopSmoothScroller(this);
smoothScroller.setTargetPosition(position);
detailsCommentsView.getLayoutManager().startSmoothScroll(smoothScroller);
}
}
class LinearTopSmoothScroller extends LinearSmoothScroller {
public LinearTopSmoothScroller(Context context) {
super(context);
}
@Override
protected int getVerticalSnapPreference() {
return SNAP_TO_START;
}
}

@ -0,0 +1,37 @@
package com.example.androidtermwork;
import androidx.appcompat.app.AppCompatActivity;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.WindowManager;
public class WelcomePage extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_welcome_page);
// //设置全屏
// getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
// //隐藏顶部标题栏
// getSupportActionBar().hide();
//设置延时时间
handler.sendEmptyMessageDelayed(0,1000);
}
@SuppressLint("HandlerLeak")
private Handler handler = new Handler() {
@Override
public void handleMessage(Message msg) {
//实现页面的跳转
Intent intent = new Intent(WelcomePage.this, LoginPage.class);
startActivity(intent);
finish();
super.handleMessage(msg);
}
};
}

@ -0,0 +1,263 @@
package com.example.androidtermwork.adpter;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.style.ForegroundColorSpan;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import com.example.androidtermwork.Activity1;
import com.example.androidtermwork.R;
import com.example.androidtermwork.pojo.PointSummary;
import com.example.androidtermwork.pojo.PointTask;
import com.example.androidtermwork.util.TestUtil;
import org.w3c.dom.Text;
import java.util.List;
/**
* ListViewListView
*
*/
public class PointsItemAdapter extends BaseAdapter {
private static final int TYPE_SUMMARY = 0; //表示积分概述
private static final int TYPE_TASK = 1; //表示积分任务
private Context context;
private PointSummary summary; //积分概述
private List<PointTask> pointTasks; //积分任务列表
public PointsItemAdapter(Context context, PointSummary summary, List<PointTask> pointTasks) {
super();
this.context = context;
this.summary = summary;
this.pointTasks = pointTasks;
}
@Override
public int getCount() {
return pointTasks.size() + 1;
}
@Override
public Object getItem(int position) {
return null;
}
@Override
public long getItemId(int position) {
return 0;
}
@Override
public int getItemViewType(int position) {
return position == 0 ? TYPE_SUMMARY : TYPE_TASK; //只有第一个列表项是概述,之后的都是任务
}
@Override
public int getViewTypeCount() {
return 2; //概述、任务2种类型的item放在ListView中
}
@Override
public boolean isEnabled(int position) {
return false;
}
@SuppressLint("InflateParams")
@Override
public View getView(int position, View convertView, ViewGroup parent) {
TaskSummaryViewHolder summaryHolder;
TaskViewHolder taskHolder;
switch (getItemViewType(position)) {
case TYPE_SUMMARY: {
if (convertView == null) {
convertView = LayoutInflater.from(context).inflate(R.layout.points_page_item_sum, null);
summaryHolder = buildSummaryViewHolder(convertView);
convertView.setTag(summaryHolder);
} else {
summaryHolder = (TaskSummaryViewHolder) convertView.getTag();
}
buildPointSummaryLayout(summaryHolder);
break;
}
case TYPE_TASK: {
if (convertView == null) {
convertView = LayoutInflater.from(context).inflate(R.layout.points_page_item_task, null);
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
convertView.setLayoutParams(layoutParams);
taskHolder = buildTaskViewHolder(convertView);
convertView.setTag(taskHolder);
} else {
taskHolder = (TaskViewHolder) convertView.getTag();
}
buildPointTaskLayout(taskHolder, position - 1);
break;
}
}
return convertView;
}
/**
* ViewHolder
*
* @param summaryView
* @return viewHolder
*/
private TaskSummaryViewHolder buildSummaryViewHolder(View summaryView) {
TaskSummaryViewHolder viewHolder = new TaskSummaryViewHolder();
viewHolder.points = summaryView.findViewById(R.id.tvPoints);
viewHolder.danName = summaryView.findViewById(R.id.tvDanName);
viewHolder.pointsToday = summaryView.findViewById(R.id.tvPointsToday);
viewHolder.danStars = summaryView.findViewById(R.id.imgDanStar);
return viewHolder;
}
/**
*
*
* @param viewHolder
*/
private void buildPointSummaryLayout(TaskSummaryViewHolder viewHolder) {
viewHolder.points.setText(String.valueOf(this.summary.getPoints()));
viewHolder.danName.setText(String.format(context.getString(R.string.dan_name),
this.summary.getDanName()));
viewHolder.danStars.setImageDrawable(context.getDrawable(summary.getDanStar()));
SpannableString pointsTodayString =
SpannableString.valueOf(String.format(context.getString(R.string.today_points),
summary.getPointsToday()));
pointsTodayString.setSpan(new ForegroundColorSpan(Color.RED), 6, pointsTodayString.length(),
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); //标红 ”%d积分“
viewHolder.pointsToday.setText(pointsTodayString);
}
/**
* ViewHolder
*
* @param taskView
* @return
*/
private TaskViewHolder buildTaskViewHolder(View taskView) {
TaskViewHolder taskViewHolder = new TaskViewHolder();
taskViewHolder.name = taskView.findViewById(R.id.taskName);
taskViewHolder.description = taskView.findViewById(R.id.taskDescription);
taskViewHolder.pointDetails = taskView.findViewById(R.id.taskPointsDetail);
taskViewHolder.go = taskView.findViewById(R.id.taskGo);
taskViewHolder.pointsProgress = taskView.findViewById(R.id.progress_bar_points);
return taskViewHolder;
}
/**
*
*
* @param position
* @param viewHolder
*/
private void buildPointTaskLayout(TaskViewHolder viewHolder, int position) {
PointTask pointTaskData = this.pointTasks.get(position);
viewHolder.name.setText(pointTaskData.getName());
viewHolder.description.setText(pointTaskData.getDescription());
int pointsToday = pointTaskData.getTodayPoints();
int pointsLimit = pointTaskData.getPointsLimit();
String pointDetails = String.format(context.getString(R.string.today_points_details),
pointsToday, pointsLimit);
viewHolder.pointDetails.setText(pointDetails);
viewHolder.pointsProgress.setProgress((int) ((double) pointsToday / pointsLimit * 100));
//根据今日积分和积分上限判断今日该任务是否完成,未完成添加跳转界面的事件监听器
String backColor = context.getString(R.string.background_todo);
String textColor = context.getString(R.string.text_todo);
String text = "去看看";
if (pointsToday == pointsLimit) {
backColor = context.getString(R.string.background_done);
textColor = context.getString(R.string.text_done);
text = "已完成";
}
if (pointsToday < pointsLimit || pointTaskData.getGoAction().startsWith("new_")){
viewHolder.go.setTag(pointTaskData.getGoAction()); //将动作描述设置为去做任务TextView的tag
viewHolder.go.setOnClickListener(new DoTaskClickListener(context));
}
viewHolder.go.setText(text);
viewHolder.go.setTextColor(Color.parseColor(textColor));
viewHolder.go.setBackgroundColor(Color.parseColor(backColor));
}
/**
* ViewHolderTag
*
*/
private static final class TaskSummaryViewHolder {
TextView points; //总积分
TextView pointsToday; //今日已累积积分
TextView danName; //段位名称
ImageView danStars; //段位星星数图片
}
private static final class TaskViewHolder {
TextView name; //任务名称
TextView description; //任务描述
TextView pointDetails; //积分详情
TextView go; //去做任务
ProgressBar pointsProgress; //积分进度条
}
}
//点击去做任务的事件监听器
class DoTaskClickListener implements View.OnClickListener {
private Context context;
public DoTaskClickListener(Context context) {
this.context = context;
}
@Override
public void onClick(View v) {
String task = (String) v.getTag();
AppCompatActivity activity = (AppCompatActivity) context;
if (task.startsWith("res_")) {
activity.setResult(Activity.RESULT_OK, new Intent().putExtra("goAction", task));
activity.finish();
return;
}
//TestUtil.showSnakeBarMessage(task, -1, v);
switch (task){
case "new_dailyQ":
Intent intent = new Intent(context, Activity1.class);
context.startActivity(intent);
break;
case "new_weeklyQ":
Intent intent1 = new Intent(context, Activity1.class);
context.startActivity(intent1);
break;
//case...
}
activity.finish();
}
}

@ -0,0 +1,281 @@
package com.example.androidtermwork.adpter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.RecyclerView;
import com.android.volley.RequestQueue;
import com.android.volley.toolbox.ImageLoader;
import com.android.volley.toolbox.Volley;
import com.example.androidtermwork.R;
import com.example.androidtermwork.pojo.TvComment;
import com.example.androidtermwork.pojo.TvDetails;
import com.example.androidtermwork.util.FormatUtil;
import com.example.androidtermwork.util.TestUtil;
import com.example.androidtermwork.volley.BitmapCache;
import java.util.List;
import de.hdodenhof.circleimageview.CircleImageView;
public class TVDetailsCommentsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
private TvDetails tvDetails;
private List<TvComment> tvComments;
private static final int DETAILS = 0;
private static final int COMMENT = 1;
private static final int HINT_NO_COMMENT = 2;
private static boolean isMoreInfoOpened = false;
private RequestQueue requestQueue;
private ImageLoader imageLoader;
private Context context;
public TVDetailsCommentsAdapter(Context context){
this.context = context;
requestQueue = Volley.newRequestQueue(context);
imageLoader = new ImageLoader(requestQueue, new BitmapCache());
}
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
RecyclerView.ViewHolder viewHolder;
View view;
switch (viewType){
case DETAILS:
view = LayoutInflater.from(parent.getContext()).inflate(R.layout.tv_play_details_item, parent, false);
viewHolder = new TvDetailsViewHolder(view);
break;
case COMMENT:
view = LayoutInflater.from(parent.getContext()).inflate(R.layout.tv_play_comment_item, parent, false);
viewHolder = new TvCommentsViewHolder(view);
break;
default: // case HINT_NO_COMMENT:
view = LayoutInflater.from(parent.getContext()).inflate(R.layout.tv_play_hint_item_nocomment, parent, false);
viewHolder = new RecyclerView.ViewHolder(view){};
break;
}
return viewHolder;
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
if (holder instanceof TvDetailsViewHolder){
bindDetailsData(holder);
} else if (holder instanceof TvCommentsViewHolder){
bindCommentData(holder, position);
}
}
private void bindCommentData(RecyclerView.ViewHolder viewHolder, int position) {
TvCommentsViewHolder holder = (TvCommentsViewHolder) viewHolder;
TvComment comment = tvComments.get(position - 1);
//请求并设置头像
if (comment.getUserHead() != null) {
imageLoader.get(comment.getUserHead(),
ImageLoader.getImageListener(holder.userHeadImage, R.mipmap.loading_head_portrait, R.mipmap.default_head_portrait));
} else {
holder.userHeadImage.setImageResource(R.mipmap.default_head_portrait);
}
//设置用户名
holder.userName.setText(comment.getUserName());
//设置评论内容
holder.commentContent.setText(comment.getCommentContent());
//设置评论发表时间
holder.commentDate.setText(comment.getCommentDate());
//设置点赞
holder.setFeelGood(comment.getFeelGoodCounts(), comment.isFeelGood());
//设置点赞事件监听(测试,跳过接口调用)
holder.feelGoodHub.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (comment.isFeelGood()){
comment.setFeelGood(false);
comment.setFeelGoodCounts(comment.getFeelGoodCounts() - 1);
} else {
comment.setFeelGood(true);
comment.setFeelGoodCounts(comment.getFeelGoodCounts() + 1);
}
holder.setFeelGood(comment.getFeelGoodCounts(), comment.isFeelGood());
}
});
//todo 设置点击回复事件监听
}
private void bindDetailsData(RecyclerView.ViewHolder viewHolder) {
TvDetailsViewHolder holder = (TvDetailsViewHolder) viewHolder;
//设置视频标题
holder.title.setText(tvDetails.getTitle());
//设置作者和发布时间
String authorAndDate = tvDetails.getAuthor() + " " + tvDetails.getDate();
holder.authorAndDate.setText(authorAndDate);
//设置播放量
String playCounts = "播放 " + FormatUtil.simpleFormat(tvDetails.getPlayCounts());
holder.playCounts.setText(playCounts);
//设置点赞数
holder.setFeelGood(tvDetails.getFeelGoodCounts(), tvDetails.isFeelGood());
//点赞数事件监听
holder.feelGood.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (!tvDetails.isFeelGood()){
// 调用相关接口,成功后增加点赞数
//测试,跳过接口调用
tvDetails.setFeelGoodCounts(tvDetails.getFeelGoodCounts() + 1);
tvDetails.setFeelGood(true);
} else {
//调用相关接口,成功后减少点赞数
//测试,跳过接口调用
tvDetails.setFeelGoodCounts(tvDetails.getFeelGoodCounts() - 1);
tvDetails.setFeelGood(false);
}
holder.setFeelGood(tvDetails.getFeelGoodCounts(), tvDetails.isFeelGood());
}
});
//设置简介
holder.introduction.setText(tvDetails.getIntroduction());
//设置更多信息和展开更多信息
holder.moreInfo.setVisibility(View.GONE);
if (tvDetails.getMoreInfo() == null || tvDetails.getMoreInfo().length() == 0) {
holder.openOrCloseHub.setVisibility(View.GONE);
} else {
holder.moreInfo.setText(tvDetails.getMoreInfo());
holder.openOrCloseHub.setOnClickListener(view -> {
ImageView openOrClose = view.findViewById(R.id.tvPlay_openOrCloseImage);
if (isMoreInfoOpened){
isMoreInfoOpened = false;
openOrClose.setRotation(0f);
holder.moreInfo.setVisibility(View.GONE);
} else {
isMoreInfoOpened = true;
openOrClose.setRotation(180f);
holder.moreInfo.setVisibility(View.VISIBLE);
}
});
}
}
@Override
public int getItemCount() {
int t = tvComments.size() + 1;
return t == 1 ? 2 : t;
}
@Override
public int getItemViewType(int position) {
int type = COMMENT;
if (tvComments.size() == 0){
type = HINT_NO_COMMENT;
}
return position == 0 ? DETAILS : type;
}
public TvDetails getTvDetails() {
return tvDetails;
}
public void setTvDetails(TvDetails tvDetails) {
this.tvDetails = tvDetails;
}
public List<TvComment> getTvComments() {
return tvComments;
}
public void setTvComments(List<TvComment> tvComments) {
this.tvComments = tvComments;
}
class TvDetailsViewHolder extends RecyclerView.ViewHolder {
TextView title;
TextView authorAndDate;
TextView moreInfo;
TextView playCounts;
CheckBox feelGood;
TextView introduction;
RelativeLayout openOrCloseHub;
public TvDetailsViewHolder(@NonNull View itemView) {
super(itemView);
title = itemView.findViewById(R.id.title);
authorAndDate = itemView.findViewById(R.id.authorAndDate);
moreInfo = itemView.findViewById(R.id.moreInfo);
playCounts = itemView.findViewById(R.id.playCounts);
feelGood = itemView.findViewById(R.id.feelGood);
introduction = itemView.findViewById(R.id.introduction);
openOrCloseHub = itemView.findViewById(R.id.tvPlay_openOrCloseHub);
}
/**
*
* @param counts
* @param status
*/
private void setFeelGood(long counts, boolean status){
String feelGoodCounts = "点赞 " + FormatUtil.simpleFormat(counts);
feelGood.setText(feelGoodCounts);
feelGood.setChecked(status);
}
}
class TvCommentsViewHolder extends RecyclerView.ViewHolder{
CircleImageView userHeadImage;
TextView userName;
TextView feelGoodCounts;
ImageView feelGood;
TextView commentContent;
TextView commentDate;
TextView reply;
LinearLayout feelGoodHub;
public TvCommentsViewHolder(@NonNull View itemView) {
super(itemView);
userHeadImage = itemView.findViewById(R.id.userHeadImage);
userName = itemView.findViewById(R.id.userName);
feelGoodCounts = itemView.findViewById(R.id.commentFeelGoodCounts);
feelGood = itemView.findViewById(R.id.commentFeelGood);
commentContent = itemView.findViewById(R.id.commentContent);
commentDate = itemView.findViewById(R.id.commentDate);
reply = itemView.findViewById(R.id.replyComment);
feelGoodHub = itemView.findViewById(R.id.commentFeelGoodHub);
}
/**
*
* @param counts
* @param status
*/
private void setFeelGood(long counts, boolean status){
String feelGoodCounts = String.valueOf(counts);
if (counts > 10000){
feelGoodCounts = String.format("%.2f万", FormatUtil.getFloorCount(counts) /10000.0);
//feelGoodCounts = counts / 10000.0 + "万";
}
this.feelGoodCounts.setText(feelGoodCounts);
if (status){
feelGood.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.feel_good));
} else {
feelGood.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_feel_good));
}
}
}
}

@ -0,0 +1,131 @@
package com.example.androidtermwork.adpter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.android.volley.RequestQueue;
import com.android.volley.toolbox.ImageLoader;
import com.android.volley.toolbox.Volley;
import com.example.androidtermwork.R;
import com.example.androidtermwork.pojo.TVStation;
import com.example.androidtermwork.volley.BitmapCache;
import java.util.List;
public class TVStationAdapter extends BaseAdapter {
private static final int BIG_COVER_TV = 0;
//private static final int STD_COVER_TV = 1;
private Context context;
private List<TVStation> tvStations;
private RequestQueue mQueue;
private ImageLoader imageLoader;
public TVStationAdapter(Context context, List<TVStation> tvStations) {
this.context = context;
this.tvStations = tvStations;
mQueue = Volley.newRequestQueue(context);
imageLoader = new ImageLoader(mQueue, new BitmapCache());
}
public Context getContext() {
return context;
}
public void setContext(Context context) {
this.context = context;
}
public List<TVStation> getTvStations() {
return tvStations;
}
public void setTvStations(List<TVStation> tvStations) {
this.tvStations = tvStations;
}
@Override
public int getCount() {
return tvStations.size();
}
@Override
public Object getItem(int position) {
return tvStations.get(position);
}
@Override
public long getItemId(int position) {
return tvStations.get(position).getId();
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
TVStationViewHolder viewHolder;
TVStation tvStation = tvStations.get(position);
if (convertView != null){
viewHolder = (TVStationViewHolder) convertView.getTag();
bindItemData(tvStation, viewHolder);
return convertView;
}
switch (tvStation.getItemType()){
case BIG_COVER_TV:
convertView = LayoutInflater.from(context).inflate(R.layout.tv_station_big_item, null);
break;
default: convertView = LayoutInflater.from(context).inflate(R.layout.tv_station_standard_item, null);
}
ViewGroup.MarginLayoutParams layoutParams = new ViewGroup.MarginLayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
convertView.setLayoutParams(layoutParams);
viewHolder = buildTVStationViewHolder(convertView);
bindItemData(tvStation, viewHolder);
convertView.setTag(viewHolder);
return convertView;
}
private void bindItemData(TVStation tvStation, TVStationViewHolder viewHolder) {
//设置标题
viewHolder.title.setText(tvStation.getTitle());
//设置作者和发布时间
String authorAndDate = tvStation.getAuthor() + " " + tvStation.getDate();
viewHolder.authorAndDate.setText(authorAndDate);
//设置视频时长
int minutes = tvStation.getTimeLength()/60;
int seconds = tvStation.getTimeLength()%60;
String timeLength = minutes + ":" + seconds;
viewHolder.timeLength.setText(timeLength);
//请求封面图片
imageLoader.get(tvStation.getCover(),
ImageLoader.getImageListener(viewHolder.cover, R.mipmap.img_loading, R.mipmap.img_fail_to_load));
//viewHolder.cover.setImageURI(Uri.parse(tvStation.getCover()));
}
private TVStationViewHolder buildTVStationViewHolder(View convertView) {
TVStationViewHolder viewHolder = new TVStationViewHolder();
viewHolder.cover = convertView.findViewById(R.id.tvImgCover);
viewHolder.title = convertView.findViewById(R.id.tvTitle);
viewHolder.timeLength = convertView.findViewById(R.id.tvTimeLength);
viewHolder.authorAndDate = convertView.findViewById(R.id.tvAuthorDate);
return viewHolder;
}
@Override
public int getViewTypeCount() {
return 2; //大图片封面和小封面图片两种电视台
}
/**
* ViewHolder
*/
private static final class TVStationViewHolder {
ImageView cover; //封面图片
TextView title; //标题
TextView authorAndDate; //作者和发布时间
TextView timeLength; //视频时长
}
}

@ -0,0 +1,51 @@
package com.example.androidtermwork.pojo;
//积分概览
public class PointSummary
{
private int points; //总积分
private int pointsToday; //今日已累积积分
private int dan; //段位
private String danName; //段位名称
private int danStar; //段位星星图片id
public int getPoints() {
return points;
}
public void setPoints(int points) {
this.points = points;
}
public int getPointsToday() {
return pointsToday;
}
public void setPointsToday(int pointsToday) {
this.pointsToday = pointsToday;
}
public String getDanName() {
return danName;
}
public void setDanName(String danName) {
this.danName = danName;
}
public int getDanStar() {
return danStar;
}
public void setDanStar(int danStar) {
this.danStar = danStar;
}
public int getDan() {
return dan;
}
public void setDan(int dan) {
this.dan = dan;
}
}

@ -0,0 +1,51 @@
package com.example.androidtermwork.pojo;
//积分任务
public class PointTask
{
private String name; // 任务名
private String description; // 任务描述
private int todayPoints; // 今日已获积分
private int pointsLimit; // 任务积分上限
private String goAction; // 表示点击去做任务后的动作
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getGoAction() {
return goAction;
}
public void setGoAction(String goAction) {
this.goAction = goAction;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public int getTodayPoints() {
return todayPoints;
}
public void setTodayPoints(int todayPoints) {
this.todayPoints = todayPoints;
}
public int getPointsLimit() {
return pointsLimit;
}
public void setPointsLimit(int pointsLimit) {
this.pointsLimit = pointsLimit;
}
}

@ -0,0 +1,78 @@
package com.example.androidtermwork.pojo;
public class TVStation
{
private long id;
private String cover;
private String videoSource;
private String author;
private String date;
private int timeLength;
private int itemType;
private String title;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getCover() {
return cover;
}
public void setCover(String cover) {
this.cover = cover;
}
public String getVideoSource() {
return videoSource;
}
public void setVideoSource(String videoSource) {
this.videoSource = videoSource;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public int getTimeLength() {
return timeLength;
}
public void setTimeLength(int timeLength) {
this.timeLength = timeLength;
}
public int getItemType() {
return itemType;
}
public void setItemType(int itemType) {
this.itemType = itemType;
}
}

@ -0,0 +1,67 @@
package com.example.androidtermwork.pojo;
public class TvComment {
private String userHead;
private String userId;
private String userName;
private long feelGoodCounts;
private boolean isFeelGood;
private String commentContent;
private String commentDate;
public String getUserHead() {
return userHead;
}
public void setUserHead(String userHead) {
this.userHead = userHead;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public long getFeelGoodCounts() {
return feelGoodCounts;
}
public void setFeelGoodCounts(long feelGoodCounts) {
this.feelGoodCounts = feelGoodCounts;
}
public boolean isFeelGood() {
return isFeelGood;
}
public void setFeelGood(boolean feelGood) {
isFeelGood = feelGood;
}
public String getCommentContent() {
return commentContent;
}
public void setCommentContent(String commentContent) {
this.commentContent = commentContent;
}
public String getCommentDate() {
return commentDate;
}
public void setCommentDate(String commentDate) {
this.commentDate = commentDate;
}
}

@ -0,0 +1,103 @@
package com.example.androidtermwork.pojo;
public class TvDetails {
private long id;
private String title;
private String author;
private String date;
private String moreInfo;
private long playCounts;
private long feelGoodCounts;
private String introduction;
private boolean isFeelGood;
private boolean isCollect;
private String sourceUrl;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public String getMoreInfo() {
return moreInfo;
}
public void setMoreInfo(String moreInfo) {
this.moreInfo = moreInfo;
}
public long getPlayCounts() {
return playCounts;
}
public void setPlayCounts(long playCounts) {
this.playCounts = playCounts;
}
public long getFeelGoodCounts() {
return feelGoodCounts;
}
public void setFeelGoodCounts(long feelGoodCounts) {
this.feelGoodCounts = feelGoodCounts;
}
public String getIntroduction() {
return introduction;
}
public void setIntroduction(String introduction) {
this.introduction = introduction;
}
public boolean isFeelGood() {
return isFeelGood;
}
public void setFeelGood(boolean feelGood) {
isFeelGood = feelGood;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public boolean isCollect() {
return isCollect;
}
public void setCollect(boolean collect) {
isCollect = collect;
}
public String getSourceUrl() {
return sourceUrl;
}
public void setSourceUrl(String sourceUrl) {
this.sourceUrl = sourceUrl;
}
}

@ -0,0 +1,140 @@
package com.example.androidtermwork.ui.dashboard;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import com.example.androidtermwork.R;
import com.example.androidtermwork.webView;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
class News {
public String title;
public String resource;
public String title2;
public String time;
public String article;
public String editor;
public News(String title, String resource, String title2, String time, String article, String editor) {
this.title = title;
this.resource = resource;
this.title2 = title2;
this.time = time;
this.article = article;
this.editor = editor;
}
}
public class DashboardFragment extends Fragment {
public static List<News> newLists = Arrays.asList(
new News("中国共产党第十九届中央委员会第六次全体会议公报",
"“学习强国”学习平台",
"中国共产党第十九届中央委员会第六次全体会议公报2021年11月11日中国共产党第十九届中央委员会第六次全体会议通过",
"2021-11-12",
"中国共产党第十九届中央委员会第六次全体会议于2021年11月8日至11日在北京举行。\\n' +\n" +
" '出席这次全会的有中央委员197人候补中央委员151人。中央纪律检查委员会常务委员会委员和有关方面负责同志列席会议。\\n' +\n" +
" '全会由中央政治局主持。中央委员会总书记习近平作了重要讲话。\\n' +\n" +
" '全会听取和讨论了习近平受中央政治局委托作的工作报告,审议通过了《中共中央关于党的百年奋斗重大成就和历史经验的决议》,审议通过了《关于召开党的第二十次全国代表大会的决议》。习近平就《中共中央关于党的百年奋斗重大成就和历史经验的决议(讨论稿)》向全会作了说明。\\n' +\n" +
" '全会认为,总结党的百年奋斗重大成就和历史经验,是在建党百年历史条件下开启全面建设社会主义现代化国家新征程、在新时代坚持和发展中国特色社会主义的需要;是增强政治意识、大局意识、核心意识、看齐意识,坚定道路自信、理论自信、制度自信、文化自信,做到坚决维护习近平同志党中央的核心、全党的核心地位,坚决维护党中央权威和集中统一领导,确保全党步调一致向前进的需要;是推进党的自我革命、提高全党斗争本领和应对风险挑战能力、永葆党的生机活力、团结带领全国各族人民为实现中华民族伟大复兴的中国梦而继续奋斗的需要。全党要坚持唯物史观和正确党史观,从党的百年奋斗中看清楚过去我们为什么能够成功、弄明白未来我们怎样才能继续成功,从而更加坚定、更加自觉地践行初心使命,在新时代更好坚持和发展中国特色社会主义。",
"秦辰宇"),
new News("习近平主持召开中央政治局会议 分析研究2022年经济工作", "“学习强国”学习平台",
"征求对经济工作的意见和建议\n" +
"\n" +
"中共中央召开党外人士座谈会\n" +
"\n" +
"习近平主持并发表重要讲话\n" +
"\n" +
"李克强通报有关情况 汪洋王沪宁韩正出席",
"2021-12-06",
"新华社北京12月6日电 12月2日中共中央在中南海召开党外人士座谈会就今年经济形势和明年经济工作听取各民主党派中央、全国工商联负责人和无党派人士代表的意见和建议。中共中央总书记习近平主持座谈会并发表重要讲话强调要全面贯彻落实中共十九届六中全会精神重温多党合作的历程和作用发扬光荣传统坚守合作初心围绕宏观政策要稳健有效、微观政策要激发市场主体活力、改革开放政策要增强发展动力、社会政策要兜住民生底线积极履行职能加强自身建设引导广大成员和所联系群众把会议精神转化为共同奋斗的政治共识在全面建设社会主义现代化国家新征程中继续团结奋斗。\n" +
"\n" +
"座谈会上,民革中央主席万鄂湘、民盟中央主席丁仲礼、民建中央主席郝明金、民进中央主席蔡达峰、农工党中央主席陈竺、致公党中央常务副主席蒋作君、九三学社中央主席武维华、台盟中央主席苏辉、全国工商联主席高云龙、无党派人士代表宇如聪先后发言。他们完全赞同中共中央对当前我国经济形势的分析判断和明年经济工作的谋划考虑,并就加强宏观调控、提升政策效能,改善进出口结构、促进内外贸一体化,提高生产制造装备水平、加快我国高端制造业发展,健全人口服务体系、激发内需增长潜力,完善我国疫情防控策略、为稳增长打牢扎实基础,强化法治保障和政策引领、科学有序推进“双碳”目标,转变涉企财税支持方式、提高财政收入质量,加强农村生态环境治理、夯实乡村振兴基础,加大改革力度、助力推进共同富裕,强化中小企业发展政策导向和可持续发展能力,发挥民企在促进共同富裕中积极作用,完善科技领域“揭榜挂帅”工作机制,加快推动省际交界地区协同发展等提出意见建议。",
"张秋兰"),
new News("习近平主持党外人士座谈会并发表重要讲话", "“学习强国”学习平台",
"",
"2021-12-06",
"", "张玙蕗"),
new News("国家主席习近平任免驻外大使", "“学习强国”学习平台",
"",
"2021-12-03",
"", "齐翼"),
new News("习近平向“2021从都国际论坛”开幕式发表视频致辞",
"“学习强国”学习平台",
"",
"2021-12-05",
"", "秦辰宇"),
new News("习近平同老挝人民革命党中央总书记、国家主席通伦共同出席中老铁路通车仪式",
"“学习强国”学习平台",
"",
"2021-12-03",
"", "胡佳"),
new News("习近平向中国-拉共体论坛第三届部长会议发表视频致辞",
"“学习强国”学习平台",
"",
"2021-12-03",
"", "齐翼"),
new News("习近平出席全国宗教工作会议并发表重要讲话",
"“学习强国”学习平台",
"",
"2021-12-04",
"", "秦辰宇"));
private DashboardViewModel dashboardViewModel;
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
// dashboardViewModel =
// ViewModelProviders.of(this).get(DashboardViewModel.class);
View root = inflater.inflate(R.layout.fragment_dashboard, container, false);
final ListView listView = root.findViewById(R.id.newsList);
// dashboardViewModel.getText().observe(this, new Observer<String>() {
// @Override
// public void onChanged(@Nullable String s) {
// }
// });
updateListView(listView);
return root;
}
public void updateListView(ListView listView) {
final List<Map<String, Object>> listItem = new ArrayList<>();
for (int i = 0; i < newLists.size(); i++) {
Map<String, Object> tempMap = new HashMap<>();
tempMap.put("title", newLists.get(i).title);
tempMap.put("resource", newLists.get(i).resource + newLists.get(i).time);
listItem.add(tempMap);
}
SimpleAdapter mAdapter = new SimpleAdapter(getActivity(), listItem, R.layout.news_list_item, new String[]{"title", "resource"}, new int[]{R.id.title, R.id.resource});
listView.setAdapter(mAdapter);
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
//跳转页面,显示详细信息
Intent intent = new Intent(getActivity(), webView.class);
Bundle bundle = new Bundle();
bundle.putString("title", newLists.get(i).title);
bundle.putString("resource", newLists.get(i).resource);
bundle.putString("title2", newLists.get(i).title2);
bundle.putString("time", newLists.get(i).time);
bundle.putString("article", newLists.get(i).article);
bundle.putString("editor", newLists.get(i).editor);
intent.putExtras(bundle);
startActivity(intent);
}
});
}
}

@ -0,0 +1,32 @@
package com.example.androidtermwork.ui.dashboard;
import android.content.Intent;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
import com.example.androidtermwork.R;
import com.example.androidtermwork.webView;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class DashboardViewModel extends ViewModel {
private MutableLiveData<ListView> listView;
public DashboardViewModel() {
listView = new MutableLiveData<>();
}
public LiveData<ListView> getListView() {
return listView;
}
}

@ -0,0 +1,73 @@
package com.example.androidtermwork.ui.home;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import com.example.androidtermwork.ChatActivity;
import com.example.androidtermwork.R;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
class chat {
public int img;
public String name;
public String word;
public String date;
public chat(int img, String name, String word, String date) {
this.img = img;
this.name = name;
this.word = word;
this.date = date;
}
}
public class HomeFragment extends Fragment {
public static List<chat> chatLists = Arrays.asList(
new chat(R.mipmap.tx1, "学习强国助手1", "关注进博会,游世界展馆,看……","11月1日"),
new chat(R.mipmap.tx2, "学习强国助手2", "关注进博会,游世界展馆,看……","11月3日"));
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.fragment_home, container, false);
final ListView listView = root.findViewById(R.id.listview);
updateListView(listView);
return root;
}
public void updateListView(ListView listView) {
final List<Map<String, Object>> listItem = new ArrayList<>();
for (int i = 0; i < chatLists.size(); i++) {
Map<String, Object> tempMap = new HashMap<>();
tempMap.put("img", chatLists.get(i).img);
tempMap.put("name", chatLists.get(i).name);
tempMap.put("word", chatLists.get(i).word);
tempMap.put("date", chatLists.get(i).date);
listItem.add(tempMap);
}
SimpleAdapter mAdapter = new SimpleAdapter(getActivity(), listItem, R.layout.chat_list_item, new String[]{"img", "name", "word", "date"}, new int[]{R.id.img, R.id.name, R.id.word, R.id.date});
listView.setAdapter(mAdapter);
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
//Toast.makeText(getActivity(),chatLists.get(position).name,Toast.LENGTH_SHORT).show();
Intent intent = new Intent(getActivity(), ChatActivity.class);
startActivity(intent);
}
});
}
}

@ -0,0 +1,19 @@
package com.example.androidtermwork.ui.home;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
public class HomeViewModel extends ViewModel {
private MutableLiveData<String> mText;
public HomeViewModel() {
mText = new MutableLiveData<>();
mText.setValue("This is 强国通 fragment");
}
public LiveData<String> getText() {
return mText;
}
}

@ -0,0 +1,170 @@
package com.example.androidtermwork.ui.notifications;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.ListView;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import com.example.androidtermwork.R;
import com.example.androidtermwork.TvStationPlayPage;
import com.example.androidtermwork.adpter.TVStationAdapter;
import com.example.androidtermwork.pojo.TVStation;
import com.example.androidtermwork.util.TestUtil;
import com.scwang.smart.refresh.layout.SmartRefreshLayout;
import com.scwang.smart.refresh.layout.api.RefreshLayout;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Fragment
*/
public class NotificationsFragment extends Fragment {
private View bindingView;
private ListView TVListView;
private SmartRefreshLayout refreshLayout;
//private Gson gson;
private Handler refreshLayoutHandler;
private TVStationAdapter tvStationAdapter;
private int page = 1;
private static final int TV_STATION_PLAY = 0x03;
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
/*dashboardViewModel =
new ViewModelProvider(this).get(DashboardViewModel.class);*/
bindingView = inflater.inflate(R.layout.fragment_notifications, container, false);
View root = bindingView.getRootView();
TVListView = bindingView.findViewById(R.id.tvListView);
refreshLayout = bindingView.findViewById(R.id.refreshLayout);
init();
eventListener();
refreshLayout.autoRefresh(150);
return root;
}
private void init() {
//gson = new Gson();
refreshLayoutHandler = new Handler(Looper.getMainLooper()) {
@Override
public void handleMessage(@NonNull Message msg) {
super.handleMessage(msg);
Map<String, Object> resp = (Map)msg.obj;
if (msg.what == 0){
switch ((int)resp.get("code")){
case 200: refreshLayout.finishRefresh();break;
case 400: refreshLayout.finishRefresh(false);break;
}
} else if (msg.what == 1){
switch ((int)resp.get("code")){
case 200: refreshLayout.finishLoadMore();break;
case 400: refreshLayout.finishLoadMore(false);break;
case 201: refreshLayout.finishLoadMoreWithNoMoreData();break;
}
}
((BaseAdapter) resp.get("data_adapter")).notifyDataSetChanged();
}
};
tvStationAdapter = new TVStationAdapter(getContext(), new ArrayList<>());
TVListView.setAdapter(tvStationAdapter);
}
private void bindTVListViewData(List<TVStation> tvStations, int operationType) {
List<TVStation> tvStationsInAdapter = tvStationAdapter.getTvStations();
switch (operationType) {
case 0:
tvStationsInAdapter.clear();
tvStationsInAdapter.addAll(tvStations);
break;
case 1:
tvStationsInAdapter.addAll(tvStations);
break;
}
}
private void refreshLayoutMessage(Map<String, Object> resp, int what) {
refreshLayoutHandler.sendMessage(Message.obtain(refreshLayoutHandler, what, resp));
}
private void eventListener() {
refreshLayout.setOnLoadMoreListener(new MyOnLoadMoreRefreshListener(1)::listener);
refreshLayout.setOnRefreshListener(new MyOnLoadMoreRefreshListener(0)::listener);
TVListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
TVStation station = (TVStation) parent.getItemAtPosition(position);
startActivityForResult(
new Intent(getActivity(), TvStationPlayPage.class)
.putExtra("id", id)
.putExtra("title", station.getTitle())
.putExtra("author", station.getAuthor())
.putExtra("date", station.getDate())
.putExtra("sourceUrl", station.getVideoSource()), TV_STATION_PLAY);
}
});
}
@Override
public void onDestroyView() {
super.onDestroyView();
bindingView = null;
}
class MyOnLoadMoreRefreshListener{
private int type;
public MyOnLoadMoreRefreshListener(int type) {
this.type = type;
}
public void listener(RefreshLayout refreshLayout){
new Thread(() -> {
Map<String, Object> resp = new HashMap<>();
resp.put("data_adapter", tvStationAdapter);
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
e.printStackTrace();
resp.put("code", 400);
refreshLayoutMessage(resp, type);
}
List<TVStation> tvStations;
if (type == 0) {
page = 1;
tvStations = TestUtil.getTVStationsPaging(page, getContext());
} else {
tvStations = TestUtil.getTVStationsPaging(++page, getContext());
}
if (tvStations.isEmpty()) {
resp.put("code", 201);
} else {
resp.put("code", 200);
bindTVListViewData(tvStations, type);
}
refreshLayoutMessage(resp, type);
}).start();
}
}
}

@ -0,0 +1,19 @@
package com.example.androidtermwork.ui.notifications;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
public class NotificationsViewModel extends ViewModel {
private MutableLiveData<String> mText;
public NotificationsViewModel() {
mText = new MutableLiveData<>();
mText.setValue("This is 电视台 fragment");
}
public LiveData<String> getText() {
return mText;
}
}

@ -0,0 +1,36 @@
package com.example.androidtermwork.util;
import java.text.DecimalFormat;
public class FormatUtil
{
/**
*
* @param num
* @param pattern
* @param <T>
* @return
*/
public static <T> String simpleFormat(T num, String pattern){
return new DecimalFormat(pattern).format(num);
}
/**
* ###,###
* @param num
* @param <T>
* @return
*/
public static <T> String simpleFormat(T num){
return simpleFormat(num, "###,###");
}
/**
*
*
* @return
*/
public static long getFloorCount(long count){
return count/100*100;
}
}

@ -0,0 +1,26 @@
package com.example.androidtermwork.util;
import android.content.Context;
/**
*
*/
public class ResourceUtil
{
/**
* id
* @param context
* @param var
* @param type
* @return id
*/
public static int getIdentifier(Context context, String var, String type) {
try {
return context.getResources().getIdentifier(var, type, context.getPackageName());
} catch (Exception e) {
//e.printStackTrace();
return 0;
}
}
}

@ -0,0 +1,30 @@
package com.example.androidtermwork.util;
import android.app.Activity;
import android.os.Build;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import androidx.annotation.RequiresApi;
/**
*
*/
public class StatusBarUtil {
/**
* Android 6.0
* @param activity
* @param dark
*/
@RequiresApi(api = Build.VERSION_CODES.M)
public static void setAndroidNativeLightStatusBar(Activity activity, boolean dark) {
View decor = activity.getWindow().getDecorView();
if (dark) {
decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
} else {
decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
}
}
}

@ -0,0 +1,99 @@
package com.example.androidtermwork.util;
import android.content.Context;
import android.content.res.AssetManager;
import android.view.View;
import com.example.androidtermwork.pojo.TVStation;
import com.google.android.material.snackbar.Snackbar;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Collections;
import java.util.List;
/**
*
*/
public class TestUtil
{
private static Gson gson;
private static void gsonInit() {
if (gson == null) {
synchronized (TestUtil.class) {
if (gson == null) {
gson = new Gson();
}
}
}
}
/**
* assetsJSON
* @param fileName
* @param context context
* @return - JSON
*/
public static String getJson(String fileName, Context context) {
//将json数据变成字符串
StringBuilder stringBuilder = new StringBuilder();
try {
//获取assets资源管理器
AssetManager assetManager = context.getAssets();
//通过管理器打开文件并读取
BufferedReader bf = new BufferedReader(new InputStreamReader(
assetManager.open(fileName)));
String line;
while ((line = bf.readLine()) != null) {
stringBuilder.append(line);
}
} catch (IOException e) {
e.printStackTrace();
}
return stringBuilder.toString();
}
/**
* SnakeBar
* @param message
* @param duration LENGTH_SHORT = -1 or LENGTH_LONG = 0
* @param base
*/
public static void showSnakeBarMessage(String message, int duration, View base) {
Snackbar.make(base, message, duration).show();
}
/**
*
* @param page
* @param context
* @return
*/
public static List<TVStation> getTVStationsPaging(int page, Context context){
if(page > 2){
return Collections.emptyList();
}
gsonInit();
return gson.fromJson(getJson("mock_data_tv_" + String.format("%02d", page) + ".json", context),
new TypeToken<List<TVStation>>(){}.getType());
}
/**
* Java
* @param jsonFileName
* @param typeToken
* @param context
* @param <T>
* @return
*/
public static <T> T getMockData(String jsonFileName, TypeToken<T> typeToken, Context context){
gsonInit();
return gson.fromJson(getJson(jsonFileName, context), typeToken.getType());
}
}

@ -0,0 +1,32 @@
package com.example.androidtermwork.view;
import android.content.Context;
import android.util.AttributeSet;
import androidx.appcompat.app.AppCompatActivity;
import cn.jzvd.JzvdStd;
public class JzvdPlayer extends JzvdStd {
public JzvdPlayer(Context context) {
super(context);
}
public JzvdPlayer(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
public void setScreenNormal() {
super.setScreenNormal();
backButton.setVisibility(VISIBLE);
}
@Override
protected void clickBack() {
if (!backPress() && CURRENT_JZVD.screen == SCREEN_NORMAL) {
((AppCompatActivity) jzvdContext).finish();
}
}
}

@ -0,0 +1,32 @@
package com.example.androidtermwork.volley;
import android.graphics.Bitmap;
import android.util.LruCache;
import com.android.volley.toolbox.ImageLoader;
public class BitmapCache implements ImageLoader.ImageCache {
private LruCache<String, Bitmap> mCache;
public BitmapCache() {
int maxSize = (int) Runtime.getRuntime().maxMemory();//获取手机分配给应用的最大内存
mCache = new LruCache<String, Bitmap>(maxSize) {
@Override
protected int sizeOf(String key, Bitmap bitmap) {
return bitmap.getRowBytes() * bitmap.getHeight();
}
};
}
@Override
public Bitmap getBitmap(String url) {
return mCache.get(url);
}
@Override
public void putBitmap(String url, Bitmap bitmap) {
mCache.put(url, bitmap);
}
}

@ -0,0 +1,160 @@
package com.example.androidtermwork;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
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 com.example.androidtermwork.util.StatusBarUtil;
public class webView extends AppCompatActivity {
private WebView webView;
private ProgressBar progressBar;
@RequiresApi(api = Build.VERSION_CODES.M)
@SuppressLint({"SetJavaScriptEnabled", "JavascriptInterface"})
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_web_view);
//设置状态栏字体为黑色
StatusBarUtil.setAndroidNativeLightStatusBar(this, true);
Bundle bundle = this.getIntent().getExtras();
AndroidToastForJs.title= bundle.getString("title");
AndroidToastForJs.resource = bundle.getString("resource");
AndroidToastForJs.title2 = bundle.getString("title2");
AndroidToastForJs.time = bundle.getString("time");
AndroidToastForJs.article = bundle.getString("article");
AndroidToastForJs.editor = bundle.getString("editor");
progressBar= findViewById(R.id.progressbar);//进度条
webView = findViewById(R.id.webview);
WebSettings webSettings=webView.getSettings();
webSettings.setJavaScriptEnabled(true);//允许使用js
webSettings.setDefaultTextEncodingName("GBK");//设置字符编码 增加对中文的支持
// 设置允许JS弹窗
webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
//使用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);
webView.addJavascriptInterface(new AndroidToastForJs(this), "JavaScriptInterface");
webView.loadUrl("file:///android_asset/index.html");//加载asset文件夹下html
// webView.loadUrl(url);//加载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);
}
//WebViewClient主要帮助WebView处理各种通知、请求事件
private WebViewClient webViewClient=new WebViewClient(){
public void onPageFinished(WebView view, String url) {//页面加载完成
progressBar.setVisibility(View.GONE);
}
public void onPageStarted(WebView view, String url, Bitmap favicon) {//页面开始加载
progressBar.setVisibility(View.VISIBLE);
}
public boolean shouldOverrideUrlLoading(WebView view, String url) {
Log.i("ansen","拦截url:"+url);
if(url.equals("http://www.google.com/")){
Toast.makeText(webView.this,"国内不能访问google,拦截该url",Toast.LENGTH_LONG).show();
return true;//表示我已经处理过了
}
return super.shouldOverrideUrlLoading(view, url);
}
};
//WebChromeClient主要辅助WebView处理Javascript的对话框、网站图标、网站title、加载进度等
private final WebChromeClient webChromeClient = new WebChromeClient() {
//不支持js的alert弹窗需要自己监听然后通过dialog弹窗
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;
}
//获取网页标题
public void onReceivedTitle(WebView view, String title) {
super.onReceivedTitle(view, title);
Log.i("ansen", "网页标题:" + title);
}
//加载进度回调
public void onProgressChanged(WebView view, int newProgress) {
progressBar.setProgress(newProgress);
}
};
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
Log.i("ansen","是否有上一个页面:"+webView.canGoBack());
if (webView.canGoBack() && keyCode == KeyEvent.KEYCODE_BACK){//点击返回按钮的时候判断有没有上一页
webView.goBack(); // goBack()表示返回webView的上一页面
return true;
}
return super.onKeyDown(keyCode,event);
}
/**
* JSandroid
* @param str
* @return
*/
@JavascriptInterface //仍然必不可少
public void getClient(String str){
Log.i("ansen","html调用客户端:"+str);
}
@Override
protected void onDestroy() {
super.onDestroy();
//释放资源
webView.destroy();
webView=null;
}
}

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="50in" />
<gradient
android:angle="270"/>
<stroke
android:width="1dp"
android:color="#799196" />
<solid
android:color="#0000"
/>
</shape>

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="10dp" />
<gradient
android:angle="90"
android:endColor="#C6EC3636"
android:startColor="#C6EC3636" />
<stroke
android:width="1dp"
android:color="#626464" />
</shape>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="line">
<corners android:radius="50dp" />
<gradient
android:angle="270" />
<stroke
android:width="1dp"
android:color="#C6D2E6E6" />
</shape>

@ -0,0 +1,34 @@
<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:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeWidth="1"
android:strokeColor="#00000000">
<aapt:attr name="android:fillColor">
<gradient
android:endX="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
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="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="#F0F0F0"/>
<corners android:radius="2dp" />
</shape>
</item>
<item
android:left="3dp"
android:right="3dp"
android:top="1dp"
android:bottom="3dp">
<shape android:shape="rectangle">
<solid android:color="@android:color/white"/>
<corners android:radius="3dp" />
</shape>
</item>
</layer-list>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 693 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape
android:shape="rectangle">
<solid android:color="#f5f5f7"/>
<corners android:radius="2dp"/>
</shape>
</item>
</layer-list>

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="20dp"
android:height="20dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:fillColor="#f70606"
android:pathData="M844.231111 391.39555600000006H659.9111109999999c-13.653333-2.275556-18.204444-15.928889-20.48-22.755556V202.52444400000002c0-45.511111-36.408889-81.92-81.92-81.92-40.96 0-75.093333 31.857778-81.92 70.542223-25.031111 157.013333-120.604444 209.351111-182.044444 225.28 2.275556 6.826667 2.275556 11.377778 2.275555 15.928889v441.457777c0 9.102222-2.275556 18.204444-6.826666 27.306666999999997h446.008888c43.235556-9.102222 72.817778-25.031111 93.297778-68.266667l93.297778-327.68c18.204444-59.16444400000001-11.377778-116.053333-77.368889-113.77777699999999zM257.137778 876.0888889999999V432.355556c0-13.653333-18.204444-25.031111-38.684445-25.031112H157.013333c-31.857778 0-59.16444400000001 27.306666999999997-59.16444400000001 59.16444500000001v373.191111c0 34.133333 25.031111 61.44 59.16444400000001 61.44h61.44c20.48 0 38.684444-11.377778 38.684445-25.031111z m0 0" />
</vector>

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="25dp"
android:height="25dp"
android:viewportWidth="1025"
android:viewportHeight="1024"
>
<path
android:fillColor="#707070"
android:pathData="M512.73613 151.4l103 208.7c11.7 23.6 34.2 40 60.2 43.8l230.3 33.5-166.6 162.4c-18.9 18.4-27.5 44.9-23 70.8L755.93613 900l-206-108.3c-11.4-6-24.3-9.2-37.2-9.2-12.9 0-25.8 3.2-37.2 9.2L269.53613 900l39.3-229.4c4.5-26-4.2-52.4-23-70.8L119.23613 437.3l230.3-33.5c26.1-3.8 48.6-20.1 60.2-43.8l103-208.6M512.73613 27c-5.7 0-11.4 3-14.3 8.9l-146 295.9c-2.3 4.7-6.8 8-12 8.8L13.73613 388c-13.1 1.9-18.4 18-8.9 27.3l236.3 230.3c3.8 3.7 5.5 9 4.6 14.2L190.03613 985c-1.8 10.3 6.4 18.7 15.8 18.7 2.5 0 5-0.6 7.4-1.9l292.1-153.5c2.3-1.2 4.9-1.8 7.4-1.8s5.1 0.6 7.4 1.8l292.1 153.5c2.5 1.3 5 1.9 7.4 1.9 9.3 0 17.5-8.4 15.8-18.7l-55.8-325.2c-0.9-5.2 0.8-10.5 4.6-14.2l236.3-230.3c9.5-9.3 4.3-25.4-8.9-27.3l-326.5-47.4c-5.2-0.8-9.7-4-12-8.8l-146-295.9c-3-6-8.7-8.9-14.4-8.9z" />
</vector>

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="100dp"
android:height="100dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:fillColor="#707070"
android:pathData="M797.217 174.331h-573.888c-45.598 0-78.696 35.256-78.696 83.821v421.086c0 46.947 31.567 78.515 78.696 78.515h168.182l100.639 97.762c5.396 5.396 12.502 8.094 19.607 8.094 7.194 0 14.3-2.788 19.786-8.184l98.751-97.582h166.924c46.947 0 78.516-31.568 78.516-78.516v-421.176c0-48.565-33.008-83.821-78.516-83.821zM819.971 679.238c0 16.189-6.565 22.754-22.755 22.754h-177.895c-0.193-0.005-0.42-0.008-0.649-0.008-7.72 0-14.709 3.13-19.766 8.191l-87.329 86.069-89.037-86.25c-5.666-5.575-13.042-8.274-20.416-8.004h-178.793c-16.279 0-22.934-6.565-22.934-22.755v-421.084c0-8.455 2.248-28.061 22.934-28.061h573.888c20.505 0 22.754 19.606 22.754 28.060v421.086z" />
<path
android:fillColor="#707070"
android:pathData="M292.311 463.21c0 0 0 0 0 0 0 27.319 22.146 49.464 49.464 49.464 27.319 0 49.465-22.146 49.465-49.464 0 0 0 0 0 0 0-27.319-22.146-49.465-49.465-49.465-27.319 0-49.464 22.146-49.464 49.464zM468.587 463.21c0 0 0 0 0 0 0 27.319 22.147 49.465 49.465 49.465 27.319 0 49.465-22.147 49.465-49.465 0 0 0 0 0 0 0 0 0 0 0 0 0-27.319-22.147-49.465-49.465-49.465-27.319 0-49.465 22.147-49.465 49.465s0 0 0 0zM643.695 462.579c0 27.319 22.146 49.465 49.464 49.465s49.465-22.146 49.465-49.465c0-27.319-22.146-49.464-49.465-49.464-27.319 0-49.464 22.146-49.464 49.465 0 0 0 0 0 0z" />
</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,11 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="20dp"
android:height="20dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:fillColor="#000000"
android:pathData="M890.908 429.534c-20.66-26.05-51.585-40.99-84.84-40.99l-189.34 0c10.34-28.83 17.18-60.165 19.615-90.48 3.785-47.147-3.465-89.02-20.955-121.095-21.53-39.46-58.18-64.072-105.997-71.177-21.662-3.22-40.292 0.945-55.377 12.372-30.495 23.102-36.092 67.065-42.575 117.97-5.182 40.692-11.055 86.817-30.79 119.877-13.172 22.065-38.807 51.397-109.092 51.397l-73.345 0c-48.842 0-88.58 39.722-88.58 88.545l0 334.754c0 48.82 39.737 88.545 88.58 88.545l534.336 0c24.33 0 48.22-8.325 67.275-23.43 19.06-15.11 32.605-36.475 38.145-60.155l73.52-314.264C919.058 489.054 911.553 455.569 890.908 429.534zM168.672 830.708 168.672 495.956c0-16.27 13.252-29.505 29.537-29.505l62.232 0 0 393.762-62.232 0C181.925 860.213 168.672 846.978 168.672 830.708zM853.998 507.956l-73.52 314.272c-5.23 22.36-24.94 37.985-47.93 37.985L319.484 860.213 319.484 462.169c49.877-9.52 87.4-34.92 111.86-75.895 26.05-43.64 32.75-96.257 38.662-142.68 2.67-20.977 5.193-40.79 9.2-55.99 4.297-16.302 8.745-21.08 10.457-22.377 1.96-1.485 5.677-1.835 11.05-1.035 29.615 4.4 50.175 17.83 62.84 41.052 25.99 47.642 14.505 128.052-10.265 182.86-5.93 13.127-4.83 28.167 2.96 40.232 7.78 12.052 21.01 19.247 35.395 19.247l214.424 0c15.125 0 29.185 6.792 38.58 18.637C854.028 478.049 857.438 493.261 853.998 507.956z" />
</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="#008577"
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>

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="25.5dp"
android:height="25.5dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:fillColor="#707070"
android:pathData="M779.636364 954.181818h-535.272728A174.778182 174.778182 0 0 1 69.818182 779.636364v-535.272728A174.778182 174.778182 0 0 1 244.363636 69.818182H512a34.909091 34.909091 0 0 1 0 69.818182H244.363636A104.96 104.96 0 0 0 139.636364 244.363636v535.272728a104.96 104.96 0 0 0 104.727272 104.727272h535.272728a104.96 104.96 0 0 0 104.727272-104.727272V512a34.909091 34.909091 0 0 1 69.818182 0v267.636364a174.778182 174.778182 0 0 1-174.545454 174.545454z" />
<path
android:fillColor="#707070"
android:pathData="M500.363636 558.545455a35.141818 35.141818 0 0 1-24.669091-10.24 34.676364 34.676364 0 0 1 0-49.338182l418.909091-418.909091a34.909091 34.909091 0 0 1 49.338182 49.338182l-418.909091 418.909091a35.141818 35.141818 0 0 1-24.669091 10.24z" />
<path
android:fillColor="#707070"
android:pathData="M919.272727 139.636364h-186.181818a34.909091 34.909091 0 0 1 0-69.818182h186.181818a34.909091 34.909091 0 0 1 0 69.818182z" />
<path
android:fillColor="#707070"
android:pathData="M919.272727 325.818182a34.909091 34.909091 0 0 1-34.909091-34.909091v-186.181818a34.909091 34.909091 0 0 1 69.818182 0v186.181818a34.909091 34.909091 0 0 1-34.909091 34.909091z" />
</vector>

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="20dp" />
<gradient
android:angle="270"
android:endColor="#EBE7C4BB"
android:startColor="#F07894A0" />
<stroke
android:width="1dp"
android:color="#6D7577" />
</shape>

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="5dp" />
<gradient
android:angle="90"
android:endColor="#C6EB2A2A"
android:startColor="#C6F02F2F" />
<stroke
android:width="1dp"
android:color="#BED84141" />
</shape>

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item> <!-- 格子间的连接处颜色 -->
<shape>
<solid android:color="#dddddd" />
</shape>
</item>
<item android:bottom="1dp"> <!--设置底部有边框-->
<shape>
<solid android:color="#ffffff" /> <!-- 主体背景颜色 -->
</shape>
</item>
</layer-list>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape
android:shape="rectangle">
<solid android:color="#ffffff"/>
<corners android:radius="30dp"/>
</shape>
</item>
</layer-list>

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape
android:shape="rectangle">
<solid android:color="#FF9600"/>
<corners android:topLeftRadius="30dp"
android:bottomLeftRadius="30dp"
/>
</shape>
</item>
</layer-list>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#efefef"/>
<size android:height="1.5dp"/>
</shape>

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 设置背景色 -->
<item android:id="@android:id/background">
<shape
android:shape="rectangle">
<solid android:color="#efefef"/>
<corners android:radius="10dp"/>
</shape>
</item>
<!-- 设置进度条颜色 -->
<item android:id="@android:id/progress">
<clip>
<shape>
<corners android:radius="10dp"/>
<gradient
android:endColor="#ff0000"
android:startColor="#ff0000" />
</shape>
</clip>
</item>
</layer-list>

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

Loading…
Cancel
Save