@ -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 @@
|
||||
Test
|
@ -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 @@
|
||||
<root></root>
|
@ -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,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,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,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,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,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,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,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,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,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,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>
|
After Width: | Height: | Size: 1023 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 356 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 116 KiB |
After Width: | Height: | Size: 110 KiB |
After Width: | Height: | Size: 160 KiB |
After Width: | Height: | Size: 108 KiB |
After Width: | Height: | Size: 129 KiB |
After Width: | Height: | Size: 98 KiB |
After Width: | Height: | Size: 125 KiB |
After Width: | Height: | Size: 112 KiB |
After Width: | Height: | Size: 66 KiB |
After Width: | Height: | Size: 111 KiB |
After Width: | Height: | Size: 67 KiB |
After Width: | Height: | Size: 227 KiB |
After Width: | Height: | Size: 221 KiB |
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>
|
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 5.8 KiB |
After Width: | Height: | Size: 8.3 KiB |
After Width: | Height: | Size: 1.0 MiB |
After Width: | Height: | Size: 135 KiB |