master
yx 2 years ago
parent fe65da69f3
commit 31ea650228

15
Luxury/.gitignore vendored

@ -0,0 +1,15 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties

@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AndroidTestResultsUserPreferences">
<option name="androidTestResultsTableState">
<map>
<entry key="28629151">
<value>
<AndroidTestResultsTableState>
<option name="preferredColumnWidths">
<map>
<entry key="Duration" value="90" />
<entry key="Pixel_2_API_30" value="120" />
<entry key="Tests" value="360" />
</map>
</option>
</AndroidTestResultsTableState>
</value>
</entry>
</map>
</option>
</component>
</project>

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

@ -0,0 +1,613 @@
<?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.DatabaseBrowserManager">
<autoscroll-to-editor value="false" />
<autoscroll-from-editor value="true" />
<show-object-properties value="true" />
<loaded-nodes />
</component>
<component name="DBNavigator.Project.DatabaseConsoleManager">
<connection id="1bc036ca-f50d-4b75-b0a2-2a83cd586404">
<console name="Connection" type="STANDARD" schema="main" session="Main" />
</connection>
<connection id="5da7b408-e83e-4169-b8f7-aa2458954d39">
<console name="Connection 1" type="STANDARD" schema="" session="Main" />
</connection>
</component>
<component name="DBNavigator.Project.DatabaseEditorStateManager">
<last-used-providers />
</component>
<component name="DBNavigator.Project.DatabaseFileManager">
<open-files />
</component>
<component name="DBNavigator.Project.DatasetFilterManager">
<filter-actions connection-id="5da7b408-e83e-4169-b8f7-aa2458954d39" dataset="main.good_user" active-filter-id="" />
<filter-actions connection-id="1bc036ca-f50d-4b75-b0a2-2a83cd586404" dataset="main.sqlite_sequence" active-filter-id="" />
<filter-actions connection-id="1bc036ca-f50d-4b75-b0a2-2a83cd586404" dataset="main.good_user" active-filter-id="" />
<filter-actions connection-id="1bc036ca-f50d-4b75-b0a2-2a83cd586404" dataset="main.android_metadata" active-filter-id="" />
</component>
<component name="DBNavigator.Project.ObjectQuickFilterManager">
<last-used-operator value="EQUAL" />
<filters />
</component>
<component name="DBNavigator.Project.Settings">
<connections>
<connection id="1bc036ca-f50d-4b75-b0a2-2a83cd586404" active="true" signed="true">
<database>
<name value="Connection" />
<description value="" />
<database-type value="SQLITE" />
<config-type value="BASIC" />
<database-version value="3.39" />
<driver-source value="BUILTIN" />
<driver-library value="" />
<driver value="" />
<url-type value="FILE" />
<host value="" />
<port value="" />
<database value="" />
<files>
<file path="C:\Users\86199\Desktop\good" schema="main" />
</files>
<type value="NONE" />
<user value="" />
<deprecated-pwd value="" />
</database>
<properties>
<auto-commit value="false" />
</properties>
<ssh-settings>
<active value="false" />
<proxy-host value="" />
<proxy-port value="22" />
<proxy-user value="" />
<deprecated-proxy-pwd value="" />
<auth-type value="PASSWORD" />
<key-file value="" />
<key-passphrase value="" />
</ssh-settings>
<ssl-settings>
<active value="false" />
<certificate-authority-file value="" />
<client-certificate-file value="" />
<client-key-file value="" />
</ssl-settings>
<details>
<charset value="UTF-8" />
<session-management value="true" />
<ddl-file-binding value="true" />
<database-logging value="true" />
<connect-automatically value="true" />
<restore-workspace value="true" />
<restore-workspace-deep value="false" />
<environment-type value="default" />
<connectivity-timeout value="10" />
<idle-time-to-disconnect value="30" />
<idle-time-to-disconnect-pool value="5" />
<credential-expiry-time value="10" />
<max-connection-pool-size value="7" />
<alternative-statement-delimiter value="" />
</details>
<object-filters hide-empty-schemas="false" hide-pseudo-columns="false">
<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>
<object-name-filters />
</object-filters>
</connection>
<connection id="5da7b408-e83e-4169-b8f7-aa2458954d39" active="true" signed="true">
<database>
<name value="Connection 1" />
<description value="" />
<database-type value="SQLITE" />
<config-type value="BASIC" />
<database-version value="3.39" />
<driver-source value="BUILTIN" />
<driver-library value="" />
<driver value="" />
<url-type value="FILE" />
<host value="" />
<port value="" />
<database value="" />
<files>
<file path="C:\Users\86199\Desktop\good" schema="main" />
</files>
<type value="NONE" />
<user value="" />
<deprecated-pwd value="" />
</database>
<properties>
<auto-commit value="false" />
</properties>
<ssh-settings>
<active value="false" />
<proxy-host value="" />
<proxy-port value="22" />
<proxy-user value="" />
<deprecated-proxy-pwd value="" />
<auth-type value="PASSWORD" />
<key-file value="" />
<key-passphrase value="" />
</ssh-settings>
<ssl-settings>
<active value="false" />
<certificate-authority-file value="" />
<client-certificate-file value="" />
<client-key-file value="" />
</ssl-settings>
<details>
<charset value="UTF-8" />
<session-management value="true" />
<ddl-file-binding value="true" />
<database-logging value="true" />
<connect-automatically value="true" />
<restore-workspace value="true" />
<restore-workspace-deep value="false" />
<environment-type value="default" />
<connectivity-timeout value="10" />
<idle-time-to-disconnect value="30" />
<idle-time-to-disconnect-pool value="5" />
<credential-expiry-time value="10" />
<max-connection-pool-size value="7" />
<alternative-statement-delimiter value="" />
</details>
<object-filters hide-empty-schemas="false" hide-pseudo-columns="false">
<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>
<object-name-filters />
</object-filters>
</connection>
</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,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="jbr-11" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
</GradleProjectSettings>
</option>
</component>
</project>

@ -0,0 +1,8 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="ClangTidy" enabled="true" level="WARNING" enabled_by_default="true">
<option name="clangTidyChecks" value="-*,cert-dcl21-cpp,cert-dcl58-cpp,cert-err34-c,cert-err52-cpp,cert-err60-cpp,cert-flp30-c,cert-msc50-cpp,cert-msc51-cpp,cert-str34-c,cppcoreguidelines-interfaces-global-init,cppcoreguidelines-narrowing-conversions,cppcoreguidelines-pro-type-member-init,cppcoreguidelines-pro-type-static-cast-downcast,cppcoreguidelines-slicing,google-default-arguments,google-explicit-constructor,google-runtime-operator,hicpp-exception-baseclass,hicpp-multiway-paths-covered,mpi-buffer-deref,mpi-type-mismatch,openmp-use-default-none,performance-faster-string-find,performance-for-range-copy,performance-implicit-conversion-in-loop,performance-inefficient-algorithm,performance-inefficient-string-concatenation,performance-inefficient-vector-operation,performance-move-const-arg,performance-move-constructor-init,performance-no-automatic-move,performance-noexcept-move-constructor,performance-trivially-destructible,performance-type-promotion-in-math-fn,performance-unnecessary-copy-initialization,performance-unnecessary-value-param" />
</inspection_tool>
</profile>
</component>

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

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>

@ -0,0 +1 @@
/build

@ -0,0 +1,60 @@
plugins {
id 'com.android.application'
}
android {
namespace 'com.example.test1'
compileSdk 33
defaultConfig {
applicationId "com.example.test"
minSdk 24
targetSdk 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildFeatures {
viewBinding true
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'com.android.car.ui:car-ui-lib:2.0.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'liji.library.dev:citypickerview:1.1.0'
implementation group: 'com.alibaba', name: 'fastjson', version: '1.2.12'
implementation 'com.squareup.okhttp3:okhttp:3.8.0'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
implementation 'androidx.navigation:navigation-fragment:2.3.5'
implementation 'androidx.navigation:navigation-ui:2.3.5'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.jakewharton:butterknife:5.1.1'
implementation 'com.google.code.gson:gson:2.2.4'
implementation 'com.github.bumptech.glide:glide:3.7.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,26 @@
package com.example.test1;
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.test1", appContext.getPackageName());
}
}

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<application
android:name="com.example.test1.entity.MyApplication"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/Theme.Test1"
tools:targetApi="31">
<!-- <service
android:enabled="true"
android:exported="true"
android:ee="true"/>
android:name=".service.TimeService"
android:process="system"-->
/>
<activity
android:name=".Activity.registerActivity"
android:exported="true" />
<activity
android:name=".Activity.userActivity"
android:exported="true" />
<activity
android:name=".Activity.IndexActivity"
android:exported="true"
tools:ignore="Instantiatable" />
<activity
android:name=".Activity.CategoryActivity"
android:exported="true" />
<activity
android:name=".Activity.IntroductionActivity"
android:exported="true" />
<activity
android:name=".Fragment.RightFragment"
android:exported="true" />
<activity
android:name=".Fragment.SetDetailFragment"
android:exported="true" />
<activity
android:name=".Activity.BandActivity"
android:exported="true" />
<activity
android:name=".Activity.MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

@ -0,0 +1,284 @@
package com.example.test1.Activity;
import android.annotation.SuppressLint;
import android.app.Fragment;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import com.example.test1.Fragment.RightFragment;
import com.example.test1.R;
import com.example.test1.entity.BrandBean;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class BandActivity extends AppCompatActivity {
private FragmentManager fragmentManager;
private FragmentTransaction fragmentTransaction;
private Fragment leftFragment;
private RightFragment rightFragment;
private TextView tv_LV,tv_Prada,tv_Hermers,tv_Miumiu,tv_Dior,tv_Channel,tv_Bl,tv_Gucci;
private TextView btn;
private String[]names1={"LV爆款包包","LV经典包包","LV特色包包","LV家喻户晓款","LV人手一只款","LV值得收藏款","LV新款包包"};
private String[]sales1={"月售520 好评度80%","月售520 好评度80%","月售520 好评度80%","月售520 好评度80%","月售520 好评度80%","月售520 好评度80%","月售520 好评度80%"};
private String[]prices1={"$23","$41","$32","$23","$41","$32","$23"};
private int []imgs1={R.drawable.lv1,R.drawable.lv2,R.drawable.lv3,R.drawable.lv4,R.drawable.lv5,R.drawable.lv6,R.drawable.lv7,};
private String[]names2={"Hermes经典包包","Hermes新款包包"};
private String[]sales2={"月售520 好评度80%","月售520 好评度80%"};
private String[]prices2={"$23","$41"};
private int []imgs2={R.drawable.hermes1,R.drawable.hermes2};
private String[]names3={"miumiu特色包包"};
private String[]sales3={"月售520 好评度80%"};
private String[]prices3={"$23"};
private int []imgs3={R.drawable.miumiu1};
private String[]names4={"Prada特色包包","Prada经典包包","Prada新款包包","Prada贵妇包包"};
private String[]sales4={"月售520 好评度80%","月售520 好评度80%","月售520 好评度80%","月售520 好评度80%"};
private String[]prices4={"$23","$41","$32","$32"};
private int []imgs4={R.drawable.prada1,R.drawable.prada2,R.drawable.prada3,R.drawable.prada4};
private String[]names5={"Dior特色包包"};
private String[]sales5={"月售520 好评度80%"};
private String[]prices5={"$23"};
private int []imgs5={R.drawable.miumiu1};
private String[]names6={"Channel特色包包"};
private String[]sales6={"月售520 好评度80%"};
private String[]prices6={"$23"};
private int []imgs6={R.drawable.miumiu1};
private String[]names7={"Balenciaga特色包包"};
private String[]sales7={"月售520 好评度80%"};
private String[]prices7={"$23"};
private int []imgs7={R.drawable.miumiu1};
private String[]names8={"Gucci特色包包"};
private String[]sales8={"月售520 好评度80%"};
private String[]prices8={"$23"};
private int []imgs8={R.drawable.miumiu1};
private Map<String, List<BrandBean>>map;
@SuppressLint("MissingInflatedId")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.band_main);
btn=findViewById(R.id.tv_business);
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent=new Intent(BandActivity.this,IntroductionActivity.class);
startActivity(intent);
}
});
setData();
init();
clickEvent();
}
private void init(){
fragmentManager = getFragmentManager();
leftFragment=fragmentManager.findFragmentById(R.id.left);
tv_LV=findViewById(R.id.tv_LV);
tv_Prada=findViewById(R.id.tv_Prada);
tv_Miumiu=findViewById(R.id.tv_miumiu);
tv_Hermers=findViewById(R.id.tv_Hermers);
tv_Dior=findViewById(R.id.tv_Dior);
tv_Channel=findViewById(R.id.tv_Channel);
tv_Bl=findViewById(R.id.tv_Bl);
tv_Gucci=findViewById(R.id.tv_Gucci);
}
private void setData(){
map=new HashMap<>();
List<BrandBean>list1=new ArrayList<>();
List<BrandBean>list2=new ArrayList<>();
List<BrandBean>list3=new ArrayList<>();
List<BrandBean>list4=new ArrayList<>();
List<BrandBean>list5=new ArrayList<>();
List<BrandBean>list6=new ArrayList<>();
List<BrandBean>list7=new ArrayList<>();
List<BrandBean>list8=new ArrayList<>();
for(int i=0;i<names1.length;i++){
BrandBean bean=new BrandBean();
bean.setName(names1[i]);
bean.setPrice(prices1[i]);
bean.setImg(imgs1[i]);
bean.setSales(sales1[i]);
list1.add(bean);
}
map.put("1",list1);
for(int i=0;i<names2.length;i++){
BrandBean bean=new BrandBean();
bean.setName(names2[i]);
bean.setPrice(prices2[i]);
bean.setImg(imgs2[i]);
bean.setSales(sales2[i]);
list2.add(bean);
}
map.put("2",list2);
for(int i=0;i<names3.length;i++){
BrandBean bean=new BrandBean();
bean.setName(names3[i]);
bean.setPrice(prices3[i]);
bean.setImg(imgs3[i]);
bean.setSales(sales3[i]);
list3.add(bean);
}
map.put("3",list3);
for(int i=0;i<names4.length;i++){
BrandBean bean=new BrandBean();
bean.setName(names4[i]);
bean.setPrice(prices4[i]);
bean.setImg(imgs4[i]);
bean.setSales(sales4[i]);
list4.add(bean);
}
map.put("4",list4);
for(int i=0;i<names2.length;i++){
BrandBean bean=new BrandBean();
bean.setName(names5[i]);
bean.setPrice(prices5[i]);
bean.setImg(imgs5[i]);
bean.setSales(sales5[i]);
list5.add(bean);
}
map.put("5",list5);
for(int i=0;i<names6.length;i++){
BrandBean bean=new BrandBean();
bean.setName(names6[i]);
bean.setPrice(prices6[i]);
bean.setImg(imgs6[i]);
bean.setSales(sales6[i]);
list6.add(bean);
}
map.put("6",list6);
for(int i=0;i<names7.length;i++){
BrandBean bean=new BrandBean();
bean.setName(names7[i]);
bean.setPrice(prices7[i]);
bean.setImg(imgs7[i]);
bean.setSales(sales7[i]);
list7.add(bean);
}
map.put("7",list7);
for(int i=0;i<names8.length;i++){
BrandBean bean=new BrandBean();
bean.setName(names8[i]);
bean.setPrice(prices8[i]);
bean.setImg(imgs8[i]);
bean.setSales(sales8[i]);
list8.add(bean);
}
map.put("8",list8);
}
private void clickEvent(){
tv_LV.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
switchData (map.get("1"));
tv_LV.setBackgroundColor(Color.WHITE);
}
});
tv_Prada.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
switchData (map.get("2"));
tv_Prada.setBackgroundColor(Color.WHITE);
}
});
tv_Miumiu.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
switchData (map.get("3"));
tv_Miumiu.setBackgroundColor(Color.WHITE);
}
});
tv_Hermers.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
switchData (map.get("4"));
tv_Hermers.setBackgroundColor(Color.WHITE);
}
});
tv_Dior.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
switchData (map.get("1"));
tv_LV.setBackgroundColor(Color.WHITE);
}
});
tv_Channel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
switchData (map.get("2"));
tv_Prada.setBackgroundColor(Color.WHITE);
}
});
tv_Bl.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
switchData (map.get("3"));
tv_Miumiu.setBackgroundColor(Color.WHITE);
}
});
tv_Gucci.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
switchData (map.get("4"));
tv_Hermers.setBackgroundColor(Color.WHITE);
}
});
}
@SuppressLint("SuspiciousIndentation")
public void switchData(List<BrandBean> list){
fragmentManager=getFragmentManager();
fragmentTransaction=getFragmentManager().beginTransaction();
rightFragment=new RightFragment().getInstance(list);
fragmentTransaction.replace(R.id.right,rightFragment);
fragmentTransaction.commit();
}
}

@ -0,0 +1,141 @@
package com.example.test1.Activity;
import android.app.Activity;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;
import androidx.annotation.Nullable;
import com.example.test1.Fragment.SetDetailFragment;
import com.example.test1.R;
import com.example.test1.adapter.Adapter;
import com.example.test1.entity.Product;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
public class CategoryActivity extends Activity implements View.OnClickListener{
public OnChangeListener onchangedListener;
private List<Product> productList;
private List<String> productCategory = new ArrayList<>();
private ListView titleList;
private Adapter adapter;
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.content_category);
initData();
init();
SetDetailFragment fragment = new SetDetailFragment();
FragmentManager fragmentManager = getFragmentManager();
FragmentTransaction transaction = fragmentManager.beginTransaction();
transaction.replace(R.id.category_detail, fragment);
transaction.commit();
titleList.setOnItemClickListener((parent, view, position, id) -> {
adapter.setSelectedPosition(position);
adapter.notifyDataSetInvalidated();
if (onchangedListener != null) {
onchangedListener.changeText(productList.get(position));
}
});
}
public void setOnChangeListener(OnChangeListener onChangeListener) {
this.onchangedListener = onChangeListener;
}
@Override
public void onClick(View view) {
switch (view.getId()){
case R.id.category_return:
Intent intent1=new Intent(CategoryActivity.this, MainActivity.class);
startActivity(intent1);
break;
}
}
public interface OnChangeListener {
void changeText(Product product);
}
/**
*
*/
private void initData() {
productList = new ArrayList<>();
productCategory.add("LV");
productCategory.add("Prada");
productCategory.add("Hermas");
productCategory.add("Dior");
productCategory.add("Chanel");
productCategory.add("Balenciaga");
productCategory.add("Gucci");
productCategory.add("miumiu");
Product product = new Product();
product.setImageUrlId(R.drawable.lv2);
product.setProductName("lv春季新款");
product.setProductPrice(new BigDecimal("18999"));
Product product1 = new Product();
product1.setImageUrlId(R.drawable.prada1);
product1.setProductName("Prada春季新款");
product1.setProductPrice(new BigDecimal("18999"));
Product product2 = new Product();
product2.setImageUrlId(R.drawable.hermes1);
product2.setProductName("Hermas春季新款");
product2.setProductPrice(new BigDecimal("18999"));
Product product3 = new Product();
product3.setImageUrlId(R.drawable.diao);
product3.setProductName("Dior春季新款");
product3.setProductPrice(new BigDecimal("18999"));
Product product4 = new Product();
product4.setImageUrlId(R.drawable.cn);
product4.setProductName("Chanel春季新款");
product4.setProductPrice(new BigDecimal("18999"));
Product product5 = new Product();
product5.setImageUrlId(R.drawable.bl);
product5.setProductName("Balenciaga春季新款");
product5.setProductPrice(new BigDecimal("18999"));
Product product6 = new Product();
product6.setImageUrlId(R.drawable.kucci);
product6.setProductName("Gucci春季新款");
product6.setProductPrice(new BigDecimal("18999"));
Product product7 = new Product();
product7.setImageUrlId(R.drawable.miumiu);
product7.setProductName("miumiu春季新款");
product7.setProductPrice(new BigDecimal("18999"));
productList.add(product);
productList.add(product1);
productList.add(product2);
productList.add(product3);
productList.add(product4);
productList.add(product5);
productList.add(product6);
productList.add(product7);
}
public void onClick1(View view) {
switch (view.getId()){
case R.id.category_return:
Intent intent1=new Intent(CategoryActivity.this, MainActivity.class);
startActivity(intent1);
break;
}
}
/**
*
*/
private void init() {
titleList = findViewById(R.id.category_title_list);
adapter = new Adapter(productCategory, CategoryActivity.this);
titleList.setAdapter(adapter);
}
}

@ -0,0 +1,279 @@
package com.example.test1.Activity;
import android.app.Activity;
import android.app.FragmentTransaction;
import android.content.Intent;
import android.os.Bundle;
import android.os.Message;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.ScrollView;
import android.widget.SearchView;
import android.widget.Toast;
import androidx.annotation.Nullable;
import com.example.test1.Fragment.BallFragment;
import com.example.test1.Fragment.ChannelFragment;
import com.example.test1.Fragment.DiaoFragment;
import com.example.test1.Fragment.GucciFragment;
import com.example.test1.Fragment.HermesFragment;
import com.example.test1.Fragment.IndexFragment;
import com.example.test1.Fragment.LvFragment;
import com.example.test1.Fragment.MiumiuFragment;
import com.example.test1.Fragment.PersonFragment;
import com.example.test1.Fragment.PradaFragment;
import com.example.test1.Fragment.ProductFragment;
import com.example.test1.Fragment.ShoppingCartFragment;
import com.example.test1.Fragment.detailFragment;
import com.example.test1.R;
import com.example.test1.service.TimeService;
import java.util.ArrayList;
public class IndexActivity extends Activity implements View.OnClickListener {
private IndexFragment indexFragment;
private ProductFragment productFragment;
private ShoppingCartFragment shoppingCartFragment;
private PersonFragment pearsonFragment;
private PradaFragment PradaFragment;
private DiaoFragment DiaoFragment;
private HermesFragment HermesFragment;
private ChannelFragment ChannelFragment;
private MiumiuFragment MiumiuFragment;
private LvFragment LvFragment;
private GucciFragment GucciFragment;
private BallFragment BallFragment;
private detailFragment detailFragment;
private PradaFragment pradaFragment;
private LinearLayout indexLine, productLine, shoppingCartLine, pearsonLine;
private Button pradaLine, hermesLine, diaoLine, channelLine,ballLine, lvLine, miumiuLine, guicciLine;
SearchView searchView;
ScrollView listView;
ArrayList<String> list;
ArrayAdapter<String > adapter;
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.navigate);
init();
initIndexFragment();
Thread thread = new Thread(runnable);
thread.start();
}
/**
*
*/
private void init() {
indexLine = findViewById(R.id.content_index);
indexLine.setOnClickListener(this);
productLine = findViewById(R.id.content_product);
productLine.setOnClickListener(this);
shoppingCartLine = findViewById(R.id.content_cart);
shoppingCartLine.setOnClickListener(this);
pearsonLine = findViewById(R.id.content_pearson);
pearsonLine.setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.content_index:
case R.id.category_return:
initIndexFragment();
break;
case R.id.content_product:
initproductFragment();
break;
case R.id.content_cart:
initshoppingCartFragment();
break;
case R.id.content_pearson:
initpearsonFragment();
break;
case R.id.btnprada:
initpradaFragment();
break;
case R.id.btndiao:
initdiaoFragment();
break;
case R.id.btnbll:
initbllFragment();
break;
case R.id.btngucci:
initguicciFragment();
break;
case R.id.btnchannel:
initchannelFragment();
break;
case R.id.btnlv:
initlvFragment();
break;
case R.id.btnhermes:
inithermesFragment();
break;
case R.id.btnmiumiu:
initmiumiuFragment();
break;
case R.id.detail:
initdetailFragment();
break;
}
}
private void initdetailFragment() {
//开启事务fragment的控制是由事务来实现的
FragmentTransaction transaction = getFragmentManager().beginTransaction();
if (detailFragment == null) {
detailFragment = new detailFragment();
}
transaction.replace(R.id.main_content, detailFragment);
transaction.commit();
}
private void initpradaFragment() {
//开启事务fragment的控制是由事务来实现的
FragmentTransaction transaction = getFragmentManager().beginTransaction();
if (PradaFragment == null) {
PradaFragment = new PradaFragment();
}
transaction.replace(R.id.main_content, PradaFragment);
transaction.commit();
}
private void initguicciFragment() {
//开启事务fragment的控制是由事务来实现的
FragmentTransaction transaction = getFragmentManager().beginTransaction();
if (GucciFragment == null) {
GucciFragment = new GucciFragment();
}
transaction.replace(R.id.main_content, GucciFragment);
transaction.commit();
}
private void initmiumiuFragment() {
//开启事务fragment的控制是由事务来实现的
FragmentTransaction transaction = getFragmentManager().beginTransaction();
if (MiumiuFragment == null) {
MiumiuFragment = new MiumiuFragment();
}
transaction.replace(R.id.main_content, MiumiuFragment);
transaction.commit();
}
private void initlvFragment() {
//开启事务fragment的控制是由事务来实现的
FragmentTransaction transaction = getFragmentManager().beginTransaction();
if (LvFragment == null) {
LvFragment = new LvFragment();
}
transaction.replace(R.id.main_content, LvFragment);
transaction.commit();
}
private void initbllFragment() {
//开启事务fragment的控制是由事务来实现的
FragmentTransaction transaction = getFragmentManager().beginTransaction();
if (BallFragment == null) {
BallFragment = new BallFragment();
}
transaction.replace(R.id.main_content, BallFragment);
transaction.commit();
}
private void inithermesFragment() {
//开启事务fragment的控制是由事务来实现的
FragmentTransaction transaction = getFragmentManager().beginTransaction();
if (HermesFragment == null) {
HermesFragment = new HermesFragment();
}
transaction.replace(R.id.main_content, HermesFragment);
transaction.commit();
}
private void initchannelFragment() {
//开启事务fragment的控制是由事务来实现的
FragmentTransaction transaction = getFragmentManager().beginTransaction();
if (ChannelFragment == null) {
ChannelFragment = new ChannelFragment();
}
transaction.replace(R.id.main_content, ChannelFragment);
transaction.commit();
}
private void initdiaoFragment() {
//开启事务fragment的控制是由事务来实现的
FragmentTransaction transaction = getFragmentManager().beginTransaction();
if (DiaoFragment == null) {
DiaoFragment = new DiaoFragment();
}
transaction.replace(R.id.main_content, DiaoFragment);
transaction.commit();
}
/**
* Fragment
*/
private void initproductFragment() {
//开启事务fragment的控制是由事务来实现的
FragmentTransaction transaction = getFragmentManager().beginTransaction();
if (productFragment == null) {
productFragment = new ProductFragment();
}
transaction.replace(R.id.main_content, productFragment);
transaction.commit();
}
/**
* Fragment
*/
private void initshoppingCartFragment() {
//开启事务fragment的控制是由事务来实现的
FragmentTransaction transaction = getFragmentManager().beginTransaction();
if (shoppingCartFragment == null) {
shoppingCartFragment = new ShoppingCartFragment();
}
transaction.replace(R.id.main_content, shoppingCartFragment);
transaction.commit();
}
/**
* Fragment
*/
private void initpearsonFragment() {
//开启事务fragment的控制是由事务来实现的
FragmentTransaction transaction = getFragmentManager().beginTransaction();
if (pearsonFragment == null) {
Intent intent = IndexActivity.this.getIntent();
Bundle bundle = intent.getExtras();
pearsonFragment = new PersonFragment();
pearsonFragment.setArguments(bundle);
}
transaction.replace(R.id.main_content, pearsonFragment);
transaction.commit();
}
private void initIndexFragment() {
//开启事务fragment的控制是由事务来实现的
FragmentTransaction transaction = getFragmentManager().beginTransaction();
if (indexFragment == null) {
indexFragment = new IndexFragment();
}
transaction.replace(R.id.main_content, indexFragment);
transaction.commit();
}
Runnable runnable = () -> {
Intent intent = new Intent(IndexActivity.this, TimeService.class);
startService(intent);
};
}

@ -0,0 +1,124 @@
package com.example.test1.Activity;
import static com.example.test1.R.id.btn_Buy;
import static com.example.test1.R.id.tv_Logo;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import com.example.test1.R;
import com.example.test1.adapter.MyAdapter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class IntroductionActivity extends AppCompatActivity implements AdapterView.OnItemClickListener, AdapterView.OnItemLongClickListener{
private List<Map<String,Object>> data;
private TextView btn,btn1;
@SuppressLint("MissingInflatedId")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_introductionhead);
btn=findViewById(btn_Buy);
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent=new Intent(IntroductionActivity.this, BandActivity.class);
startActivity(intent);
}
});
ListView listView = this.findViewById(R.id.list_main);
//准备数据源List<Map>
initData();
//创建自定义适配器
MyAdapter adapter = new MyAdapter(this);
adapter.setList(data);
listView.setAdapter(adapter);
listView.setOnItemClickListener(this);
listView.setOnItemLongClickListener(this);
}
private void initData() {
data = new ArrayList<Map<String, Object>>();
Map<String,Object> map = new HashMap<String,Object>();
map.put("icon",R.drawable.lvlogo1);
map.put("title","LV");
map.put("content","路易威登Louis Vuitton法国奢侈品品牌隶属于酩悦·轩尼诗-路易·威登集团,经营产品包括手提包,旅行用品,小型皮具,配饰,鞋履,成衣,腕表,高级珠宝及个性化订制服务等。");
data.add(map);
map = new HashMap<String ,Object>();
map.put("icon",R.drawable.hermeslogo);
map.put("title","hermers");
map.put("content","爱马仕Hermès是法国奢侈品品牌由蒂埃利·爱马仕Thierry Hermès于1837年在法国巴黎创立。 [1] 拥有皮具和马具、女士丝制品、男士丝制品、女士成衣、男士成衣、鞋履、腰带、帽子、手套、珠宝、钟表、香水、美妆、家具和生活艺术、餐瓷、petit h十六大工艺部门。 [41] ");
data.add(map);
map = new HashMap<String ,Object>();
map.put("icon",R.drawable.miumiuintroduction);
map.put("title","miumiu");
map.put("content","Miu Miu是Miuccia Prada于1992年创立的品牌。 [6] \n" +
"Miu Miu率性且充满实验风格与Prada是同一设计理念的另一种表达方式注重优雅精致且不乏趣味将女性气质发挥到极致。通过成衣、皮具、眼镜、具备突破意义的广告大片及有独特视角的女人的故事短片系列使品牌呈现了现代女性的多面特质。");
data.add(map);
map = new HashMap<String ,Object>();
map.put("icon",R.drawable.pradalogo);
map.put("title","prada");
map.put("content","普拉达PRADA是意大利奢侈品牌由玛丽奥·普拉达于1913年在意大利米兰创建。缪西娅·普拉达Miuccia Prada的独特天赋在于对新创意的不懈追求融合了对知识的好奇心和文化兴趣从而开辟了先驱之路。她不仅能够预测时尚趋势更能够引领时尚潮流。 [5] ");
data.add(map);
map.put("icon",R.drawable.guccilogo);
map.put("title","Gucci");
map.put("content","古驰(Gucci)1921年创立于意大利佛罗伦萨是全球奢侈品品牌之一借由其独特的创意和革新以及精湛的意大利工艺闻名于世。古驰隶属于开云集团(Kering Group)。开云集团旗下拥有众多极具影响力的精品、运动及生活方式品牌,是时装与配饰行业的领军者。古驰的产品包括时装、皮具、皮鞋、手表、领带、丝巾、香水、家居用品及宠物用品等,中文译作古驰。");
data.add(map);
map = new HashMap<String ,Object>();
map.put("icon",R.drawable.bllogo);
map.put("title","Balenciaga");
map.put("content","巴黎世家Balenciaga是法国的奢侈品牌隶属于开云集团经营产品主要包括男女成衣、皮具、鞋履、香氛和配饰等。 [7] [9]\n" +
"1917年克里斯托巴尔·巴伦西亚加 (Cristóbal Balenciaga)创立了巴黎世家1936年落户巴黎1972年他在西班牙巴斯克地区的故乡逝世。 [12] 2001年开云集团掌管巴黎世家再次确立了巴黎世家作为时尚界最具影响力品牌之一的地位。 [2] [11] 2018年巴黎世家与世界粮食计划署World Food ProgrammeWFP启动合作。 ");
data.add(map);
map = new HashMap<String ,Object>();
map.put("icon",R.drawable.channellogo);
map.put("title","Chanel");
map.put("content","香奈儿Chanel是法国奢侈品品牌创始人是Coco Chanel原名是Gabrielle Bonheur Chanel 中文名是加布里埃·香奈儿该品牌1910年在法国创立。[1]“时装设计具有高雅、简洁、精美的风格。\n" +
"\n" +
"香奈儿无论时尚精品、香水与美容品、腕表与高级珠宝,都致力于为女性塑造自由、优雅、与众不同的风格。2021年8月20日2021胡润世界500强排行榜发布香奈儿以3662亿元人民币价值位列第302名。" );
data.add(map);
map = new HashMap<String ,Object>();
map.put("icon",R.drawable.diaologo);
map.put("title","Dior");
map.put("content","克里斯汀·迪奥Christian Dior简称迪奥Dior或CD是法国时尚消费品牌隶属于酩悦·轩尼诗-路易·威登集团。迪奥主要经营男女手袋、女装、男装、男女鞋履、首饰、香水、化妆品、童装等高档消费品。");
data.add(map);
}
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
Toast.makeText(this,"点击item"+i,Toast.LENGTH_SHORT).show();
}
@Override
public boolean onItemLongClick(AdapterView<?> adapterView, View view, int i, long l) {
Toast.makeText(this,"长按item"+i,Toast.LENGTH_SHORT).show();
return true;//事件流机制
}
}

@ -0,0 +1,80 @@
package com.example.test1.Activity;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import com.example.test1.GoodDatabase.Database;
import com.example.test1.R;
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
private Button register,login;
private EditText passwordEdit,usernameText;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
init();
}
/**
*
*/
private void init() {
usernameText=findViewById(R.id.username);
passwordEdit=findViewById(R.id.password);
login=findViewById(R.id.login);
login.setOnClickListener(this::onClick1);
register=findViewById(R.id.register);
register.setOnClickListener(this::onClick);
}
public void onClick(View view) {
Intent intent = new Intent(MainActivity.this, registerActivity.class);
startActivity(intent);
}
public void onClick1(View view) {
switch (view.getId()){
case R.id.register:
Intent intent1=new Intent(MainActivity.this, registerActivity.class);
startActivity(intent1);
break;
case R.id.login:
if(validateLogin()){
Intent intent = new Intent(MainActivity.this, IndexActivity.class);
Bundle bundle=new Bundle();
Database dateBase=new Database(MainActivity.this);
bundle.putString("username",usernameText.getText().toString());
bundle = Database.queryUserInfo(dateBase.getReadableDatabase(), bundle);
intent.putExtras(bundle);
startActivity(intent);
}
else{
Toast.makeText(MainActivity.this,"账号或者密码错误",Toast.LENGTH_SHORT).show();
}
break;
}
}
private boolean validateLogin() {
String username=usernameText.getText().toString();
String password=passwordEdit.getText().toString();
Database dateBase=new Database(MainActivity.this);
SQLiteDatabase sqLiteDatabase = dateBase.getReadableDatabase();
Cursor cursor=sqLiteDatabase.rawQuery("select * from good_user where username=? and password=?",new String[]{username,password});
if(cursor.getCount()>0){
return true;
}
return false;
}
}

@ -0,0 +1,26 @@
package com.example.test1.Activity;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import androidx.annotation.Nullable;
public class MySQLiteHelper extends SQLiteOpenHelper {
public MySQLiteHelper(@Nullable Context context) {
super(context,"LinShopping.db", null, 1);
}
@Override
public void onCreate(SQLiteDatabase sqLiteDatabase) {
sqLiteDatabase.execSQL("create table person(id varchar(10) primary key,num integer,username varchar(30),password varchar(30),money integer)");
sqLiteDatabase.execSQL("create table shopping(id varchar(10),goodsName varchar(30),time bigint)");
}
@Override
public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {
}
}

@ -0,0 +1,109 @@
package com.example.test1.Activity;
import com.alibaba.fastjson.JSON;
import com.example.test1.R;
import com.example.test1.adapter.ShoppingCartAdapter;
import com.example.test1.entity.shoppingCart;
import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.LayoutInflater;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class ShoppingCartActivity extends Activity {
TextView jiesuan, proName, shopPrice, proCount;
ListView aListView;
private LayoutInflater layoutInflater;
private TextView name;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_no_shoppingcart);
/*根据ID找到控件*/
// public void findViewByID() {
// aListView = (ListView) findViewById(R.id.cart_shopping_listview);
// }
// findViewByID();
// /*开始线程*/
// new Thread(new myThread()).start();
// {
// }
// //开辟线程
class PrimeThread extends Thread {
long minPrime;
PrimeThread(long minPrime) {
this.minPrime = minPrime;
}
public void run() {
}
}
PrimeThread p = new PrimeThread(143);
p.start();
class myThread implements Runnable {
public void run() {
Message msg = new Message();
try {
Map<String, String> parmas = new HashMap<String, String>();
parmas.put("username", "1");
parmas.put("password", "2");
String url = "http://192.168.1.110:8080/SchoolShopJson/ShoppingCart.txt";
// 要发送的数据和访问的地址
//String result = AgentApi.dopost(parmas, url);
// 如果返回的为空或者初始化时输入的ip地址无效(会返回下面的字符串),说明服务器连接失败!
// if (result == null) {
// // 使用-1代表服务器连接失败
// msg.what = -1;
// } else {
// msg.what = 1;
// msg.obj = result;
// }
} catch (Exception e) {
e.printStackTrace();
// 使用-1代表程序异常
msg.what = -2;
msg.obj = e;
}
//mHandler.sendMessage(msg);
}
}
// protected void initView () {
// // TODO Auto-generated method stub
// }
/*子线程-解析数据*/
Handler mHandler = new Handler() {
public void handleMessage(Message msg) {
switch (msg.what) {
case -1:
Toast.makeText(ShoppingCartActivity.this, "服务器连接失败!",
Toast.LENGTH_SHORT).show();
break;
case -2:
Toast.makeText(ShoppingCartActivity.this, "哎呀,出错啦...",
Toast.LENGTH_SHORT).show();
break;
case 1:
String temp = (String) msg.obj;
//将拿到的json转换为数组
List<shoppingCart> ShoppingcartInfo = JSON.parseArray(temp, shoppingCart.class);
//ListView.setAdapter(new ShoppingCartAdapter(ShoppingCartActivity.this, ShoppingcartInfo));
break;
default:
break;
}
}
};
}
}

@ -0,0 +1,15 @@
package com.example.test1.Activity;
import android.app.Activity;
import android.os.Bundle;
import com.example.test1.R;
public class ShoppingCartItemActivity extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_shoppingcart_item);
}
}

@ -0,0 +1,34 @@
package com.example.test1.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.Toast;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import com.example.test1.R;
public class adapterActivity extends AppCompatActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.listview);
//ArrayAdapter创建ListView
ListView listView=(ListView)findViewById(R.id.listview1);
//定义数组来填充ListView
String[] arr={"章节1","章节2","章节3"};
ArrayAdapter<String>adapter = new ArrayAdapter<String>
(this, android.R.layout.simple_expandable_list_item_1,arr);
//为ListView设置Adapter接口
listView.setAdapter(adapter);
}
}

@ -0,0 +1,171 @@
package com.example.test1.Activity;
import android.content.ContentValues;
import android.content.Intent;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import com.example.test1.GoodDatabase.Database;
import com.example.test1.R;
import com.lljjcoder.citypickerview.widget.CityPicker;
public class registerActivity extends AppCompatActivity implements View.OnClickListener, RadioGroup.OnCheckedChangeListener {
private EditText usernameEdit, passwordEdit, surePasswordEdit;
private TextView cityText,numberText;
private CityPicker cityPicker;
private Button regButton;
private RadioGroup sexGroup;
private String sexStr="男";
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.register);
init();
}
/**
*
*/
private void init() {
cityText = findViewById(R.id.province);
numberText = findViewById(R.id.reg_number);
cityText.setOnClickListener(this);
usernameEdit = findViewById(R.id.username);
passwordEdit = findViewById(R.id.password);
surePasswordEdit = findViewById(R.id.reg_sure_password);
regButton = findViewById(R.id.newregister);
regButton.setOnClickListener(this);
sexGroup = findViewById(R.id.sex);
sexGroup.setOnCheckedChangeListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.province:
initCityPicker();
cityPicker.show();
break;
case R.id.newregister:
//注册验证方法
validateRegister();
break;
}
}
/**
*
*/
public void initCityPicker() {
cityPicker = new CityPicker.Builder(registerActivity.this)
.textSize(16)
.title("地址选择")
.backgroundPop(0xa0000000)
.titleBackgroundColor("#EFB81C")
.titleTextColor("#000000")
.backgroundPop(0xa0000000)
.confirTextColor("#000000")
.cancelTextColor("#000000")
.province("江西省")
.city("赣州市")
.district("章贡区")
.textColor(Color.parseColor("#000000"))
.provinceCyclic(true)
.cityCyclic(false)
.districtCyclic(false)
.visibleItemsCount(7)
.itemPadding(10)
.onlyShowProvinceAndCity(false)
.build();
cityPicker.setOnCityItemClickListener(new CityPicker.OnCityItemClickListener() {
@Override
public void onSelected(String... strings) {
String province = strings[0];
String city = strings[1];
String district = strings[2];
cityText.setText(String.format("%s %s %s", province, city, district));
}
@Override
public void onCancel() {
}
});
}
/**
*
*/
public void validateRegister() {
Intent intent = new Intent(registerActivity.this, userActivity.class);
String username = usernameEdit.getText().toString();
String password = passwordEdit.getText().toString();
String surePassword = surePasswordEdit.getText().toString();
String city = cityText.getText().toString();
String number = numberText.getText().toString();
//判断两次密码是否输入一致
if (password.equals(surePassword)) {
//这里也可以再进行其它的验证,如是否符合要求等,符合就进行插入数据库操作
if (!username.equals("") || !password.equals("")) {
if (!city.equals("")) {
Bundle bundle = new Bundle();
bundle.putString("username", username);
bundle.putString("password", password);
bundle.putString("sex", sexStr);
bundle.putString("city", city);
bundle.putString("number", number);
intent.putExtras(bundle);
//用SQLite数据库存储注册信息
Database dateBase= new Database(registerActivity.this);
SQLiteDatabase sqLiteDatabase = dateBase.getWritableDatabase();
insertData(sqLiteDatabase, bundle);
startActivity(intent);
} else {
Toast.makeText(registerActivity.this, "请选择地址", Toast.LENGTH_SHORT).show();
}
} else {
Toast.makeText(registerActivity.this, "账号或密码未填写", Toast.LENGTH_SHORT).show();
}
} else {
Toast.makeText(registerActivity.this, "两次密码输入不一致", Toast.LENGTH_SHORT).show();
}
}
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
//根据用户选择来改变sex的值
sexStr = checkedId == R.id.reg_man ? "男" : "女";
}
private void insertData(SQLiteDatabase sqLiteDatabase, Bundle bundle){
ContentValues contentValues=new ContentValues();
contentValues.put("username",bundle.getString("username"));
contentValues.put("password",bundle.getString("password"));
contentValues.put("sex",bundle.getString("sex"));
contentValues.put("city",bundle.getString("city"));
contentValues.put("number",bundle.getString("number"));
sqLiteDatabase.insert("good_user",null,contentValues);
sqLiteDatabase.close();
}
@Override
public void onPointerCaptureChanged(boolean hasCapture) {
super.onPointerCaptureChanged(hasCapture);
}
}

@ -0,0 +1,99 @@
package com.example.test1.Activity;
import androidx.appcompat.app.AppCompatActivity;
import android.app.FragmentTransaction;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.Nullable;
import com.example.test1.Fragment.PersonFragment;
import com.example.test1.Fragment.PradaFragment;
import com.example.test1.R;
public class userActivity extends AppCompatActivity {
private ImageView userSexline, userCityLine, userPayLine, userSettingLine,
userGeneralLine, usernameLine, userIconImage,userNumberLine;
private TextView userCityText, userSexText, usernameText,userNumberText;
private LinearLayout userSearchProductLine;
private PersonFragment personFragment;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.user);
init();
}
/*
*/
private void init() {
userIconImage = findViewById(R.id.user_icon);
usernameText = findViewById(R.id.user_username);
userSexText = findViewById(R.id.user_sex);
userCityText = findViewById(R.id.user_city);
userNumberText = findViewById(R.id.user_number);
usernameLine = findViewById(R.id.user_username_line);
userSexline = findViewById(R.id.user_sex_line);
userCityLine = findViewById(R.id.user_city_line);
userNumberLine = findViewById(R.id.user_number_line);
userPayLine = findViewById(R.id.user_pay);
userSettingLine = findViewById(R.id.user_setting);
userGeneralLine = findViewById(R.id.user_general);
userSearchProductLine = findViewById(R.id.user_searchProduct);
userSearchProductLine.setOnClickListener(this::onClick1);
setData();
}
/**
*
*/
private void setData() {
Intent intent = this.getIntent();
Bundle bundle = intent.getExtras();
System.out.println(bundle.getString("username"));
System.out.println(bundle.getString("sex"));
usernameText.setText(String.format("用户名:%s", bundle.getString("username")));
userSexText.setText(String.format("性别:%s", bundle.getString("sex")));
userCityText.setText(String.format("城市:%s", bundle.getString("city")));
userNumberText.setText(String.format("电话:%s", bundle.getString("number")));
}
public void onClick(View v) {
Intent intent = new Intent(userActivity.this, MainActivity.class);
startActivity(intent);
switch (v.getId()) {
case R.id.returnmain:
break;
}
}
public void onClick1(View v) {
Intent intent = new Intent(userActivity.this, MainActivity.class);
startActivity(intent);
switch (v.getId()) {
case R.id.user_searchProduct:
Intent intent1 = new Intent(userActivity.this, IntroductionActivity.class);
startActivity(intent1);
break;
}
}
private void initpersonFragment() {
//开启事务fragment的控制是由事务来实现的
FragmentTransaction transaction = getFragmentManager().beginTransaction();
if (personFragment == null) {
personFragment = new PersonFragment();
}
transaction.replace(R.id.main_content, personFragment);
transaction.commit();
}
}

@ -0,0 +1,59 @@
package com.example.test1;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.os.Bundle;
import androidx.annotation.Nullable;
public class Database extends SQLiteOpenHelper {
public Database(@Nullable Context context) {
super(context, "good", null, 4);
}
@Override
public void onCreate(SQLiteDatabase db) {
//创建用户表
String sql = "create table good_user(id integer primary key autoincrement, username varchar(50), password varchar(50),sex varchar(10),city carchar(50),number carchar(50))";
db.execSQL(sql);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
}
//插入数据
public void insertUser(SQLiteDatabase sqLiteDatabase, String username, String password, String sex, String city, String number ) {
ContentValues contentValues = new ContentValues();
contentValues.put("username", username);
contentValues.put("password", password);
contentValues.put("sex", sex);
contentValues.put("city", city);
contentValues.put("number", number);
sqLiteDatabase.insert("good_user", null, contentValues);
sqLiteDatabase.close();
}
//查询数据
public static Bundle queryUserInfo(SQLiteDatabase sqLiteDatabase, Bundle bundle) {
String username = bundle.getString("username");
Cursor cursor = sqLiteDatabase.rawQuery("select * from good_user where username=?", new String[]{username});
if (cursor != null) {
while (cursor.moveToNext()) {
bundle.putString("sex", cursor.getString(3));
bundle.putString("city", cursor.getString(4));
bundle.putString("number", cursor.getString(5));
}
}
cursor.close();
sqLiteDatabase.close();
return bundle;
}
}

@ -0,0 +1,75 @@
package com.example.test1.Fragment;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.example.test1.R;
import com.example.test1.entity.Product;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
public class BallFragment extends Fragment implements View.OnClickListener {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
initData();
}
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = LayoutInflater.from(getActivity()).inflate(R.layout.bllfragment, container, false);
return view;
}
@Override
public void onClick(View v) {
}
private List<Product> productList;
private void initData() {
productList = new ArrayList<>();
Product product = new Product();
product.setImageUrlId(R.drawable.bl);
product.setProductName("bl");
product.setProductPrice(new BigDecimal("19999"));
Product product1 = new Product();
product1.setImageUrlId(R.drawable.bl1);
product1.setProductName("bl1");
product1.setProductPrice(new BigDecimal("29999"));
Product product2 = new Product();
product2.setImageUrlId(R.drawable.bl2);
product2.setProductName("bl2");
product2.setProductPrice(new BigDecimal("19999"));
Product product3 = new Product();
product3.setImageUrlId(R.drawable.bl3);
product3.setProductName("bl3");
product3.setProductPrice(new BigDecimal("29999"));
Product product4 = new Product();
product4.setImageUrlId(R.drawable.bl4);
product4.setProductName("bl4");
product4.setProductPrice(new BigDecimal("49999"));
Product product5 = new Product();
product5.setImageUrlId(R.drawable.bl5);
product5.setProductName("bl5");
Product product6 = new Product();
product5.setProductPrice(new BigDecimal("39999"));
product1.setImageUrlId(R.drawable.bl6);
product1.setProductName("bl6");
product1.setProductPrice(new BigDecimal("29999"));
productList.add(product);
productList.add(product1);
productList.add(product2);
productList.add(product3);
productList.add(product4);
productList.add(product5);
productList.add(product6);
}
}

@ -0,0 +1,71 @@
package com.example.test1.Fragment;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.example.test1.R;
import com.example.test1.entity.Product;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
public class ChannelFragment extends Fragment implements View.OnClickListener{
@Nullable
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
initData();
}
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = LayoutInflater.from(getActivity()).inflate(R.layout.channelfragment, container, false);
return view;
}
@Override
public void onClick(View v) {
}
private List<Product> productList;
private void initData() {
productList = new ArrayList<>();
Product product = new Product();
product.setImageUrlId(R.drawable.chanel1);
product.setProductName("cn1");
product.setProductPrice(new BigDecimal("19999"));
Product product1 = new Product();
product1.setImageUrlId(R.drawable.chanel2);
product1.setProductName("cn2");
product1.setProductPrice(new BigDecimal("29999"));
Product product2 = new Product();
product2.setImageUrlId(R.drawable.chanel3);
product2.setProductName("cn3");
product2.setProductPrice(new BigDecimal("19999"));
Product product3 = new Product();
product3.setImageUrlId(R.drawable.chanel4);
product3.setProductName("cnn4");
product3.setProductPrice(new BigDecimal("29999"));
Product product4 = new Product();
product4.setImageUrlId(R.drawable.chanel5);
product4.setProductName("cn5");
product4.setProductPrice(new BigDecimal("49999"));
Product product5 = new Product();
product5.setImageUrlId(R.drawable.chanel6);
product5.setProductName("cn6");
productList.add(product);
productList.add(product1);
productList.add(product2);
productList.add(product3);
productList.add(product4);
productList.add(product5);
}
}

@ -0,0 +1,77 @@
package com.example.test1.Fragment;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.example.test1.R;
import com.example.test1.entity.Product;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
public class DiaoFragment extends Fragment implements View.OnClickListener{
@Nullable
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
initData();
}
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = LayoutInflater.from(getActivity()).inflate(R.layout.diaofregment, container, false);
// init(view);
return view;
}
@Override
public void onClick(View v) {
}
private List<Product> productList;
private void initData() {
productList = new ArrayList<>();
Product product = new Product();
product.setImageUrlId(R.drawable.diao);
product.setProductName("diao");
product.setProductPrice(new BigDecimal("19999"));
Product product1 = new Product();
product1.setImageUrlId(R.drawable.diao1);
product1.setProductName("diao1");
product1.setProductPrice(new BigDecimal("29999"));
Product product2 = new Product();
product2.setImageUrlId(R.drawable.diao2);
product2.setProductName("diao2");
product2.setProductPrice(new BigDecimal("19999"));
Product product3 = new Product();
product3.setImageUrlId(R.drawable.diao3);
product3.setProductName("diao3");
product3.setProductPrice(new BigDecimal("29999"));
Product product4 = new Product();
product4.setImageUrlId(R.drawable.diao4);
product4.setProductName("diao4");
product4.setProductPrice(new BigDecimal("49999"));
Product product5 = new Product();
product5.setImageUrlId(R.drawable.diao5);
product5.setProductName("diao5");
Product product6 = new Product();
product5.setImageUrlId(R.drawable.diao6);
product5.setProductName("diao6");
productList.add(product);
productList.add(product1);
productList.add(product2);
productList.add(product3);
productList.add(product4);
productList.add(product5);
productList.add(product6);
}
}

@ -0,0 +1,76 @@
package com.example.test1.Fragment;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.example.test1.R;
import com.example.test1.entity.Product;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
public class GucciFragment extends Fragment implements View.OnClickListener{
@Nullable
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
initData();
}
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = LayoutInflater.from(getActivity()).inflate(R.layout.guccifragment, container, false);
// init(view);
return view;
}
@Override
public void onClick(View v) {
}
private List<Product> productList;
private void initData() {
productList = new ArrayList<>();
Product product = new Product();
product.setImageUrlId(R.drawable.gucci1);
product.setProductName("gucci1");
product.setProductPrice(new BigDecimal("19999"));
Product product1 = new Product();
product1.setImageUrlId(R.drawable.gucci2);
product1.setProductName("gucci2");
product1.setProductPrice(new BigDecimal("29999"));
Product product2 = new Product();
product2.setImageUrlId(R.drawable.gucci3);
product2.setProductName("gucci3");
product2.setProductPrice(new BigDecimal("19999"));
// Product product3 = new Product();
// product3.setImageUrlId(R.drawable.diao3);
// product3.setProductName("diao3");
// product3.setProductPrice(new BigDecimal("29999"));
// Product product4 = new Product();
// product4.setImageUrlId(R.drawable.diao4);
// product4.setProductName("diao4");
// product4.setProductPrice(new BigDecimal("49999"));
// Product product5 = new Product();
// product5.setImageUrlId(R.drawable.diao5);
// product5.setProductName("diao5");
// Product product6 = new Product();
// product5.setImageUrlId(R.drawable.diao6);
// product5.setProductName("diao6");
productList.add(product);
productList.add(product1);
productList.add(product2);
// productList.add(product3);
// productList.add(product4);
// productList.add(product5);
// productList.add(product6);
}
}

@ -0,0 +1,76 @@
package com.example.test1.Fragment;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.example.test1.R;
import com.example.test1.entity.Product;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
public class HermesFragment extends Fragment implements View.OnClickListener{
@Nullable
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
initData();
}
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = LayoutInflater.from(getActivity()).inflate(R.layout.hermesfragment, container, false);
// init(view);
return view;
}
@Override
public void onClick(View v) {
}
private List<Product> productList;
private void initData() {
productList = new ArrayList<>();
Product product = new Product();
product.setImageUrlId(R.drawable.hermes);
product.setProductName("hermes");
product.setProductPrice(new BigDecimal("19999"));
Product product1 = new Product();
product1.setImageUrlId(R.drawable.hermes1);
product1.setProductName("hermes1");
product1.setProductPrice(new BigDecimal("29999"));
Product product2 = new Product();
product2.setImageUrlId(R.drawable.hermes2);
product2.setProductName("hermes2");
product2.setProductPrice(new BigDecimal("19999"));
Product product3 = new Product();
product3.setImageUrlId(R.drawable.hermes3);
product3.setProductName("hermes3");
product3.setProductPrice(new BigDecimal("29999"));
Product product4 = new Product();
product4.setImageUrlId(R.drawable.hermes4);
product4.setProductName("hermes4");
product4.setProductPrice(new BigDecimal("49999"));
Product product5 = new Product();
product5.setImageUrlId(R.drawable.hermes5);
product5.setProductName("hermes5");
Product product6 = new Product();
product5.setImageUrlId(R.drawable.hermes6);
product5.setProductName("hermes6");
productList.add(product);
productList.add(product1);
productList.add(product2);
productList.add(product3);
productList.add(product4);
productList.add(product5);
productList.add(product6);
}
}

@ -0,0 +1,137 @@
package com.example.test1.Fragment;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.GridView;
import android.widget.LinearLayout;
import android.widget.SearchView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.example.test1.R;
import com.example.test1.adapter.ProductAdapter;
import com.example.test1.entity.Product;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
public class IndexFragment extends Fragment implements View.OnClickListener {
private SearchView searchView;
private LinearLayout orangeLine, youziLine, juziLine, xiguaLine, liLine, appleLine, lemonLine, mangguoLine;
private GridView gridView;
private ProductAdapter productAdapter;
private List<Product> productList;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = LayoutInflater.from(getActivity()).inflate(R.layout.content_index, container, false);
init(view);
return view;
}
/**
*
*/
private void init(View view) {
searchView = view.findViewById(R.id.searchView);
searchView.setOnClickListener(this);
orangeLine = view.findViewById(R.id.chengzi);
orangeLine.setOnClickListener(this);
youziLine = view.findViewById(R.id.youzi);
youziLine.setOnClickListener(this);
juziLine = view.findViewById(R.id.juzi);
juziLine.setOnClickListener(this);
xiguaLine = view.findViewById(R.id.xigua);
xiguaLine.setOnClickListener(this);
liLine = view.findViewById(R.id.li);
liLine.setOnClickListener(this);
lemonLine = view.findViewById(R.id.lemon);
lemonLine.setOnClickListener(this);
mangguoLine = view.findViewById(R.id.mangguo);
mangguoLine.setOnClickListener(this);
appleLine = view.findViewById(R.id.apple);
appleLine.setOnClickListener(this);
gridView = view.findViewById(R.id.index_famous_gridview);
initData();
productAdapter = new ProductAdapter(getActivity(), productList);
gridView.setAdapter(productAdapter);
}
public void onClick(View v) {
}
/**
*
*/
private void initData() {
productList = new ArrayList<>();
Product product = new Product();
product.setImageUrlId(R.drawable.lv1);
product.setProductName("lv");
product.setProductPrice(new BigDecimal("19999"));
Product product1 = new Product();
product1.setImageUrlId(R.drawable.lv2);
product1.setProductName("prada");
product1.setProductPrice(new BigDecimal("29999"));
Product product2 = new Product();
product2.setImageUrlId(R.drawable.miumiu1);
product2.setProductName("miumiu");
product2.setProductPrice(new BigDecimal("19999"));
Product product3 = new Product();
product3.setImageUrlId(R.drawable.prada1);
product3.setProductName("hermes");
product3.setProductPrice(new BigDecimal("29999"));
Product product4 = new Product();
product4.setImageUrlId(R.drawable.prada2);
product4.setProductName("cn");
product4.setProductPrice(new BigDecimal("49999"));
Product product5 = new Product();
product5.setImageUrlId(R.drawable.hermes1);
product5.setProductName("diao");
Product product6 = new Product();
product5.setProductPrice(new BigDecimal("39999"));
product1.setImageUrlId(R.drawable.lv2);
product1.setProductName("prada");
product1.setProductPrice(new BigDecimal("29999"));
Product product7 = new Product();
product2.setImageUrlId(R.drawable.miumiu1);
product2.setProductName("miumiu");
product2.setProductPrice(new BigDecimal("19999"));
Product product8 = new Product();
product3.setImageUrlId(R.drawable.prada1);
product3.setProductName("hermes");
product3.setProductPrice(new BigDecimal("29999"));
Product product9 = new Product();
product4.setImageUrlId(R.drawable.prada2);
product4.setProductName("cn");
product4.setProductPrice(new BigDecimal("49999"));
Product product10 = new Product();
product5.setImageUrlId(R.drawable.hermes1);
product5.setProductName("diao");
product5.setProductPrice(new BigDecimal("39999"));
productList.add(product);
productList.add(product1);
productList.add(product2);
productList.add(product3);
productList.add(product4);
productList.add(product5);
productList.add(product6);
productList.add(product7);
productList.add(product8);
productList.add(product9);
productList.add(product10);
}
}

@ -0,0 +1,33 @@
package com.example.test1.Fragment;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.example.test1.R;
public class LeftFragment extends Fragment {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view= inflater.inflate(R.layout.fragment_left, container, false);
return view;
}
public void onPause(){
super.onPause();
}
}

@ -0,0 +1,80 @@
package com.example.test1.Fragment;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.example.test1.R;
import com.example.test1.entity.Product;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
public class LvFragment extends Fragment implements View.OnClickListener{
@Nullable
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
initData();
}
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = LayoutInflater.from(getActivity()).inflate(R.layout.lvfragment, container, false);
// init(view);
return view;
}
@Override
public void onClick(View v) {
}
private List<Product> productList;
private void initData() {
productList = new ArrayList<>();
Product product = new Product();
product.setImageUrlId(R.drawable.lv);
product.setProductName("lv");
product.setProductPrice(new BigDecimal("19999"));
Product product1 = new Product();
product1.setImageUrlId(R.drawable.lv1);
product1.setProductName("lv1");
product1.setProductPrice(new BigDecimal("29999"));
Product product2 = new Product();
product2.setImageUrlId(R.drawable.lv2);
product2.setProductName("lv2");
product2.setProductPrice(new BigDecimal("19999"));
Product product3 = new Product();
product3.setImageUrlId(R.drawable.lv3);
product3.setProductName("lv3");
product3.setProductPrice(new BigDecimal("29999"));
Product product4 = new Product();
product4.setImageUrlId(R.drawable.lv4);
product4.setProductName("lv4");
product4.setProductPrice(new BigDecimal("49999"));
Product product5 = new Product();
product5.setImageUrlId(R.drawable.lv5);
product5.setProductName("lv5");
Product product6 = new Product();
product5.setImageUrlId(R.drawable.lv6);
product5.setProductName("lv6");
Product product7 = new Product();
product5.setImageUrlId(R.drawable.lv7);
product5.setProductName("lv7");
productList.add(product);
productList.add(product1);
productList.add(product2);
productList.add(product3);
productList.add(product4);
productList.add(product5);
productList.add(product6);
productList.add(product7);
}
}

@ -0,0 +1,76 @@
package com.example.test1.Fragment;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.example.test1.R;
import com.example.test1.entity.Product;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
public class MiumiuFragment extends Fragment implements View.OnClickListener{
@Nullable
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
initData();
}
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = LayoutInflater.from(getActivity()).inflate(R.layout.miumiufragment, container, false);
// init(view);
return view;
}
@Override
public void onClick(View v) {
}
private List<Product> productList;
private void initData() {
productList = new ArrayList<>();
Product product = new Product();
product.setImageUrlId(R.drawable.miumiu);
product.setProductName("miumiu");
product.setProductPrice(new BigDecimal("19999"));
Product product1 = new Product();
product1.setImageUrlId(R.drawable.miumiu1);
product1.setProductName("miumiu1");
product1.setProductPrice(new BigDecimal("29999"));
Product product2 = new Product();
product2.setImageUrlId(R.drawable.miumiu2);
product2.setProductName("miumiu2");
product2.setProductPrice(new BigDecimal("19999"));
Product product3 = new Product();
product3.setImageUrlId(R.drawable.miumiu3);
product3.setProductName("miumiu3");
product3.setProductPrice(new BigDecimal("29999"));
Product product4 = new Product();
product4.setImageUrlId(R.drawable.miumiu4);
product4.setProductName("miumiu4");
product4.setProductPrice(new BigDecimal("49999"));
Product product5 = new Product();
product5.setImageUrlId(R.drawable.miumiu5);
product5.setProductName("miumiu5");
Product product6 = new Product();
product5.setImageUrlId(R.drawable.miumiu6);
product5.setProductName("miumiu6");
productList.add(product);
productList.add(product1);
productList.add(product2);
productList.add(product3);
productList.add(product4);
productList.add(product5);
productList.add(product6);
}
}

@ -0,0 +1,82 @@
package com.example.test1.Fragment;
import android.app.Fragment;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.example.test1.Activity.IntroductionActivity;
import com.example.test1.Activity.MainActivity;
import com.example.test1.Activity.registerActivity;
import com.example.test1.Activity.userActivity;
import com.example.test1.R;
public class PersonFragment extends Fragment implements View.OnClickListener {
private ImageView userIconImage;
private TextView userNumberText,usernameText, userSexText, userCityText;
private ImageView userNumberLine,usernameLine, userSexline, userCityLine, userPayLine, userSettingLine, userGeneralLine;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = LayoutInflater.from(getActivity()).inflate(R.layout.user, container, false);
init(view);
return view;
}
/**
*
*/
private void init(View view) {
userIconImage = view.findViewById(R.id.user_icon);
usernameText = view.findViewById(R.id.user_username);
userSexText = view.findViewById(R.id.user_sex);
userCityText = view.findViewById(R.id.user_city);
userNumberText = view.findViewById(R.id.user_number);
userNumberLine = view.findViewById(R.id.user_number_line);
usernameLine = view.findViewById(R.id.user_username_line);
userSexline = view.findViewById(R.id.user_sex_line);
userCityLine = view.findViewById(R.id.user_city_line);
userPayLine = view.findViewById(R.id.user_pay);
userSettingLine = view.findViewById(R.id.user_setting);
userGeneralLine = view.findViewById(R.id.user_general);
setData();
}
/**
*
*/
private void setData() {
Bundle bundle = getArguments();
usernameText.setText(String.format("用户名:%s", bundle.getString("username")));
userSexText.setText(String.format("性别:%s", bundle.getString("sex")));
userCityText.setText(String.format("城市:%s", bundle.getString("city")));
userNumberText.setText(String.format("电话:%s", bundle.getString("number")));
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.user_searchProduct:
Intent intent1=new Intent(getActivity(), IntroductionActivity.class);
startActivity(intent1);
break;
case R.id.returnmain:
//开启事务fragment的控制是由事务来实现的
Intent intent=new Intent(getActivity(), MainActivity.class);
startActivity(intent);
break;
}
}
}

@ -0,0 +1,94 @@
package com.example.test1.Fragment;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.GridView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.example.test1.R;
import com.example.test1.adapter.ProductAdapter;
import com.example.test1.entity.Product;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
public class PradaFragment extends Fragment implements View.OnClickListener {
@Nullable
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = LayoutInflater.from(getActivity()).inflate(R.layout.pradafragment, container, false);
//init(view);
return view;
}
private ProductAdapter productAdapter;
private GridView gridView;
private void init(View view) {
initData();
productAdapter = new ProductAdapter(getActivity(), productList);
gridView.setAdapter(productAdapter);
}
@Override
public void onClick(View v) {
}
private List<Product> productList;
private void initData() {
productList = new ArrayList<>();
Product product = new Product();
product.setImageUrlId(R.drawable.prada);
product.setProductName("prada");
product.setProductPrice(new BigDecimal("19999"));
Product product1 = new Product();
product1.setImageUrlId(R.drawable.prada1);
product1.setProductName("prada1");
product1.setProductPrice(new BigDecimal("29999"));
Product product2 = new Product();
product2.setImageUrlId(R.drawable.prada2);
product2.setProductName("prada2");
product2.setProductPrice(new BigDecimal("19999"));
Product product3 = new Product();
product3.setImageUrlId(R.drawable.prada3);
product3.setProductName("prada3");
product3.setProductPrice(new BigDecimal("29999"));
Product product4 = new Product();
product4.setImageUrlId(R.drawable.prada4);
product4.setProductName("prada4");
product4.setProductPrice(new BigDecimal("49999"));
Product product5 = new Product();
product5.setImageUrlId(R.drawable.prada5);
product5.setProductName("prada5");
Product product6 = new Product();
product5.setImageUrlId(R.drawable.prada6);
product5.setProductName("prada6");
Product product7 = new Product();
product5.setImageUrlId(R.drawable.prada7);
product5.setProductName("prada7");
productList.add(product);
productList.add(product1);
productList.add(product2);
productList.add(product3);
productList.add(product4);
productList.add(product5);
productList.add(product6);
productList.add(product7);
}
}

@ -0,0 +1,198 @@
package com.example.test1.Fragment;
import android.app.Fragment;
import android.app.FragmentTransaction;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.GridView;
import android.widget.Spinner;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.example.test1.R;
import com.example.test1.adapter.ListViewAdapter;
import com.example.test1.adapter.ProductAdapter;
import com.example.test1.entity.Condition;
import com.example.test1.entity.Product;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
public class ProductFragment extends Fragment {
private Spinner conditonListSpinner;
private ListViewAdapter listViewAdapter;
private List<Condition> conditionList;
private GridView productGridView;
private List<Product> productList;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = LayoutInflater.from(getActivity()).inflate(R.layout.content_product, container, false);
init(view);
return view;
}
/**
*
*
* @param view
*/
private void init(View view) {
conditonListSpinner = view.findViewById(R.id.product_select_condition);
initCondList();
listViewAdapter = new ListViewAdapter(getActivity(), conditionList);
conditonListSpinner.setAdapter(listViewAdapter);
productGridView = view.findViewById(R.id.product_list);
initData();
ProductAdapter productAdapter = new ProductAdapter(getActivity(), productList);
productGridView.setAdapter(productAdapter);
}
public void onClick(View v) {
switch (v.getId()) {
case R.id.random_search:
break;
}
}
/**
* conditionList
*/
private void initCondList() {
conditionList = new ArrayList<>();
Condition allCondition = new Condition();
allCondition.setConditionIcon(R.drawable.all);
allCondition.setConditionName("全部");
Condition saleCondition = new Condition();
saleCondition.setConditionIcon(R.drawable.sale);
saleCondition.setConditionName("按销量高低排序");
Condition timeCondition = new Condition();
timeCondition.setConditionIcon(R.drawable.time);
timeCondition.setConditionName("按上市时间排序");
Condition priceCondition = new Condition();
priceCondition.setConditionIcon(R.drawable.price);
priceCondition.setConditionName("按商品价格排序");
conditionList.add(allCondition);
conditionList.add(saleCondition);
conditionList.add(timeCondition);
conditionList.add(priceCondition);
}
/**
*
*/
private void initData() {
productList = new ArrayList<>();
Product product0 = new Product();
product0.setImageUrlId(R.drawable.lv1);
product0.setProductName("lv");
product0.setProductPrice(new BigDecimal("19999"));
Product product1 = new Product();
product1.setImageUrlId(R.drawable.lv2);
product1.setProductName("prada");
product1.setProductPrice(new BigDecimal("29999"));
Product product2 = new Product();
product2.setImageUrlId(R.drawable.miumiu1);
product2.setProductName("miumiu");
product2.setProductPrice(new BigDecimal("19999"));
Product product3 = new Product();
product3.setImageUrlId(R.drawable.prada1);
product3.setProductName("hermes");
product3.setProductPrice(new BigDecimal("29999"));
Product product4 = new Product();
product4.setImageUrlId(R.drawable.prada2);
product4.setProductName("cn");
product4.setProductPrice(new BigDecimal("49999"));
Product product5 = new Product();
product5.setImageUrlId(R.drawable.hermes1);
product5.setProductName("diao");
product5.setProductPrice(new BigDecimal("39999"));
Product product6 = new Product();
product6.setImageUrlId(R.drawable.lv3);
product6.setProductName("prada");
product6.setProductPrice(new BigDecimal("29999"));
Product product7 = new Product();
product7.setImageUrlId(R.drawable.lv6);
product7.setProductName("miumiu");
product7.setProductPrice(new BigDecimal("19999"));
Product product8 = new Product();
product8.setImageUrlId(R.drawable.prada1);
product8.setProductName("hermes");
product8.setProductPrice(new BigDecimal("29999"));
Product product9 = new Product();
product9.setImageUrlId(R.drawable.prada2);
product9.setProductName("cn");
product9.setProductPrice(new BigDecimal("49999"));
Product product10 = new Product();
product10.setImageUrlId(R.drawable.hermes2);
product10.setProductName("diao");
product10.setProductPrice(new BigDecimal("39999"));
Product product11 = new Product();
product11.setImageUrlId(R.drawable.lv4);
product11.setProductName("prada");
product11.setProductPrice(new BigDecimal("29999"));
Product product12 = new Product();
product12.setImageUrlId(R.drawable.lv5);
product12.setProductName("miumiu");
product12.setProductPrice(new BigDecimal("19999"));
Product product13 = new Product();
product13.setImageUrlId(R.drawable.prada3);
product13.setProductName("hermes");
product13.setProductPrice(new BigDecimal("29999"));
Product product14 = new Product();
product14.setImageUrlId(R.drawable.prada4);
product14.setProductName("cn");
product14.setProductPrice(new BigDecimal("49999"));
Product product15 = new Product();
product15.setImageUrlId(R.drawable.lv7);
product15.setProductName("diao");
product15.setProductPrice(new BigDecimal("39999"));
Product product16 = new Product();
product16.setImageUrlId(R.drawable.lv2);
product16.setProductName("prada");
product16.setProductPrice(new BigDecimal("29999"));
Product product17 = new Product();
product17.setImageUrlId(R.drawable.miumiu1);
product17.setProductName("miumiu");
product17.setProductPrice(new BigDecimal("19999"));
Product product18 = new Product();
product18.setImageUrlId(R.drawable.prada1);
product18.setProductName("hermes");
product18.setProductPrice(new BigDecimal("29999"));
Product product19 = new Product();
product19.setImageUrlId(R.drawable.prada2);
product19.setProductName("cn");
product19.setProductPrice(new BigDecimal("49999"));
Product product20 = new Product();
product20.setImageUrlId(R.drawable.hermes1);
product20.setProductName("diao");
product20.setProductPrice(new BigDecimal("39999"));
productList.add(product0);
productList.add(product1);
productList.add(product2);
productList.add(product3);
productList.add(product4);
productList.add(product5);
productList.add(product6);
productList.add(product7);
productList.add(product8);
productList.add(product9);
productList.add(product10);
productList.add(product11);
productList.add(product12);
productList.add(product13);
productList.add(product14);
productList.add(product15);
productList.add(product16);
productList.add(product17);
productList.add(product18);
productList.add(product19);
productList.add(product20);
}
}

@ -0,0 +1,65 @@
package com.example.test1.Fragment;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
import com.example.test1.R;
import com.example.test1.adapter.RightAdapter;
import com.example.test1.entity.BrandBean;
import java.io.Serializable;
import java.util.List;
public class RightFragment extends Fragment {
private ListView lv_list;
/* public RightFragment(FragmentActivity activity, List<FoodBean> list) {
// Required empty public constructor
}*/
public RightFragment() {
}
public RightFragment getInstance(List<BrandBean>list){
RightFragment rightFragment=new RightFragment();
Bundle bundle=new Bundle();
bundle.putSerializable("list",(Serializable) list);
rightFragment.setArguments(bundle);
return rightFragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view=inflater.inflate(R.layout.fragment_right, container, false);
lv_list=view.findViewById(R.id.lv_list);
if(getArguments()!=null){
List<BrandBean>list=(List<BrandBean>) getArguments().getSerializable("list");
RightAdapter adapter=new RightAdapter(getActivity(),list);
lv_list.setAdapter( adapter);
}
return view;
}
}

@ -0,0 +1,53 @@
package com.example.test1.Fragment;
import android.annotation.SuppressLint;
import android.app.Fragment;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.example.test1.Activity.CategoryActivity;
import com.example.test1.R;
import java.util.Objects;
public class SetDetailFragment extends Fragment {
private View view;
private ImageView imageView;
private TextView nameText, priceText;
@SuppressLint("SetTextI18n")
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
view = inflater.inflate(R.layout.categoty_detail_content,container, false);
if (view != null) {
init();
}
CategoryActivity categoryActivity = (CategoryActivity) getActivity();
Objects.requireNonNull(categoryActivity).setOnChangeListener(product -> {
Log.i("sss", "onCreateView: " + product.getProductName());
imageView.setBackgroundResource(product.getImageUrlId());
nameText.setText(product.getProductName());
priceText.setText(product.getProductPrice().toString());
});
return view;
}
/**
*
*/
private void init() {
imageView = view.findViewById(R.id.category_product_image);
nameText = view.findViewById(R.id.category_product_name);
priceText = view.findViewById(R.id.category_product_price);
}
}

@ -0,0 +1,91 @@
package com.example.test1.Fragment;
import android.app.Fragment;
import android.app.FragmentTransaction;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.example.test1.Activity.MainActivity;
import com.example.test1.R;
import com.example.test1.entity.shoppingCart;
import java.util.ArrayList;
import java.util.List;
public class ShoppingCartFragment extends Fragment implements View.OnClickListener{
private Button walkButton,walkButton1,walkButton2;
private List<shoppingCart> cartList = new ArrayList<>();
private ProductFragment productFragment;
private IndexFragment indexFragment;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view;
if (cartList.size() > 0) {
//有商品
view = LayoutInflater.from(getActivity()).inflate(R.layout.activity_shoppingcart, container, false);
} else {
view = LayoutInflater.from(getActivity()).inflate(R.layout.activity_no_shoppingcart, container, false);
}
init(view);
return view;
}
/**
*
*/
private void init(View view) {
walkButton = view.findViewById(R.id.random_search);
walkButton.setOnClickListener(this);
// if (cartList.size() > 0) {
// //有商品
// walkButton1 = view.findViewById(R.id.back);
// walkButton1.setOnClickListener(this);
// } else {
// walkButton2 = view.findViewById(R.id.back1);
// walkButton2.setOnClickListener(this);
// }
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.random_search:
initproductFragment();
break;
case R.id.back:
case R.id.back1:
//开启事务fragment的控制是由事务来实现的
initIndexFragment();
break;
}
}
private void initproductFragment () {
//开启事务fragment的控制是由事务来实现的
FragmentTransaction transaction = getFragmentManager().beginTransaction();
if (productFragment == null) {
productFragment = new ProductFragment();
}
transaction.replace(R.id.main_content, productFragment);
transaction.commit();
}
private void initIndexFragment() {
//开启事务fragment的控制是由事务来实现的
FragmentTransaction transaction = getFragmentManager().beginTransaction();
if (indexFragment == null) {
indexFragment = new IndexFragment();
}
transaction.replace(R.id.main_content, indexFragment);
transaction.commit();
}
}

@ -0,0 +1,38 @@
package com.example.test1.Fragment;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import com.example.test1.R;
import com.example.test1.entity.shoppingCart;
import java.util.ArrayList;
import java.util.List;
public class ShoppingCartItemActivityFragment extends Fragment {
private List<shoppingCart> cartList = new ArrayList<>();
private Button walkButton;
public View onCreate(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
View view;
if (cartList.size() > 0) {
//有商品
view = LayoutInflater.from(getActivity()).inflate(R.layout.activity_shoppingcart_item, container, false);
} else {
view = LayoutInflater.from(getActivity()).inflate(R.layout.activity_no_shoppingcart, container, false);
}
init(view);
return view;
}
private void init(View view) {
walkButton = view.findViewById(R.id.random_search);
walkButton.setOnClickListener((View.OnClickListener) this);
}
}

@ -0,0 +1,134 @@
package com.example.test1.Fragment;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.GridView;
import android.widget.LinearLayout;
import android.widget.SearchView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.example.test1.R;
import com.example.test1.adapter.ProductAdapter;
import com.example.test1.entity.Product;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
public class detailFragment extends Fragment implements View.OnClickListener {
private SearchView searchView;
private LinearLayout orangeLine, youziLine, juziLine, xiguaLine, liLine, appleLine, lemonLine, mangguoLine;
private GridView gridView;
private ProductAdapter productAdapter;
private List<Product> productList;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = LayoutInflater.from(getActivity()).inflate(R.layout.detail, container, false);
//init(view);
return view;
}
/**
*
*/
private void init(View view) {
searchView = view.findViewById(R.id.searchView);
searchView.setOnClickListener(this);
orangeLine = view.findViewById(R.id.chengzi);
orangeLine.setOnClickListener(this);
youziLine = view.findViewById(R.id.youzi);
youziLine.setOnClickListener(this);
juziLine = view.findViewById(R.id.juzi);
juziLine.setOnClickListener(this);
xiguaLine = view.findViewById(R.id.xigua);
xiguaLine.setOnClickListener(this);
liLine = view.findViewById(R.id.li);
liLine.setOnClickListener(this);
lemonLine = view.findViewById(R.id.lemon);
lemonLine.setOnClickListener(this);
mangguoLine = view.findViewById(R.id.mangguo);
mangguoLine.setOnClickListener(this);
appleLine = view.findViewById(R.id.apple);
appleLine.setOnClickListener(this);
gridView = view.findViewById(R.id.index_famous_gridview);
initData();
productAdapter = new ProductAdapter(getActivity(), productList);
gridView.setAdapter(productAdapter);
}
public void onClick(View v) {
}
/**
*
*/
private void initData() {
productList = new ArrayList<>();
Product product = new Product();
product.setImageUrlId(R.drawable.lv1);
product.setProductName("lv");
product.setProductPrice(new BigDecimal("19999"));
Product product1 = new Product();
product1.setImageUrlId(R.drawable.lv2);
product1.setProductName("prada");
product1.setProductPrice(new BigDecimal("29999"));
Product product2 = new Product();
product2.setImageUrlId(R.drawable.miumiu1);
product2.setProductName("miumiu");
product2.setProductPrice(new BigDecimal("19999"));
Product product3 = new Product();
product3.setImageUrlId(R.drawable.prada1);
product3.setProductName("hermes");
product3.setProductPrice(new BigDecimal("29999"));
Product product4 = new Product();
product4.setImageUrlId(R.drawable.prada2);
product4.setProductName("cn");
product4.setProductPrice(new BigDecimal("49999"));
Product product5 = new Product();
product5.setImageUrlId(R.drawable.hermes1);
product5.setProductName("diao");
Product product6 = new Product();
product5.setProductPrice(new BigDecimal("39999"));
product1.setImageUrlId(R.drawable.lv2);
product1.setProductName("prada");
product1.setProductPrice(new BigDecimal("29999"));
Product product7 = new Product();
product2.setImageUrlId(R.drawable.miumiu1);
product2.setProductName("miumiu");
product2.setProductPrice(new BigDecimal("19999"));
Product product8 = new Product();
product3.setImageUrlId(R.drawable.prada1);
product3.setProductName("hermes");
product3.setProductPrice(new BigDecimal("29999"));
Product product9 = new Product();
product4.setImageUrlId(R.drawable.prada2);
product4.setProductName("cn");
product4.setProductPrice(new BigDecimal("49999"));
Product product10 = new Product();
product5.setImageUrlId(R.drawable.hermes1);
product5.setProductName("diao");
product5.setProductPrice(new BigDecimal("39999"));
productList.add(product);
productList.add(product1);
productList.add(product2);
productList.add(product3);
productList.add(product4);
productList.add(product5);
productList.add(product6);
productList.add(product7);
productList.add(product8);
productList.add(product9);
productList.add(product10);
}
}

@ -0,0 +1,59 @@
package com.example.test1.GoodDatabase;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.os.Bundle;
import androidx.annotation.Nullable;
public class Database extends SQLiteOpenHelper {
public Database(@Nullable Context context) {
super(context, "good", null, 4);
}
@Override
public void onCreate(SQLiteDatabase db) {
//创建用户表
String sql = "create table good_user(id integer primary key autoincrement, username varchar(50), password varchar(50),sex varchar(10),city carchar(50),number carchar(50))";
db.execSQL(sql);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
}
//插入数据
public void insertUser(SQLiteDatabase sqLiteDatabase, String username, String password, String sex, String city, String number ) {
ContentValues contentValues = new ContentValues();
contentValues.put("username", username);
contentValues.put("password", password);
contentValues.put("sex", sex);
contentValues.put("city", city);
contentValues.put("number", number);
sqLiteDatabase.insert("good_user", null, contentValues);
sqLiteDatabase.close();
}
//查询数据
public static Bundle queryUserInfo(SQLiteDatabase sqLiteDatabase, Bundle bundle) {
String username = bundle.getString("username");
Cursor cursor = sqLiteDatabase.rawQuery("select * from good_user where username=?", new String[]{username});
if (cursor != null) {
while (cursor.moveToNext()) {
bundle.putString("sex", cursor.getString(3));
bundle.putString("city", cursor.getString(4));
bundle.putString("number", cursor.getString(5));
}
}
cursor.close();
sqLiteDatabase.close();
return bundle;
}
}

@ -0,0 +1,38 @@
package com.example.test1.GoodDatabase;
/*
*
* */
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.nfc.Tag;
import android.util.Log;
import androidx.annotation.Nullable;
public class GoodsListDatabase extends SQLiteOpenHelper {
private static final String TAG=GoodsListDatabase.class.getSimpleName();
//定义创建数据表dict的SQL语句
//创建表时,定义的单个列的约束
public static final String CREATE_GOODS_SQL=
"create table goods(dbId integer ,dbIcon integer," +
"dbTitle text," +
"dbPrice text,UNIQUE(dbId))";
//private Context mContext;
//构造函数
public GoodsListDatabase(@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version) {
super(context, name, factory, version);
}
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL(CREATE_GOODS_SQL);
Log.i(TAG, "onCreate: 商品列表数据库创建成功");
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
db.execSQL("drop table if exists goods");
onCreate(db);
}
}

@ -0,0 +1,32 @@
package com.example.test1.GoodDatabase;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
import androidx.annotation.Nullable;
import java.io.DataOutputStream;
/*
* id
* */
public class ShoppingCarDatabase extends SQLiteOpenHelper {
private static final String TAG=ShoppingCarDatabase.class.getSimpleName();
//定义创建数据表dict的SQL语句
final String CREATE_GOODS_SQL=
"create table shoppingCar(carId Integer primary key autoincrement,dbId Integer,dbNum Integer)";
//构造函数
public ShoppingCarDatabase(@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version) {
super(context, name, factory, version);
}
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL(CREATE_GOODS_SQL);
Log.i(TAG, "onCreate: 购物车数据库创建成功啦!");
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
//更新数据库
db.execSQL("drop table if exists shoppingCar");
onCreate(db);
}
}

@ -0,0 +1,69 @@
package com.example.test1.adapter;
import android.content.Context;
import android.graphics.Color;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.example.test1.R;
import java.util.List;
public class Adapter extends BaseAdapter {
private List<String> productCategory;
private LayoutInflater layoutInflater;
private int selectionPosition = -1;
public Adapter(List<String> productCategory, Context context) {
this.productCategory = productCategory;
this.layoutInflater = LayoutInflater.from(context);
}
@Override
public int getCount() {
return productCategory.size();
}
@Override
public Object getItem(int position) {
return productCategory.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder viewHolder = null;
if (convertView == null) {
viewHolder = new ViewHolder();
convertView = layoutInflater.inflate(R.layout.category_list_item, null);
Log.i("adapts", "getView: " + convertView);
viewHolder.tv = convertView.findViewById(R.id.categor_titles);
convertView.setTag(viewHolder);
} else {
viewHolder = (ViewHolder) convertView.getTag();
}
viewHolder.tv.setText(productCategory.get(position));
if (selectionPosition == position) {
viewHolder.tv.setBackgroundColor(Color.YELLOW);
} else {
viewHolder.tv.setBackgroundColor(Color.WHITE);
}
return convertView;
}
public void setSelectedPosition(int position) {
this.selectionPosition = position;
}
class ViewHolder {
TextView tv;
}
}

@ -0,0 +1,78 @@
package com.example.test1.adapter;
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.example.test1.Activity.IntroductionActivity;
import com.example.test1.R;
import java.util.List;
import java.util.Map;
public class BallAdapter extends BaseAdapter {
private List<Map<String,Object>> list;
private LayoutInflater inflater;//反射器
public BallAdapter(IntroductionActivity context) {
this.inflater = LayoutInflater.from(context);
}
public void setList(List<Map<String, Object>> list) {
this.list = list;
}
@Override
public int getCount() {
return list.size();
}
@Override
public Object getItem(int i) {
return list.get(i);
}
@Override
public long getItemId(int i) {
return i;
}
@Override
public View getView(int i, View view, ViewGroup viewGroup) {
// View view1 = inflater.inflate(R.layout.layout_item,null);
ViewHolder holder = null;
if(view == null){
view = inflater.inflate(R.layout.introduction_item,null);
holder = new ViewHolder();
holder.icon = view.findViewById(R.id.icon);
holder.title = view.findViewById(R.id.title);
holder.content = view.findViewById(R.id.content);
view.setTag(holder);
}else {
holder = (ViewHolder) view.getTag();
}
//获得行布局的各个控件
// ImageView icon = view.findViewById(R.id.icon);
// TextView title = view.findViewById(R.id.title);
// TextView content = view.findViewById(R.id.content);
//给各个控件赋值
holder.icon.setImageResource((Integer) list.get(i).get("icon"));
holder.title.setText((String) list.get(i).get("title"));
holder.content.setText((String) list.get(i).get("content"));
return view;
}
public class ViewHolder{
ImageView icon;
TextView title;
TextView content;
}
}

@ -0,0 +1,78 @@
package com.example.test1.adapter;
import android.content.Context;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.example.test1.R;
import com.example.test1.entity.Condition;
import java.util.List;
public class ListViewAdapter extends BaseAdapter {
private List<Condition> conditionList;
private LayoutInflater layoutInflater;
private int selectedPosition = -1;
private int selectColor = Color.GRAY;
public ListViewAdapter(Context context, List<Condition> conditionList) {
this.conditionList = conditionList;
this.layoutInflater = LayoutInflater.from(context);
}
@Override
public int getCount() {
return conditionList.size();
}
@Override
public Object getItem(int position) {
return conditionList.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder viewHolder;
if (convertView == null) {
convertView = layoutInflater.inflate(R.layout.product_condition_item, null);
viewHolder = new ViewHolder();
viewHolder.imageView = convertView.findViewById(R.id.condition_icon);
viewHolder.jiange = convertView.findViewById(R.id.image_jiange);
viewHolder.textView = convertView.findViewById(R.id.condition_name);
viewHolder.linearLayout = convertView.findViewById(R.id.item_bg);
convertView.setTag(viewHolder);
} else {
viewHolder = (ViewHolder) convertView.getTag();
}
Condition condition = conditionList.get(position);
if (condition != null) {
viewHolder.imageView.setBackgroundResource(condition.getConditionIcon());
viewHolder.textView.setText(condition.getConditionName());
viewHolder.jiange.setBackgroundColor(Color.rgb(207, 207, 207));
if (selectedPosition == position) {
viewHolder.linearLayout.setBackgroundColor(selectColor);
}
}
return convertView;
}
class ViewHolder {
ImageView imageView, jiange;
TextView textView;
LinearLayout linearLayout;
}
}

@ -0,0 +1,78 @@
package com.example.test1.adapter;
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.example.test1.Activity.IntroductionActivity;
import com.example.test1.R;
import java.util.List;
import java.util.Map;
public class MyAdapter extends BaseAdapter {
private List<Map<String,Object>> list;
private LayoutInflater inflater;//反射器
public MyAdapter(IntroductionActivity context) {
this.inflater = LayoutInflater.from(context);
}
public void setList(List<Map<String, Object>> list) {
this.list = list;
}
@Override
public int getCount() {
return list.size();
}
@Override
public Object getItem(int i) {
return list.get(i);
}
@Override
public long getItemId(int i) {
return i;
}
@Override
public View getView(int i, View view, ViewGroup viewGroup) {
// View view1 = inflater.inflate(R.layout.layout_item,null);
ViewHolder holder = null;
if(view == null){
view = inflater.inflate(R.layout.introduction_item,null);
holder = new ViewHolder();
holder.icon = view.findViewById(R.id.icon);
holder.title = view.findViewById(R.id.title);
holder.content = view.findViewById(R.id.content);
view.setTag(holder);
}else {
holder = (ViewHolder) view.getTag();
}
//获得行布局的各个控件
// ImageView icon = view.findViewById(R.id.icon);
// TextView title = view.findViewById(R.id.title);
// TextView content = view.findViewById(R.id.content);
//给各个控件赋值
holder.icon.setImageResource((Integer) list.get(i).get("icon"));
holder.title.setText((String) list.get(i).get("title"));
holder.content.setText((String) list.get(i).get("content"));
return view;
}
public class ViewHolder{
ImageView icon;
TextView title;
TextView content;
}
}

@ -0,0 +1,27 @@
package com.example.test1.adapter;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
public class MyBaseAdapter extends BaseAdapter {
@Override
public int getCount() {
return 0;
}
@Override
public Object getItem(int i) {
return null;
}
@Override
public long getItemId(int i) {
return 0;
}
@Override
public View getView(int i, View view, ViewGroup viewGroup) {
return null;
}
}

@ -0,0 +1,75 @@
package com.example.test1.adapter;
import android.content.Context;
import android.util.Log;
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.example.test1.R;
import com.example.test1.entity.Product;
import java.util.List;
public class ProductAdapter extends BaseAdapter {
private List<Product> productList;
private LayoutInflater layoutInflater;
public ProductAdapter(Context context, List<Product> productList) {
this.productList = productList;
this.layoutInflater = LayoutInflater.from(context);
}
@Override
public int getCount() {
return productList.size();
}
@Override
public Object getItem(int position) {
return productList.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder viewHolder;
if (convertView == null) {
Log.i("aa", "getView: "+"aa");
convertView = layoutInflater.inflate(R.layout.categoty_detail_content, null);
viewHolder = new ViewHolder();
viewHolder.productImage = convertView.findViewById(R.id.category_product_image);
viewHolder.productName = convertView.findViewById(R.id.category_product_name);
viewHolder.productPrice = convertView.findViewById(R.id.category_product_price);
convertView.setTag(viewHolder);
} else {
viewHolder = (ViewHolder) convertView.getTag();
}
Product product = productList.get(position);
Log.i("product", "getView: "+product.toString());
if(product.getImageUrlId() == 0 )
{
product.setImageUrlId(null);
}
if (product != null) {
viewHolder.productImage.setBackgroundResource(product.getImageUrlId());
viewHolder.productName.setText(product.getProductName());
viewHolder.productPrice.setText(String.valueOf(product.getProductPrice()));
}
return convertView;
}
class ViewHolder {
ImageView productImage;
TextView productName, productPrice;
}
}

@ -0,0 +1,62 @@
package com.example.test1.adapter;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.example.test1.R;
import com.example.test1.entity.BrandBean;
import java.util.List;
public class RightAdapter extends BaseAdapter {
private Context mContext;
private List<BrandBean>list;
public RightAdapter(Context context , List<BrandBean>list){
this.mContext=context;
this.list=list;
}
@Override
public int getCount() {
return list.size();
}
@Override
public Object getItem(int position) {
return list.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder=null;
if(convertView==null){
convertView=View.inflate(mContext, R.layout.sale_item,null);
holder= new ViewHolder();
holder.tv_name=convertView.findViewById(R.id.tv_name);
holder.tv_sale=convertView.findViewById(R.id.tv_sale);
holder.tv_price=convertView.findViewById(R.id.tv_price);
holder.iv_img=convertView.findViewById(R.id.iv_img);
convertView.setTag(holder);
}else {
holder=(ViewHolder) convertView.getTag();
}
BrandBean bean=list.get(position);
holder.tv_name.setText(bean.getName());
holder.tv_sale.setText(bean.getSales());
holder.tv_price.setText(bean.getPrice());
holder.iv_img.setBackgroundResource(bean.getImg());
return convertView;
}
class ViewHolder{
TextView tv_name,tv_sale,tv_price;
ImageView iv_img;
}
}

@ -0,0 +1,86 @@
package com.example.test1.adapter;
import java.util.List;
import android.content.Context;
import android.content.Intent;
import android.content.DialogInterface.OnClickListener;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.example.test1.R;
import com.example.test1.entity.shoppingCart;
public class ShoppingCartAdapter extends BaseAdapter {
private Context mContext;
private List<shoppingCart> mList;
public ShoppingCartAdapter(Context mContext,List<shoppingCart> mList) {
super();
this.mContext = mContext;
this.mList = mList;
}
@Override
public int getCount() {
// TODO Auto-generated method stub
if (mList==null) {
return 0;
}else {
return this.mList.size();
}
}
@Override
public Object getItem(int position) {
// TODO Auto-generated method stub
if (mList == null) {
return null;
} else {
return this.mList.get(position);
}
}
@Override
public long getItemId(int position) {
// TODO Auto-generated method stub
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
ViewHolder holder = null;
if (convertView == null) {
holder = new ViewHolder();
convertView = LayoutInflater.from(this.mContext).inflate(R.layout.activity_shoppingcart_item, null,true);
holder.image=(ImageView) convertView.findViewById(R.id.pro_image);
holder.chose=(CheckBox) convertView.findViewById(R.id.pro_checkbox);
holder.proName=(TextView) convertView.findViewById(R.id.pro_name);
holder.proPrice=(TextView)convertView.findViewById(R.id.pro_shopPrice);
holder.proCount=(TextView) convertView.findViewById(R.id.pro_count);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
if (this.mList != null) {
shoppingCart shoppingList=this.mList.get(position);
holder.proName.setText(shoppingList.getProName().toString());
holder.proPrice.setText(shoppingList.getShopPrice().toString());
holder.proCount.setText(shoppingList.getProCount().toString());
}
return convertView;
}
/*定义item对象*/
public class ViewHolder {
ImageView image;
TextView proName;
CheckBox chose;
TextView proPrice;
TextView proCount;
}
}

@ -0,0 +1,92 @@
package com.example.test1.entity;
import java.io.Serializable;
import java.sql.Timestamp;
public class BrandBean implements Serializable {
private static final long serialVersionUID=2L;
private String sales;
private int img;
private Integer imageUrlId;
private static Integer id;
private String name;
private static String price;
private static String imgUrl;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSales() {
return sales;
}
public void setSales(String sales) {
this.sales = sales;
}
public static String getPrice() {
return price;
}
public void setPrice(String price) {
this.price = price;
}
public int getImg() {
return img;
}
public void setImg(int img) {
this.img = img;
}
public Integer getImageId() {
return imageUrlId;
}
public void setImageId(Integer imageUrlId) {
this.imageUrlId = imageUrlId;
}
@Override
public String toString() {
return "Product{" +
"imageUrlId=" + imageUrlId +
", productName='" + name + '\'' +
", productPrice=" + price +
'}';
}
public static Timestamp getAddTime() {
return addTime;
}
public void setAddTime(Timestamp addTime) {
this.addTime = addTime;
}
private static Timestamp addTime;
public static Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public static String getImgUrl() {
return imgUrl;
}
public void setImgUrl(String imgUrl) {
this.imgUrl = imgUrl;
}
}

@ -0,0 +1,118 @@
package com.example.test1.entity;
import static android.service.controls.ControlsProviderService.TAG;
import android.annotation.SuppressLint;
import android.content.ContentValues;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;
import com.example.test1.GoodDatabase.ShoppingCarDatabase;
/*
*
* carId Id
* 1.1
*/
public class Car {
private int carId;
private int goodsId;
private int goodsNum;
public Car() {//无参构造函数
}
public Car(int carId, int goodsId, int goodsNum) {//有参构造函数
this.carId = carId;
this.goodsId = goodsId;
this.goodsNum = goodsNum;
}
public int getCarId() {
return carId;
}
public int getGoodsId() {
return goodsId;
}
public int getGoodsNum() {
return goodsNum;
}
//加入购物车
public void addCar(int goodsId) {
//创建数据库
ShoppingCarDatabase shoppingCarDatabase = new ShoppingCarDatabase(MyApplication.getContext(), "shoppingCar.db", null, 3);
SQLiteDatabase db = shoppingCarDatabase.getReadableDatabase();
//查询数据库是否已存在该商品
Cursor cursor = db.rawQuery("select * from shoppingCar where dbId=? ", new String[]{String.valueOf(goodsId)});
while (cursor.moveToNext()) {
Log.i(TAG, "isDbIdExist1: 数据已存在");
//已存在更改数量加1调用下面的addOne方法
addOne(goodsId);
db.close();
return;
}
//不存在执行插入将该goodsId插入数据库数量是1
Log.i(TAG, "isDbIdExist1: 数据不存在");
String sql = "insert into shoppingCar(dbId,dbNum)values('" + goodsId + "',1 )";
db.execSQL(sql);
db.close();
Log.i(TAG, "addCar: 加入新商品成功!!!");
}
//获得购物车中该商品数量 查询操作
@SuppressLint("Range")
public int getGoodsCarNum(int goodsId) {
ShoppingCarDatabase shoppingCarDatabase = new ShoppingCarDatabase(MyApplication.getContext(), "shoppingCar.db", null, 3);
SQLiteDatabase db = shoppingCarDatabase.getReadableDatabase();
//初始化数量为1
int goodsCarNum = 1;
Cursor cursor = db.rawQuery("select * from shoppingCar where dbId = ?", new String[]{String.valueOf(goodsId)});
if (cursor.moveToFirst()) {
do {
//遍历cursor对象取出数据
goodsCarNum = cursor.getInt(cursor.getColumnIndex("dbNum"));
Log.i(TAG, "dbNum" + goodsCarNum);
} while (cursor.moveToNext());
cursor.close();
Log.i(TAG, "readShoppingCarDatabase: 读取购物车数据库ID成功拉");
}
return goodsCarNum;
}
//商品数量加一 增
public int addOne(int goodsId) {
ShoppingCarDatabase shoppingCarDatabase = new ShoppingCarDatabase(MyApplication.getContext(), "shoppingCar.db", null, 3);
SQLiteDatabase db = shoppingCarDatabase.getReadableDatabase();
ContentValues values = new ContentValues();
goodsNum = getGoodsCarNum(goodsId) + 1;
values.put("dbNum", goodsNum);
db.update("shoppingCar", values, "dbId=?", new String[]{String.valueOf(goodsId)});
Log.i(TAG, goodsId + "addCar: 数量加1" + goodsNum);
db.close();
return goodsNum;
}
//商品数量减一 减
public int reduceOne(int goodsId) {
ShoppingCarDatabase shoppingCarDatabase = new ShoppingCarDatabase(MyApplication.getContext(), "shoppingCar.db", null, 3);
SQLiteDatabase db = shoppingCarDatabase.getReadableDatabase();
ContentValues values = new ContentValues();
goodsNum = getGoodsCarNum(goodsId) - 1;
values.put("dbNum", goodsNum);
db.update("shoppingCar", values, "dbId=?", new String[]{String.valueOf(goodsId)});
Log.i(TAG, goodsId + "addCar: 数量-1" + goodsNum);
db.close();
return goodsNum;
}
//删除商品
public void deleteCar(int goodsId) {
ShoppingCarDatabase shoppingCarDatabase = new ShoppingCarDatabase(MyApplication.getContext(), "shoppingCar.db", null, 3);
SQLiteDatabase db = shoppingCarDatabase.getReadableDatabase();
db.delete("shoppingCar", "dbId=?", new String[]{String.valueOf(goodsId)});
}
}

@ -0,0 +1,30 @@
package com.example.test1.entity;
public class Condition {
private Integer conditionIcon;
private String conditionName;
public Integer getConditionIcon() {
return conditionIcon;
}
public void setConditionIcon(Integer conditionIcon) {
this.conditionIcon = conditionIcon;
}
public String getConditionName() {
return conditionName;
}
public void setConditionName(String conditionName) {
this.conditionName = conditionName;
}
@Override
public String toString() {
return "Condition{" +
"conditionIcon=" + conditionIcon +
", conditionName='" + conditionName + '\'' +
'}';
}
}

@ -0,0 +1,84 @@
package com.example.test1.entity;
import android.annotation.SuppressLint;
import android.content.ContentValues;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;
import com.example.test1.GoodDatabase.GoodsListDatabase;
/*
* Id Icon
*
*
* */
public class Goods {
private int goodsId;
private int goodsIcon;
private String goodsTitle;
private String goodsPrice;
private static final String TAG = GoodsListDatabase.class.getSimpleName();
public Goods() {
}
public Goods(int goodsId, int goodsIcon, String goodsTitle, String goodsPrice) {
this.goodsId = goodsId;
this.goodsIcon = goodsIcon;
this.goodsTitle = goodsTitle;
this.goodsPrice = goodsPrice;
}
public int getGoodsId() {
return goodsId;
}
public int getGoodsIcon() {
return goodsIcon;
}
public String getGoodsTitle() {
return goodsTitle;
}
public String getGoodsPrice() {
return goodsPrice;
}
//插入商品 增
public void addGoods(int id, int icon, String title, String price) {
GoodsListDatabase goodsListDatabase = new GoodsListDatabase(MyApplication.getContext(), "goods.db", null, 2);
SQLiteDatabase db = goodsListDatabase.getReadableDatabase();
ContentValues values = new ContentValues();
values.put("dbId", id);
values.put("dbIcon", icon);
values.put("dbTitle", title);
values.put("dbPrice", price);
//数据库构建中UNIQUE(dbId)与insert ignore into配合解决重复插入数据库的问题
String sql = "insert or ignore into goods(dbId,dbIcon,dbTitle,dbPrice)values('" + id + "','" + icon + "','" + title + "','" + price + "')";
db.execSQL(sql);
Log.i(TAG, "addGoods: 商品插入商品列表数据库成功拉!");
}
@SuppressLint("Range")
//查找商品 查
public Goods findGoods(int goodId) {
GoodsListDatabase goodsListDatabase = new GoodsListDatabase(MyApplication.getContext(), "goods.db", null, 2);
SQLiteDatabase db = goodsListDatabase.getWritableDatabase();
String idNew = String.valueOf(goodId);
int id = 0;
int icon = 0;
String title = "";
String price = "";
Cursor cursor = db.query("goods", null, "dbId= ?", new String[]{idNew}, null, null, null);
if (cursor.moveToFirst()) {
do {
id = cursor.getInt(cursor.getColumnIndex("dbId"));
icon = cursor.getInt(cursor.getColumnIndex("dbIcon"));
title = cursor.getString(cursor.getColumnIndex("dbTitle"));
price = cursor.getString(cursor.getColumnIndex("dbPrice"));
} while (cursor.moveToNext());
}
Goods goods1 = new Goods(id, icon, title, price);
Log.i(TAG, "findGoods: goods1" + goods1);
Log.i(TAG, "findGoods: 读取购物车商品成功拉");
cursor.close();
return goods1;
}
}

@ -0,0 +1,52 @@
package com.example.test1.entity;
import java.sql.Timestamp;
public class Message {
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Timestamp getSendTime() {
return sendTime;
}
public void setSendTime(Timestamp sendTime) {
this.sendTime = sendTime;
}
public String getUsed() {
return used;
}
public void setUsed(String used) {
this.used = used;
}
private Integer id;
private String content;
private Timestamp sendTime;
private String used;
@Override
public String toString() {
return "OrangeMessage{" +
"id=" + id +
", content='" + content + '\'' +
", sendTime=" + sendTime +
", used='" + used + '\'' +
'}';
}
}

@ -0,0 +1,18 @@
package com.example.test1.entity;
import android.app.Application;
import android.content.Context;
public class MyApplication extends Application {
private static Context context;
@Override
public void onCreate() {
super.onCreate();
context = getApplicationContext();
}
public static Context getContext(){
return context;
}
}

@ -0,0 +1,44 @@
package com.example.test1.entity;
import java.math.BigDecimal;
public class Product {
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public BigDecimal getProductPrice() {
return productPrice;
}
public void setProductPrice(BigDecimal productPrice) {
this.productPrice = productPrice;
}
public Integer getImageUrlId() {
return imageUrlId;
}
public void setImageUrlId(Integer imageUrlId) {
this.imageUrlId = imageUrlId;
}
private Integer imageUrlId;
private String productName;
private BigDecimal productPrice;
@Override
public String toString() {
return "Product{" +
"imageUrlId=" + imageUrlId +
", productName='" + productName + '\'' +
", productPrice=" + productPrice +
'}';
}
}

@ -0,0 +1,65 @@
package com.example.test1.entity;
import android.graphics.Bitmap;
import java.sql.Timestamp;
public class ProductPack {
private Integer id;
private String name;
private Timestamp addTime;
private Bitmap imgBitmap;
public String getPrice() {
return price;
}
public void setPrice(String price) {
this.price = price;
}
private String price;
@Override
public String toString() {
return "OrangeProductPack{" +
"id=" + id +
", name='" + name + '\'' +
", addTime=" + addTime +
", imgBitmap=" + imgBitmap +
", price=" + price +
'}';
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Timestamp getAddTime() {
return addTime;
}
public void setAddTime(Timestamp addTime) {
this.addTime = addTime;
}
public Bitmap getImgBitmap() {
return imgBitmap;
}
public void setImgBitmap(Bitmap imgBitmap) {
this.imgBitmap = imgBitmap;
}
}

@ -0,0 +1,52 @@
package com.example.test1.entity;
/***
*
*
* 2015810 09:41:18
*/
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import android.R.string;
import android.app.Fragment;
public class shoppingCart extends Fragment implements Serializable {
private String proImg;
private String ProName;
private String shopPrice;
private String markPrice;
private String proCount;
public String getProImg() {
return proImg;
}
public void setProImg(String proImg) {
this.proImg = proImg;
}
public String getProName() {
return ProName;
}
public void setProName(String proName) {
ProName = proName;
}
public String getShopPrice() {
return shopPrice;
}
public void setShopPrice(String shopPrice) {
this.shopPrice = shopPrice;
}
public String getMarkPrice() {
return markPrice;
}
public void setMarkPrice(String markPrice) {
this.markPrice = markPrice;
}
public String getProCount() {
return proCount;
}
public void setProCount(String proCount) {
this.proCount = proCount;
}
}

@ -0,0 +1,59 @@
package com.example.test1.entity;
public class user {
private Integer id;
private String username;
private String password;
private String sex;
private String city;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
@Override
public String toString() {
return "OrangeUser{" +
"username='" + username + '\'' +
", password='" + password + '\'' +
", sex='" + sex + '\'' +
", city='" + city + '\'' +
'}';
}
}

@ -0,0 +1,82 @@
package com.example.test1.netrequest;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.example.test1.entity.BrandBean;
import com.example.test1.entity.Product;
import com.example.test1.entity.ProductPack;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
public class OkHttpClientProduct {
/**
*
*
* @return
*/
public List<Product> getProduct() throws IOException {
OkHttpClient okHttpClient = new OkHttpClient();
Request request = new Request.Builder()
.url("http://172.16.40.55:8081/orange/product/search")
.build();
Response response = okHttpClient.newCall(request).execute();
JSONObject jsonObject = JSON.parseObject(Objects.requireNonNull(response.body()).string());
List<Product> list = JSON.parseObject(jsonObject.getString("data"), new TypeReference<List<Product>>() {
});
return list;
}
/**
*
*
* @param imgUrl
* @return
* @throws IOException
*/
public Bitmap getImageBitMap(String imgUrl) throws IOException {
Bitmap bitmap;
OkHttpClient okHttpClient = new OkHttpClient();
Request request = new Request.Builder()
.url(imgUrl)
.build();
Response response = okHttpClient.newCall(request).execute();
byte[] bytes = Objects.requireNonNull(response.body()).bytes();
bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.length);
return bitmap;
}
/**
*
*
* @return
* @throws IOException
*/
public List<ProductPack> getProductPack() throws IOException {
List<ProductPack> packList = new ArrayList<>();
List<Product> list = getProduct();
for (Product Product : list) {
ProductPack ProductPack = new ProductPack();
ProductPack.setId(BrandBean.getId());
ProductPack.setImgBitmap(getImageBitMap(BrandBean.getImgUrl()));
ProductPack.setAddTime(BrandBean.getAddTime());
ProductPack.setPrice(BrandBean.getPrice());
packList.add(ProductPack);
}
return packList;
}
}

@ -0,0 +1,40 @@
package com.example.test1.netrequest;
import android.os.Message;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import java.io.IOException;
import java.util.Objects;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
public class OkHttpMessage {
/**
*
*
* @return
*/
public Message consumeMessage() throws IOException {
OkHttpClient okHttpClient = new OkHttpClient();
Request request = new Request.Builder()
.url("http://172.16.40.55:8081/orange/message/consumeMessage")
.build();
Response response = okHttpClient.newCall(request).execute();
JSONObject jsonObject = JSON.parseObject(Objects.requireNonNull(response.body()).string());
Message Message = JSON.toJavaObject(jsonObject.getJSONObject("data"), Message.class);
/**
*
*/
Request request1 = new Request.Builder()
.url("http://172.16.40.55:8081/orange/message/updateMessage")
.build();
okHttpClient.newCall(request1).execute();
return Message;
}
}

@ -0,0 +1,67 @@
package com.example.test1.netrequest;
import android.util.Log;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.example.test1.entity.user;
import java.io.IOException;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
public class OkHttpUser {
/**
*
*
* @param user
*/
public user userLogin(user user) throws IOException {
OkHttpClient okHttpClient = new OkHttpClient();
//数据类型为json格式
MediaType mediaType = MediaType.parse("application/json; charset=utf-8");
//将对象转为JSON字符串
String jsonStr = JSONObject.toJSONString(user);
RequestBody requestBody = RequestBody.create(mediaType, jsonStr);
Request request = new Request.Builder()
.url("http://172.16.40.55:8081/orange/user/login")
.post(requestBody)
.build();
Response response = okHttpClient.newCall(request).execute();
JSONObject jsonObject = JSON.parseObject(response.body().string());
JSONObject jsonObject1 = jsonObject.getJSONObject("data");
user user1 = JSON.toJavaObject(jsonObject1, user.class);
return user1;
}
/**
*
*
* @param orangeUser
* @return
* @throws IOException
*/
public boolean userRegister(user orangeUser) throws IOException {
OkHttpClient okHttpClient = new OkHttpClient();
//数据类型为json格式
MediaType mediaType = MediaType.parse("application/json; charset=utf-8");
//将对象转为JSON字符串
String jsonStr = JSONObject.toJSONString(orangeUser);
RequestBody requestBody = RequestBody.create(mediaType, jsonStr);
Request request = new Request.Builder()
.url("http://172.16.40.55:8081/orange/user/register")
.post(requestBody)
.build();
Response response = okHttpClient.newCall(request).execute();
JSONObject jsonObject = JSON.parseObject(response.body().string());
Log.i("register", "userRegister: "+jsonObject);
return jsonObject.getBoolean("flag");
}
}

@ -0,0 +1,92 @@
package com.example.test1.service;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.IBinder;
import androidx.annotation.Nullable;
import androidx.core.app.NotificationCompat;
import com.example.test1.R;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;
public class TimeService extends Service {
public TimeService() {
}
private static Timer timer = null;
private NotificationManager manager;
private NotificationCompat.Builder builder;
@Nullable
@Override
public IBinder onBind(Intent intent) {
// TODO: Return the communication channel to the service.
throw new UnsupportedOperationException("Not yet implemented");
}
/**
*
*/
private void cleanAllNotification() {
manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
manager.cancelAll();
if (timer != null) {
timer.cancel();
timer = null;
}
}
/**
*
*/
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
long period = 60 * 1000; //1分钟一个周期
if (timer == null) {
timer = new Timer();
}
timer.schedule(new TimerTask() {
@Override
public void run() {
/**
* NotificationChannelandroid8.0ApptargetSDKVersion>=26
* channel
* Failed to post notification on channel null
*/
NotificationChannel channel = null;
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
channel = new NotificationChannel("channel", "通知", NotificationManager.IMPORTANCE_DEFAULT);
}
manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
manager.createNotificationChannel(channel);
}
builder = new NotificationCompat.Builder(com.example.test1.service.TimeService.this);
builder.setContentTitle("提醒系统当前时间");
builder.setSmallIcon(R.drawable.lv1);
builder.setChannelId("channel");
Date date = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
builder.setContentText("系统当前时间为:" + formatter.format(date));
builder.setAutoCancel(true);
builder.setDefaults(Notification.DEFAULT_ALL);
Notification notification = builder.build();
manager.notify(1, notification);
}
}, 0, period);
return super.onStartCommand(intent, flags, startId);
}
}

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1023 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 356 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/color_focused" android:state_checked="true" />
<item android:color="@color/color_un_focused" android:state_checked="false" />
</selector>

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="false">
<shape>
<solid android:color="@color/pink" />
<corners android:radius="5dp" />
</shape>
</item>
<item android:state_pressed="true">
<shape>
<solid android:color="@color/blue" />
<corners android:radius="5dp" />
</shape>
</item>
</selector>

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="false">
<shape>
<solid android:color="@color/pink" />
<corners android:radius="5dp" />
</shape>
</item>
<item android:state_pressed="true">
<shape>
<solid android:color="@color/blue" />
<corners android:radius="5dp" />
</shape>
</item>
</selector>

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="false">
<shape>
<solid android:color="@color/pink" />
<corners android:radius="5dp" />
</shape>
</item>
<item android:state_pressed="true">
<shape>
<solid android:color="@color/blue" />
<corners android:radius="5dp" />
</shape>
</item>
</selector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

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

Loading…
Cancel
Save