新增发送http请求相关内容

master
FinalJcsp 2 years ago
parent be7a4d2eea
commit c669691056

@ -0,0 +1,533 @@
<?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="false" />
<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="c9199ceb-a7c9-4c27-b4b1-b791257d30be">
<console name="Connection" type="STANDARD" schema="" session="Main" />
</connection>
</component>
<component name="DBNavigator.Project.DatabaseEditorStateManager">
<last-used-providers />
</component>
<component name="DBNavigator.Project.DatabaseFileManager">
<open-files>
<object connection-id="c9199ceb-a7c9-4c27-b4b1-b791257d30be" object-ref="schemas/main/tables/person" />
</open-files>
</component>
<component name="DBNavigator.Project.DatasetFilterManager">
<filter-actions connection-id="c9199ceb-a7c9-4c27-b4b1-b791257d30be" dataset="main.person" active-filter-id="EMPTY_FILTER" />
</component>
<component name="DBNavigator.Project.ExecutionManager">
<retain-sticky-names value="false" />
</component>
<component name="DBNavigator.Project.MethodExecutionManager">
<method-browser />
<execution-history>
<group-entries value="true" />
<execution-inputs />
</execution-history>
<argument-values-cache />
</component>
<component name="DBNavigator.Project.ObjectQuickFilterManager">
<last-used-operator value="EQUAL" />
<filters />
</component>
<component name="DBNavigator.Project.Settings">
<connections>
<connection id="c9199ceb-a7c9-4c27-b4b1-b791257d30be" 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="D:\person" 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>

@ -12,6 +12,6 @@
</deviceKey>
</Target>
</runningDeviceTargetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2023-04-01T11:11:38.454193600Z" />
<timeTargetWasSelectedWithDropDown value="2023-05-03T08:41:49.808142700Z" />
</component>
</project>

@ -40,4 +40,6 @@ dependencies {
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation "com.squareup.okhttp3:okhttp:4.2.2"
implementation group: 'com.alibaba', name: 'fastjson', version: '1.2.12'
}

@ -8,14 +8,15 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.MyApplication">
android:theme="@style/Theme.MyApplication"
android:usesCleartextTraffic="true">
<activity
android:name=".MainActivity2"
android:exported="false"
android:label="@string/title_activity_main2"
android:theme="@style/Theme.MyApplication.NoActionBar" />
<activity
android:name=".MainActivity"
android:name=".originMainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@ -32,6 +33,15 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".activity.home.IndexActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".GoodsActivity"
android:exported="true">
@ -50,6 +60,15 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<activity
android:name=".activity.home.CategoryActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.INTERNET" />
</manifest>

@ -0,0 +1,12 @@
// IMyAidlInterface.aidl
package com.example.myapplication.service;
// Declare any non-default types here with import statements
interface IMyAidlInterface {
/**
* Demonstrates some basic types that you can use as parameters
* and return values in AIDL.
*/
void send();
}

@ -0,0 +1,105 @@
package com.example.myapplication.service;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.IBinder;
import android.util.Log;
import androidx.annotation.Nullable;
import androidx.core.app.NotificationCompat;
import com.example.myapplication.R;
import com.example.myapplication.entity.OrangeMessage;
import com.example.myapplication.netrequest.OkHttpMessage;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Objects;
import java.util.Timer;
import java.util.TimerTask;
public class TimeService extends Service {
private static Timer timer = null;
private NotificationManager manager;
private NotificationCompat.Builder builder;
@Nullable
@Override
public IBinder onBind(Intent intent) {
return null;
}
/**
*
*/
private void cleanAllNotification() {
manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
manager.cancelAll();
if (timer != null) {
timer.cancel();
timer = null;
}
}
/**
*
*/
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
long period = 60 * 1000; //1分钟一个周期
if (timer == null) {
timer = new Timer();
}
timer.schedule(new TimerTask() {
@Override
public void run() {
new ConsumeMessageTask().execute();
}
}, 0, period);
return super.onStartCommand(intent, flags, startId);
}
class ConsumeMessageTask extends AsyncTask<Void, Void, Void> {
@Override
protected Void doInBackground(Void... voids) {
/**
* NotificationChannelandroid8.0ApptargetSDKVersion>=26
* channel
* Failed to post notification on channel null
*/
OkHttpMessage okHttpMessage = new OkHttpMessage();
OrangeMessage orangeMessage;
try {
orangeMessage = okHttpMessage.consumeMessage();
if (!Objects.isNull(orangeMessage)) {
Log.i("orangeMessage", "run: " + orangeMessage.toString());
NotificationChannel channel = new NotificationChannel("channel", "通知", NotificationManager.IMPORTANCE_DEFAULT);
manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
manager.createNotificationChannel(channel);
builder = new NotificationCompat.Builder(TimeService.this);
Date date = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
builder.setContentTitle("来自橙一色的系统通知消息" + " " + formatter.format(date));
builder.setSmallIcon(R.drawable.home_chengzi);
builder.setChannelId("channel");
builder.setContentText(orangeMessage.getContent());
builder.setAutoCancel(true);
builder.setDefaults(Notification.DEFAULT_ALL);
Notification notification = builder.build();
manager.notify(1, notification);
}
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
}
}

@ -1,18 +1,12 @@
package com.example.myapplication;
import android.app.Activity;
import android.app.Notification;
import android.content.ComponentName;
import android.content.Intent;
import android.icu.text.IDNA;
import android.os.Bundle;
import android.text.Editable;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import org.w3c.dom.Text;
public class InfoActivity extends Activity {
private EditText usernameET;
@ -27,7 +21,7 @@ public class InfoActivity extends Activity {
nickName.setText(getIntent().getCharSequenceExtra("username"));
back.setOnClickListener(v -> {
Intent intent = new Intent();
ComponentName componentName = new ComponentName(InfoActivity.this, MainActivity.class);
ComponentName componentName = new ComponentName(InfoActivity.this, originMainActivity.class);
intent.setComponent(componentName);
startActivity(intent);
});

@ -2,14 +2,9 @@ package com.example.myapplication;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.DatePickerDialog;
import android.content.ComponentName;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
@ -18,15 +13,6 @@ import android.widget.RatingBar;
import android.widget.Spinner;
import android.widget.Toast;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
public class MainActivity2 extends Activity {
@ -74,7 +60,7 @@ public class MainActivity2 extends Activity {
builder.setMessage("确认注册?");
builder.setPositiveButton("是", (dialog, which) -> {
Intent intent = new Intent(MainActivity2.this, MainActivity.class);
Intent intent = new Intent(MainActivity2.this, originMainActivity.class);
intent.putExtra("username", edtNewUserName.getText().toString());
intent.putExtra("password", edtPwd1.getText().toString());
this.register();
@ -100,7 +86,7 @@ public class MainActivity2 extends Activity {
back.setOnClickListener(v -> {
Intent intent = new Intent();
ComponentName componentName = new ComponentName(MainActivity2.this, MainActivity.class);
ComponentName componentName = new ComponentName(MainActivity2.this, originMainActivity.class);
intent.setComponent(componentName);
startActivity(intent);
});

@ -0,0 +1,90 @@
package com.example.myapplication.activity.home;
import android.app.Activity;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.os.Bundle;
import android.widget.ListView;
import androidx.annotation.Nullable;
import com.example.myapplication.R;
import com.example.myapplication.adapter.Adapter;
import com.example.myapplication.entity.Product;
import com.example.myapplication.fragment.SetDetailFragment;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
public class CategoryActivity extends Activity {
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.home_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;
}
public interface OnChangeListener {
void changeText(Product product);
}
/**
*
*/
private void initData() {
productList = new ArrayList<>();
productCategory.add("橘子");
productCategory.add("橙子");
productCategory.add("柚子");
Product product = new Product();
product.setImageUrlId(R.drawable.home_arrow_down);
product.setProductName("橘子");
product.setProductPrice(new BigDecimal("9.9"));
Product product1 = new Product();
product1.setImageUrlId(R.drawable.home_orange);
product1.setProductName("橙子");
product1.setProductPrice(new BigDecimal("29.9"));
Product product2 = new Product();
product2.setImageUrlId(R.drawable.home_arrow_left);
product2.setProductName("柚子");
product2.setProductPrice(new BigDecimal("19.9"));
productList.add(product);
productList.add(product1);
productList.add(product2);
}
/**
*
*/
private void init() {
titleList = findViewById(R.id.category_title_list);
adapter = new Adapter(productCategory, CategoryActivity.this);
titleList.setAdapter(adapter);
}
}

@ -0,0 +1,127 @@
package com.example.myapplication.activity.home;
import android.app.Activity;
import android.app.FragmentTransaction;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import androidx.annotation.Nullable;
import com.example.myapplication.R;
import com.example.myapplication.fragment.IndexFragment;
import com.example.myapplication.fragment.PearsonFragment;
import com.example.myapplication.fragment.ProductFragment;
import com.example.myapplication.fragment.ShoppingCartFragment;
public class IndexActivity extends Activity implements View.OnClickListener {
private IndexFragment indexFragment;
private ProductFragment productFragment;
private ShoppingCartFragment shoppingCartFragment;
private PearsonFragment pearsonFragment;
private LinearLayout indexLine, productLine, shoppingCartLine, pearsonLine;
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.home_activity_main);
init();
initIndexFragment();
Thread thread = new Thread(runnable);
thread.start();
}
/**
*
*/
private void init() {
indexLine = findViewById(R.id.content_index);
indexLine.setOnClickListener(this);
productLine = findViewById(R.id.content_product);
productLine.setOnClickListener(this);
shoppingCartLine = findViewById(R.id.content_cart);
shoppingCartLine.setOnClickListener(this);
pearsonLine = findViewById(R.id.content_pearson);
pearsonLine.setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.content_index:
initIndexFragment();
break;
case R.id.content_product:
initproductFragment();
break;
case R.id.content_cart:
initshoppingCartFragment();
break;
case R.id.content_pearson:
initpearsonFragment();
break;
}
}
/**
* Fragment
*/
private void initIndexFragment() {
//开启事务fragment的控制是由事务来实现的
FragmentTransaction transaction = getFragmentManager().beginTransaction();
if (indexFragment == null) {
indexFragment = new IndexFragment();
}
transaction.replace(R.id.main_content0, indexFragment);
transaction.commit();
}
/**
* Fragment
*/
private void initproductFragment() {
//开启事务fragment的控制是由事务来实现的
FragmentTransaction transaction = getFragmentManager().beginTransaction();
if (productFragment == null) {
productFragment = new ProductFragment();
}
transaction.replace(R.id.main_content0, productFragment);
transaction.commit();
}
/**
* Fragment
*/
private void initshoppingCartFragment() {
//开启事务fragment的控制是由事务来实现的
FragmentTransaction transaction = getFragmentManager().beginTransaction();
if (shoppingCartFragment == null) {
shoppingCartFragment = new ShoppingCartFragment();
}
transaction.replace(R.id.main_content0, shoppingCartFragment);
transaction.commit();
}
/**
* Fragment
*/
private void initpearsonFragment() {
//开启事务fragment的控制是由事务来实现的
FragmentTransaction transaction = getFragmentManager().beginTransaction();
if (pearsonFragment == null) {
Intent intent = IndexActivity.this.getIntent();
Bundle bundle = intent.getExtras();
pearsonFragment = new PearsonFragment();
pearsonFragment.setArguments(bundle);
}
transaction.replace(R.id.main_content0, pearsonFragment);
transaction.commit();
}
Runnable runnable = () -> {
// Intent intent = new Intent(IndexActivity.this, TimeService.class);
// startService(intent);
};
}

@ -0,0 +1,175 @@
package com.example.myapplication.activity.home;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Looper;
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.myapplication.R;
import com.example.myapplication.entity.OrangeUser;
import com.example.myapplication.netrequest.OkHttpUser;
import java.io.IOException;
public class RegisterActivity extends AppCompatActivity implements View.OnClickListener, RadioGroup.OnCheckedChangeListener {
private EditText usernameEdit, passwordEdit, surePasswordEdit;
private TextView cityText;
// 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.home_user_register);
init();
}
/**
*
*/
private void init() {
cityText = findViewById(R.id.reg_province);
cityText.setOnClickListener(this);
usernameEdit = findViewById(R.id.reg_username);
passwordEdit = findViewById(R.id.reg_password);
surePasswordEdit = findViewById(R.id.reg_sure_password);
regButton = findViewById(R.id.reg_register);
regButton.setOnClickListener(this);
sexGroup = findViewById(R.id.sex);
sexGroup.setOnCheckedChangeListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.reg_province:
initCityPicker();
// cityPicker.show();
break;
case R.id.reg_register:
//注册验证方法
//validateRegister();
Thread thread = new Thread(runnable);
thread.start();
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() {
// }
// });
}
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
//根据用户选择来改变sex的值
sexStr = checkedId == R.id.reg_man ? "男" : "女";
}
/**
*
*/
Runnable runnable = new Runnable() {
@Override
public void run() {
String username = usernameEdit.getText().toString();
String password = passwordEdit.getText().toString();
String surePassword = surePasswordEdit.getText().toString();
String city = cityText.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);
OrangeUser orangeUser = new OrangeUser();
orangeUser.setUsername(username);
orangeUser.setPassword(password);
orangeUser.setCity(city);
orangeUser.setSex(sexStr);
//将使用安卓自身带的SQLite数据库换成调用okhttp的方式
OkHttpUser okHttpUser = new OkHttpUser();
try {
if (okHttpUser.userRegister(orangeUser)) {
Intent intent = new Intent(RegisterActivity.this, IndexActivity.class);
intent.putExtras(bundle);
startActivity(intent);
} else {
Looper.prepare();
Toast.makeText(RegisterActivity.this, "注册失败!", Toast.LENGTH_SHORT).show();
Looper.loop();
}
} catch (IOException e) {
e.printStackTrace();
}
} else {
Looper.prepare();
Toast.makeText(RegisterActivity.this, "请选择地址", Toast.LENGTH_SHORT). show();
Looper.loop();
}
} else {
Looper.prepare();
Toast.makeText(RegisterActivity.this, "账号或密码未填写", Toast.LENGTH_SHORT).show();
Looper.loop();
}
} else {
Looper.prepare();
Toast.makeText(RegisterActivity.this, "两次密码输入不一致", Toast.LENGTH_SHORT).show();
Looper.loop();
}
}
};
}

@ -0,0 +1,70 @@
package com.example.myapplication.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.myapplication.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.home_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,79 @@
package com.example.myapplication.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.myapplication.R;
import com.example.myapplication.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.home_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,68 @@
package com.example.myapplication.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.example.myapplication.R;
import com.example.myapplication.entity.OrangeProductPack;
import java.util.List;
public class ProductAdapter extends BaseAdapter {
//private List<Product> productList;
private List<OrangeProductPack> orangeProductList;
private LayoutInflater layoutInflater;
public ProductAdapter(Context context, List<OrangeProductPack> orangeProductList) {
this.orangeProductList = orangeProductList;
this.layoutInflater = LayoutInflater.from(context);
}
@Override
public int getCount() {
return orangeProductList.size();
}
@Override
public Object getItem(int position) {
return orangeProductList.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.home_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();
}
OrangeProductPack product = orangeProductList.get(position);
if (product != null) {
viewHolder.productImage.setImageBitmap(product.getImgBitmap());
viewHolder.productName.setText(product.getName());
viewHolder.productPrice.setText(String.format("%s元", String.valueOf(product.getPrice())));
}
return convertView;
}
class ViewHolder {
ImageView productImage;
TextView productName, productPrice;
}
}

@ -0,0 +1,30 @@
package com.example.myapplication.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.myapplication.entity;
import java.sql.Timestamp;
public class OrangeMessage {
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,64 @@
package com.example.myapplication.entity;
import java.math.BigDecimal;
import java.sql.Timestamp;
public class OrangeProduct {
private Integer id;
private String name;
private BigDecimal price;
private String imgUrl;
@Override
public String toString() {
return "OrangeProduct{" +
"id=" + id +
", name='" + name + '\'' +
", price=" + price +
", imgUrl='" + imgUrl + '\'' +
", addTime=" + addTime +
'}';
}
public Timestamp getAddTime() {
return addTime;
}
public void setAddTime(Timestamp addTime) {
this.addTime = addTime;
}
private Timestamp addTime;
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 BigDecimal getPrice() {
return price;
}
public void setPrice(BigDecimal price) {
this.price = price;
}
public String getImgUrl() {
return imgUrl;
}
public void setImgUrl(String imgUrl) {
this.imgUrl = imgUrl;
}
}

@ -0,0 +1,66 @@
package com.example.myapplication.entity;
import android.graphics.Bitmap;
import java.math.BigDecimal;
import java.sql.Timestamp;
public class OrangeProductPack {
private Integer id;
private String name;
private Timestamp addTime;
private Bitmap imgBitmap;
public BigDecimal getPrice() {
return price;
}
public void setPrice(BigDecimal price) {
this.price = price;
}
private BigDecimal 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.myapplication.entity;
public class OrangeUser {
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,43 @@
package com.example.myapplication.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,44 @@
package com.example.myapplication.entity;
public class ShoppingCart {
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public Integer getProductId() {
return ProductId;
}
public void setProductId(Integer productId) {
ProductId = productId;
}
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
private Integer id;
private Integer userId;
private Integer ProductId;
/**
*
*/
private Integer number;
}

@ -0,0 +1,135 @@
package com.example.myapplication.fragment;
import android.app.Fragment;
import android.os.AsyncTask;
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.myapplication.R;
import com.example.myapplication.adapter.ProductAdapter;
import com.example.myapplication.entity.OrangeProductPack;
import com.example.myapplication.entity.Product;
import com.example.myapplication.netrequest.OkHttpClientProduct;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import okhttp3.OkHttpClient;
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;
private List<OrangeProductPack> list = new ArrayList<>();
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = LayoutInflater.from(getActivity()).inflate(R.layout.wsy, 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);
liLine = view.findViewById(R.id.li);
liLine.setOnClickListener(this);
lemonLine = view.findViewById(R.id.lemon);
lemonLine.setOnClickListener(this);
appleLine = view.findViewById(R.id.apple);
appleLine.setOnClickListener(this);
gridView = view.findViewById(R.id.index_famous_gridview);
//initData();
new SearchProductTask().execute();
}
@Override
public void onClick(View v) {
}
/**
*
*/
private void initData() {
productList = new ArrayList<>();
Product product = new Product();
product.setImageUrlId(R.drawable.home_juzip);
product.setProductName("橘子");
product.setProductPrice(new BigDecimal("9.9"));
Product product1 = new Product();
product1.setImageUrlId(R.drawable.home_orange);
product1.setProductName("橙子");
product1.setProductPrice(new BigDecimal("29.9"));
Product product2 = new Product();
product2.setImageUrlId(R.drawable.home_youzip);
product2.setProductName("柚子");
product2.setProductPrice(new BigDecimal("19.9"));
Product product3 = new Product();
product3.setImageUrlId(R.drawable.home_xiguap);
product3.setProductName("西瓜");
product3.setProductPrice(new BigDecimal("19.9"));
Product product4 = new Product();
product4.setImageUrlId(R.drawable.home_applep);
product4.setProductName("苹果");
product4.setProductPrice(new BigDecimal("49.9"));
Product product5 = new Product();
product5.setImageUrlId(R.drawable.home_lemonp);
product5.setProductName("柠檬");
product5.setProductPrice(new BigDecimal("9.9"));
productList.add(product);
productList.add(product1);
productList.add(product2);
productList.add(product3);
productList.add(product4);
productList.add(product5);
}
/**
*
*/
class SearchProductTask extends AsyncTask<Void, Void, List<OrangeProductPack>> {
@Override
protected List<OrangeProductPack> doInBackground(Void... voids) {
OkHttpClientProduct clientProduct = new OkHttpClientProduct();
try {
list = clientProduct.getProductPack();
} catch (IOException e) {
e.printStackTrace();
}
return list;
}
@Override
protected void onPostExecute(List<OrangeProductPack> orangeProducts) {
productAdapter = new ProductAdapter(getActivity(), list);
gridView.setAdapter(productAdapter);
}
}
}

@ -0,0 +1,65 @@
package com.example.myapplication.fragment;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.example.myapplication.R;
public class PearsonFragment extends Fragment implements View.OnClickListener {
private ImageView userIconImage;
private TextView usernameText, userSexText, userCityText;
private LinearLayout usernameLine, userSexline, userCityLine, userPayLine, userSettingLine, userGeneralLine;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = LayoutInflater.from(getActivity()).inflate(R.layout.home_content_user, container, false);
init(view);
return view;
}
/**
*
*/
private void init(View view) {
userIconImage = view.findViewById(R.id.user_icon);
usernameText = view.findViewById(R.id.user_username);
userSexText = view.findViewById(R.id.user_sex);
userCityText = view.findViewById(R.id.user_city);
usernameLine = view.findViewById(R.id.user_username_line);
userSexline = view.findViewById(R.id.user_sex_line);
userCityLine = view.findViewById(R.id.user_city_line);
userPayLine = view.findViewById(R.id.user_pay);
userSettingLine = view.findViewById(R.id.user_setting);
userGeneralLine = view.findViewById(R.id.user_general);
setData();
}
/**
*
*/
private void setData() {
Bundle bundle = getArguments();
usernameText.setText(String.format("用户名:%s", bundle.getString("username")));
userSexText.setText(String.format("性别:%s", bundle.getString("sex")));
userCityText.setText(String.format("城市:%s", bundle.getString("city")));
}
@Override
public void onClick(View v) {
}
}

@ -0,0 +1,102 @@
package com.example.myapplication.fragment;
import android.app.Fragment;
import android.os.AsyncTask;
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.myapplication.R;
import com.example.myapplication.adapter.ListViewAdapter;
import com.example.myapplication.adapter.ProductAdapter;
import com.example.myapplication.entity.Condition;
import com.example.myapplication.entity.OrangeProductPack;
import com.example.myapplication.netrequest.OkHttpClientProduct;
import java.io.IOException;
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<OrangeProductPack> orangeProductList = new ArrayList<>();
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = LayoutInflater.from(getActivity()).inflate(R.layout.home_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);
new SearchProductTask().execute();
}
/**
* conditionList
*/
private void initCondList() {
conditionList = new ArrayList<>();
Condition allCondition = new Condition();
allCondition.setConditionIcon(R.drawable.home_all);
allCondition.setConditionName("全部");
Condition saleCondition = new Condition();
saleCondition.setConditionIcon(R.drawable.home_salenum);
saleCondition.setConditionName("按销量高低排序");
Condition timeCondition = new Condition();
timeCondition.setConditionIcon(R.drawable.home_time);
timeCondition.setConditionName("按上市时间排序");
Condition priceCondition = new Condition();
priceCondition.setConditionIcon(R.drawable.home_price);
priceCondition.setConditionName("按商品价格排序");
conditionList.add(allCondition);
conditionList.add(saleCondition);
conditionList.add(timeCondition);
conditionList.add(priceCondition);
}
/**
*
*/
class SearchProductTask extends AsyncTask<Void, Void, List<OrangeProductPack>> {
@Override
protected List<OrangeProductPack> doInBackground(Void... voids) {
OkHttpClientProduct clientProduct = new OkHttpClientProduct();
try {
orangeProductList = clientProduct.getProductPack();
} catch (IOException e) {
e.printStackTrace();
}
return orangeProductList;
}
@Override
protected void onPostExecute(List<OrangeProductPack> orangeProducts) {
ProductAdapter productAdapter = new ProductAdapter(getActivity(), orangeProductList);
productGridView.setAdapter(productAdapter);
}
}
}

@ -0,0 +1,53 @@
package com.example.myapplication.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.myapplication.R;
import com.example.myapplication.activity.home.CategoryActivity;
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.home_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,62 @@
package com.example.myapplication.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.Button;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.example.myapplication.R;
import com.example.myapplication.entity.ShoppingCart;
import java.util.ArrayList;
import java.util.List;
public class ShoppingCartFragment extends Fragment implements View.OnClickListener {
private Button walkButton;
private List<ShoppingCart> cartList = new ArrayList<>();
private ProductFragment productFragment;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view;
if (cartList.size() > 0) {
//有商品
view = LayoutInflater.from(getActivity()).inflate(R.layout.home_cart_have_product, container, false);
} else {
view = LayoutInflater.from(getActivity()).inflate(R.layout.home_cart_no_product, container, false);
}
init(view);
return view;
}
/**
*
*/
private void init(View view) {
walkButton = view.findViewById(R.id.random_search);
walkButton.setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.random_search:
//开启事务fragment的控制是由事务来实现的
FragmentTransaction transaction = getFragmentManager().beginTransaction();
if (productFragment == null) {
productFragment = new ProductFragment();
}
transaction.replace(R.id.main_content0, productFragment);
transaction.commit();
break;
}
}
}

@ -0,0 +1,83 @@
package com.example.myapplication.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.myapplication.entity.OrangeProduct;
import com.example.myapplication.entity.OrangeProductPack;
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<OrangeProduct> getProduct() throws IOException {
OkHttpClient okHttpClient = new OkHttpClient();
// Request request = new Request.Builder()
// .url("http://api.k8s.mt178.com/mock/orange/product/search")
// .build();
Request request = new Request.Builder()
.url("http://106.55.41.135:8081/orange/user/register")
.build();
Response response = okHttpClient.newCall(request).execute();
JSONObject jsonObject = JSON.parseObject(Objects.requireNonNull(response.body()).string());
List<OrangeProduct> list = JSON.parseObject(jsonObject.getString("data"), new TypeReference<List<OrangeProduct>>() {
});
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<OrangeProductPack> getProductPack() throws IOException {
List<OrangeProductPack> packList = new ArrayList<>();
List<OrangeProduct> list = getProduct();
for (OrangeProduct orangeProduct : list) {
OrangeProductPack orangeProductPack = new OrangeProductPack();
orangeProductPack.setId(orangeProduct.getId());
orangeProductPack.setImgBitmap(getImageBitMap(orangeProduct.getImgUrl()));
orangeProductPack.setAddTime(orangeProduct.getAddTime());
orangeProductPack.setPrice(orangeProduct.getPrice());
packList.add(orangeProductPack);
}
return packList;
}
}

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

@ -0,0 +1,71 @@
package com.example.myapplication.netrequest;
import android.util.Log;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.example.myapplication.entity.OrangeUser;
import java.io.IOException;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
public class OkHttpUser {
/**
*
*
* @param orangeUser
*/
public OrangeUser userLogin(OrangeUser 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(jsonStr, mediaType);
Request request = new Request.Builder()
.url("http://106.55.41.135:8081/orange/user/login")
.post(requestBody)
.build();
Response response = okHttpClient.newCall(request).execute();
String responseStr = response.body().string();
System.out.println("responseStr = " + responseStr);
JSONObject jsonObject = JSON.parseObject(responseStr);
JSONObject jsonObject1 = jsonObject.getJSONObject("data");
OrangeUser orangeUser1 = JSON.toJavaObject(jsonObject1, OrangeUser.class);
return orangeUser1;
}
/**
*
*
* @param orangeUser
* @return
* @throws IOException
*/
public boolean userRegister(OrangeUser 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(jsonStr, mediaType);
Request request = new Request.Builder()
.url("http://106.55.41.135: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");
}
}

@ -9,7 +9,10 @@ import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
public class MainActivity extends AppCompatActivity {
import com.example.myapplication.activity.home.CategoryActivity;
import com.example.myapplication.activity.home.IndexActivity;
public class originMainActivity extends AppCompatActivity {
Button loginB, newUser;
EditText usernameET, passwordET;
SqliteDbManager instance;
@ -24,19 +27,19 @@ public class MainActivity extends AppCompatActivity {
initView();
loginB.setOnClickListener(v -> {
if (submit()) {
Toast.makeText(MainActivity.this, "登录成功", Toast.LENGTH_LONG).show();
Toast.makeText(originMainActivity.this, "登录成功", Toast.LENGTH_LONG).show();
Intent intent = new Intent();
ComponentName componentName = new ComponentName(MainActivity.this, InfoActivity.class);
ComponentName componentName = new ComponentName(originMainActivity.this, InfoActivity.class);
intent.setComponent(componentName);
intent.putExtra("username", usernameET.getText());
startActivity(intent);
} else {
Toast.makeText(MainActivity.this, "账号或密码输入错误", Toast.LENGTH_LONG).show();
Toast.makeText(originMainActivity.this, "账号或密码输入错误", Toast.LENGTH_LONG).show();
}
});
newUser.setOnClickListener(v -> {
Intent intent = new Intent();
ComponentName componentName = new ComponentName(MainActivity.this, MainActivity2.class);
ComponentName componentName = new ComponentName(originMainActivity.this, IndexActivity.class);
intent.setComponent(componentName);
startActivity(intent);
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B

@ -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="#EFB81C" />
<corners android:radius="5dp" />
</shape>
</item>
<item android:state_pressed="true">
<shape>
<solid android:color="#c0c0c0" />
<corners android:radius="5dp" />
</shape>
</item>
</selector>

@ -0,0 +1,14 @@
<?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="#c0c0c0" />
</shape>
</item>
<item android:state_pressed="true">
<shape>
<solid android:color="#c0c0c0" />
<corners android:radius="10dp" />
</shape>
</item>
</selector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 790 B

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

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<solid android:color="#FFFFFF"/>
<corners android:radius="2dip"/>
<stroke
android:width="1dp"
android:color="#FFFFFF"
/>
</shape>
</item>
<item>
<bitmap android:src="@drawable/home_arrow_down" android:gravity="end"/>
</item>
</layer-list>

Binary file not shown.

After

Width:  |  Height:  |  Size: 799 B

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="#F0A732" android:state_selected="true" />
<item android:color="#CFCFCF" />
</selector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 402 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 554 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
tools:context=".originMainActivity">
<LinearLayout
android:layout_width="match_parent"

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".activity.IndexActivity">
<!-- <LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="5">
<include layout="@layout/content_user"/>
</LinearLayout>-->
<FrameLayout
android:id="@+id/main_content0"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="70dp">
<!--底部导航-->
<include layout="@layout/home_content_nav" />
</LinearLayout>
</LinearLayout>

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include layout="@layout/home_shoppingcart_title" />
<!--有商品时的布局-->
<GridView
android:id="@+id/cart_productList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:numColumns="1" />
</LinearLayout>

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#F2F2F2"
android:orientation="vertical">
<include layout="@layout/home_shoppingcart_title" />
<!--无商品时的布局-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="160dp"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/home_cart" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:text="Cart is Empty ~"
android:textColor="#B5B5B5"
android:textSize="20sp" />
<Button
android:id="@+id/random_search"
android:layout_width="180dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:layout_marginTop="25dp"
android:background="@drawable/home_button_login"
android:text="go shopping..."
android:textColor="#fff"
android:textSize="18sp" />
</LinearLayout>
</LinearLayout>

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<GridView
android:id="@+id/category_detail_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:numColumns="3"
android:verticalSpacing="10dp"
android:horizontalSpacing="10dp"
android:gravity="center"/>
</LinearLayout>

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/categor_titles"
android:layout_width="match_parent"
android:gravity="center"
android:layout_height="wrap_content"
android:textSize="18sp"
android:text="标题" />
</LinearLayout>

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#fff"
android:orientation="vertical">
<ImageView
android:id="@+id/category_product_image"
android:layout_width="120dp"
android:layout_marginTop="5dp"
android:layout_height="120dp"
android:layout_gravity="center" />
<TextView
android:id="@+id/category_product_name"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_gravity="center"
android:layout_marginTop="2dp"
android:textColor="#050505"
android:textSize="16sp" />
<TextView
android:id="@+id/category_product_price"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_gravity="center"
android:layout_marginTop="2dp"
android:gravity="center"
android:textColor="#050505"
android:textSize="16sp" />
</LinearLayout>

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#E8E8E8"
android:orientation="vertical">
<include layout="@layout/home_content_product_title" />
<!--分类标题和内容-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<!--标题-->
<ListView
android:id="@+id/category_title_list"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1" />
<!--内容-->
<FrameLayout
android:id="@+id/category_detail"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3" />
</LinearLayout>
</LinearLayout>

@ -0,0 +1,179 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#E8E8E8"
android:orientation="vertical">
<SearchView
android:id="@+id/searchView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/home_index_menu"
android:focusable="false"
android:iconifiedByDefault="false"
android:queryHint="请输入搜索内容" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="1dp"
android:layout_marginTop="20dp"
android:layout_marginRight="1dp"
android:background="@drawable/home_index_menu"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/chengzi"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="80dp"
android:src="@drawable/kyrieinfinity"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="欧文infinity"
android:textColor="#696969"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/youzi"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="80dp"
android:src="@drawable/kyrielow5" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="欧文low2"
android:textColor="#696969"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/juzi"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="80dp"
android:src="@drawable/kyrie5" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="欧文5"
android:textColor="#696969"
android:textSize="20sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_marginBottom="5dp"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/li"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="50dp"
android:src="@drawable/qk" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="球裤白"
android:textColor="#696969"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/apple"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="50dp"
android:src="@drawable/clothewhite" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="球衣黑"
android:textColor="#696969"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/lemon"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="50dp"
android:src="@drawable/clotheblack" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="球衣白"
android:textColor="#696969"
android:textSize="20sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<include layout="@layout/home_index_famous"/>
</LinearLayout>

@ -0,0 +1,119 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<!--首页-->
<LinearLayout
android:id="@+id/content_index"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="2dp"
android:src="@drawable/home_index" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="首页"
android:textColor="#000"
android:textSize="18sp" />
</LinearLayout>
<!--间隔线-->
<ImageView
android:layout_width="1dp"
android:layout_height="70dp"
android:background="#CFCFCF" />
<!--商品-->
<LinearLayout
android:id="@+id/content_product"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="2dp"
android:src="@drawable/home_product" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="商品"
android:textColor="#000"
android:textSize="18sp" />
</LinearLayout>
<!--间隔线-->
<ImageView
android:layout_width="1dp"
android:layout_height="70dp"
android:background="#CFCFCF" />
<!--购物车-->
<LinearLayout
android:id="@+id/content_cart"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginTop="2dp"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/home_shoppingcart" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="购物车"
android:textColor="#000"
android:textSize="18sp" />
</LinearLayout>
<!--间隔线-->
<ImageView
android:layout_width="1dp"
android:layout_height="70dp"
android:background="#CFCFCF" />
<!--个人-->
<LinearLayout
android:id="@+id/content_pearson"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginTop="2dp"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/home_pearson" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="我"
android:textColor="#000"
android:textSize="18sp" />
</LinearLayout>
</LinearLayout>

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include layout="@layout/home_content_product_title" />
<Spinner
android:id="@+id/product_select_condition"
android:layout_width="match_parent"
android:paddingHorizontal="1dp"
android:layout_height="wrap_content" />
<GridView
android:id="@+id/product_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="#E8E8E8"
android:horizontalSpacing="10dp"
android:verticalSpacing="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:numColumns="2"/>
</LinearLayout>

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<!--标题-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#EFB81C"
android:layout_marginBottom="8dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/category_return"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/home_arrow_left" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:layout_weight="1"
android:gravity="center"
android:text="商品"
android:layout_marginRight="40dp"
android:textColor="#FFF"
android:textSize="20sp" />
</LinearLayout>
</LinearLayout>

@ -0,0 +1,234 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#E8E8E8"
android:orientation="vertical">
<ImageView
android:id="@+id/user_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_gravity="center_horizontal"
android:src="@drawable/home_user_icon" />
<!--卡券-->
<LinearLayout
android:id="@+id/user_pay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FFF"
android:layout_marginTop="40dp"
android:orientation="horizontal">
<TextView
android:layout_height="45dp"
android:layout_weight="1"
android:drawableLeft="@drawable/home_user_pay"
android:textColor="#000"
android:text="卡券"
android:gravity="center_vertical"
android:drawablePadding="8dp"
android:textSize="16sp"
android:layout_marginLeft="5dp"
android:layout_width="0dp" />
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_gravity="center"
android:src="@drawable/home_arrow_right" />
</LinearLayout>
<!--账号-->
<LinearLayout
android:id="@+id/user_username_line"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FFF"
android:layout_marginTop="30dp"
android:orientation="horizontal">
<TextView
android:id="@+id/user_username"
android:layout_height="45dp"
android:layout_weight="1"
android:drawableLeft="@drawable/home_user_account"
android:textColor="#000"
android:text="账号:"
android:gravity="center_vertical"
android:drawablePadding="8dp"
android:textSize="16sp"
android:layout_marginLeft="5dp"
android:layout_width="0dp" />
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_gravity="center"
android:src="@drawable/home_arrow_right" />
</LinearLayout>
<!--性别-->
<LinearLayout
android:id="@+id/user_sex_line"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FFF"
android:layout_marginTop="1dp"
android:orientation="horizontal">
<TextView
android:id="@+id/user_sex"
android:layout_height="45dp"
android:layout_weight="1"
android:layout_marginLeft="5dp"
android:drawableLeft="@drawable/home_user_sex"
android:textColor="#000"
android:text="性别:"
android:gravity="center_vertical"
android:drawablePadding="8dp"
android:textSize="16sp"
android:layout_width="0dp" />
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_gravity="center"
android:src="@drawable/home_arrow_right" />
</LinearLayout>
<!--城市-->
<LinearLayout
android:id="@+id/user_city_line"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FFF"
android:layout_marginTop="1dp"
android:orientation="horizontal">
<TextView
android:id="@+id/user_city"
android:layout_height="45dp"
android:layout_weight="1"
android:drawableLeft="@drawable/home_city"
android:textColor="#000"
android:text="城市:"
android:gravity="center_vertical"
android:drawablePadding="8dp"
android:textSize="16sp"
android:layout_marginLeft="5dp"
android:layout_width="0dp" />
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_gravity="center"
android:src="@drawable/home_arrow_right" />
</LinearLayout>
<!--通用-->
<LinearLayout
android:id="@+id/user_general"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FFF"
android:layout_marginTop="20dp"
android:orientation="horizontal">
<TextView
android:layout_height="45dp"
android:layout_weight="1"
android:drawableLeft="@drawable/home_user_general"
android:textColor="#000"
android:text="通用"
android:gravity="center_vertical"
android:drawablePadding="8dp"
android:textSize="16sp"
android:layout_marginLeft="5dp"
android:layout_width="0dp" />
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_gravity="center"
android:src="@drawable/home_arrow_right" />
</LinearLayout>
<!-- &lt;!&ndash;查看商品&ndash;&gt;
<LinearLayout
android:id="@+id/user_searchProduct"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FFF"
android:layout_marginTop="20dp"
android:orientation="horizontal">
<TextView
android:layout_height="45dp"
android:layout_weight="1"
android:drawableLeft="@drawable/search"
android:textColor="#000"
android:text="查看消息"
android:gravity="center_vertical"
android:drawablePadding="8dp"
android:textSize="16sp"
android:layout_marginLeft="5dp"
android:layout_width="0dp" />
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_gravity="center"
android:src="@drawable/arrow_right" />
</LinearLayout>-->
<!--设置-->
<LinearLayout
android:id="@+id/user_setting"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FFF"
android:layout_marginTop="20dp"
android:orientation="horizontal">
<TextView
android:layout_height="45dp"
android:layout_weight="1"
android:drawableLeft="@drawable/home_setting"
android:textColor="#000"
android:text="设置"
android:gravity="center_vertical"
android:drawablePadding="8dp"
android:textSize="16sp"
android:layout_marginLeft="5dp"
android:layout_width="0dp" />
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_gravity="center"
android:src="@drawable/home_arrow_right" />
</LinearLayout>
<Button
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:textSize="18sp"
android:layout_marginTop="90dp"
android:text="退出登录"
android:textColor="#FFFFFF"
android:layout_gravity="center"
android:background="@drawable/home_button_login"/>
</LinearLayout>

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:orientation="vertical">
<!--热门商品-->
<LinearLayout
android:id="@+id/index_famous_product"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:background="#FFF"
android:orientation="horizontal">
<TextView
android:layout_width="157dp"
android:layout_height="50dp"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:drawableLeft="@drawable/home_shoes"
android:drawablePadding="8dp"
android:gravity="center_vertical"
android:text="热门商品"
android:textColor="#000"
android:textSize="18sp" />
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_gravity="center"
android:src="@drawable/home_arrow_right" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:orientation="vertical">
<GridView
android:id="@+id/index_famous_gridview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#E8E8E8"
android:verticalSpacing="10dp"
android:horizontalSpacing="10dp"
android:numColumns="2" />
</LinearLayout>
</LinearLayout>

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/item_bg"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="60dp"
android:background="#fff"
android:orientation="horizontal">
<ImageView
android:id="@+id/condition_icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp" />
<TextView
android:id="@+id/condition_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:text="销量"
android:textSize="18sp" />
</LinearLayout>
<ImageView
android:id="@+id/image_jiange"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:background="#CFCFCF" />
</LinearLayout>

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#F2F2F2"
android:orientation="vertical">
<include layout="@layout/home_shoppingcart_title" />
<include layout="@layout/home_cart_no_product" />
</LinearLayout>

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<!--标题-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#EFB81C"
android:orientation="horizontal">
<ImageView
android:id="@+id/shopcart_return"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/home_arrow_left" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:layout_weight="1"
android:gravity="center"
android:text="shopping cart"
android:layout_marginRight="40dp"
android:textColor="#FFF"
android:textSize="20sp" />
</LinearLayout>
</LinearLayout>

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#E8E8E8">
<!--APPLogo及名字-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:layout_marginTop="40dp"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:src="@drawable/home_orange" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="22sp"
android:textColor="#000000"
android:textStyle="italic"
android:text="Orange" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:layout_marginTop="50dp"
android:orientation="horizontal">
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center_vertical"
android:src="@drawable/home_user" />
<EditText
android:id="@+id/username"
android:layout_width="270dp"
android:layout_height="60dp"
android:textAlignment="center"
android:maxLength="10"
android:maxLines="1"
android:hint="username" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="horizontal">
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center_vertical"
android:src="@drawable/home_password" />
<EditText
android:id="@+id/password"
android:layout_width="270dp"
android:layout_height="60dp"
android:inputType="textPassword"
android:textAlignment="center"
android:maxLength="16"
android:maxLines="1"
android:hint="password" />
</LinearLayout>
<Button
android:id="@+id/login"
android:layout_width="250dp"
android:layout_height="50dp"
android:textSize="18sp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="60dp"
android:background="@drawable/home_button_login"
android:textColor="#FFFFFF"
android:text="登&#160;&#160;&#160;&#160;&#160;录" />
<Button
android:id="@+id/register"
android:layout_width="250dp"
android:layout_height="50dp"
android:layout_marginTop="10dp"
android:textSize="18sp"
android:layout_gravity="center_horizontal"
android:background="@drawable/home_button_register"
android:textColor="#FFFFFF"
android:text="注&#160;&#160;&#160;&#160;&#160;册" />
</LinearLayout>

@ -0,0 +1,168 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#E8E8E8">
<!--APPLogo及名字-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:layout_marginTop="20dp"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:src="@drawable/home_orange" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="22sp"
android:textColor="#000000"
android:textStyle="italic"
android:text="Orange" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:layout_marginTop="30dp"
android:orientation="horizontal">
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center_vertical"
android:src="@drawable/home_user" />
<EditText
android:id="@+id/reg_username"
android:layout_width="290dp"
android:layout_height="60dp"
android:textAlignment="center"
android:maxLength="10"
android:maxLines="1"
android:hint="用户名&#160;10位" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="horizontal">
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center_vertical"
android:src="@drawable/home_password" />
<EditText
android:id="@+id/reg_password"
android:layout_width="290dp"
android:layout_height="60dp"
android:inputType="textPassword"
android:textAlignment="center"
android:maxLength="16"
android:maxLines="1"
android:hint="密码&#160;6-16位" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="horizontal">
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center_vertical"
android:src="@drawable/home_sure_apssword" />
<EditText
android:id="@+id/reg_sure_password"
android:layout_width="290dp"
android:layout_height="60dp"
android:inputType="textPassword"
android:textAlignment="center"
android:maxLength="16"
android:maxLines="1"
android:hint="确认密码" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center_vertical"
android:src="@drawable/home_sex" />
<RadioGroup
android:id="@+id/sex"
android:layout_width="270dp"
android:layout_height="wrap_content"
android:orientation="horizontal">
<RadioButton
android:id="@+id/reg_man"
android:layout_width="wrap_content"
android:checked="true"
android:layout_height="wrap_content"
android:text="男"/>
<RadioButton
android:id="@+id/reg_woman"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="女"/>
</RadioGroup>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center_vertical"
android:src="@drawable/home_address" />
<TextView
android:id="@+id/reg_province"
android:layout_width="290dp"
android:layout_height="60dp"
android:gravity="center"
android:maxLength="20"
android:maxLines="1"
android:drawableRight="@drawable/home_arrow_down"
android:hint="地址选择" />
</LinearLayout>
<Button
android:id="@+id/reg_register"
android:layout_width="280dp"
android:layout_height="50dp"
android:layout_marginTop="80dp"
android:textSize="18sp"
android:layout_gravity="center_horizontal"
android:background="@drawable/home_button_login"
android:textColor="#FFFFFF"
android:text="注&#160;&#160;&#160;&#160;&#160;册" />
</LinearLayout>

@ -0,0 +1,179 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#E8E8E8"
android:orientation="vertical">
<SearchView
android:id="@+id/searchView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/home_index_menu"
android:focusable="false"
android:iconifiedByDefault="false"
android:queryHint="请输入搜索内容" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="1dp"
android:layout_marginTop="20dp"
android:layout_marginRight="1dp"
android:background="@drawable/home_index_menu"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/chengzi"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="80dp"
android:src="@drawable/flowerr"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="红花"
android:textColor="#696969"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/youzi"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="80dp"
android:src="@drawable/flowerg" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="白花"
android:textColor="#696969"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/juzi"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="80dp"
android:src="@drawable/home_orange" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="橙子"
android:textColor="#696969"
android:textSize="20sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_marginBottom="5dp"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/li"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="50dp"
android:src="@drawable/home_apple" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="苹果"
android:textColor="#696969"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/apple"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="50dp"
android:src="@drawable/clothewhite" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="球衣黑"
android:textColor="#696969"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/lemon"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="50dp"
android:src="@drawable/clotheblack" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="球衣白"
android:textColor="#696969"
android:textSize="20sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<include layout="@layout/home_index_famous"/>
</LinearLayout>
Loading…
Cancel
Save