@ -0,0 +1,15 @@
|
||||
*.iml
|
||||
.gradle
|
||||
/local.properties
|
||||
/.idea/caches
|
||||
/.idea/libraries
|
||||
/.idea/modules.xml
|
||||
/.idea/workspace.xml
|
||||
/.idea/navEditor.xml
|
||||
/.idea/assetWizardSettings.xml
|
||||
.DS_Store
|
||||
/build
|
||||
/captures
|
||||
.externalNativeBuild
|
||||
.cxx
|
||||
local.properties
|
@ -0,0 +1,3 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="11" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="GRADLE" />
|
||||
<option name="distributionType" value="LOCAL" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleJvm" value="jbr-11" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
</set>
|
||||
</option>
|
||||
<option name="resolveExternalAnnotations" value="false" />
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="Android Studio default JDK" 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 @@
|
||||
/build
|
@ -0,0 +1,40 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
}
|
||||
|
||||
android {
|
||||
namespace 'com.example.test'
|
||||
compileSdk 33
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.example.test"
|
||||
minSdk 27
|
||||
targetSdk 33
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.4.1'
|
||||
implementation 'com.google.android.material:material:1.5.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
||||
implementation 'com.github.crazyandcoder:citypicker:6.0.2'
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
@ -0,0 +1,26 @@
|
||||
package com.example.test;
|
||||
|
||||
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.test", appContext.getPackageName());
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||
android:fullBackupContent="@xml/backup_rules"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
tools:targetApi="31">
|
||||
<activity
|
||||
android:name=".activity.fragmentActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".activity.user"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".activity.fruitFragment"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".activity.register"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".activity.login"
|
||||
android:exported="false" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
@ -0,0 +1,88 @@
|
||||
package com.example.test;
|
||||
|
||||
|
||||
import android.content.ContentValues;
|
||||
import android.content.Intent;
|
||||
import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.example.test.activity.login;
|
||||
import com.example.test.activity.register;
|
||||
import com.example.test.activity.user;
|
||||
import com.example.test.dao.UserDatabase;
|
||||
|
||||
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
|
||||
private Button registerButton, loginButton;
|
||||
private EditText usernameText, paswdEdit;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.login);
|
||||
init();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
switch (view.getId()){
|
||||
case R.id.register:
|
||||
Intent intent = new Intent(this, register.class);
|
||||
startActivity(intent);
|
||||
break;
|
||||
case R.id.login:
|
||||
loginCheck();
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void loginCheck() {
|
||||
String name = usernameText.getText().toString();
|
||||
String pass = paswdEdit.getText().toString();
|
||||
if(name.isEmpty()||pass.isEmpty()){
|
||||
Toast.makeText(this,"用户名或密码为空",Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
UserDatabase db = new UserDatabase(this, "orange");
|
||||
SQLiteDatabase readdb = db.getReadableDatabase();
|
||||
// SQLiteDatabase writedb = db.getWritableDatabase();
|
||||
Cursor cursor = db.select(readdb, "user",null,"username=? and password=?",new String[]{name,pass},null,null,null);
|
||||
|
||||
if(cursor.getCount()!=0){
|
||||
cursor.moveToNext();
|
||||
Intent intent = new Intent(this, user.class);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("username",cursor.getString(1));
|
||||
bundle.putString("sex",cursor.getString(3));
|
||||
bundle.putString("adress",cursor.getString(4));
|
||||
cursor.close();
|
||||
readdb.close();
|
||||
intent.putExtras(bundle);
|
||||
startActivity(intent);
|
||||
}else {
|
||||
Toast.makeText(this,"用户名或密码有误",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void init(){
|
||||
registerButton = findViewById(R.id.register);
|
||||
registerButton.setOnClickListener(this);
|
||||
loginButton = findViewById(R.id.login);
|
||||
loginButton.setOnClickListener(this);
|
||||
usernameText = findViewById(R.id.username);
|
||||
paswdEdit = findViewById(R.id.password);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package com.example.test.activity;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.text.Editable;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.example.test.R;
|
||||
|
||||
|
||||
public class login extends AppCompatActivity implements View.OnClickListener {
|
||||
private EditText userEdit;
|
||||
private EditText passEdit;
|
||||
private Button regBut;
|
||||
private Button logBut;
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.login);
|
||||
regBut = findViewById(R.id.register);
|
||||
logBut = findViewById(R.id.login);
|
||||
regBut.setOnClickListener(this);
|
||||
logBut.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
switch (view.getId())
|
||||
{
|
||||
case R.id.login:
|
||||
check();
|
||||
break;
|
||||
case R.id.register:
|
||||
Intent intent = new Intent(this, register.class);
|
||||
startActivity(intent);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void check() {
|
||||
Intent intent = getIntent();
|
||||
Bundle bundle = intent.getExtras();
|
||||
String username = bundle.getString("username");
|
||||
String password = bundle.getString("password");
|
||||
userEdit = findViewById(R.id.username);
|
||||
String user = userEdit.getText().toString();
|
||||
passEdit = findViewById(R.id.password);
|
||||
String pass = passEdit.getText().toString();
|
||||
if(pass.equals(password)&&user.equals(username))
|
||||
{
|
||||
String sex = bundle.getString("sex");
|
||||
String adress = bundle.getString("adress");
|
||||
Intent userIntent = new Intent(this, user.class);
|
||||
Bundle userBundle = new Bundle();
|
||||
userBundle.putString("username",username);
|
||||
userBundle.putString("sex",sex);
|
||||
userBundle.putString("adress",adress);
|
||||
userIntent.putExtras(userBundle);
|
||||
startActivity(userIntent);
|
||||
}else{
|
||||
Toast.makeText(this,"用户名或密码不对",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,153 @@
|
||||
package com.example.test.activity;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.content.ContentValues;
|
||||
import android.content.Intent;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.RadioGroup;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.example.test.MainActivity;
|
||||
import com.example.test.R;
|
||||
import com.example.test.dao.UserDatabase;
|
||||
import com.lljjcoder.Interface.OnCityItemClickListener;
|
||||
import com.lljjcoder.bean.CityBean;
|
||||
import com.lljjcoder.bean.DistrictBean;
|
||||
import com.lljjcoder.bean.ProvinceBean;
|
||||
import com.lljjcoder.citywheel.CityConfig;
|
||||
import com.lljjcoder.style.citypickerview.CityPickerView;
|
||||
|
||||
public class register extends AppCompatActivity implements View.OnClickListener, RadioGroup.OnCheckedChangeListener {
|
||||
private EditText userEdit;
|
||||
private EditText passEdit;
|
||||
private EditText paEdit;
|
||||
private RadioGroup sexBut;
|
||||
private TextView adressText;
|
||||
private String sex ="男";
|
||||
private Button regBut;
|
||||
CityPickerView citypv;
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.register);
|
||||
init();
|
||||
}
|
||||
|
||||
public void init(){
|
||||
citypv = new CityPickerView();
|
||||
citypv.init(this);
|
||||
initConfig();
|
||||
citypv.setOnCityItemClickListener(new OnCityItemClickListener() {
|
||||
@Override
|
||||
public void onSelected(ProvinceBean province, CityBean city, DistrictBean district) {
|
||||
String pro = province.getName();
|
||||
String ci = city.getName();
|
||||
String dis = district.getName();
|
||||
adressText.setText(String.format("%s %s %s",pro,ci,dis));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
}
|
||||
});
|
||||
userEdit = findViewById(R.id.reg_username);
|
||||
passEdit = findViewById(R.id.reg_password);
|
||||
paEdit = findViewById(R.id.reg_apassword);
|
||||
adressText = findViewById(R.id.reg_adress);
|
||||
adressText.setOnClickListener(this);
|
||||
sexBut = findViewById(R.id.reg_sex);
|
||||
sexBut.setOnCheckedChangeListener(this);
|
||||
regBut = findViewById(R.id.reg_register);
|
||||
regBut.setOnClickListener(this);
|
||||
}
|
||||
|
||||
private void initConfig() {
|
||||
CityConfig cityConfig = new CityConfig.Builder()
|
||||
.title("选择城市")//标题
|
||||
.titleTextSize(18)//标题文字大小
|
||||
.titleTextColor("#585858")//标题文字颜 色
|
||||
.titleBackgroundColor("#E9E9E9")//标题栏背景色
|
||||
.confirTextColor("#585858")//确认按钮文字颜色
|
||||
.confirmText("ok")//确认按钮文字
|
||||
.confirmTextSize(16)//确认按钮文字大小
|
||||
.cancelTextColor("#585858")//取消按钮文字颜色
|
||||
.cancelText("cancel")//取消按钮文字
|
||||
.cancelTextSize(16)//取消按钮文字大小
|
||||
.setCityWheelType(CityConfig.WheelType.PRO_CITY_DIS)//显示类,只显示省份一级,显示省市两级还是显示省市区三级
|
||||
.showBackground(true)//是否显示半透明背景
|
||||
.visibleItemsCount(7)//显示item的数量
|
||||
.province("浙江省")//默认显示的省份
|
||||
.city("杭州市")//默认显示省份下面的城市
|
||||
.district("滨江区")//默认显示省市下面的区县数据
|
||||
.provinceCyclic(true)//省份滚轮是否可以循环滚动
|
||||
.cityCyclic(true)//城市滚轮是否可以循环滚动
|
||||
.districtCyclic(true)//区县滚轮是否循环滚动
|
||||
.drawShadows(false)//滚轮不显示模糊效果
|
||||
.setLineColor("#03a9f4")//中间横线的颜色
|
||||
.setLineHeigh(5)//中间横线的高度
|
||||
.setShowGAT(true)//是否显示港澳台数据,默认不显示
|
||||
.build();
|
||||
citypv.setConfig(cityConfig);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
switch (view.getId()){
|
||||
case R.id.reg_adress:
|
||||
citypv.showCityPicker();
|
||||
break;
|
||||
case R.id.reg_register:
|
||||
check();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void check() {
|
||||
Intent intent = new Intent(this, MainActivity.class);
|
||||
String username = userEdit.getText().toString();
|
||||
String password = passEdit.getText().toString();
|
||||
String apassword = paEdit.getText().toString();
|
||||
String adress = adressText.getText().toString();
|
||||
if(password.equals(apassword)){
|
||||
if(username.equals("")||username.startsWith(" ")||password.equals("")||password.startsWith(" ")){
|
||||
Toast.makeText(this,"用户名或密码为空",Toast.LENGTH_SHORT).show();
|
||||
}else {
|
||||
if(adress.equals("")||adress.equals("地址选择"))
|
||||
Toast.makeText(this,"未选择地址",Toast.LENGTH_SHORT).show();
|
||||
else{
|
||||
UserDatabase db = new UserDatabase(this, "orange");
|
||||
SQLiteDatabase writedb = db.getWritableDatabase();
|
||||
ContentValues values = new ContentValues();
|
||||
values.put("username",username);
|
||||
values.put("password",password);
|
||||
values.put("adress",adress);
|
||||
values.put("sex",sex);
|
||||
db.insert(writedb,"user",values);
|
||||
writedb.close();
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
Toast.makeText(this,"两次密码不一致",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onCheckedChanged(RadioGroup group, int checkedId) {
|
||||
//根据用户选择来改变sex的值
|
||||
sex = R.id.reg_male==checkedId?"男":"女";
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
package com.example.test.activity;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.Display;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.example.test.R;
|
||||
import com.example.test.dao.UserDatabase;
|
||||
|
||||
public class user extends AppCompatActivity implements View.OnClickListener {
|
||||
|
||||
private TextView userText;
|
||||
private TextView sexText;
|
||||
private TextView adressText;
|
||||
private Button logoutBut;
|
||||
private View shoppingView;
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.content_user);
|
||||
display();
|
||||
}
|
||||
|
||||
private void display() {
|
||||
Intent intent = getIntent();
|
||||
Bundle bundle = intent.getExtras();
|
||||
String username = "账号:"+bundle.getString("username");
|
||||
String sex = "性别:"+bundle.getString("sex");
|
||||
String adress = "城市:"+bundle.getString("adress");
|
||||
// Log.i("info",username+""+sex+""+adress+"");
|
||||
userText = findViewById(R.id.user_username);
|
||||
userText.setText(username);
|
||||
sexText = findViewById(R.id.user_sex);
|
||||
sexText.setText(sex);
|
||||
adressText = findViewById(R.id.user_city);
|
||||
adressText.setText(adress);
|
||||
logoutBut = findViewById(R.id.logout);
|
||||
logoutBut.setOnClickListener(this);
|
||||
shoppingView = findViewById(R.id.user_shopping_line);
|
||||
shoppingView.setOnClickListener(this);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
switch (view.getId())
|
||||
{
|
||||
case R.id.logout:
|
||||
logout();
|
||||
break;
|
||||
case R.id.user_shopping_line:
|
||||
goShopping();
|
||||
}
|
||||
}
|
||||
|
||||
protected void goShopping() {
|
||||
Intent intent = new Intent(this, fruitFragment.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
protected void logout() {
|
||||
Intent intent = new Intent(this, login.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
package com.example.test.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.example.test.R;
|
||||
import com.example.test.entity.fruitContent;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class fruitContentAdapter extends BaseAdapter {
|
||||
private Holder holder;
|
||||
private fruitContent fruitContents[];
|
||||
private Context context;
|
||||
|
||||
public fruitContentAdapter() {
|
||||
}
|
||||
|
||||
public fruitContentAdapter(fruitContent fruitContents[], Context context) {
|
||||
this.fruitContents = fruitContents;
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return fruitContents.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getItem(int i) {
|
||||
return fruitContents[i];
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int i) {
|
||||
return i;
|
||||
}
|
||||
public void setBackgroundColor(int position,String color){
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int i, View convertview, ViewGroup viewGroup) {
|
||||
holder = new fruitContentAdapter.Holder();
|
||||
fruitContent content = fruitContents[i];
|
||||
if(convertview==null){
|
||||
convertview = LayoutInflater.from(context).inflate(R.layout.fruit_content_item,null);
|
||||
holder.iv_img = convertview.findViewById(R.id.fruit_content_img);
|
||||
holder.tv_name = convertview.findViewById(R.id.fruit_content_name);
|
||||
holder.tv_desc = convertview.findViewById(R.id.fruit_content_desc);
|
||||
holder.tv_tag = convertview.findViewById(R.id.fruit_content_tag);
|
||||
holder.tv_price = convertview.findViewById(R.id.fruit_content_price);
|
||||
convertview.setTag(holder);
|
||||
}else {
|
||||
holder = (fruitContentAdapter.Holder) convertview.getTag();
|
||||
}
|
||||
holder.iv_img.setImageResource(content.getImg());
|
||||
holder.tv_name.setText(content.getName());
|
||||
// holder.tv_name.getPaint().setFakeBoldText(true);
|
||||
holder.tv_desc.setText(content.getDesc());
|
||||
if(content.getTag()==1)
|
||||
holder.tv_tag.setText("爆款直降");
|
||||
holder.tv_price.setText(content.getPrice()+"");
|
||||
return convertview;
|
||||
}
|
||||
static class Holder{
|
||||
ImageView iv_img;
|
||||
TextView tv_name;
|
||||
TextView tv_desc;
|
||||
TextView tv_tag;
|
||||
TextView tv_price;
|
||||
}
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
package com.example.test.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.example.test.R;
|
||||
import com.example.test.entity.fruitKind;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class fruitKindAdapter extends BaseAdapter {
|
||||
private List<fruitKind> fruitKinds;
|
||||
private Context context;
|
||||
private Holder holder;
|
||||
private int selected_item=0;
|
||||
|
||||
public fruitKindAdapter() {
|
||||
}
|
||||
|
||||
public fruitKindAdapter(List<fruitKind> fruitKinds, Context context) {
|
||||
this.fruitKinds = fruitKinds;
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return fruitKinds.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getItem(int i) {
|
||||
return fruitKinds.get(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int i) {
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int i, View convertview, ViewGroup viewGroup) {
|
||||
holder = new Holder();
|
||||
fruitKind kind = fruitKinds.get(i);
|
||||
if(convertview==null){
|
||||
Log.i("init",i+"");
|
||||
convertview = LayoutInflater.from(context).inflate(R.layout.fruit_kind_item,null);
|
||||
if(i == 0){
|
||||
convertview.setBackgroundResource(R.color.gray);
|
||||
}
|
||||
holder.iv_img = convertview.findViewById(R.id.kind_img);
|
||||
holder.tv_name = convertview.findViewById(R.id.kind_name);
|
||||
if(kind.getImg()!=0)
|
||||
holder.iv_img.setImageResource(kind.getImg());
|
||||
holder.tv_name.setText(kind.getName());
|
||||
convertview.setTag(holder);
|
||||
}else {
|
||||
Log.i("after",i+"");
|
||||
holder = (Holder) convertview.getTag();
|
||||
holder.iv_img.setImageResource(kind.getImg());
|
||||
holder.tv_name.setText(kind.getName());
|
||||
}
|
||||
return convertview;
|
||||
}
|
||||
static class Holder{
|
||||
ImageView iv_img;
|
||||
TextView tv_name;
|
||||
}
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package com.example.test.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.example.test.R;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class titleAdapter extends BaseAdapter {
|
||||
private String titles[];
|
||||
private Context context;
|
||||
|
||||
public titleAdapter() {
|
||||
}
|
||||
|
||||
public titleAdapter(String[] titles, Context context) {
|
||||
this.titles = titles;
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return titles.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getItem(int i) {
|
||||
return titles[i];
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int i) {
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int i, View convertview, ViewGroup viewGroup) {
|
||||
View view = LayoutInflater.from(context).inflate(R.layout.list_item,null);
|
||||
TextView text = view.findViewById(R.id.item_title);
|
||||
text.setText(titles[i]);
|
||||
return view;
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package com.example.test.dao;
|
||||
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.database.sqlite.SQLiteOpenHelper;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
public class UserDatabase extends SQLiteOpenHelper {
|
||||
public UserDatabase(@Nullable Context context, @Nullable String name) {
|
||||
super(context, name,null, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(SQLiteDatabase sqLiteDatabase) {
|
||||
String sql = "create table user(id integer primary key autoincrement,username varchar(20),password varchar(20),sex varchar(20),adress varchar(20),phoneNumber char(11))";
|
||||
sqLiteDatabase.execSQL(sql);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {
|
||||
|
||||
}
|
||||
public void insert(SQLiteDatabase sqLiteDatabase, String table, ContentValues values){
|
||||
sqLiteDatabase.insert(table,null,values);
|
||||
// sqLiteDatabase.close();
|
||||
}
|
||||
|
||||
public void delete(SQLiteDatabase sqLiteDatabase,String table,String name,String []args){
|
||||
sqLiteDatabase.delete(table,name,args);
|
||||
// sqLiteDatabase.close();
|
||||
}
|
||||
|
||||
public Cursor select(SQLiteDatabase sqLiteDatabase,String table,String columns[],String selection,String selectionArgs[],String grunpBy,String having,String orderBy){
|
||||
// Cursor cursor = sqLiteDatabase.query(table,null,null,null,null,null,null);
|
||||
Cursor cursor = sqLiteDatabase.query(table,null,selection,selectionArgs,grunpBy,having,orderBy);
|
||||
return cursor;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package com.example.test.entity;
|
||||
|
||||
public class OrangeUser {
|
||||
private Integer id;
|
||||
private String username;
|
||||
private String password;
|
||||
private String sex;
|
||||
private String city;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getSex() {
|
||||
return sex;
|
||||
}
|
||||
|
||||
public void setSex(String sex) {
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
public String getCity() {
|
||||
return city;
|
||||
}
|
||||
|
||||
public void setCity(String city) {
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OrangeUser{" +
|
||||
"username='" + username + '\'' +
|
||||
", password='" + password + '\'' +
|
||||
", sex='" + sex + '\'' +
|
||||
", city='" + city + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.example.test.entity;
|
||||
|
||||
public class fruit {
|
||||
private String name;
|
||||
private double price;
|
||||
|
||||
public fruit() {
|
||||
}
|
||||
|
||||
public fruit(String name, double price) {
|
||||
this.name = name;
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public double getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(double price) {
|
||||
this.price = price;
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.example.test.entity;
|
||||
|
||||
public class fruitContent {
|
||||
private int img;
|
||||
private String name;
|
||||
private String desc;
|
||||
private int tag;
|
||||
private double price;
|
||||
|
||||
public fruitContent() {
|
||||
}
|
||||
|
||||
public fruitContent(int img, String name, String desc, int tag, double price) {
|
||||
this.img = img;
|
||||
this.name = name;
|
||||
this.desc = desc;
|
||||
this.tag = tag;
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public int getImg() {
|
||||
return img;
|
||||
}
|
||||
|
||||
public void setImg(int img) {
|
||||
this.img = img;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public void setDesc(String desc) {
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public int getTag() {
|
||||
return tag;
|
||||
}
|
||||
|
||||
public void setTag(int tag) {
|
||||
this.tag = tag;
|
||||
}
|
||||
|
||||
public double getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(double price) {
|
||||
this.price = price;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,30 @@
|
||||
package com.example.test.entity;
|
||||
|
||||
public class fruitKind {
|
||||
private String name;
|
||||
private int img;
|
||||
|
||||
public fruitKind() {
|
||||
}
|
||||
|
||||
public fruitKind(String name, int img) {
|
||||
this.name = name;
|
||||
this.img = img;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getImg() {
|
||||
return img;
|
||||
}
|
||||
|
||||
public void setImg(int img) {
|
||||
this.img = img;
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.example.test.entity;
|
||||
|
||||
public class planet {
|
||||
private String name;
|
||||
private int img;
|
||||
private String desc;
|
||||
|
||||
public planet() {
|
||||
}
|
||||
|
||||
public planet(String name, int img, String desc) {
|
||||
this.name = name;
|
||||
this.img = img;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getImg() {
|
||||
return img;
|
||||
}
|
||||
|
||||
public void setImg(int img) {
|
||||
this.img = img;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public void setDesc(String desc) {
|
||||
this.desc = desc;
|
||||
}
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package com.example.test.entity;
|
||||
|
||||
public class user {
|
||||
private String username;
|
||||
private String password;
|
||||
private String phoneNumber;
|
||||
private String sex;
|
||||
private String adress;
|
||||
private int id;
|
||||
|
||||
public user() {
|
||||
}
|
||||
|
||||
public user(String username, String password, String phoneNumber, String sex, String adress, int id) {
|
||||
this.username = username;
|
||||
this.password = password;
|
||||
this.phoneNumber = phoneNumber;
|
||||
this.sex = sex;
|
||||
this.adress = adress;
|
||||
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 getPhoneNumber() {
|
||||
return phoneNumber;
|
||||
}
|
||||
|
||||
public void setPhoneNumber(String phoneNumber) {
|
||||
this.phoneNumber = phoneNumber;
|
||||
}
|
||||
|
||||
public String getSex() {
|
||||
return sex;
|
||||
}
|
||||
|
||||
public void setSex(String sex) {
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
public String getAdress() {
|
||||
return adress;
|
||||
}
|
||||
|
||||
public void setAdress(String adress) {
|
||||
this.adress = adress;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package com.example.test.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import android.service.quicksettings.Tile;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.example.test.R;
|
||||
import com.example.test.activity.fragmentActivity;
|
||||
|
||||
public class contentFragment extends Fragment {
|
||||
private TextView tv_content;
|
||||
private ImageView iv_img ;
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
// Inflate the layout for this fragment
|
||||
View view =inflater.inflate(R.layout.fragment_content, container, false);
|
||||
if(view!=null){
|
||||
tv_content=view.findViewById(R.id.content_content);
|
||||
iv_img=view.findViewById(R.id.content_img);
|
||||
}
|
||||
setcontent(((fragmentActivity)getActivity()).getContents()[0],((fragmentActivity)getActivity()).getImgs()[0]);
|
||||
return view;
|
||||
}
|
||||
|
||||
public void setcontent(String content,int img){
|
||||
tv_content.setText(content);
|
||||
iv_img.setImageResource(img);
|
||||
}
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package com.example.test.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ListView;
|
||||
|
||||
import com.example.test.R;
|
||||
import com.example.test.activity.fruitFragment;
|
||||
import com.example.test.adapter.fruitContentAdapter;
|
||||
import com.example.test.entity.fruitContent;
|
||||
|
||||
import java.nio.file.NotLinkException;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class fruitContentFragment extends Fragment {
|
||||
private View view;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
// Inflate the layout for this fragment
|
||||
view= inflater.inflate(R.layout.fragment_fruit_content, container, false);
|
||||
fruitFragment activity=(fruitFragment)getActivity();
|
||||
List<fruitContent[]> fruitContents = activity.getFruitContents();
|
||||
show(fruitContents.get(0));
|
||||
return view;
|
||||
}
|
||||
public void show(fruitContent fruitContents[]){
|
||||
ListView listView = view.findViewById(R.id.fruit_content_listview);
|
||||
listView.setDivider(null);
|
||||
fruitContentAdapter adapter = new fruitContentAdapter(fruitContents,getActivity());
|
||||
listView.setAdapter(adapter);
|
||||
}
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package com.example.test.fragment;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ListView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.example.test.R;
|
||||
import com.example.test.activity.fruitFragment;
|
||||
import com.example.test.adapter.fruitKindAdapter;
|
||||
import com.example.test.entity.fruitContent;
|
||||
import com.example.test.entity.fruitKind;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class fruitKindFragment extends Fragment {
|
||||
|
||||
private int selected_item = 0;
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
View view=inflater.inflate(R.layout.fragment_fruit_kind, container, false);
|
||||
ListView listView = view.findViewById(R.id.kind_listview);
|
||||
listView.setDivider(null);
|
||||
listView.setDividerHeight(30);
|
||||
fruitFragment activity = (fruitFragment) getActivity();
|
||||
List<fruitKind> fruitKinds = activity.getfuritKinds();
|
||||
fruitKindAdapter fruitKindAdapter = new fruitKindAdapter(fruitKinds, getActivity());
|
||||
listView.setAdapter(fruitKindAdapter);
|
||||
|
||||
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
|
||||
fruitFragment activity=(fruitFragment)getActivity();
|
||||
List<fruitContent[]> list = activity.getFruitContents();
|
||||
fruitContentFragment fragment = (fruitContentFragment)activity.getSupportFragmentManager().findFragmentById(R.id.fruit);
|
||||
fragment.show(list.get(i));
|
||||
if(i!=selected_item){
|
||||
adapterView.getChildAt(selected_item).setBackgroundResource(R.color.white);
|
||||
adapterView.getChildAt(i).setBackgroundResource(R.color.gray);
|
||||
selected_item=i;
|
||||
}
|
||||
}
|
||||
});
|
||||
return view;
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.example.test.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.example.test.R;
|
||||
|
||||
public class rightSeconedFragment extends Fragment {
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
// Inflate the layout for this fragment
|
||||
return inflater.inflate(R.layout.fragment_right_second, container, false);
|
||||
}
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package com.example.test.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.ListView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.example.test.R;
|
||||
import com.example.test.activity.fragmentActivity;
|
||||
import com.example.test.adapter.titleAdapter;
|
||||
|
||||
|
||||
public class titleFragment extends Fragment {
|
||||
private String titles[];
|
||||
private String contents[];
|
||||
private int imgs[];
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
// Inflate the layout for this fragment
|
||||
View view= inflater.inflate(R.layout.fragment_title, container, false);
|
||||
initListView(view);
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
public void initListView(View view) {
|
||||
fragmentActivity activity = (fragmentActivity) getActivity();
|
||||
titles = activity.getTitles();
|
||||
contents = activity.getContents();
|
||||
imgs=activity.getImgs();
|
||||
ListView listview = view.findViewById(R.id.listview);
|
||||
titleAdapter titleAdapter = new titleAdapter(titles,activity);
|
||||
listview.setAdapter(titleAdapter);
|
||||
listview.setOnItemClickListener(new AdapterView.OnItemClickListener(){
|
||||
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
|
||||
contentFragment cf= (contentFragment)((fragmentActivity) getActivity()).
|
||||
getSupportFragmentManager().findFragmentById(R.id.content);
|
||||
cf.setcontent(contents[i],imgs[i]);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -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: 1.0 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 368 B |
After Width: | Height: | Size: 233 B |
After Width: | Height: | Size: 14 KiB |
@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="false">
|
||||
<shape>
|
||||
<solid android:color="#EFB81C" />
|
||||
<corners android:radius="5dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:state_pressed="true">
|
||||
<shape>
|
||||
<solid android:color="#c0c0c0" />
|
||||
<corners android:radius="5dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="false">
|
||||
<shape>
|
||||
<solid android:color="#c0c0c0" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:state_pressed="true">
|
||||
<shape>
|
||||
<solid android:color="#c0c0c0" />
|
||||
<corners android:radius="10dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 8.8 KiB |
After Width: | Height: | Size: 801 B |
After Width: | Height: | Size: 790 B |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 68 KiB |
After Width: | Height: | Size: 448 B |
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 这个是选中的时候item显示背景色 -->;
|
||||
<item android:drawable="@color/yellow" android:state_selected="true"/>
|
||||
<!-- 未选中时的背景颜色 -->
|
||||
<item android:drawable="@color/white"/>
|
||||
</selector>
|
After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 27 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 608 B |
@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#008577"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
After Width: | Height: | Size: 154 KiB |
After Width: | Height: | Size: 97 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 6.0 KiB |
After Width: | Height: | Size: 8.9 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 8.2 KiB |
After Width: | Height: | Size: 9.1 KiB |
After Width: | Height: | Size: 45 KiB |
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 347 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 453 B |
After Width: | Height: | Size: 7.8 KiB |
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape>
|
||||
<solid android:color="#FFFFFF"/>
|
||||
<corners android:radius="2dip"/>
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#FFFFFF"
|
||||
/>
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<bitmap android:src="@drawable/arrow_down" android:gravity="end"/>
|
||||
</item>
|
||||
</layer-list>
|
After Width: | Height: | Size: 799 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 402 B |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 554 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 18 KiB |
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:orientation="horizontal">
|
||||
<fragment
|
||||
android:id="@+id/title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:name="com.example.test.fragment.titleFragment"
|
||||
android:layout_weight="1"
|
||||
tools:layout="@layout/fragment_title"/>
|
||||
<fragment
|
||||
android:id="@+id/content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:name="com.example.test.fragment.contentFragment"
|
||||
tools:layout="@layout/fragment_content"/>
|
||||
|
||||
</LinearLayout>
|
@ -0,0 +1,21 @@
|
||||
<?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=".activity.fruitFragment">
|
||||
<fragment
|
||||
android:id="@+id/kind"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="23"
|
||||
android:name="com.example.test.fragment.fruitKindFragment"
|
||||
android:layout_marginBottom="10dp"/>
|
||||
<fragment
|
||||
android:id="@+id/fruit"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="77"
|
||||
android:name="com.example.test.fragment.fruitContentFragment"/>
|
||||
</LinearLayout>
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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.login">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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.user">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -0,0 +1,12 @@
|
||||
<?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=".activity.userDatabase">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="数据库"/>
|
||||
</LinearLayout>
|
@ -0,0 +1,235 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#E8E8E8"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/user_icon"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:src="@drawable/people" />
|
||||
|
||||
<!--卡券-->
|
||||
<LinearLayout
|
||||
android:id="@+id/user_pay"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#FFF"
|
||||
android:layout_marginTop="40dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_height="35dp"
|
||||
android:layout_weight="1"
|
||||
android:drawableLeft="@drawable/user_pay"
|
||||
android:textColor="#000"
|
||||
android:text="卡券"
|
||||
android:gravity="center_vertical"
|
||||
android:drawablePadding="8dp"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_width="0dp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/arrow_right" />
|
||||
</LinearLayout>
|
||||
|
||||
<!--账号-->
|
||||
<LinearLayout
|
||||
android:id="@+id/user_username_line"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#FFF"
|
||||
android:layout_marginTop="30dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/user_username"
|
||||
android:layout_height="35dp"
|
||||
android:layout_weight="1"
|
||||
android:drawableLeft="@drawable/user_account"
|
||||
android:textColor="#000"
|
||||
android:text="账号:"
|
||||
android:gravity="center_vertical"
|
||||
android:drawablePadding="8dp"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_width="0dp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/arrow_right" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!--性别-->
|
||||
<LinearLayout
|
||||
android:id="@+id/user_sex_line"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#FFF"
|
||||
android:layout_marginTop="1dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/user_sex"
|
||||
android:layout_height="35dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:drawableLeft="@drawable/user_sex"
|
||||
android:textColor="#000"
|
||||
android:text="性别:"
|
||||
android:gravity="center_vertical"
|
||||
android:drawablePadding="8dp"
|
||||
android:textSize="14sp"
|
||||
android:layout_width="0dp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/arrow_right" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!--城市-->
|
||||
<LinearLayout
|
||||
android:id="@+id/user_city_line"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#FFF"
|
||||
android:layout_marginTop="1dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/user_city"
|
||||
android:layout_height="35dp"
|
||||
android:layout_weight="1"
|
||||
android:drawableLeft="@drawable/city"
|
||||
android:textColor="#000"
|
||||
android:text="城市:"
|
||||
android:gravity="center_vertical"
|
||||
android:drawablePadding="8dp"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_width="0dp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/arrow_right" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!--通用-->
|
||||
<LinearLayout
|
||||
android:id="@+id/user_general"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#FFF"
|
||||
android:layout_marginTop="20dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_height="35dp"
|
||||
android:layout_weight="1"
|
||||
android:drawableLeft="@drawable/user_general"
|
||||
android:textColor="#000"
|
||||
android:text="通用"
|
||||
android:gravity="center_vertical"
|
||||
android:drawablePadding="8dp"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_width="0dp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/arrow_right" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!--购物-->
|
||||
<LinearLayout
|
||||
android:id="@+id/user_shopping_line"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#FFF"
|
||||
android:layout_marginTop="1dp"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:id="@+id/user_shopping"
|
||||
android:layout_height="35dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:drawableLeft="@drawable/cart"
|
||||
android:textColor="#000"
|
||||
android:text="购物"
|
||||
android:gravity="center_vertical"
|
||||
android:drawablePadding="8dp"
|
||||
android:textSize="14sp"
|
||||
android:layout_width="0dp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/arrow_right" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!--设置-->
|
||||
<LinearLayout
|
||||
android:id="@+id/user_setting"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#FFF"
|
||||
android:layout_marginTop="20dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_height="35dp"
|
||||
android:layout_weight="1"
|
||||
android:drawableLeft="@drawable/setting"
|
||||
android:textColor="#000"
|
||||
android:text="设置"
|
||||
android:gravity="center_vertical"
|
||||
android:drawablePadding="8dp"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_width="0dp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/arrow_right" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/logout"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:textSize="18sp"
|
||||
android:layout_marginTop="150dp"
|
||||
android:text="退出登录"
|
||||
android:textColor="#FFFFFF"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/button_login"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/content_img"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_marginBottom="20dp"/>
|
||||
<TextView
|
||||
android:id="@+id/content_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
</LinearLayout>
|
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout 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=".fragment.fruitContentFragment">
|
||||
<ListView
|
||||
android:id="@+id/fruit_content_listview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
</FrameLayout>
|
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout 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=".fragment.fruitKindFragment">
|
||||
<ListView
|
||||
android:id="@+id/kind_listview"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"/>
|
||||
</FrameLayout>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</LinearLayout>
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<ListView
|
||||
android:id="@+id/listview"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"/>
|
||||
</LinearLayout>
|
@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<ImageView
|
||||
android:id="@+id/fruit_content_img"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginRight="10dp"/>
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_weight="3">
|
||||
<TextView
|
||||
android:id="@+id/fruit_content_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="18dp"
|
||||
android:textStyle="bold"/>
|
||||
<TextView
|
||||
android:id="@+id/fruit_content_desc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textFontWeight="5"/>
|
||||
<TextView
|
||||
android:id="@+id/fruit_content_tag"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/red" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:id="@+id/fruit_content_price"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="bold"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="/份"/>
|
||||
<ImageView
|
||||
android:layout_marginLeft="150dp"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:src="@drawable/shopping"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|