@ -0,0 +1,14 @@
|
||||
*.iml
|
||||
.gradle
|
||||
/local.properties
|
||||
/.idea/caches
|
||||
/.idea/libraries
|
||||
/.idea/modules.xml
|
||||
/.idea/workspace.xml
|
||||
/.idea/navEditor.xml
|
||||
/.idea/assetWizardSettings.xml
|
||||
.DS_Store
|
||||
/build
|
||||
/captures
|
||||
.externalNativeBuild
|
||||
.cxx
|
@ -0,0 +1,3 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AndroidProjectSystem">
|
||||
<option name="providerId" value="com.android.tools.idea.GradleProjectSystem" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AndroidTestResultsUserPreferences">
|
||||
<option name="androidTestResultsTableState">
|
||||
<map>
|
||||
<entry key="-167171631">
|
||||
<value>
|
||||
<AndroidTestResultsTableState>
|
||||
<option name="preferredColumnWidths">
|
||||
<map>
|
||||
<entry key="Duration" value="90" />
|
||||
<entry key="Tests" value="360" />
|
||||
<entry key="Xiaomi 23116PN5BC" value="120" />
|
||||
</map>
|
||||
</option>
|
||||
</AndroidTestResultsTableState>
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,116 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<code_scheme name="Project" version="173">
|
||||
<codeStyleSettings language="XML">
|
||||
<indentOptions>
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||
</indentOptions>
|
||||
<arrangement>
|
||||
<rules>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>xmlns:android</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>xmlns:.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:id</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:name</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>name</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>style</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>ANDROID_ATTRIBUTE_ORDER</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>.*</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
</rules>
|
||||
</arrangement>
|
||||
</codeStyleSettings>
|
||||
</code_scheme>
|
||||
</component>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="1.8" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetSelector">
|
||||
<selectionStates>
|
||||
<SelectionState runConfigName="app">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
</SelectionState>
|
||||
<SelectionState runConfigName="ExampleInstrumentedTest">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
</SelectionState>
|
||||
</selectionStates>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="CHOOSE_PER_TEST" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleJvm" value="1.8" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
</set>
|
||||
</option>
|
||||
<option name="resolveExternalAnnotations" value="false" />
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RemoteRepositoriesConfiguration">
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Maven Central repository" />
|
||||
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="jboss.community" />
|
||||
<option name="name" value="JBoss Community repository" />
|
||||
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="BintrayJCenter" />
|
||||
<option name="name" value="BintrayJCenter" />
|
||||
<option name="url" value="https://jcenter.bintray.com/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="Google" />
|
||||
<option name="name" value="Google" />
|
||||
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="maven" />
|
||||
<option name="name" value="maven" />
|
||||
<option name="url" value="http://maven.aliyun.com/nexus/content/groups/public/" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectMigrations">
|
||||
<option name="MigrateToGradleLocalJavaHome">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="corretto-1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
<option name="id" value="Android" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RunConfigurationProducerService">
|
||||
<option name="ignoredProducers">
|
||||
<set>
|
||||
<option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.PatternConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.TestInClassConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.testDiscovery.JUnitTestDiscoveryConfigurationProducer" />
|
||||
<option value="org.jetbrains.kotlin.idea.junit.KotlinJUnitRunConfigurationProducer" />
|
||||
<option value="org.jetbrains.kotlin.idea.junit.KotlinPatternConfigurationProducer" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1 @@
|
||||
/build
|
@ -0,0 +1,47 @@
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
|
||||
lintOptions {
|
||||
checkReleaseBuilds false
|
||||
abortOnError false
|
||||
}
|
||||
|
||||
compileSdkVersion 30
|
||||
buildToolsVersion "30.0.2"
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.example.shoppingmallsystem"
|
||||
minSdkVersion 14
|
||||
targetSdkVersion 30
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: "libs", include: ["*.jar"])
|
||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
|
||||
|
||||
|
||||
implementation 'androidx.navigation:navigation-fragment:2.3.2'
|
||||
implementation 'androidx.navigation:navigation-ui:2.3.2'
|
||||
implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.6'
|
||||
compile 'com.android.support:cardview-v7:21.+'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.0.0'
|
||||
|
||||
compile 'com.jungly:gridPasswordView:0.3'
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
@ -0,0 +1,20 @@
|
||||
{
|
||||
"version": 1,
|
||||
"artifactType": {
|
||||
"type": "APK",
|
||||
"kind": "Directory"
|
||||
},
|
||||
"applicationId": "com.example.shoppingmallsystem",
|
||||
"variantName": "release",
|
||||
"elements": [
|
||||
{
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"properties": [],
|
||||
"versionCode": 1,
|
||||
"versionName": "1.0",
|
||||
"enabled": true,
|
||||
"outputFile": "app-release.apk"
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.example.shoppingmallsystem;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("com.example.shoppingmallsystem", appContext.getPackageName());
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.example.shoppingmallsystem">
|
||||
|
||||
<application
|
||||
android:name=".util.AppContext"
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
<activity android:name=".activity.OrderDetailsActivity"></activity>
|
||||
<activity android:name=".activity.OrderActivity" />
|
||||
<activity android:name=".activity.PayActivity" />
|
||||
<activity android:name=".activity.PersonalCenterActivity" />
|
||||
<activity android:name=".activity.RechargeActivity" />
|
||||
<activity android:name=".activity.MyAccountActivity" />
|
||||
<activity android:name=".activity.StoreGoodsActivity" />
|
||||
<activity android:name=".activity.RegisterActivity" />
|
||||
<activity android:name=".activity.HomeAllStoresActivity" />
|
||||
<activity android:name=".MainActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
@ -0,0 +1,148 @@
|
||||
package com.example.shoppingmallsystem;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.example.shoppingmallsystem.activity.HomeAllStoresActivity;
|
||||
import com.example.shoppingmallsystem.activity.RegisterActivity;
|
||||
import com.example.shoppingmallsystem.bean.Userinfo;
|
||||
import com.example.shoppingmallsystem.util.MySQLiteHelper;
|
||||
import com.example.shoppingmallsystem.util.ShareUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
|
||||
|
||||
private EditText et_password;
|
||||
private EditText et_username;
|
||||
private Button btn_login;
|
||||
private Button btn_register;
|
||||
public static String username;
|
||||
private String password;
|
||||
private CheckBox rember;
|
||||
private CheckBox autologin;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
initView();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
et_password = (EditText) findViewById(R.id.et_password);
|
||||
et_username = (EditText) findViewById(R.id.et_username);
|
||||
btn_login = (Button)findViewById(R.id.M_login);
|
||||
btn_register = (Button)findViewById(R.id.M_register);
|
||||
rember = (CheckBox) findViewById(R.id.remenberpw);
|
||||
autologin = (CheckBox)findViewById(R.id.autologin);
|
||||
|
||||
btn_login.setOnClickListener(this);
|
||||
btn_register.setOnClickListener(this);
|
||||
|
||||
//清除表中所有数据
|
||||
// MySQLiteHelper.getInstance(this).deleateAllUserInfo();
|
||||
|
||||
//打印所有用户名和密码记录信息
|
||||
List<Userinfo> userinfoList = MySQLiteHelper.getInstance(this).queryAlluserInfo();
|
||||
//Log.e("userinfoList", userinfoList.toString());
|
||||
|
||||
|
||||
if (ShareUtils.getRember().equals("1")) {
|
||||
rember.setChecked(true);
|
||||
et_username.setText(ShareUtils.getUserName());
|
||||
et_password.setText(ShareUtils.getPassword());
|
||||
}else {
|
||||
rember.setChecked(false);
|
||||
}
|
||||
|
||||
|
||||
if (ShareUtils.getAuto_Login().equals("1")) {
|
||||
autologin.setChecked(true);
|
||||
if (TextUtils.isEmpty(et_username.getText()) || TextUtils.isEmpty(et_password.getText())) {
|
||||
Toast.makeText(this, "用户名密码为空", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
//登陆成功进入的页面
|
||||
startActivity(new Intent(this, HomeAllStoresActivity.class));
|
||||
username = ShareUtils.getUserName();
|
||||
this.finish();
|
||||
}
|
||||
}else {
|
||||
autologin.setChecked(false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
rember.setOnCheckedChangeListener(new CheckBox.OnCheckedChangeListener(){
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
|
||||
if (rember.isChecked()){
|
||||
//System.out.println("记住密码已被选中");
|
||||
ShareUtils.putRember("1");
|
||||
}else {
|
||||
//System.out.println("记住密码没有被选中");
|
||||
ShareUtils.putRember("0");
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
autologin.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
|
||||
if (autologin.isChecked()){
|
||||
//System.out.println("自动登录被选中");
|
||||
ShareUtils.putAuto_Login("1");
|
||||
}else {
|
||||
//System.out.println("自动登录没有被选中");
|
||||
ShareUtils.putAuto_Login("0");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
switch (view.getId()){
|
||||
case R.id.M_login:
|
||||
username = et_username.getText().toString();
|
||||
password = et_password.getText().toString();
|
||||
// Log.e("password " ,password);
|
||||
// Log.e("username " ,username);
|
||||
if (TextUtils.isEmpty(username) || TextUtils.isEmpty(password)) {
|
||||
Toast.makeText(MainActivity.this, "用户名或密码不能为空", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
|
||||
}
|
||||
if (MySQLiteHelper.getInstance(this).queryUseristrue(username,password)){
|
||||
if (rember.isChecked()){
|
||||
ShareUtils.putUserName(username);
|
||||
ShareUtils.putPassword(password);
|
||||
}
|
||||
Toast.makeText(MainActivity.this, "登陆成功", Toast.LENGTH_SHORT).show();
|
||||
startActivity(new Intent(this, HomeAllStoresActivity.class));
|
||||
MainActivity.this.finish();
|
||||
}else {
|
||||
Toast.makeText(MainActivity.this, "登录失败,用户名或密码错误", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case R.id.M_register:
|
||||
Intent intent = new Intent(this, RegisterActivity.class);
|
||||
startActivity(intent);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,215 @@
|
||||
package com.example.shoppingmallsystem.activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.ActionBarDrawerToggle;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.view.GravityCompat;
|
||||
import androidx.drawerlayout.widget.DrawerLayout;
|
||||
import androidx.recyclerview.widget.DefaultItemAnimator;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.example.shoppingmallsystem.MainActivity;
|
||||
import com.example.shoppingmallsystem.R;
|
||||
import com.example.shoppingmallsystem.adapter.AllStoresAdapter;
|
||||
import com.example.shoppingmallsystem.bean.StoreBean;
|
||||
import com.example.shoppingmallsystem.util.MySQLiteHelper;
|
||||
import com.example.shoppingmallsystem.util.ShareUtils;
|
||||
import com.example.shoppingmallsystem.util.ToastUtil;
|
||||
import com.google.android.material.navigation.NavigationView;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 主页所有商店的activity
|
||||
*
|
||||
*/
|
||||
public class HomeAllStoresActivity extends AppCompatActivity implements View.OnClickListener {
|
||||
|
||||
|
||||
/*创建一个Drawerlayout和Toolbar联动的开关*/
|
||||
private ActionBarDrawerToggle toggle ;
|
||||
private DrawerLayout drawerLayout;
|
||||
private NavigationView navigationView;
|
||||
private Toolbar toolbar;
|
||||
private TextView tv_bar_title;
|
||||
private TextView tv_main_userName;
|
||||
private ImageView iv_head;
|
||||
|
||||
private AllStoresAdapter allStoresAdapter;
|
||||
//private SearchView mySearchView;
|
||||
private RecyclerView rv_stores;
|
||||
private List<StoreBean> storeBeans;
|
||||
private LinearLayout headerView;
|
||||
private int UserID ;
|
||||
|
||||
//初始化数据
|
||||
private void initData(){
|
||||
storeBeans = new ArrayList<>();
|
||||
storeBeans = MySQLiteHelper.getInstance(getApplicationContext()).queryAllStores();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_home_all_stores);
|
||||
//加载数据
|
||||
initData();
|
||||
//初始化View
|
||||
ininView();
|
||||
//隐藏滑动条
|
||||
hideScrollBar();
|
||||
//设置ActionBar
|
||||
setActionBar();
|
||||
/*设置Drawerlayout开关*/
|
||||
setDrawerToggle();
|
||||
/*设置监听器*/
|
||||
setListener();
|
||||
}
|
||||
|
||||
/*初始化View*/
|
||||
private void ininView() {
|
||||
drawerLayout = findViewById(R.id.drawer_layout);
|
||||
navigationView = findViewById(R.id.navigation_view);
|
||||
toolbar = findViewById(R.id.toolbar);
|
||||
tv_bar_title = findViewById(R.id.tv_bar_title);
|
||||
tv_bar_title.setText("商家列表");
|
||||
|
||||
//获取头布局
|
||||
headerView = (LinearLayout) navigationView.getHeaderView(0);
|
||||
tv_main_userName = headerView.findViewById(R.id.tv_header_userName);
|
||||
iv_head = headerView.findViewById(R.id.iv_head);
|
||||
tv_main_userName.setText(MainActivity.username);
|
||||
UserID = MySQLiteHelper.getInstance(getApplicationContext()).GetUserId(MainActivity.username);
|
||||
switch (UserID){
|
||||
case 1:
|
||||
iv_head.setImageResource(R.drawable.tx_1_48);
|
||||
break;
|
||||
case 2:
|
||||
iv_head.setImageResource(R.drawable.tx_2_48);
|
||||
break;
|
||||
case 3:
|
||||
iv_head.setImageResource(R.drawable.tx_3_48);
|
||||
break;
|
||||
case 4:
|
||||
iv_head.setImageResource(R.drawable.tx_4_48);
|
||||
break;
|
||||
case 5:
|
||||
iv_head.setImageResource(R.drawable.tx_5_48);
|
||||
break;
|
||||
case 6:
|
||||
iv_head.setImageResource(R.drawable.tx_6_48);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
rv_stores = findViewById(R.id.rv_stores);
|
||||
allStoresAdapter = new AllStoresAdapter(storeBeans);
|
||||
//初始化recyclerView
|
||||
rv_stores.setItemAnimator(new DefaultItemAnimator());
|
||||
rv_stores.setLayoutManager(new LinearLayoutManager(this));
|
||||
rv_stores.setAdapter(allStoresAdapter);
|
||||
|
||||
//设置item点击事件
|
||||
allStoresAdapter.setOnItemClickListener(new AllStoresAdapter.OnItemClickListener() {
|
||||
@Override
|
||||
public void onClick(View v, int position, StoreBean storeBean) {
|
||||
//ToastUtil.showShort("您点击的下标"+position+"商家:"+storeBean.getStoreName());
|
||||
startActivity(new Intent(HomeAllStoresActivity.this,StoreGoodsActivity.class).putExtra("storeID",storeBean.getID()));
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/*去掉navigation中的滑动条*/
|
||||
private void hideScrollBar() {
|
||||
navigationView.getChildAt(0).setVerticalScrollBarEnabled(false);
|
||||
}
|
||||
|
||||
/*设置ActionBar*/
|
||||
private void setActionBar() {
|
||||
setSupportActionBar(toolbar);
|
||||
/*显示Home图标*/
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
//设置不显示项目名称
|
||||
getSupportActionBar().setDisplayShowTitleEnabled(false);
|
||||
}
|
||||
/*设置Drawerlayout的开关,并且和Home图标联动*/
|
||||
private void setDrawerToggle() {
|
||||
toggle = new ActionBarDrawerToggle(this,drawerLayout,toolbar,0,0);
|
||||
drawerLayout.addDrawerListener(toggle);
|
||||
/*同步drawerlayout的状态*/
|
||||
toggle.syncState();
|
||||
}
|
||||
|
||||
/*设置监听器*/
|
||||
private void setListener() {
|
||||
navigationView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() {
|
||||
@Override
|
||||
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
|
||||
switch (item.getItemId()){
|
||||
case R.id.single_1:
|
||||
startActivity(new Intent(HomeAllStoresActivity.this,OrderActivity.class));
|
||||
break;
|
||||
case R.id.single_2:
|
||||
startActivity(new Intent(HomeAllStoresActivity.this, MyAccountActivity.class));
|
||||
break;
|
||||
case R.id.single_3:
|
||||
startActivity(new Intent(HomeAllStoresActivity.this,PersonalCenterActivity.class));
|
||||
break;
|
||||
case R.id.single_4:
|
||||
startActivity(new Intent(HomeAllStoresActivity.this, MainActivity.class));
|
||||
ShareUtils.putAuto_Login("0");
|
||||
HomeAllStoresActivity.this.finish();
|
||||
break;
|
||||
|
||||
}
|
||||
drawerLayout.closeDrawer(GravityCompat.START);
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
switch (view.getId()){
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置返回两次退出程序的方法
|
||||
*/
|
||||
protected long exitTime ; //记录第一次点击的时间
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN){
|
||||
if ((System.currentTimeMillis() - exitTime) > 2000 ){
|
||||
Toast.makeText(HomeAllStoresActivity.this,"再按一次退出商城",
|
||||
Toast.LENGTH_SHORT).show();
|
||||
exitTime = System.currentTimeMillis();
|
||||
}else {
|
||||
HomeAllStoresActivity.this.finish();
|
||||
System.exit(0);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return super.onKeyDown(keyCode,event);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,84 @@
|
||||
package com.example.shoppingmallsystem.activity;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.recyclerview.widget.DefaultItemAnimator;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.MenuItem;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.example.shoppingmallsystem.MainActivity;
|
||||
import com.example.shoppingmallsystem.R;
|
||||
import com.example.shoppingmallsystem.adapter.AllStoresAdapter;
|
||||
import com.example.shoppingmallsystem.adapter.OrderAdapter;
|
||||
import com.example.shoppingmallsystem.bean.OrderBean;
|
||||
import com.example.shoppingmallsystem.util.MySQLiteHelper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单界面
|
||||
*/
|
||||
public class OrderActivity extends AppCompatActivity {
|
||||
|
||||
|
||||
private TextView tv_bar_title;
|
||||
private Toolbar toolbar;
|
||||
private RecyclerView tv_order;
|
||||
private OrderAdapter orderAdapter ;
|
||||
private List<OrderBean> orderBeans;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_order);
|
||||
initData();
|
||||
initView();
|
||||
setActionBar();
|
||||
}
|
||||
|
||||
/*设置ActionBar*/
|
||||
private void setActionBar() {
|
||||
setSupportActionBar(toolbar);
|
||||
/*显示Home图标*/
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
//设置不显示项目名称
|
||||
getSupportActionBar().setDisplayShowTitleEnabled(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
//为toolbar设置返回按钮
|
||||
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||
if(item.getItemId() == android.R.id.home)
|
||||
{
|
||||
finish();
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化数据
|
||||
*/
|
||||
private void initData() {
|
||||
orderBeans = MySQLiteHelper.getInstance(OrderActivity.this).queryOrderBeanFromUserName(MainActivity.username);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void initView() {
|
||||
toolbar = findViewById(R.id.toolbar);
|
||||
tv_bar_title = findViewById(R.id.tv_bar_title);
|
||||
tv_bar_title.setText("订单信息");
|
||||
|
||||
tv_order = findViewById(R.id.rv_order);
|
||||
orderAdapter = new OrderAdapter(orderBeans);
|
||||
tv_order.setItemAnimator(new DefaultItemAnimator());
|
||||
tv_order.setLayoutManager(new LinearLayoutManager(this));
|
||||
tv_order.setAdapter(orderAdapter);
|
||||
}
|
||||
}
|
@ -0,0 +1,186 @@
|
||||
package com.example.shoppingmallsystem.activity;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.example.shoppingmallsystem.MainActivity;
|
||||
import com.example.shoppingmallsystem.R;
|
||||
import com.example.shoppingmallsystem.adapter.PayRVAdapter;
|
||||
import com.example.shoppingmallsystem.adapter.ShoppongCarGoodsAdapter;
|
||||
import com.example.shoppingmallsystem.bean.GoodsArrayBean;
|
||||
import com.example.shoppingmallsystem.bean.OrderBean;
|
||||
import com.example.shoppingmallsystem.fragment.StoreGoodsFragment;
|
||||
import com.example.shoppingmallsystem.util.AppContext;
|
||||
import com.example.shoppingmallsystem.util.DateUtill;
|
||||
import com.example.shoppingmallsystem.util.MyDialog;
|
||||
import com.example.shoppingmallsystem.util.MySQLiteHelper;
|
||||
import com.example.shoppingmallsystem.util.ToastUtil;
|
||||
import com.google.gson.Gson;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.security.spec.RSAOtherPrimeInfo;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 付款界面的activity
|
||||
*/
|
||||
public class PayActivity extends AppCompatActivity {
|
||||
|
||||
private TextView tv_bar_title;
|
||||
private Toolbar toolbar;
|
||||
|
||||
private List<GoodsArrayBean.ItemR> data =new ArrayList<>();
|
||||
private RecyclerView rv_pay;
|
||||
private TextView tv_pay_total;
|
||||
private TextView tv_submitOrder;
|
||||
private PayRVAdapter payRVAdapter;
|
||||
private double total = 0;
|
||||
private BigDecimal b1 ;
|
||||
private BigDecimal b2 ;
|
||||
private BigDecimal b3 ;
|
||||
private BigDecimal result ;
|
||||
private BigDecimal one ;
|
||||
private double a ;
|
||||
private Dialog dialog;
|
||||
private double accountMoney;
|
||||
private OrderBean orderBean;
|
||||
private Gson gson;
|
||||
private String goodsJson;
|
||||
|
||||
private BigDecimal a1 ;
|
||||
private BigDecimal a2 ;
|
||||
private BigDecimal result1 ;
|
||||
private double resultMoney ;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_pay);
|
||||
data = (ArrayList<GoodsArrayBean.ItemR>) getIntent().getSerializableExtra("PayList");
|
||||
initView();
|
||||
setActionBar();
|
||||
}
|
||||
|
||||
/*设置ActionBar*/
|
||||
private void setActionBar() {
|
||||
setSupportActionBar(toolbar);
|
||||
/*显示Home图标*/
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
//设置不显示项目名称
|
||||
getSupportActionBar().setDisplayShowTitleEnabled(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
//为toolbar设置返回按钮
|
||||
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||
if(item.getItemId() == android.R.id.home)
|
||||
{
|
||||
finish();
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
rv_pay = findViewById(R.id.rv_pay);
|
||||
tv_pay_total = findViewById(R.id.tv_pay_total);
|
||||
tv_submitOrder = findViewById(R.id.tv_submitOrder);
|
||||
toolbar = findViewById(R.id.toolbar);
|
||||
tv_bar_title = findViewById(R.id.tv_bar_title);
|
||||
tv_bar_title.setText("提交订单");
|
||||
|
||||
//初始化recyclerView
|
||||
rv_pay.setItemAnimator(null);
|
||||
payRVAdapter = new PayRVAdapter(data);
|
||||
rv_pay.setLayoutManager(new LinearLayoutManager(AppContext.getInstance()));
|
||||
rv_pay.setAdapter(payRVAdapter);
|
||||
|
||||
|
||||
/**
|
||||
* 循环获得总价格
|
||||
*/
|
||||
for (int i= 0;i<data.size();i++){
|
||||
b1 = new BigDecimal(data.get(i).getPrice().trim());
|
||||
b2 = new BigDecimal(data.get(i).getNumber());
|
||||
b3 = new BigDecimal(total);
|
||||
result = b1.multiply(b2);
|
||||
result = result.add(b3);
|
||||
one = new BigDecimal("1");
|
||||
a = result.divide(one,2,BigDecimal.ROUND_HALF_UP).doubleValue();//保留2位数
|
||||
total = a ;
|
||||
//Log.e("total",total+"");
|
||||
}
|
||||
|
||||
tv_pay_total.setText("¥"+ total);
|
||||
|
||||
tv_submitOrder.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
//ToastUtil.showShort("总金额"+total);
|
||||
dialog = new AlertDialog.Builder(PayActivity.this).setTitle("是否确认购买?")
|
||||
.setMessage("总金额:" + total)
|
||||
.setIcon(R.mipmap.ic_launcher)
|
||||
.setPositiveButton("确定", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
doInsertOrder();
|
||||
}
|
||||
})
|
||||
.setNegativeButton("取消", null)
|
||||
.create();
|
||||
dialog.show();
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 进行插入订单的判定和操作
|
||||
*/
|
||||
private void doInsertOrder(){
|
||||
accountMoney = MySQLiteHelper.getInstance(PayActivity.this).getUserMoneyFromUserName(MainActivity.username);
|
||||
//判断账户余额是否足够
|
||||
if (total > accountMoney){
|
||||
ToastUtil.showShort("账户余额不足,请先充值");
|
||||
dialog.dismiss();
|
||||
}else {
|
||||
//解决double精度丢失问题
|
||||
a1 = new BigDecimal(accountMoney);
|
||||
a2 = new BigDecimal(total);
|
||||
result1 = a1.subtract(a2);
|
||||
one = new BigDecimal("1");
|
||||
resultMoney = result1.divide(one,2,BigDecimal.ROUND_HALF_UP).doubleValue();//保留2位数
|
||||
|
||||
MySQLiteHelper.getInstance(PayActivity.this).RechargeMoney(MainActivity.username,resultMoney);
|
||||
gson = new Gson();
|
||||
goodsJson = gson.toJson(data);
|
||||
//Log.e("inputString=" , inputString);
|
||||
orderBean = new OrderBean(MainActivity.username, DateUtill.getCurrentTime(),goodsJson);
|
||||
//Log.e("order",orderBean.toString());
|
||||
//Log.e("时间",DateUtill.getCurrentTime());
|
||||
MySQLiteHelper.getInstance(PayActivity.this).insertOrderInfo(orderBean);
|
||||
ToastUtil.showShort("下单成功!");
|
||||
//通过handler通知刷新购物车界面
|
||||
MyDialog.handler.sendEmptyMessage(2);
|
||||
PayActivity.this.finish();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,144 @@
|
||||
package com.example.shoppingmallsystem.activity;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
|
||||
import com.example.shoppingmallsystem.MainActivity;
|
||||
import com.example.shoppingmallsystem.R;
|
||||
import com.example.shoppingmallsystem.bean.Userinfo;
|
||||
import com.example.shoppingmallsystem.util.MySQLiteHelper;
|
||||
import com.example.shoppingmallsystem.util.ToastUtil;
|
||||
|
||||
|
||||
/**
|
||||
* 个人中心界面activity
|
||||
*/
|
||||
public class PersonalCenterActivity extends AppCompatActivity {
|
||||
|
||||
private TextView tv_userName;
|
||||
private EditText et_nickName;
|
||||
private EditText et_phonNumb;
|
||||
private EditText et_schoolName;
|
||||
private EditText et_apartmentNumb;
|
||||
private Button btn_alter;
|
||||
private Button btn_cancle;
|
||||
|
||||
private String nickName;
|
||||
private String phoneNumb;
|
||||
private String schoolName;
|
||||
private String apartmentNumb;
|
||||
|
||||
private TextView tv_bar_title;
|
||||
private Toolbar toolbar;
|
||||
|
||||
private Userinfo userinfo;
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_personal_center);
|
||||
initView();
|
||||
setActionBar();
|
||||
}
|
||||
|
||||
/*设置ActionBar*/
|
||||
private void setActionBar() {
|
||||
setSupportActionBar(toolbar);
|
||||
/*显示Home图标*/
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
//设置不显示项目名称
|
||||
getSupportActionBar().setDisplayShowTitleEnabled(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
//为toolbar设置返回按钮
|
||||
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||
if(item.getItemId() == android.R.id.home)
|
||||
{
|
||||
finish();
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
tv_userName = findViewById(R.id.tv_username);
|
||||
et_nickName = findViewById(R.id.et_nickName_per);
|
||||
et_phonNumb = findViewById(R.id.et_phoneNumb_per);
|
||||
et_schoolName = findViewById(R.id.et_schoolName_per);
|
||||
et_apartmentNumb = findViewById(R.id.et_apartmentNumb_per);
|
||||
btn_alter = findViewById(R.id.btn_alter);
|
||||
btn_cancle = findViewById(R.id.btn_cancle_per);
|
||||
|
||||
toolbar = findViewById(R.id.toolbar);
|
||||
tv_bar_title = findViewById(R.id.tv_bar_title);
|
||||
tv_bar_title.setText("个人信息");
|
||||
|
||||
|
||||
//获取用户信息数据
|
||||
userinfo = MySQLiteHelper.getInstance(getApplicationContext()).getUserInfoFromUserName(MainActivity.username);
|
||||
|
||||
tv_userName.setText(userinfo.getUserName());
|
||||
et_nickName.setText(userinfo.getNickName());
|
||||
et_phonNumb.setText(userinfo.getPhoneNumb());
|
||||
et_schoolName.setText(userinfo.getSchoolName());
|
||||
et_apartmentNumb.setText(userinfo.getApartmentNumb());
|
||||
|
||||
btn_alter.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
private Userinfo userinfo1;
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
nickName = et_nickName.getText().toString();
|
||||
phoneNumb = et_phonNumb.getText().toString();
|
||||
schoolName = et_schoolName.getText().toString();
|
||||
apartmentNumb = et_apartmentNumb.getText().toString();
|
||||
|
||||
if (TextUtils.isEmpty(nickName)) {
|
||||
ToastUtil.showShort("昵称不能为空!");
|
||||
return;
|
||||
}
|
||||
if (TextUtils.isEmpty(phoneNumb)) {
|
||||
ToastUtil.showShort("手机号码不能为空!");
|
||||
return;
|
||||
}
|
||||
if (TextUtils.isEmpty(schoolName)) {
|
||||
ToastUtil.showShort("学校名称不能为空");
|
||||
return;
|
||||
}
|
||||
if (TextUtils.isEmpty(apartmentNumb)) {
|
||||
ToastUtil.showShort("公寓楼号不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
userinfo1 = new Userinfo();
|
||||
userinfo1.setUserName(MainActivity.username);
|
||||
userinfo1.setNickName(nickName);
|
||||
userinfo1.setPassword(userinfo.getPassword());
|
||||
userinfo1.setPhoneNumb(phoneNumb);
|
||||
userinfo1.setSchoolName(schoolName);
|
||||
userinfo1.setApartmentNumb(apartmentNumb);
|
||||
//Log.e("修改后的信息",userinfo1.toString());
|
||||
//在数据库中修改相关信息
|
||||
MySQLiteHelper.getInstance(getBaseContext()).updateUserInfo(userinfo1);
|
||||
ToastUtil.showShort("信息更新成功");
|
||||
}
|
||||
});
|
||||
|
||||
btn_cancle.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
PersonalCenterActivity.this.finish();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -0,0 +1,104 @@
|
||||
package com.example.shoppingmallsystem.activity;
|
||||
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
|
||||
import com.example.shoppingmallsystem.MainActivity;
|
||||
import com.example.shoppingmallsystem.R;
|
||||
import com.example.shoppingmallsystem.util.MySQLiteHelper;
|
||||
import com.example.shoppingmallsystem.util.ToastUtil;
|
||||
|
||||
|
||||
/**
|
||||
* 充值界面的activity
|
||||
*/
|
||||
public class RechargeActivity extends AppCompatActivity {
|
||||
|
||||
private TextView tv_bar_title;
|
||||
private Toolbar toolbar;
|
||||
private EditText et_rechargeMoney;
|
||||
private Button btn_doRecharge;
|
||||
private String money1;
|
||||
private double currentAccountMoney;
|
||||
private AlertDialog dialog1;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_recharge);
|
||||
initView();
|
||||
setActionBar();
|
||||
}
|
||||
|
||||
/*设置ActionBar*/
|
||||
private void setActionBar() {
|
||||
setSupportActionBar(toolbar);
|
||||
/*显示Home图标*/
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
//设置不显示项目名称
|
||||
getSupportActionBar().setDisplayShowTitleEnabled(false);
|
||||
}
|
||||
@Override
|
||||
//为toolbar设置返回按钮
|
||||
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||
if(item.getItemId() == android.R.id.home)
|
||||
{
|
||||
setResult(1);
|
||||
finish();
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
//获取当前账户的金额
|
||||
currentAccountMoney = MySQLiteHelper.getInstance(getApplicationContext()).getUserMoneyFromUserName(MainActivity.username);
|
||||
|
||||
toolbar = findViewById(R.id.toolbar);
|
||||
tv_bar_title = findViewById(R.id.tv_bar_title);
|
||||
tv_bar_title.setText("充值");
|
||||
et_rechargeMoney= findViewById(R.id.et_rechargeMoney);
|
||||
btn_doRecharge = findViewById(R.id.btn_doRecharge);
|
||||
//充值到账户的点击事件
|
||||
btn_doRecharge.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
money1 =et_rechargeMoney.getText().toString();
|
||||
if (money1.equals("0")){
|
||||
ToastUtil.showShort("金额不能为0");
|
||||
}else if (TextUtils.isEmpty(money1)) {
|
||||
ToastUtil.showShort("金额不能为空");
|
||||
}else {
|
||||
double m1 = Double.parseDouble(money1);
|
||||
currentAccountMoney = currentAccountMoney + m1;
|
||||
dialog1 = new AlertDialog.Builder(RechargeActivity.this).setTitle("是否确认充值")
|
||||
.setMessage("充值账户:" + MainActivity.username + '\n' + "金 额:" + money1 +"元")
|
||||
.setIcon(R.mipmap.ic_launcher)
|
||||
.setPositiveButton("确定", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
MySQLiteHelper.getInstance(getBaseContext()).RechargeMoney(MainActivity.username, currentAccountMoney);
|
||||
ToastUtil.showShort("充值成功");
|
||||
et_rechargeMoney.setText("");
|
||||
}
|
||||
})
|
||||
.setNegativeButton("取消", null)
|
||||
.create();
|
||||
dialog1.show();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,150 @@
|
||||
package com.example.shoppingmallsystem.activity;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.MenuItem;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.example.shoppingmallsystem.R;
|
||||
import com.example.shoppingmallsystem.adapter.MyTabAdapter;
|
||||
import com.example.shoppingmallsystem.bean.StoreBean;
|
||||
import com.example.shoppingmallsystem.fragment.StoreCommentFragment;
|
||||
import com.example.shoppingmallsystem.fragment.StoreGoodsFragment;
|
||||
import com.example.shoppingmallsystem.fragment.StoreIntroFragment;
|
||||
import com.example.shoppingmallsystem.util.MySQLiteHelper;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 点击商家后进入的商家商品界面
|
||||
*/
|
||||
public class StoreGoodsActivity extends AppCompatActivity {
|
||||
|
||||
private TabLayout tabLayout = null;
|
||||
private MyTabAdapter myTabAdapter;
|
||||
private ViewPager home_news_viewPager;
|
||||
private StoreGoodsFragment storeGoodsFragment;
|
||||
private StoreCommentFragment storeCommentFragment;
|
||||
private StoreIntroFragment storeIntroFragment;
|
||||
private List<Fragment> fragments = new ArrayList<>();
|
||||
|
||||
private TextView tv_bar_title;
|
||||
private Toolbar toolbar;
|
||||
private String storeID;
|
||||
private StoreBean storeBean;
|
||||
private ImageView iv_pic;
|
||||
private TextView tv_storeName;
|
||||
private TextView tv_storeScore;
|
||||
private TextView tv_storeSell;
|
||||
private TextView tv_storeSign;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_store_goods);
|
||||
storeID = getIntent().getStringExtra("storeID");
|
||||
initData();
|
||||
initView();
|
||||
setActionBar();
|
||||
}
|
||||
|
||||
/*设置ActionBar*/
|
||||
private void setActionBar() {
|
||||
setSupportActionBar(toolbar);
|
||||
/*显示Home图标*/
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
//设置不显示项目名称
|
||||
getSupportActionBar().setDisplayShowTitleEnabled(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
//为toolbar设置返回按钮
|
||||
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||
if(item.getItemId() == android.R.id.home){
|
||||
finish();
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
|
||||
private void initData() {
|
||||
storeBean = new StoreBean();
|
||||
storeBean = MySQLiteHelper.getInstance(getApplicationContext()).queryStoreBeanFromStoreID(storeID);
|
||||
storeGoodsFragment = new StoreGoodsFragment(storeID);
|
||||
storeCommentFragment = new StoreCommentFragment();
|
||||
storeIntroFragment = new StoreIntroFragment(storeBean);
|
||||
fragments.add(storeGoodsFragment);
|
||||
fragments.add(storeCommentFragment);
|
||||
fragments.add(storeIntroFragment);
|
||||
}
|
||||
|
||||
|
||||
private void initView() {
|
||||
toolbar = findViewById(R.id.toolbar);
|
||||
tv_bar_title = findViewById(R.id.tv_bar_title);
|
||||
tv_bar_title.setText("商店详情");
|
||||
tabLayout = findViewById(R.id.home_newsTab);
|
||||
home_news_viewPager = findViewById(R.id.home_news_vp);
|
||||
iv_pic = findViewById(R.id.iv_store_act);
|
||||
tv_storeName = findViewById(R.id.tv_storeName_act);
|
||||
tv_storeScore = findViewById(R.id.tv_store_score_act);
|
||||
tv_storeSell = findViewById(R.id.tv_store_sell_act);
|
||||
tv_storeSign = findViewById(R.id.tv_store_sign_act);
|
||||
|
||||
switch (storeBean.getIv_store_pic()){
|
||||
case "0":
|
||||
iv_pic.setImageResource(R.mipmap.store_1);
|
||||
break;
|
||||
case "1":
|
||||
iv_pic.setImageResource(R.mipmap.store_2);
|
||||
break;
|
||||
case "2":
|
||||
iv_pic.setImageResource(R.mipmap.store_3);
|
||||
break;
|
||||
case "3":
|
||||
iv_pic.setImageResource(R.mipmap.store_4);
|
||||
break;
|
||||
case "4":
|
||||
iv_pic.setImageResource(R.mipmap.store_5);
|
||||
break;
|
||||
case "5":
|
||||
iv_pic.setImageResource(R.mipmap.store_6);
|
||||
break;
|
||||
case "6":
|
||||
iv_pic.setImageResource(R.mipmap.store_7);
|
||||
break;
|
||||
case "7":
|
||||
iv_pic.setImageResource(R.mipmap.store_8);
|
||||
break;
|
||||
case "8":
|
||||
iv_pic.setImageResource(R.mipmap.store_9);
|
||||
break;
|
||||
case "9":
|
||||
iv_pic.setImageResource(R.mipmap.store_10);
|
||||
break;
|
||||
}
|
||||
|
||||
tv_storeName.setText(storeBean.getStoreName());
|
||||
tv_storeScore.setText(storeBean.getStoreScore()+"分");
|
||||
tv_storeSell.setText("月销量:"+storeBean.getStoreSell());
|
||||
tv_storeSign.setText(storeBean.getStoreSign());
|
||||
|
||||
//初始化tab的Adapter
|
||||
myTabAdapter = new MyTabAdapter(getSupportFragmentManager(),fragments);
|
||||
home_news_viewPager.setAdapter(myTabAdapter);
|
||||
tabLayout.setupWithViewPager(home_news_viewPager);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,136 @@
|
||||
package com.example.shoppingmallsystem.adapter;
|
||||
|
||||
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.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.shoppingmallsystem.R;
|
||||
import com.example.shoppingmallsystem.bean.StoreBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 首页所有商家的Adapter
|
||||
*/
|
||||
public class AllStoresAdapter extends RecyclerView.Adapter<AllStoresAdapter.ViewHolder>{
|
||||
|
||||
//设置数据源
|
||||
private LayoutInflater inflater ;
|
||||
private List<StoreBean> storeBeans;
|
||||
|
||||
|
||||
private OnItemClickListener onItemClickListener;
|
||||
public void setOnItemClickListener(OnItemClickListener listener){
|
||||
this.onItemClickListener = listener;
|
||||
}
|
||||
|
||||
|
||||
//适配器的构造方法
|
||||
public AllStoresAdapter(List<StoreBean> storeBeans){
|
||||
this.storeBeans = storeBeans;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
inflater = LayoutInflater.from(parent.getContext());
|
||||
View view = inflater.inflate(R.layout.store_item,parent,false);
|
||||
final ViewHolder viewHolder = new ViewHolder(view);
|
||||
return viewHolder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
switch (storeBeans.get(position).getIv_store_pic()){
|
||||
case "0":
|
||||
holder.iv_store_pic.setImageResource(R.mipmap.store_1);
|
||||
break;
|
||||
case "1":
|
||||
holder.iv_store_pic.setImageResource(R.mipmap.store_2);
|
||||
break;
|
||||
case "2":
|
||||
holder.iv_store_pic.setImageResource(R.mipmap.store_3);
|
||||
break;
|
||||
case "3":
|
||||
holder.iv_store_pic.setImageResource(R.mipmap.store_4);
|
||||
break;
|
||||
case "4":
|
||||
holder.iv_store_pic.setImageResource(R.mipmap.store_5);
|
||||
break;
|
||||
case "5":
|
||||
holder.iv_store_pic.setImageResource(R.mipmap.store_6);
|
||||
break;
|
||||
case "6":
|
||||
holder.iv_store_pic.setImageResource(R.mipmap.store_7);
|
||||
break;
|
||||
case "7":
|
||||
holder.iv_store_pic.setImageResource(R.mipmap.store_8);
|
||||
break;
|
||||
case "8":
|
||||
holder.iv_store_pic.setImageResource(R.mipmap.store_9);
|
||||
break;
|
||||
case "9":
|
||||
holder.iv_store_pic.setImageResource(R.mipmap.store_10);
|
||||
break;
|
||||
}
|
||||
holder.tv_storeName.setText(storeBeans.get(position).getStoreName());
|
||||
holder.tv_storeScore.setText(storeBeans.get(position).getStoreScore()+"分");
|
||||
holder.tv_storeSell.setText(storeBeans.get(position).getStoreSell()+"份");
|
||||
holder.tv_storeSign.setText(storeBeans.get(position).getStoreSign());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return position;
|
||||
}
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return storeBeans.size();
|
||||
}
|
||||
|
||||
class ViewHolder extends RecyclerView.ViewHolder{
|
||||
|
||||
private ImageView iv_store_pic ;
|
||||
private TextView tv_storeName ;
|
||||
private TextView tv_storeScore ;
|
||||
private TextView tv_storeSell ;
|
||||
private TextView tv_storeSign;
|
||||
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
|
||||
//绑定控件
|
||||
iv_store_pic = itemView.findViewById(R.id.iv_store_pic);
|
||||
tv_storeName = itemView.findViewById(R.id.tv_storeName);
|
||||
tv_storeScore = itemView.findViewById(R.id.tv_store_score);
|
||||
tv_storeSell = itemView.findViewById(R.id.tv_store_sell);
|
||||
tv_storeSign = itemView.findViewById(R.id.tv_store_sign);
|
||||
|
||||
//实现item点击事件
|
||||
itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (onItemClickListener != null){
|
||||
onItemClickListener.onClick(view,getLayoutPosition(),storeBeans.get(getLayoutPosition()));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* RecycleView 的 点击事件 的 接口
|
||||
*/
|
||||
//item点击事件接口
|
||||
public interface OnItemClickListener {
|
||||
void onClick(View v, int position, StoreBean storeBean);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.example.shoppingmallsystem.adapter;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.IdRes;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.collection.SparseArrayCompat;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
public class BaseRecyclerHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
private SparseArrayCompat<View> mViews;
|
||||
public BaseRecyclerHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
mViews = new SparseArrayCompat<>();
|
||||
}
|
||||
|
||||
public <V extends View>V getView(@IdRes int ids){
|
||||
View v = mViews.get(ids);
|
||||
if (v == null){
|
||||
v = itemView.findViewById(ids);
|
||||
mViews.put(ids,v);
|
||||
}
|
||||
return (V) v;
|
||||
}
|
||||
}
|
@ -0,0 +1,131 @@
|
||||
package com.example.shoppingmallsystem.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.IntRange;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class BaseRecyclerViewAdater<T> extends RecyclerView.Adapter<BaseRecyclerHolder> {
|
||||
|
||||
private List<T> mData;
|
||||
public Context context;
|
||||
private List<Integer> resLayout;
|
||||
|
||||
public BaseRecyclerViewAdater(Context context , int resLayout){
|
||||
this.resLayout = new ArrayList<>();
|
||||
this.context = context;
|
||||
this.resLayout.add(resLayout);
|
||||
mData = new ArrayList<>();
|
||||
}
|
||||
|
||||
public BaseRecyclerViewAdater(Context context , int resLayout,List<T> data){
|
||||
this.resLayout = new ArrayList<>();
|
||||
this.context = context;
|
||||
this.resLayout.add(resLayout);
|
||||
mData = data;
|
||||
}
|
||||
|
||||
//需要重写getItemViewType方法自行给布局分类
|
||||
public BaseRecyclerViewAdater(Context context , List<Integer> resLayouts){
|
||||
this.context = context;
|
||||
this.resLayout = resLayouts;
|
||||
mData = new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
return super.getItemViewType(position);
|
||||
}
|
||||
|
||||
public List<T> getmData() {
|
||||
return mData;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public BaseRecyclerHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
final BaseRecyclerHolder holder = new BaseRecyclerHolder(LayoutInflater.from(context).inflate(resLayout.get(viewType), parent, false));
|
||||
if (null != mOnItemClickListener) {
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
mOnItemClickListener.onItemClick(v, holder.getAdapterPosition());
|
||||
}
|
||||
});
|
||||
}
|
||||
return holder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull BaseRecyclerHolder holder, int position) {
|
||||
convert(holder,position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mData.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* 需要重写的方法
|
||||
* @param holder
|
||||
* @param position
|
||||
*/
|
||||
public abstract void convert(BaseRecyclerHolder holder, int position);
|
||||
|
||||
|
||||
public void setData(List<T> items) {
|
||||
this.mData = items == null ? new ArrayList<T>() : items;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void addData(@IntRange(from = 0) int position, @NonNull T data) {
|
||||
mData.add(position, data);
|
||||
notifyItemInserted(position);
|
||||
compatibilityDataSizeChanged(1);
|
||||
}
|
||||
public void addData( @NonNull T data) {
|
||||
mData.add(data);
|
||||
notifyItemInserted(mData.size());
|
||||
}
|
||||
|
||||
|
||||
public void remove(int position) {
|
||||
mData.remove(position);
|
||||
int internalPosition = position;
|
||||
notifyItemRemoved(internalPosition);
|
||||
notifyItemRangeChanged(internalPosition, mData.size() - internalPosition);
|
||||
}
|
||||
|
||||
private void compatibilityDataSizeChanged(int size) {
|
||||
final int dataSize = mData == null ? 0 : mData.size();
|
||||
if (dataSize == size) {
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private OnItemClickListener mOnItemClickListener;
|
||||
public BaseRecyclerViewAdater setOnItemClickListener(OnItemClickListener listener) {
|
||||
this.mOnItemClickListener = listener;
|
||||
return this;
|
||||
}
|
||||
public interface OnItemClickListener {
|
||||
void onItemClick(View view, int position);
|
||||
}
|
||||
|
||||
private RecyclerView recyclerView;
|
||||
public void bindToRecyclerView(RecyclerView recyclerView){
|
||||
this.recyclerView = recyclerView;
|
||||
}
|
||||
|
||||
public RecyclerView getRecyclerView() {
|
||||
return recyclerView;
|
||||
}
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
package com.example.shoppingmallsystem.adapter;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentPagerAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* tab的适配器
|
||||
*/
|
||||
public class MyTabAdapter extends FragmentPagerAdapter {
|
||||
|
||||
private List<Fragment> fragments;
|
||||
String[] Title = new String[]{"点餐","讨论","商家"};
|
||||
|
||||
public MyTabAdapter(@NonNull FragmentManager fm, List<Fragment> fragments) {
|
||||
super(fm);
|
||||
this.fragments = fragments;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Fragment getItem(int position) {
|
||||
return fragments.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
/**
|
||||
* //此方法用来显示tab上的名字
|
||||
* @param position
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public CharSequence getPageTitle(int position) {
|
||||
return Title[position];
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
package com.example.shoppingmallsystem.adapter;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.example.shoppingmallsystem.R;
|
||||
import com.example.shoppingmallsystem.activity.OrderDetailsActivity;
|
||||
import com.example.shoppingmallsystem.bean.OrderBean;
|
||||
import com.example.shoppingmallsystem.util.AppContext;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 订单界面的适配器
|
||||
*/
|
||||
public class OrderAdapter extends RecyclerView.Adapter<OrderAdapter.ViewHolder>{
|
||||
|
||||
private LayoutInflater inflater ;
|
||||
private List<OrderBean> data ;
|
||||
|
||||
public OrderAdapter (List<OrderBean> data){
|
||||
this.data = data ;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
inflater = LayoutInflater.from(parent.getContext());
|
||||
View view = inflater.inflate(R.layout.order_item,parent,false);
|
||||
final ViewHolder viewHolder = new ViewHolder(view);
|
||||
return viewHolder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
holder.tv_time.setText(data.get(position).getTime());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return data.size();
|
||||
}
|
||||
|
||||
class ViewHolder extends RecyclerView.ViewHolder{
|
||||
|
||||
private TextView tv_time ;
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
tv_time = itemView.findViewById(R.id.tv_orderTime);
|
||||
|
||||
//设置点击事件点击后跳转订单详情界面
|
||||
tv_time.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
AppContext.getInstance().startActivity(new Intent(AppContext.getInstance(), OrderDetailsActivity.class)
|
||||
.putExtra("orderDetails",data.get(getLayoutPosition()))
|
||||
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK ));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,97 @@
|
||||
package com.example.shoppingmallsystem.adapter;
|
||||
|
||||
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.recyclerview.widget.RecyclerView;
|
||||
import com.example.shoppingmallsystem.R;
|
||||
import com.example.shoppingmallsystem.bean.GoodsArrayBean;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 付款界面recyclerView的适配器
|
||||
*/
|
||||
public class PayRVAdapter extends RecyclerView.Adapter<PayRVAdapter.ViewHolder> {
|
||||
|
||||
//设置数据源
|
||||
private LayoutInflater inflater ;
|
||||
private List<GoodsArrayBean.ItemR> data;
|
||||
|
||||
//适配器的构造方法
|
||||
public PayRVAdapter(List<GoodsArrayBean.ItemR> data){
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
inflater = LayoutInflater.from(parent.getContext());
|
||||
View view = inflater.inflate(R.layout.pay_order_goods_item,parent,false);
|
||||
final ViewHolder viewHolder = new ViewHolder(view);
|
||||
return viewHolder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
switch (data.get(position).getPicNumb()){
|
||||
case "0":
|
||||
holder.iv_pic.setImageResource(R.drawable.goods_1);
|
||||
break;
|
||||
case "1":
|
||||
holder.iv_pic.setImageResource(R.drawable.goods_2);
|
||||
break;
|
||||
case "2":
|
||||
holder.iv_pic.setImageResource(R.drawable.goods_3);
|
||||
break;
|
||||
case "3":
|
||||
holder.iv_pic.setImageResource(R.drawable.goods_4);
|
||||
break;
|
||||
case "4":
|
||||
holder.iv_pic.setImageResource(R.drawable.goods_5);
|
||||
break;
|
||||
case "5":
|
||||
holder.iv_pic.setImageResource(R.drawable.goods_6);
|
||||
break;
|
||||
case "6":
|
||||
holder.iv_pic.setImageResource(R.drawable.goods_7);
|
||||
break;
|
||||
case "7":
|
||||
holder.iv_pic.setImageResource(R.drawable.goods_8);
|
||||
break;
|
||||
case "8":
|
||||
holder.iv_pic.setImageResource(R.drawable.goods_9);
|
||||
break;
|
||||
case "9":
|
||||
holder.iv_pic.setImageResource(R.drawable.goods_10);
|
||||
break;
|
||||
}
|
||||
holder.tv_name.setText(data.get(position).getName());
|
||||
holder.tv_price.setText(data.get(position).getPrice());
|
||||
holder.tv_number.setText("X "+data.get(position).getNumber());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return data.size();
|
||||
}
|
||||
|
||||
|
||||
class ViewHolder extends RecyclerView.ViewHolder{
|
||||
|
||||
|
||||
private ImageView iv_pic;
|
||||
private TextView tv_name ;
|
||||
private TextView tv_price ;
|
||||
private TextView tv_number ;
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
iv_pic = itemView.findViewById(R.id.iv_pay_goods);
|
||||
tv_name = itemView.findViewById(R.id.tv_pay_Name);
|
||||
tv_price = itemView.findViewById(R.id.tv_pay_Price);
|
||||
tv_number = itemView.findViewById(R.id.tv_pay_number);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,80 @@
|
||||
package com.example.shoppingmallsystem.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* 评论信息bean
|
||||
*/
|
||||
public class ChatMessageBean implements Serializable {
|
||||
|
||||
private int id ;
|
||||
private String img_id;
|
||||
private String message;
|
||||
private String userName;
|
||||
private String time;
|
||||
|
||||
|
||||
public ChatMessageBean(int id, String img_id, String message, String userName, String time) {
|
||||
this.id = id;
|
||||
this.img_id = img_id;
|
||||
this.message = message;
|
||||
this.userName = userName;
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public ChatMessageBean() {
|
||||
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getImg_id() {
|
||||
return img_id;
|
||||
}
|
||||
|
||||
public void setImg_id(String img_id) {
|
||||
this.img_id = img_id;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setTime(String time) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ChatMessageBean{" +
|
||||
"id=" + id +
|
||||
", img_id='" + img_id + '\'' +
|
||||
", message='" + message + '\'' +
|
||||
", userName='" + userName + '\'' +
|
||||
", time='" + time + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,133 @@
|
||||
package com.example.shoppingmallsystem.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 商家商品信息bean
|
||||
*/
|
||||
public class GoodsArrayBean implements Serializable {
|
||||
|
||||
public List<ItemL> itemsLeft;
|
||||
public List<ItemR> itemsRight;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "GoodsArrayBean{" +
|
||||
"itemsLeft=" + itemsLeft +
|
||||
", itemsRight=" + itemsRight +
|
||||
'}';
|
||||
}
|
||||
|
||||
public static class ItemL{
|
||||
private String title;
|
||||
|
||||
public ItemL(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public ItemL() {
|
||||
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ItemL{" +
|
||||
"title='" + title + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class ItemR implements Serializable{
|
||||
private String title;
|
||||
private String picNumb;
|
||||
private String name;
|
||||
private String price;
|
||||
private String content;
|
||||
private int number = 0;
|
||||
|
||||
public ItemR() {
|
||||
|
||||
}
|
||||
|
||||
public ItemR(String title, String picNumb, String name, String price, String content, int number) {
|
||||
this.title = title;
|
||||
this.picNumb = picNumb;
|
||||
this.name = name;
|
||||
this.price = price;
|
||||
this.content = content;
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getPicNumb() {
|
||||
return picNumb;
|
||||
}
|
||||
|
||||
public void setPicNumb(String picNumb) {
|
||||
this.picNumb = picNumb;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(String price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public int getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
public void setNumber(int number) {
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ItemR{" +
|
||||
"title='" + title + '\'' +
|
||||
", picNumb='" + picNumb + '\'' +
|
||||
", name='" + name + '\'' +
|
||||
", price='" + price + '\'' +
|
||||
", content='" + content + '\'' +
|
||||
", number=" + number +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
package com.example.shoppingmallsystem.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* 订单信息bean
|
||||
*/
|
||||
public class OrderBean implements Serializable {
|
||||
|
||||
private String userName ;
|
||||
private String time ;
|
||||
private String goodsJson ;
|
||||
|
||||
public OrderBean(String userName, String time, String goodsJson) {
|
||||
this.userName = userName;
|
||||
this.time = time;
|
||||
this.goodsJson = goodsJson;
|
||||
}
|
||||
|
||||
public OrderBean() {
|
||||
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setTime(String time) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public String getGoodsJson() {
|
||||
return goodsJson;
|
||||
}
|
||||
|
||||
public void setGoodsJson(String goodsJson) {
|
||||
this.goodsJson = goodsJson;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OrderBean{" +
|
||||
"userName='" + userName + '\'' +
|
||||
", time='" + time + '\'' +
|
||||
", goodsJson='" + goodsJson + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,101 @@
|
||||
package com.example.shoppingmallsystem.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* 商家信息bean
|
||||
*/
|
||||
public class StoreBean implements Serializable {
|
||||
|
||||
private String ID;
|
||||
private String iv_store_pic;
|
||||
private String storeName;
|
||||
private String storeScore;
|
||||
private String storeSell;
|
||||
private String storeSign;
|
||||
private String storeIntro;
|
||||
|
||||
public StoreBean(String ID, String iv_store_pic, String storeName, String storeScore, String storeSell, String storeSign, String storeIntro) {
|
||||
this.ID = ID;
|
||||
this.iv_store_pic = iv_store_pic;
|
||||
this.storeName = storeName;
|
||||
this.storeScore = storeScore;
|
||||
this.storeSell = storeSell;
|
||||
this.storeSign = storeSign;
|
||||
this.storeIntro = storeIntro;
|
||||
}
|
||||
|
||||
public StoreBean() {
|
||||
|
||||
}
|
||||
|
||||
public String getID() {
|
||||
return ID;
|
||||
}
|
||||
|
||||
public void setID(String ID) {
|
||||
this.ID = ID;
|
||||
}
|
||||
|
||||
public String getIv_store_pic() {
|
||||
return iv_store_pic;
|
||||
}
|
||||
|
||||
public void setIv_store_pic(String iv_store_pic) {
|
||||
this.iv_store_pic = iv_store_pic;
|
||||
}
|
||||
|
||||
public String getStoreName() {
|
||||
return storeName;
|
||||
}
|
||||
|
||||
public void setStoreName(String storeName) {
|
||||
this.storeName = storeName;
|
||||
}
|
||||
|
||||
public String getStoreScore() {
|
||||
return storeScore;
|
||||
}
|
||||
|
||||
public void setStoreScore(String storeScore) {
|
||||
this.storeScore = storeScore;
|
||||
}
|
||||
|
||||
public String getStoreSell() {
|
||||
return storeSell;
|
||||
}
|
||||
|
||||
public void setStoreSell(String storeSell) {
|
||||
this.storeSell = storeSell;
|
||||
}
|
||||
|
||||
public String getStoreSign() {
|
||||
return storeSign;
|
||||
}
|
||||
|
||||
public void setStoreSign(String storeSign) {
|
||||
this.storeSign = storeSign;
|
||||
}
|
||||
|
||||
public String getStoreIntro() {
|
||||
return storeIntro;
|
||||
}
|
||||
|
||||
public void setStoreIntro(String storeIntro) {
|
||||
this.storeIntro = storeIntro;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StoreBean{" +
|
||||
"ID='" + ID + '\'' +
|
||||
", iv_store_pic='" + iv_store_pic + '\'' +
|
||||
", storeName='" + storeName + '\'' +
|
||||
", storeScore='" + storeScore + '\'' +
|
||||
", storeSell='" + storeSell + '\'' +
|
||||
", storeSign='" + storeSign + '\'' +
|
||||
", storeIntro='" + storeIntro + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,109 @@
|
||||
package com.example.shoppingmallsystem.bean;
|
||||
|
||||
/**
|
||||
* 用户信息的bean
|
||||
*/
|
||||
public class Userinfo {
|
||||
private int id ;
|
||||
private String userName;
|
||||
private String password;
|
||||
private String nickName;
|
||||
private String phoneNumb;
|
||||
private String schoolName;
|
||||
private String apartmentNumb;
|
||||
private double money;
|
||||
|
||||
|
||||
public Userinfo(){
|
||||
|
||||
}
|
||||
|
||||
public Userinfo(int id, String userName, String password, String nickName, String phoneNumb, String schoolName, String apartmentNumb, double money) {
|
||||
this.id = id;
|
||||
this.userName = userName;
|
||||
this.password = password;
|
||||
this.nickName = nickName;
|
||||
this.phoneNumb = phoneNumb;
|
||||
this.schoolName = schoolName;
|
||||
this.apartmentNumb = apartmentNumb;
|
||||
this.money = money;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int 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 getNickName() {
|
||||
return nickName;
|
||||
}
|
||||
|
||||
public void setNickName(String nickName) {
|
||||
this.nickName = nickName;
|
||||
}
|
||||
|
||||
public String getPhoneNumb() {
|
||||
return phoneNumb;
|
||||
}
|
||||
|
||||
public void setPhoneNumb(String phoneNumb) {
|
||||
this.phoneNumb = phoneNumb;
|
||||
}
|
||||
|
||||
public String getSchoolName() {
|
||||
return schoolName;
|
||||
}
|
||||
|
||||
public void setSchoolName(String schoolName) {
|
||||
this.schoolName = schoolName;
|
||||
}
|
||||
|
||||
public String getApartmentNumb() {
|
||||
return apartmentNumb;
|
||||
}
|
||||
|
||||
public void setApartmentNumb(String apartmentNumb) {
|
||||
this.apartmentNumb = apartmentNumb;
|
||||
}
|
||||
|
||||
public double getMoney() {
|
||||
return money;
|
||||
}
|
||||
|
||||
public void setMoney(double money) {
|
||||
this.money = money;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Userinfo{" +
|
||||
"id=" + id +
|
||||
", userName='" + userName + '\'' +
|
||||
", password='" + password + '\'' +
|
||||
", nickName='" + nickName + '\'' +
|
||||
", phoneNumb='" + phoneNumb + '\'' +
|
||||
", schoolName='" + schoolName + '\'' +
|
||||
", apartmentNumb='" + apartmentNumb + '\'' +
|
||||
", money=" + money +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
package com.example.shoppingmallsystem.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
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 androidx.fragment.app.Fragment;
|
||||
|
||||
import com.example.shoppingmallsystem.R;
|
||||
import com.example.shoppingmallsystem.bean.StoreBean;
|
||||
|
||||
/**
|
||||
* 商家信息fragment
|
||||
*/
|
||||
public class StoreIntroFragment extends Fragment {
|
||||
|
||||
private StoreBean storeBean;
|
||||
private ImageView iv_store_pic ;
|
||||
private TextView tv_storeName ;
|
||||
private TextView tv_storeScore ;
|
||||
private TextView tv_storeSell ;
|
||||
private TextView tv_storeSign;
|
||||
private TextView tv_storeIntro;
|
||||
|
||||
public StoreIntroFragment(StoreBean storeBean){
|
||||
this.storeBean = storeBean;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.fragment_store_intro,container,false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
initData();
|
||||
initView();
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
iv_store_pic = getActivity().findViewById(R.id.iv_store_frag);
|
||||
tv_storeName = getActivity().findViewById(R.id.tv_storeName_frag);
|
||||
tv_storeScore = getActivity().findViewById(R.id.tv_store_score_frag);
|
||||
tv_storeSell = getActivity().findViewById(R.id.tv_store_sell_frag);
|
||||
tv_storeSign = getActivity().findViewById(R.id.tv_store_sign_frag);
|
||||
tv_storeIntro = getActivity().findViewById(R.id.tv_store_intro);
|
||||
|
||||
|
||||
switch (storeBean.getIv_store_pic()){
|
||||
case "0":
|
||||
iv_store_pic.setImageResource(R.mipmap.store_1);
|
||||
break;
|
||||
case "1":
|
||||
iv_store_pic.setImageResource(R.mipmap.store_2);
|
||||
break;
|
||||
case "2":
|
||||
iv_store_pic.setImageResource(R.mipmap.store_3);
|
||||
break;
|
||||
case "3":
|
||||
iv_store_pic.setImageResource(R.mipmap.store_4);
|
||||
break;
|
||||
case "4":
|
||||
iv_store_pic.setImageResource(R.mipmap.store_5);
|
||||
break;
|
||||
case "5":
|
||||
iv_store_pic.setImageResource(R.mipmap.store_6);
|
||||
break;
|
||||
case "6":
|
||||
iv_store_pic.setImageResource(R.mipmap.store_7);
|
||||
break;
|
||||
case "7":
|
||||
iv_store_pic.setImageResource(R.mipmap.store_8);
|
||||
break;
|
||||
case "8":
|
||||
iv_store_pic.setImageResource(R.mipmap.store_9);
|
||||
break;
|
||||
case "9":
|
||||
iv_store_pic.setImageResource(R.mipmap.store_10);
|
||||
break;
|
||||
}
|
||||
tv_storeName.setText(storeBean.getStoreName());
|
||||
tv_storeScore.setText(storeBean.getStoreScore()+"分");
|
||||
tv_storeSell.setText(storeBean.getStoreSell()+"份");
|
||||
tv_storeSign.setText(storeBean.getStoreSign());
|
||||
tv_storeIntro.setText(storeBean.getStoreIntro());
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.example.shoppingmallsystem.util;
|
||||
|
||||
import android.app.Application;
|
||||
|
||||
public class AppContext extends Application {
|
||||
//建立一个静态私有变量用于存储上下文实例
|
||||
private static AppContext instance;
|
||||
|
||||
//建立一个静态方法,用于返回所需要的上下文实例
|
||||
public static AppContext getInstance(){
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
//将应用程序本身的上下文实例赋值给instance变量
|
||||
this.instance = AppContext.this;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.example.shoppingmallsystem.util;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
|
||||
public class CustomDialog extends Dialog {
|
||||
IBeforeDismiss iBeforeDismiss;
|
||||
|
||||
public CustomDialog(Context context, int themeResId) {
|
||||
super(context, themeResId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dismiss(){
|
||||
iBeforeDismiss.onBeforeDismiss();
|
||||
}
|
||||
|
||||
// 真正让dialog消失
|
||||
public void myDismiss() {
|
||||
super.dismiss();// dialog消失
|
||||
}
|
||||
|
||||
// dismiss前执行
|
||||
interface IBeforeDismiss {
|
||||
void onBeforeDismiss();
|
||||
}
|
||||
|
||||
public void setBeforeDismiss(IBeforeDismiss iBeforeDismiss) {
|
||||
this.iBeforeDismiss = iBeforeDismiss;
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package com.example.shoppingmallsystem.util;
|
||||
|
||||
import java.text.ParsePosition;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
public class DateUtill {
|
||||
|
||||
//获取当前系统时间
|
||||
public static String getCurrentTime(){
|
||||
String time = "";
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Date date = new Date(System.currentTimeMillis());
|
||||
time = simpleDateFormat.format(date);
|
||||
//Log.e("Tag","当前的时间:" + time);
|
||||
return time;
|
||||
}
|
||||
|
||||
public static Date stringToDate(String dateString){
|
||||
ParsePosition position = new ParsePosition(0);
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Date date = simpleDateFormat.parse(dateString,position);
|
||||
return date;
|
||||
}
|
||||
|
||||
|
||||
//拿到七天后的时间
|
||||
public static String getAfterSevenDayTime(){
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy.MM.dd HH:mm");
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.set(Calendar.SECOND,calendar.get(Calendar.SECOND)+ 604800);
|
||||
String afterSevenDay = simpleDateFormat.format(calendar.getTime());
|
||||
//Log.e("Tag","七天后的时间:" + afterSevenDay);
|
||||
return afterSevenDay;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.example.shoppingmallsystem.util;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.TypedValue;
|
||||
|
||||
|
||||
/**
|
||||
* 尺寸转换工具类
|
||||
*/
|
||||
public class DensityUtil {
|
||||
|
||||
private DensityUtil() {
|
||||
throw new UnsupportedOperationException("cannot be instantiated");
|
||||
}
|
||||
|
||||
/**
|
||||
* dp转px
|
||||
*/
|
||||
public static int dp2px(Context context, float dpVal) {
|
||||
return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
|
||||
dpVal, context.getResources().getDisplayMetrics());
|
||||
}
|
||||
|
||||
/**
|
||||
* sp转px
|
||||
*/
|
||||
public static int sp2px(Context context, float spVal) {
|
||||
return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP,
|
||||
spVal, context.getResources().getDisplayMetrics());
|
||||
}
|
||||
|
||||
/**
|
||||
* px转dp
|
||||
*/
|
||||
public static float px2dp(Context context, float pxVal) {
|
||||
final float scale = context.getResources().getDisplayMetrics().density;
|
||||
return (pxVal / scale);
|
||||
}
|
||||
|
||||
/**
|
||||
* px转sp
|
||||
*/
|
||||
public static float px2sp(Context context, float pxVal) {
|
||||
return (pxVal / context.getResources().getDisplayMetrics().scaledDensity);
|
||||
}
|
||||
}
|
@ -0,0 +1,199 @@
|
||||
package com.example.shoppingmallsystem.util;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.os.Parcelable;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.TranslateAnimation;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.DefaultItemAnimator;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.recyclerview.widget.SimpleItemAnimator;
|
||||
|
||||
import com.example.shoppingmallsystem.R;
|
||||
import com.example.shoppingmallsystem.activity.PayActivity;
|
||||
import com.example.shoppingmallsystem.adapter.ShoppongCarGoodsAdapter;
|
||||
import com.example.shoppingmallsystem.bean.GoodsArrayBean;
|
||||
import com.example.shoppingmallsystem.fragment.StoreGoodsFragment;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class MyDialog {
|
||||
private static CustomDialog dialog;
|
||||
private View view; // dialog布局
|
||||
private View animView; // 商品菜单布局
|
||||
private View dismissView; // 半透明遮罩布局
|
||||
private RelativeLayout re_bottow ;
|
||||
private RecyclerView recyclerView_carGoods;
|
||||
private TextView tv_clean ;
|
||||
private TextView tv_DoShopping;
|
||||
private ImageView iv_shoppingCar ;
|
||||
private Context context;
|
||||
private ShoppongCarGoodsAdapter shoppongCarGoodsAdapter;
|
||||
public static TextView tv_total;
|
||||
public static double total = 0;
|
||||
private Intent intent ;
|
||||
|
||||
|
||||
public static Handler handler = new Handler(){
|
||||
@Override
|
||||
public void handleMessage(@NonNull Message msg) {
|
||||
switch (msg.what){
|
||||
case 1:
|
||||
dialog.dismiss();
|
||||
break;
|
||||
case 2:
|
||||
for (int i = 0;i< StoreGoodsFragment.goodsArrayBean.itemsRight.size() ;i++){
|
||||
StoreGoodsFragment.goodsArrayBean.itemsRight.get(i).setNumber(0);
|
||||
}
|
||||
StoreGoodsFragment.handler.sendEmptyMessage(1);
|
||||
dialog.dismiss();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
public MyDialog(final Context context, final List<GoodsArrayBean.ItemR> dialogData) {
|
||||
this.context = context;
|
||||
dialog = new CustomDialog(context, R.style.myDialog);
|
||||
// dialog的样式
|
||||
view = LayoutInflater.from(context).inflate(R.layout.shoppcar_dialog, null);
|
||||
//拿到dialog里的控件
|
||||
animView = view.findViewById(R.id.v_anim);
|
||||
re_bottow = view.findViewById(R.id.rl);
|
||||
tv_clean = view.findViewById(R.id.tv_car_clean);
|
||||
recyclerView_carGoods = view.findViewById(R.id.re_shoppingGoods);
|
||||
tv_DoShopping = view.findViewById(R.id.tv_DoShopping);
|
||||
iv_shoppingCar = view.findViewById(R.id.iv_shoppingCar);
|
||||
tv_total =view.findViewById(R.id.tv_total_dialog);
|
||||
|
||||
total = StoreGoodsFragment.total;
|
||||
tv_total.setText("¥ "+StoreGoodsFragment.total);
|
||||
iv_shoppingCar.setImageResource(R.drawable.shoppingcar_full_64);
|
||||
tv_DoShopping.setText("去结算");
|
||||
//初始化recyclerView
|
||||
recyclerView_carGoods.setItemAnimator(null);
|
||||
shoppongCarGoodsAdapter = new ShoppongCarGoodsAdapter(dialogData);
|
||||
recyclerView_carGoods.setLayoutManager(new LinearLayoutManager(AppContext.getInstance()));
|
||||
recyclerView_carGoods.setAdapter(shoppongCarGoodsAdapter);
|
||||
|
||||
|
||||
dialog.setContentView(view);
|
||||
|
||||
dismissView = view.findViewById(R.id.v_dimiss);
|
||||
dismissView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
re_bottow.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
tv_DoShopping.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
intent = new Intent();
|
||||
intent.setClass(context, PayActivity.class);
|
||||
intent.putExtra("PayList",(Serializable) dialogData);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
});
|
||||
|
||||
tv_clean.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
dialogData.clear();
|
||||
shoppongCarGoodsAdapter.notifyDataSetChanged();
|
||||
for (int i = 0;i< StoreGoodsFragment.goodsArrayBean.itemsRight.size() ;i++){
|
||||
StoreGoodsFragment.goodsArrayBean.itemsRight.get(i).setNumber(0);
|
||||
}
|
||||
StoreGoodsFragment.handler.sendEmptyMessage(1);
|
||||
dialog.dismiss();
|
||||
ToastUtil.showShort("购物车已清空");
|
||||
}
|
||||
});
|
||||
|
||||
dialog.setBeforeDismiss(new CustomDialog.IBeforeDismiss() {
|
||||
@Override
|
||||
public void onBeforeDismiss() {
|
||||
dismissAnim();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// 设置dialog的位置
|
||||
Window dialogWindow = dialog.getWindow();
|
||||
dialogWindow.getDecorView().setPadding(0, 0, 0, 0);
|
||||
dialogWindow.setBackgroundDrawableResource(android.R.color.transparent);//背景透明,不然会有个白色的东东
|
||||
// dialogWindow.setWindowAnimations(R.style.dialogWindowAnim); //不使用窗口弹出动画
|
||||
WindowManager.LayoutParams lp = dialogWindow.getAttributes();
|
||||
|
||||
lp.width = WindowManager.LayoutParams.MATCH_PARENT; // 宽度
|
||||
lp.height = WindowManager.LayoutParams.MATCH_PARENT; // 高度
|
||||
dialogWindow.setAttributes(lp);
|
||||
// 设置dialog为底部
|
||||
dialogWindow.setGravity(Gravity.BOTTOM);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public void show() {
|
||||
dialog.show();
|
||||
showAnim();
|
||||
}
|
||||
|
||||
// 出现动画
|
||||
private void showAnim() {
|
||||
TranslateAnimation animation = new TranslateAnimation(0, 0, DensityUtil.dp2px(context, 300), 0);
|
||||
animation.setDuration(300);
|
||||
animView.startAnimation(animation);
|
||||
}
|
||||
|
||||
// 消失动画
|
||||
private void dismissAnim() {
|
||||
TranslateAnimation animation = new TranslateAnimation(0, 0, 0, DensityUtil.dp2px(context, 300));
|
||||
animation.setAnimationListener(new Animation.AnimationListener() {
|
||||
@Override
|
||||
public void onAnimationStart(Animation animation) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationEnd(Animation animation) {
|
||||
dialog.myDismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationRepeat(Animation animation) {
|
||||
|
||||
}
|
||||
});
|
||||
animation.setDuration(300);
|
||||
animView.startAnimation(animation);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,118 @@
|
||||
package com.example.shoppingmallsystem.util;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.TranslateAnimation;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.shoppingmallsystem.R;
|
||||
import com.example.shoppingmallsystem.adapter.ShoppongCarGoodsAdapter;
|
||||
import com.jungly.gridpasswordview.GridPasswordView;
|
||||
|
||||
public class PayDialog {
|
||||
|
||||
private static CustomDialog dialog;
|
||||
private View view; // dialog布局
|
||||
private GridPasswordView gridPasswordView ;
|
||||
private RelativeLayout re_bottow ;
|
||||
private RecyclerView recyclerView_carGoods;
|
||||
private TextView tv_clean ;
|
||||
private TextView tv_DoShopping;
|
||||
private ImageView iv_shoppingCar ;
|
||||
private Context context;
|
||||
private ShoppongCarGoodsAdapter shoppongCarGoodsAdapter;
|
||||
public static TextView tv_total;
|
||||
public static double total = 0;
|
||||
|
||||
public PayDialog(Context context) {
|
||||
this.context = context;
|
||||
dialog = new CustomDialog(context, R.style.PayDialog);
|
||||
// dialog的样式
|
||||
view = LayoutInflater.from(context).inflate(R.layout.pay_dialog, null);
|
||||
//拿到dialog里的控件
|
||||
gridPasswordView = view.findViewById(R.id.my_passwordView);
|
||||
|
||||
//设置输入密码监听
|
||||
gridPasswordView.setOnPasswordChangedListener(new GridPasswordView.OnPasswordChangedListener() {
|
||||
//正在输入密码时执行此方法
|
||||
public void onTextChanged(String psw) {
|
||||
//tv.setText("正在输入密码...");
|
||||
}
|
||||
//输入密码完成时执行此方法
|
||||
public void onInputFinish(String psw) {
|
||||
Log.e("你输入的密码为",psw);
|
||||
}
|
||||
});
|
||||
|
||||
dialog.setBeforeDismiss(new CustomDialog.IBeforeDismiss() {
|
||||
@Override
|
||||
public void onBeforeDismiss() {
|
||||
dismissAnim();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// 设置dialog的位置
|
||||
Window dialogWindow = dialog.getWindow();
|
||||
dialogWindow.getDecorView().setPadding(0, 0, 0, 0);
|
||||
dialogWindow.setBackgroundDrawableResource(android.R.color.transparent);//背景透明,不然会有个白色的东东
|
||||
// dialogWindow.setWindowAnimations(R.style.dialogWindowAnim); //不使用窗口弹出动画
|
||||
WindowManager.LayoutParams lp = dialogWindow.getAttributes();
|
||||
|
||||
lp.width = WindowManager.LayoutParams.MATCH_PARENT; // 宽度
|
||||
lp.height = WindowManager.LayoutParams.MATCH_PARENT; // 高度
|
||||
dialogWindow.setAttributes(lp);
|
||||
// 设置dialog为底部
|
||||
dialogWindow.setGravity(Gravity.BOTTOM);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public void show() {
|
||||
dialog.show();
|
||||
showAnim();
|
||||
}
|
||||
|
||||
// 出现动画
|
||||
private void showAnim() {
|
||||
TranslateAnimation animation = new TranslateAnimation(0, 0, DensityUtil.dp2px(context, 300), 0);
|
||||
animation.setDuration(300);
|
||||
}
|
||||
|
||||
// 消失动画
|
||||
private void dismissAnim() {
|
||||
TranslateAnimation animation = new TranslateAnimation(0, 0, 0, DensityUtil.dp2px(context, 300));
|
||||
animation.setAnimationListener(new Animation.AnimationListener() {
|
||||
@Override
|
||||
public void onAnimationStart(Animation animation) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationEnd(Animation animation) {
|
||||
dialog.myDismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationRepeat(Animation animation) {
|
||||
|
||||
}
|
||||
});
|
||||
animation.setDuration(300);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package com.example.shoppingmallsystem.util;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
|
||||
public class ShareUtils {
|
||||
static SharedPreferences preferences = AppContext.getInstance().getSharedPreferences("data", Context.MODE_PRIVATE);
|
||||
static SharedPreferences.Editor editor = preferences.edit();
|
||||
|
||||
/**
|
||||
* 从SharedPreferences保存的文件中获取是否自动登录
|
||||
*/
|
||||
public static String getAuto_Login() {
|
||||
return preferences.getString("AUTO_LOGIN", "");
|
||||
}
|
||||
|
||||
/**
|
||||
* 从SharedPreferences保存的文件中获取是否自动登录
|
||||
*/
|
||||
public static void putAuto_Login( String tag) {
|
||||
editor.putString("AUTO_LOGIN", tag);
|
||||
editor.commit();
|
||||
}
|
||||
|
||||
/**
|
||||
* 从SharedPreferences保存的文件中获取是否记住密码
|
||||
*/
|
||||
public static String getRember() {
|
||||
return preferences.getString("Rember", "");
|
||||
}
|
||||
|
||||
/**
|
||||
* 从SharedPreferences保存的文件中获取否记住密码
|
||||
*/
|
||||
public static void putRember( String isRember) {
|
||||
editor.putString("Rember", isRember);
|
||||
editor.commit();
|
||||
}
|
||||
|
||||
/**
|
||||
* 向SharedPreferences存储用户名
|
||||
*/
|
||||
public static void putUserName(String username) {
|
||||
editor.putString("UserName", username);
|
||||
editor.commit();
|
||||
}
|
||||
/**
|
||||
* 从SharedPreferences取出用户名
|
||||
*/
|
||||
public static String getUserName() {
|
||||
return preferences.getString("UserName", "");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 向SharedPreferences存储密码
|
||||
*/
|
||||
public static void putPassword(String password) {
|
||||
editor.putString("Password", password);
|
||||
editor.commit();
|
||||
}
|
||||
/**
|
||||
* 从SharedPreferences取出密码
|
||||
*/
|
||||
public static String getPassword() {
|
||||
return preferences.getString("Password", "");
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.example.shoppingmallsystem.util;
|
||||
|
||||
import android.widget.Toast;
|
||||
|
||||
public class ToastUtil {
|
||||
private ToastUtil() {
|
||||
/* cannot be instantiated */
|
||||
throw new UnsupportedOperationException("cannot be instantiated");
|
||||
}
|
||||
|
||||
/**
|
||||
* 短时间显示Toast
|
||||
*
|
||||
* @param message
|
||||
*/
|
||||
public static void showShort( String message)
|
||||
{
|
||||
Toast.makeText(AppContext.getInstance(), message, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
/**
|
||||
* 长时间显示Toast
|
||||
*
|
||||
* @param message
|
||||
*/
|
||||
public static void showLong( String message)
|
||||
{
|
||||
Toast.makeText(AppContext.getInstance(), message, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
After Width: | Height: | Size: 566 B |
After Width: | Height: | Size: 713 B |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 9.9 KiB |
After Width: | Height: | Size: 9.5 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 8.7 KiB |
After Width: | Height: | Size: 8.8 KiB |
After Width: | Height: | Size: 9.3 KiB |
After Width: | Height: | Size: 11 KiB |
@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 652 B |
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/white"/>
|
||||
|
||||
<corners android:radius="20dp"/>
|
||||
|
||||
<stroke android:width="5dp" android:color="@color/card_bg_green"/>
|
||||
|
||||
|
||||
</shape>
|
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.7 KiB |
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<solid android:color="#E6B287"/>
|
||||
|
||||
<corners android:radius="10dp"/>
|
||||
|
||||
</shape>
|
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<solid android:color="#668AC8"/>
|
||||
|
||||
<corners android:radius="90dp"/>
|
||||
|
||||
</shape>
|
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.3 KiB |
@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context=".activity.HomeAllStoresActivity">
|
||||
|
||||
<include layout="@layout/mytoolbar" />
|
||||
|
||||
<androidx.drawerlayout.widget.DrawerLayout
|
||||
android:id="@+id/drawer_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_stores"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
<com.google.android.material.navigation.NavigationView
|
||||
android:id="@+id/navigation_view"
|
||||
android:layout_width="240dp"
|
||||
android:layout_height="match_parent"
|
||||
app:menu="@menu/navigation"
|
||||
app:itemIconTint="#98061D"
|
||||
android:layout_gravity="start"
|
||||
app:headerLayout="@layout/header">
|
||||
</com.google.android.material.navigation.NavigationView>
|
||||
|
||||
|
||||
</androidx.drawerlayout.widget.DrawerLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
@ -0,0 +1,208 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".MainActivity"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="购物商城系统"
|
||||
android:textStyle="bold"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="50dp"
|
||||
android:textSize="40dp"
|
||||
android:textColor="#000000"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="180dp"
|
||||
android:background="@drawable/login_bg"
|
||||
/>
|
||||
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginTop="30dp"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
>
|
||||
<TextView
|
||||
android:id="@+id/textView1"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:text="用户名"
|
||||
android:layout_marginLeft="40dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="25dp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_username"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:textColor="#000000"
|
||||
android:hint="请输入用户名" />
|
||||
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center">
|
||||
<TextView
|
||||
android:id="@+id/textView2"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:layout_marginLeft="40dp"
|
||||
android:text="密 码"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="25dp" />
|
||||
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_password"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#000000"
|
||||
android:inputType="textPassword"
|
||||
android:layout_gravity="center"
|
||||
android:hint="请输入密码" />
|
||||
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp">
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
/>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/remenberpw"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="记住密码"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="center"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/autologin"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="自动登录"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
>
|
||||
|
||||
<Button
|
||||
android:layout_weight="1"
|
||||
android:id="@+id/M_login"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="登录"
|
||||
android:layout_gravity="center"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="30sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_weight="1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
|
||||
<Button
|
||||
android:layout_weight="1"
|
||||
android:id="@+id/M_register"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="注册"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="30sp" />
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
@ -0,0 +1,213 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".activity.MyAccountActivity">
|
||||
|
||||
<include layout="@layout/mytoolbar"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/re_userName"
|
||||
android:layout_marginTop="100dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:text="用户名"
|
||||
android:textColor="@color/black"
|
||||
android:layout_gravity="center"
|
||||
android:textSize="20dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_username_acc"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:gravity="right"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20dp" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/re_money"
|
||||
android:layout_below="@+id/re_userName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:text="余额"
|
||||
android:textColor="@color/black"
|
||||
android:layout_gravity="center"
|
||||
android:textSize="20dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_money"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:gravity="right"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20dp" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/re_phoneNumb"
|
||||
android:layout_below="@+id/re_money"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:text="手机号"
|
||||
android:textColor="@color/black"
|
||||
android:layout_gravity="center"
|
||||
android:textSize="20dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_phoneNumb_acc"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:gravity="right"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20dp" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/re_schoolName"
|
||||
android:layout_below="@+id/re_phoneNumb"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="学校名称"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:textColor="@color/black"
|
||||
android:layout_gravity="center"
|
||||
android:textSize="20dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_schoolName_acc"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:textSize="20dp"
|
||||
android:gravity="right"
|
||||
android:textColor="@color/black"
|
||||
/>
|
||||
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/re_apartmentNumb"
|
||||
android:layout_below="@+id/re_schoolName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="公寓楼号"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:textColor="@color/black"
|
||||
android:layout_gravity="center"
|
||||
android:textSize="20dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_apartmentNumb_acc"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:gravity="right"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20dp" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/re_personal_pic"
|
||||
android:layout_below="@+id/re_apartmentNumb"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="头像"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:textColor="@color/black"
|
||||
android:layout_gravity="center"
|
||||
android:textSize="20dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_personal_pic"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20dp" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</RelativeLayout>
|
@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".activity.OrderActivity">
|
||||
|
||||
<include layout="@layout/mytoolbar"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tip"
|
||||
android:layout_marginTop="60dp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/black"
|
||||
android:background="@color/color666"
|
||||
android:textSize="25dp"
|
||||
android:text="您的订单信息如下"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_order"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_below="@+id/tip"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
|
||||
</RelativeLayout>
|
@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".activity.OrderDetailsActivity">
|
||||
|
||||
<include layout="@layout/mytoolbar"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tip"
|
||||
android:layout_marginTop="60dp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/black"
|
||||
android:background="@color/colorAccent"
|
||||
android:textSize="25dp"
|
||||
android:text="订单详细信息"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_orderDetails"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_below="@+id/tip"
|
||||
android:layout_marginBottom="90dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_orderDetails_time"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:textSize="25dp"
|
||||
android:layout_above="@+id/re_1"
|
||||
android:text="212.35520.52200.522"
|
||||
android:textColor="@color/black"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/re_1"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp">
|
||||
|
||||
|
||||
<TextView
|
||||
android:text="总金额: "
|
||||
android:textSize="25sp"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_toLeftOf="@+id/tv_order_total"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_order_total"
|
||||
android:textStyle="bold"
|
||||
android:gravity="center"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:textSize="30dp"
|
||||
android:text="¥45.26"
|
||||
android:textColor="#E30732"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
</RelativeLayout>
|
@ -0,0 +1,79 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".activity.PayActivity">
|
||||
|
||||
<include layout="@layout/mytoolbar"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tip"
|
||||
android:layout_marginTop="60dp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/black"
|
||||
android:background="@color/color666"
|
||||
android:textSize="25dp"
|
||||
android:text="请核对商品信息"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_below="@+id/tip"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="60dp"
|
||||
>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_pay"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_pay_total"
|
||||
android:textStyle="bold"
|
||||
android:gravity="center"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_toLeftOf="@+id/tv_submitOrder"
|
||||
android:textSize="30dp"
|
||||
android:text="¥45.26"
|
||||
android:textColor="#E30732"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_submitOrder"
|
||||
android:text="提交订单"
|
||||
android:textStyle="bold"
|
||||
android:gravity="center"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:textColor="@color/colorPrimaryDark"
|
||||
android:background="@drawable/textview_shape"
|
||||
android:textSize="25dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_width="140dp"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
</RelativeLayout>
|
@ -0,0 +1,185 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".activity.PersonalCenterActivity">
|
||||
|
||||
<include layout="@layout/mytoolbar"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_userName"
|
||||
android:layout_marginTop="100dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="用户名"
|
||||
android:textColor="@color/black"
|
||||
android:layout_gravity="center"
|
||||
android:textSize="20dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_username"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_nickName"
|
||||
android:layout_below="@+id/ll_userName"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="昵 称"
|
||||
android:textColor="@color/black"
|
||||
android:layout_gravity="center"
|
||||
android:textSize="20dp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_nickName_per"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="50dp"
|
||||
android:textSize="20dp"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/black"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_phoneNumb"
|
||||
android:layout_below="@+id/ll_nickName"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="手机号"
|
||||
android:textColor="@color/black"
|
||||
android:layout_gravity="center"
|
||||
android:textSize="20dp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_phoneNumb_per"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="50dp"
|
||||
android:textSize="20dp"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/black"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_schoolName"
|
||||
android:layout_below="@+id/ll_phoneNumb"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="学校名称"
|
||||
android:textColor="@color/black"
|
||||
android:layout_gravity="center"
|
||||
android:textSize="20dp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_schoolName_per"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="50dp"
|
||||
android:textSize="20dp"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/black"
|
||||
/>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_apartmentNumb"
|
||||
android:layout_below="@+id/ll_schoolName"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="公寓楼号"
|
||||
android:textColor="@color/black"
|
||||
android:layout_gravity="center"
|
||||
android:textSize="20dp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_apartmentNumb_per"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="50dp"
|
||||
android:textSize="20dp"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/black"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_alter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_above="@+id/btn_cancle_per"
|
||||
android:width="160dp"
|
||||
android:text="修改" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_cancle_per"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:width="160dp"
|
||||
android:text="取消" />
|
||||
|
||||
</RelativeLayout>
|
@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".activity.RechargeActivity">
|
||||
|
||||
<include layout="@layout/mytoolbar"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_rechargeMoney"
|
||||
android:text="100"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="40dp"
|
||||
android:textStyle="bold"
|
||||
android:gravity="center"
|
||||
android:layout_marginTop="80dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="80dp"
|
||||
android:background="@drawable/recharge_et_shape"
|
||||
/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_doRecharge"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="30dp"
|
||||
android:text="充值"
|
||||
android:layout_below="@+id/et_rechargeMoney"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="#BB2BD12E"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
|
||||
|
||||
</RelativeLayout>
|
@ -0,0 +1,213 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".activity.RegisterActivity">
|
||||
|
||||
<include layout="@layout/mytoolbar"/>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_userName"
|
||||
android:layout_marginTop="100dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="用户名"
|
||||
android:textColor="@color/black"
|
||||
android:layout_gravity="center"
|
||||
android:textSize="20dp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_username"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="50dp"
|
||||
android:textSize="20dp"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/black"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_password"
|
||||
android:layout_below="@+id/ll_userName"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="密 码"
|
||||
android:textColor="@color/black"
|
||||
android:layout_gravity="center"
|
||||
android:textSize="20dp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_password"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="50dp"
|
||||
android:textSize="20dp"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/black"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_nickName"
|
||||
android:layout_below="@+id/ll_password"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="昵 称"
|
||||
android:textColor="@color/black"
|
||||
android:layout_gravity="center"
|
||||
android:textSize="20dp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_nickName"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="50dp"
|
||||
android:textSize="20dp"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/black"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_phoneNumb"
|
||||
android:layout_below="@+id/ll_nickName"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="手机号"
|
||||
android:textColor="@color/black"
|
||||
android:layout_gravity="center"
|
||||
android:textSize="20dp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_phoneNumb"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="50dp"
|
||||
android:textSize="20dp"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/black"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_schoolName"
|
||||
android:layout_below="@+id/ll_phoneNumb"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="学校名称"
|
||||
android:textColor="@color/black"
|
||||
android:layout_gravity="center"
|
||||
android:textSize="20dp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_schoolName"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="50dp"
|
||||
android:textSize="20dp"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/black"
|
||||
/>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_apartmentNumb"
|
||||
android:layout_below="@+id/ll_schoolName"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="公寓楼号"
|
||||
android:textColor="@color/black"
|
||||
android:layout_gravity="center"
|
||||
android:textSize="20dp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_apartmentNumb"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="50dp"
|
||||
android:textSize="20dp"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/black"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_register"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_above="@+id/btn_cancle"
|
||||
android:width="160dp"
|
||||
android:text="注册" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_cancle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:width="160dp"
|
||||
android:text="取消" />
|
||||
|
||||
</RelativeLayout>
|
@ -0,0 +1,108 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context=".activity.StoreGoodsActivity">
|
||||
|
||||
<include layout="@layout/mytoolbar"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:background="#B13628"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="120dp"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_storeName_act"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="我是店家名称"
|
||||
android:textStyle="bold"
|
||||
android:textSize="20dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:textColor="@color/black"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll"
|
||||
android:layout_below="@+id/tv_storeName_act"
|
||||
android:layout_marginTop="3dp"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_height="20dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_store_score_act"
|
||||
android:textStyle="bold"
|
||||
android:textColor="#FF2256"
|
||||
android:gravity="center"
|
||||
android:text="5.0分"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_store_sell_act"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="月售457"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_below="@+id/ll"
|
||||
android:id="@+id/tv_store_sign_act"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:background="@drawable/store_intro_shape"
|
||||
android:textColor="#B83F3F"
|
||||
android:textStyle="bold"
|
||||
android:text="棒棒哒,又快又好吃"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"/>
|
||||
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_store_act"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_width="80dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_height="80dp"/>
|
||||
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/home_newsTab"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="40dp"
|
||||
app:tabIndicatorFullWidth="false"
|
||||
app:tabIndicatorColor="@color/card_bg_red"
|
||||
app:tabSelectedTextColor="@color/card_bg_red"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
/>
|
||||
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/home_news_vp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
/>
|
||||
|
||||
|
||||
</LinearLayout>
|
@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_icon"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="top"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_left_userName"
|
||||
android:layout_below="@id/iv_icon"
|
||||
android:text="我是用户名"
|
||||
android:textColor="@color/black"
|
||||
android:gravity="center"
|
||||
android:textSize="14dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_left_time"
|
||||
android:textSize="10dp"
|
||||
android:textColor="@color/black"
|
||||
android:text="2021:12:12: "
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_message_left"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/tv_left_time"
|
||||
android:layout_toRightOf="@+id/tv_left_userName"
|
||||
android:padding="8dp"
|
||||
android:text="我是信息内容!!!"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18dp" />
|
||||
|
||||
</RelativeLayout>
|
@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_chat_me_message"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/tv_right_time"
|
||||
android:layout_toLeftOf="@+id/tv_right_userName"
|
||||
android:padding="8dp"
|
||||
android:text="把那些贩毒的关到小黑屋,枪毙五十次,快去" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_right_userName"
|
||||
android:layout_below="@id/iv_chat_imagr_right"
|
||||
android:text="我是用户名"
|
||||
android:layout_alignParentRight="true"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14dp"
|
||||
android:gravity="center"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_right_time"
|
||||
android:textSize="10dp"
|
||||
android:textColor="@color/black"
|
||||
android:text="2021:12:12: "
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_chat_imagr_right"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_gravity="top"
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
@ -0,0 +1,59 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:background="#c2c2c2"
|
||||
android:padding="16dp" >
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="70dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_chat"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:divider="#0000"
|
||||
android:dividerHeight="8dp"
|
||||
android:scrollbars="none" >
|
||||
</androidx.recyclerview.widget.RecyclerView>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="45dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_chat_message"
|
||||
android:textColor="@color/black"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:textSize="20dp"
|
||||
android:gravity="center|left"
|
||||
android:background="@color/white"
|
||||
android:padding="8dp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_message_send"
|
||||
android:text="发送"
|
||||
style="?android:attr/buttonStyleSmall"
|
||||
android:layout_width="64dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:gravity="center"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center|right"
|
||||
android:layout_marginRight="4dp" />
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
@ -0,0 +1,100 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv1"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#ddd"
|
||||
/>
|
||||
<FrameLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="50dp"
|
||||
/>
|
||||
|
||||
|
||||
<include layout="@layout/view_stick_head"/>
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/re_shoppingCar"
|
||||
android:background="@color/orange"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:alpha="0.7"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_shoppingCar"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="25dp"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:background="@drawable/shoppingcar_null_64"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_shoppingCar"
|
||||
android:textSize="20dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:textColor="@color/black"
|
||||
android:textStyle="bold"
|
||||
android:gravity="center"
|
||||
android:text="暂无商品"
|
||||
android:background="@drawable/textview_shape"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="40dp"/>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_total_frag"
|
||||
android:text="¥50"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20dp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_toRightOf="@+id/iv_shoppingCar"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="invisible"
|
||||
/>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
</RelativeLayout>
|
@ -0,0 +1,139 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_one"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
tools:ignore="MissingConstraints">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
app:cardBackgroundColor="@color/white"
|
||||
android:id="@+id/iv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:cardCornerRadius="5dp"
|
||||
app:cardElevation="3dp">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_store_frag"
|
||||
android:layout_width="95dp"
|
||||
android:layout_height="95dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@mipmap/store_bg" />
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
app:cardBackgroundColor="@color/white"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:cardCornerRadius="5dp"
|
||||
app:cardElevation="3dp"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_marginLeft="8dp"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_storeName_frag"
|
||||
android:textColor="@color/black"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="30dp"
|
||||
android:textSize="20dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_gravity="left"
|
||||
android:gravity="center"
|
||||
android:text="我是商家名称"
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_marginTop="3dp"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="20dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_store_score_frag"
|
||||
android:textStyle="bold"
|
||||
android:textColor="#FF2256"
|
||||
android:gravity="center"
|
||||
android:text="5.0分"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_store_sell_frag"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="月售457"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_store_sign_frag"
|
||||
android:layout_marginTop="3dp"
|
||||
android:background="@drawable/store_intro_shape"
|
||||
android:textColor="#B83F3F"
|
||||
android:textStyle="bold"
|
||||
android:text="我是商家的标题"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ScrollView
|
||||
android:layout_below="@+id/ll_one"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_store_intro"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="25dp"
|
||||
android:gravity="left"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
|
||||
</ScrollView>
|
||||
|
||||
|
||||
</RelativeLayout>
|
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/tv"
|
||||
android:textSize="14dp"
|
||||
android:text="我是左目录"
|
||||
android:textColor="#333"
|
||||
android:background="#11fd5588"
|
||||
android:layout_marginBottom="1dp"
|
||||
android:padding="18dp"
|
||||
>
|
||||
|
||||
</TextView>
|