Compare commits

...

No commits in common. 'master' and 'lastcode' have entirely different histories.

@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<<<<<<< HEAD
<<<<<<< HEAD
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="org.jetbrains.annotations.Nullable" />
<option name="myDefaultNotNull" value="android.annotation.NonNull" />
@ -69,11 +71,19 @@
</entry>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="JDK" project-jdk-type="JavaSDK">
=======
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="1.8" project-jdk-type="JavaSDK">
>>>>>>> 8d271bc (end_code)
=======
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="1.8" project-jdk-type="JavaSDK">
>>>>>>> 76999d0 (last)
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
<<<<<<< HEAD
<<<<<<< HEAD
<component name="VisualizationToolProject">
<option name="state">
<ProjectState>
@ -81,4 +91,8 @@
</ProjectState>
</option>
</component>
=======
>>>>>>> 8d271bc (end_code)
=======
>>>>>>> 76999d0 (last)
</project>

@ -1,12 +1,27 @@
apply plugin: 'com.android.application'
android {
<<<<<<< HEAD
<<<<<<< HEAD
compileSdkVersion 33
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.orangesale.cn"
minSdkVersion 26
targetSdkVersion 33
=======
=======
>>>>>>> 76999d0 (last)
compileSdkVersion 30
buildToolsVersion "30.0.2"
defaultConfig {
applicationId "com.example.orangesale_end"
minSdkVersion 26
targetSdkVersion 30
<<<<<<< HEAD
>>>>>>> 8d271bc (end_code)
=======
>>>>>>> 76999d0 (last)
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@ -17,14 +32,45 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
<<<<<<< HEAD
<<<<<<< HEAD
=======
=======
>>>>>>> 76999d0 (last)
compileOptions {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
<<<<<<< HEAD
>>>>>>> 8d271bc (end_code)
=======
>>>>>>> 76999d0 (last)
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
<<<<<<< HEAD
<<<<<<< HEAD
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'liji.library.dev:citypickerview:1.1.0'
=======
=======
>>>>>>> 76999d0 (last)
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
implementation 'liji.library.dev:citypickerview:1.1.0'
implementation "com.squareup.okhttp3:okhttp:4.2.2"
implementation group: 'com.alibaba', name: 'fastjson', version: '1.2.12'
<<<<<<< HEAD
>>>>>>> 8d271bc (end_code)
=======
implementation 'com.android.support:recyclerview-v7:28.0.0'
>>>>>>> 76999d0 (last)
}

@ -0,0 +1,27 @@
package com.example.orangesale_end;
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.orangesale_end", appContext.getPackageName());
}
}

@ -1,12 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
<<<<<<< HEAD
<<<<<<< HEAD
package="com.yemamacake.cn">
=======
package="com.example.orangesale_end">
<uses-permission android:name="android.permission.INTERNET" />
>>>>>>> 8d271bc (end_code)
=======
package="com.example.orangesale_end">
<uses-permission android:name="android.permission.INTERNET" />
>>>>>>> 76999d0 (last)
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
<<<<<<< HEAD
<<<<<<< HEAD
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name="com.yemamacake.cn.activity.MainActivity"
@ -20,6 +32,31 @@
<activity android:name="com.yemamacake.cn.activity.RegisterActivity" />
<activity android:name="com.yemamacake.cn.activity.CategoryActivity"/>
<activity android:name=".activity.IndexActivity"/>
=======
=======
>>>>>>> 76999d0 (last)
android:usesCleartextTraffic="true"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".activity.RegisterActivity"></activity>
<activity android:name=".activity.UserActivity" />
<activity android:name=".activity.CategoryActivity" />
<activity android:name=".activity.IndexActivity" />
<service
android:name=".service.TimeService"
android:enabled="true" />
<<<<<<< HEAD
>>>>>>> 8d271bc (end_code)
=======
>>>>>>> 76999d0 (last)
</application>
</manifest>

@ -0,0 +1,92 @@
package com.example.orangesale_end;
import android.content.Intent;
import android.os.Bundle;
import android.os.Looper;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import com.example.orangesale_end.activity.IndexActivity;
import com.example.orangesale_end.activity.RegisterActivity;
import com.example.orangesale_end.entity.OrangeUser;
import com.example.orangesale_end.netrequest.OkHttpUser;
import java.io.IOException;
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.user_login);
init();
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.register:
Intent intent = new Intent(MainActivity.this, RegisterActivity.class);
startActivity(intent);
break;
case R.id.login:
//注册时,我们引入了数据库,登录这里可以通过数据库进行验证,验证跳转到首页,不通过进行提示
Thread thread = new Thread(runnable);
thread.start();
break;
}
}
//界面组件初始化
private void init() {
usernameText = findViewById(R.id.username);
paswdEdit = findViewById(R.id.password);
loginButton = findViewById(R.id.login);
loginButton.setOnClickListener(this);
registerButton = findViewById(R.id.register);
registerButton.setOnClickListener(this);
}
/**
*
*/
Runnable runnable = new Runnable() {
@Override
public void run() {
String username = usernameText.getText().toString();
String password = paswdEdit.getText().toString();
OrangeUser orangeUser = new OrangeUser();
orangeUser.setUsername(username);
orangeUser.setPassword(password);
OkHttpUser okHttpUser = new OkHttpUser();
OrangeUser orangeUser1 = null;
try {
orangeUser1 = okHttpUser.userLogin(orangeUser);
if (orangeUser1 != null) {
Intent intent1 = new Intent(MainActivity.this, IndexActivity.class);
Bundle bundle = new Bundle();
bundle.putString("username", usernameText.getText().toString());
bundle.putString("password", orangeUser1.getPassword());
bundle.putString("city", orangeUser1.getCity());
bundle.putString("sex", orangeUser1.getSex());
intent1.putExtras(bundle);
startActivity(intent1);
} else {
//解决在子线程中调用Toast的异常情况处理
Looper.prepare();
Toast.makeText(MainActivity.this, "账号或者密码错误", Toast.LENGTH_SHORT).show();
Looper.loop();
}
} catch (IOException e) {
e.printStackTrace();
}
}
};
}

@ -0,0 +1,90 @@
package com.example.orangesale_end.activity;
import android.app.Activity;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.os.Bundle;
import android.widget.ListView;
import androidx.annotation.Nullable;
import com.example.orangesale_end.R;
import com.example.orangesale_end.adapter.Adapter;
import com.example.orangesale_end.entity.Product;
import com.example.orangesale_end.fragment.SetDetailFragment;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
public class CategoryActivity extends Activity {
public OnChangeListener onchangedListener;
private List<Product> productList;
private List<String> productCategory = new ArrayList<>();
private ListView titleList;
private Adapter adapter;
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.content_category);
initData();
init();
SetDetailFragment fragment = new SetDetailFragment();
FragmentManager fragmentManager = getFragmentManager();
FragmentTransaction transaction = fragmentManager.beginTransaction();
transaction.replace(R.id.category_detail, fragment);
transaction.commit();
titleList.setOnItemClickListener((parent, view, position, id) -> {
adapter.setSelectedPosition(position);
adapter.notifyDataSetInvalidated();
if (onchangedListener != null) {
onchangedListener.changeText(productList.get(position));
}
});
}
public void setOnChangeListener(OnChangeListener onChangeListener) {
this.onchangedListener = onChangeListener;
}
public interface OnChangeListener {
void changeText(Product product);
}
/**
*
*/
private void initData() {
productList = new ArrayList<>();
productCategory.add("橘子");
productCategory.add("橙子");
productCategory.add("柚子");
Product product = new Product();
product.setImageUrlId(R.drawable.arrow_down);
product.setProductName("橘子");
product.setProductPrice(new BigDecimal("9.9"));
Product product1 = new Product();
product1.setImageUrlId(R.drawable.orange);
product1.setProductName("橙子");
product1.setProductPrice(new BigDecimal("29.9"));
Product product2 = new Product();
product2.setImageUrlId(R.drawable.arrow_left);
product2.setProductName("柚子");
product2.setProductPrice(new BigDecimal("19.9"));
productList.add(product);
productList.add(product1);
productList.add(product2);
}
/**
*
*/
private void init() {
titleList = findViewById(R.id.category_title_list);
adapter = new Adapter(productCategory, CategoryActivity.this);
titleList.setAdapter(adapter);
}
}

@ -1,4 +1,4 @@
package com.yemamacake.cn.activity;
package com.example.orangesale_end.activity;
import android.app.Activity;
import android.app.FragmentTransaction;
@ -8,26 +8,59 @@ import android.view.View;
import android.widget.LinearLayout;
import androidx.annotation.Nullable;
<<<<<<< HEAD
import com.yemamacake.cn.R;
import com.yemamacake.cn.fragment.IndexFragment;
import com.yemamacake.cn.fragment.PearsonFragment;
import com.yemamacake.cn.fragment.ProductFragment;
import com.yemamacake.cn.fragment.ShoppingCartFragment;
import com.example.orangesale_end.R;
=======
import androidx.recyclerview.widget.LinearLayoutManager;
import com.example.orangesale_end.R;
import com.example.orangesale_end.adapter.ShoppingcartAdapter;
import com.example.orangesale_end.entity.OrangeShoppingcart;
>>>>>>> 76999d0 (last)
import com.example.orangesale_end.fragment.IndexFragment;
import com.example.orangesale_end.fragment.PearsonFragment;
import com.example.orangesale_end.fragment.ProductFragment;
import com.example.orangesale_end.fragment.ShoppingCartFragment;
import com.example.orangesale_end.service.TimeService;
<<<<<<< HEAD
=======
import java.util.ArrayList;
import java.util.List;
>>>>>>> 76999d0 (last)
public class IndexActivity extends Activity implements View.OnClickListener {
private IndexFragment indexFragment;
private ProductFragment productFragment;
private ShoppingCartFragment shoppingCartFragment;
private PearsonFragment pearsonFragment;
private LinearLayout indexLine, productLine, shoppingCartLine, pearsonLine;
<<<<<<< HEAD
=======
private List<OrangeShoppingcart>shoppingcarts=new ArrayList<>();
>>>>>>> 76999d0 (last)
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
init();
<<<<<<< HEAD
=======
OrangeShoppingcart orangeShoppingcart = new OrangeShoppingcart();
orangeShoppingcart.setId("商品序号1");
orangeShoppingcart.setNum("商品数量1");
orangeShoppingcart.setImgUrl(R.drawable.apple);
orangeShoppingcart.setProductId("商品编号1");
orangeShoppingcart.setUserId("用户id123");
shoppingcarts.add(orangeShoppingcart);
/* shoppingcartAdapter= new ShoppingcartAdapter(shoppingcarts, this);
LinearLayoutManager linearLayoutManager=new LinearLayoutManager(this);*/
>>>>>>> 76999d0 (last)
initIndexFragment();
Thread thread = new Thread(runnable);
thread.start();
}
/**
@ -71,7 +104,7 @@ public class IndexActivity extends Activity implements View.OnClickListener {
if (indexFragment == null) {
indexFragment = new IndexFragment();
}
transaction.replace(R.id.main_content, indexFragment);
transaction.replace(R.id.main_content0, indexFragment);
transaction.commit();
}
@ -84,7 +117,7 @@ public class IndexActivity extends Activity implements View.OnClickListener {
if (productFragment == null) {
productFragment = new ProductFragment();
}
transaction.replace(R.id.main_content, productFragment);
transaction.replace(R.id.main_content0, productFragment);
transaction.commit();
}
@ -95,9 +128,13 @@ public class IndexActivity extends Activity implements View.OnClickListener {
//开启事务fragment的控制是由事务来实现的
FragmentTransaction transaction = getFragmentManager().beginTransaction();
if (shoppingCartFragment == null) {
<<<<<<< HEAD
shoppingCartFragment = new ShoppingCartFragment();
=======
shoppingCartFragment = new ShoppingCartFragment(shoppingcarts);
>>>>>>> 76999d0 (last)
}
transaction.replace(R.id.main_content, shoppingCartFragment);
transaction.replace(R.id.main_content0, shoppingCartFragment);
transaction.commit();
}
@ -113,9 +150,13 @@ public class IndexActivity extends Activity implements View.OnClickListener {
pearsonFragment = new PearsonFragment();
pearsonFragment.setArguments(bundle);
}
transaction.replace(R.id.main_content, pearsonFragment);
transaction.replace(R.id.main_content0, pearsonFragment);
transaction.commit();
}
}
Runnable runnable = () -> {
Intent intent = new Intent(IndexActivity.this, TimeService.class);
startService(intent);
};
}

@ -1,10 +1,9 @@
package com.yemamacake.cn.activity;
package com.example.orangesale_end.activity;
import android.content.ContentValues;
import android.content.Intent;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Looper;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
@ -16,16 +15,19 @@ import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import com.lljjcoder.citypickerview.widget.CityPicker;
import com.yemamacake.cn.R;
import com.yemamacake.cn.database.MamacakeUser;
import com.example.orangesale_end.R;
import com.example.orangesale_end.entity.OrangeUser;
import com.example.orangesale_end.netrequest.OkHttpUser;
public class RegisterActivity extends AppCompatActivity implements View.OnClickListener, RadioGroup.OnCheckedChangeListener {
import java.io.IOException;
public class RegisterActivity extends AppCompatActivity implements View.OnClickListener, RadioGroup.OnCheckedChangeListener {
private EditText usernameEdit, passwordEdit, surePasswordEdit;
private TextView cityText;
private CityPicker cityPicker;
private Button regButton;
private RadioGroup sexGroup;
private String sexStr="男";
private String sexStr = "男";
@Override
@ -60,7 +62,9 @@ public class RegisterActivity extends AppCompatActivity implements View.OnCli
break;
case R.id.reg_register:
//注册验证方法
validateRegister();
//validateRegister();
Thread thread = new Thread(runnable);
thread.start();
break;
}
@ -106,57 +110,67 @@ public class RegisterActivity extends AppCompatActivity implements View.OnCli
}
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
//根据用户选择来改变sex的值
sexStr = checkedId == R.id.reg_man ? "男" : "女";
}
/**
*
*/
public void validateRegister() {
String username = usernameEdit.getText().toString();
String password = passwordEdit.getText().toString();
String surePassword = surePasswordEdit.getText().toString();
String city = cityText.getText().toString();
//判断两次密码是否输入一致
if (password.equals(surePassword)) {
//这里也可以再进行其它的验证,如是否符合要求等,符合就进行插入数据库操作
if (!username.equals("") || !password.equals("")) {
if (!city.equals("")) {
Bundle bundle = new Bundle();
bundle.putString("username", username);
bundle.putString("password", password);
bundle.putString("sex", sexStr);
bundle.putString("city", city);
MamacakeUser mamacakeUser = new MamacakeUser(RegisterActivity.this);
SQLiteDatabase sqLiteDatabase = mamacakeUser.getWritableDatabase();
insertData(sqLiteDatabase,bundle);
Intent intent = new Intent(RegisterActivity.this, IndexActivity.class);
intent.putExtras(bundle);
startActivity(intent);
intent.putExtras(bundle);
startActivity(intent);
Runnable runnable = new Runnable() {
@Override
public void run() {
String username = usernameEdit.getText().toString();
String password = passwordEdit.getText().toString();
String surePassword = surePasswordEdit.getText().toString();
String city = cityText.getText().toString();
//判断两次密码是否输入一致
if (password.equals(surePassword)) {
//这里也可以再进行其它的验证,如是否符合要求等,符合就进行插入数据库操作
if (!username.equals("") || !password.equals("")) {
if (!city.equals("")) {
Bundle bundle = new Bundle();
bundle.putString("username", username);
bundle.putString("password", password);
bundle.putString("sex", sexStr);
bundle.putString("city", city);
OrangeUser orangeUser = new OrangeUser();
orangeUser.setUsername(username);
orangeUser.setPassword(password);
orangeUser.setCity(city);
orangeUser.setSex(sexStr);
//将使用安卓自身带的SQLite数据库换成调用okhttp的方式
OkHttpUser okHttpUser = new OkHttpUser();
try {
if (okHttpUser.userRegister(orangeUser)) {
Intent intent = new Intent(RegisterActivity.this, IndexActivity.class);
intent.putExtras(bundle);
startActivity(intent);
} else {
Looper.prepare();
Toast.makeText(RegisterActivity.this, "注册失败!", Toast.LENGTH_SHORT).show();
Looper.loop();
}
} catch (IOException e) {
e.printStackTrace();
}
} else {
Looper.prepare();
Toast.makeText(RegisterActivity.this, "请选择地址", Toast.LENGTH_SHORT).show();
Looper.loop();
}
} else {
Toast.makeText(RegisterActivity.this, "请选择地址", Toast.LENGTH_SHORT).show();
Looper.prepare();
Toast.makeText(RegisterActivity.this, "账号或密码未填写", Toast.LENGTH_SHORT).show();
Looper.loop();
}
} else {
Toast.makeText(RegisterActivity.this, "账号或密码未填写", Toast.LENGTH_SHORT).show();
Looper.prepare();
Toast.makeText(RegisterActivity.this, "两次密码输入不一致", Toast.LENGTH_SHORT).show();
Looper.loop();
}
} else {
Toast.makeText(RegisterActivity.this, "两次密码输入不一致", Toast.LENGTH_SHORT).show();
}
}
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
//根据用户选择来改变sex的值
sexStr = checkedId == R.id.reg_man ? "男" : "女";
}
private void insertData(SQLiteDatabase sqLiteDatabase, Bundle bundle) {
ContentValues contentValues = new ContentValues();
contentValues.put("username", bundle.getString("username"));
contentValues.put("password", bundle.getString("password"));
contentValues.put("sex", bundle.getString("sex"));
contentValues.put("city", bundle.getString("city"));
sqLiteDatabase.insert("cake_user", null, contentValues);
sqLiteDatabase.close();
}
};
}

@ -1,4 +1,4 @@
package com.yemamacake.cn.activity;
package com.example.orangesale_end.activity;
import android.app.Activity;
import android.content.Intent;
@ -10,7 +10,7 @@ import android.widget.TextView;
import androidx.annotation.Nullable;
import com.yemamacake.cn.R;
import com.example.orangesale_end.R;
public class UserActivity extends Activity implements View.OnClickListener {
private ImageView userIconImage;
@ -38,7 +38,7 @@ public class UserActivity extends Activity implements View.OnClickListener {
userPayLine = findViewById(R.id.user_pay);
userSettingLine = findViewById(R.id.user_setting);
userGeneralLine = findViewById(R.id.user_general);
userSearchProductLine = findViewById(R.id.user_searchProduct);
// userSearchProductLine = findViewById(R.id.user_searchProduct);
userSearchProductLine.setOnClickListener(this);
setData();
}
@ -57,10 +57,10 @@ public class UserActivity extends Activity implements View.OnClickListener {
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.user_searchProduct:
/*case R.id.user_searchProduct:
Intent intent1 = new Intent(UserActivity.this, CategoryActivity.class);
startActivity(intent1);
break;
break;*/
}
}
}

@ -0,0 +1,30 @@
package com.example.orangesale_end.activity.holder;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.example.orangesale_end.R;
public class ViewHolder extends RecyclerView.ViewHolder
{
public TextView shproductid;
public TextView shuserid;
public ImageView imageView;
public TextView shid;
public TextView shproductnum;
public ViewHolder(@NonNull View itemView) {
super(itemView);
shid = itemView.findViewById(R.id.shid);
shuserid=itemView.findViewById(R.id.userid);
shproductnum=itemView.findViewById(R.id.shproductnum);
imageView=itemView.findViewById(R.id.shoppingproductpicture);
shproductid=itemView.findViewById(R.id.shproductid);
}
}

@ -1,4 +1,4 @@
package com.yemamacake.cn.adapter;
package com.example.orangesale_end.adapter;
import android.content.Context;
import android.graphics.Color;
@ -9,20 +9,21 @@ import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.yemamacake.cn.R;
import com.example.orangesale_end.R;
import java.util.List;
public class Myadapter extends BaseAdapter {
private List <String > productCategory;
LayoutInflater layoutInflater;
private int selectionPosition=-1;
public Myadapter(List<String> productCategory, Context context)
{
this.productCategory=productCategory;
public class Adapter extends BaseAdapter {
private List<String> productCategory;
private LayoutInflater layoutInflater;
private int selectionPosition = -1;
public Adapter(List<String> productCategory, Context context) {
this.productCategory = productCategory;
this.layoutInflater = LayoutInflater.from(context);
}
} @Override
@Override
public int getCount() {
return productCategory.size();
}
@ -51,19 +52,18 @@ public class Myadapter extends BaseAdapter {
}
viewHolder.tv.setText(productCategory.get(position));
if (selectionPosition == position) {
viewHolder.tv.setBackgroundColor(Color.RED);} else {
viewHolder.tv.setBackgroundColor(Color.YELLOW);
} else {
viewHolder.tv.setBackgroundColor(Color.WHITE);
}
return convertView;
}
public void setSelectedPosition(int position) {
this.selectionPosition = position;
}
class ViewHolder
{
class ViewHolder {
TextView tv;
}
}

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

@ -1,7 +1,6 @@
package com.yemamacake.cn.adapter;
package com.example.orangesale_end.adapter;
import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -9,28 +8,29 @@ import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.yemamacake.cn.R;
import com.yemamacake.cn.entity.Product;
import com.example.orangesale_end.R;
import com.example.orangesale_end.entity.OrangeProductPack;
import java.util.List;
public class ProductAdapter extends BaseAdapter {
private List<Product> productList;
//private List<Product> productList;
private List<OrangeProductPack> orangeProductList;
private LayoutInflater layoutInflater;
public ProductAdapter(Context context, List<Product> productList) {
this.productList = productList;
public ProductAdapter(Context context, List<OrangeProductPack> orangeProductList) {
this.orangeProductList = orangeProductList;
this.layoutInflater = LayoutInflater.from(context);
}
@Override
public int getCount() {
return productList.size();
return orangeProductList.size();
}
@Override
public Object getItem(int position) {
return productList.get(position);
return orangeProductList.get(position);
}
@Override
@ -42,8 +42,7 @@ public class ProductAdapter extends BaseAdapter {
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder viewHolder;
if (convertView == null) {
Log.i("aa", "getView: "+"aa");
convertView = layoutInflater.inflate(R.layout.category_detail_content, null);
convertView = layoutInflater.inflate(R.layout.categoty_detail_content, null);
viewHolder = new ViewHolder();
viewHolder.productImage = convertView.findViewById(R.id.category_product_image);
viewHolder.productName = convertView.findViewById(R.id.category_product_name);
@ -52,12 +51,11 @@ public class ProductAdapter extends BaseAdapter {
} else {
viewHolder = (ViewHolder) convertView.getTag();
}
Product product = productList.get(position);
Log.i("product", "getView: "+product.toString());
OrangeProductPack product = orangeProductList.get(position);
if (product != null) {
viewHolder.productImage.setBackgroundResource(product.getImageUrlId());
viewHolder.productName.setText(product.getProductName());
viewHolder.productPrice.setText(String.valueOf(product.getProductPrice()));
viewHolder.productImage.setImageBitmap(product.getImgBitmap());
viewHolder.productName.setText(product.getName());
viewHolder.productPrice.setText(String.format("%s元", String.valueOf(product.getPrice())));
}
return convertView;
}
@ -66,4 +64,5 @@ public class ProductAdapter extends BaseAdapter {
ImageView productImage;
TextView productName, productPrice;
}
}

@ -0,0 +1,84 @@
package com.example.orangesale_end.adapter;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.example.orangesale_end.R;
import com.example.orangesale_end.activity.holder.ViewHolder;
import com.example.orangesale_end.entity.OrangeShoppingcart;
import java.util.List;
public class ShoppingcartAdapter extends RecyclerView.Adapter<ViewHolder> {
private Context context;
private List <OrangeShoppingcart> orangeShoppingcarts;
public ShoppingcartAdapter(List<OrangeShoppingcart> orangeShoppingcarts, Context context) {
this.orangeShoppingcarts = orangeShoppingcarts;
this.context=context;
}
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view=View.inflate(context,R.layout.item_review_shopping,null);
ViewHolder viewHolder=new ViewHolder(view);
return viewHolder;
}
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
OrangeShoppingcart orangeShoppingcart=orangeShoppingcarts.get(position);
holder.imageView.setImageResource(orangeShoppingcart.getImgUrl());
holder.shid.setText(String.valueOf(orangeShoppingcart.getId()));
holder.shproductid.setText(String.valueOf(orangeShoppingcart.getProductId()));
holder.shproductnum.setText(String.valueOf(orangeShoppingcart.getNum()));
holder.shuserid.setText(String.valueOf(orangeShoppingcart.getUserId()));
}
@Override
public int getItemCount() {
return orangeShoppingcarts.size();
}
/* @Override
public View getView(int i, View view, ViewGroup viewGroup) {
ViewHolder viewHolder;
if (view==null)
{
view=LayoutInflater.from(context).inflate(R.layout.item_gridview_shopping,null);
viewHolder=new ViewHolder();
viewHolder.shproductid=view.findViewById(R.id.shproductid);
viewHolder.shuserid=view.findViewById(R.id.userid);
viewHolder.imageView=view.findViewById(R.id.shoppingproductpicture);
viewHolder.shid=view.findViewById(R.id.shid);
viewHolder.shproductnum=view.findViewById(R.id.shproductnum);
view.setTag(viewHolder);
}
else {
viewHolder = (ViewHolder)view.getTag();
}
OrangeShoppingcart orangeShoppingcart = orangeShoppingcarts.get(i);
if (orangeShoppingcart!=null)
{
viewHolder.shuserid.setText(String.valueOf(orangeShoppingcart.getUserId()));
viewHolder.shproductid.setText(String.valueOf(orangeShoppingcart.getProductId()));
viewHolder.imageView.setImageResource(
orangeShoppingcart.getImgUrl());
viewHolder.shid.setText(String.valueOf(orangeShoppingcart.getId()));
viewHolder.shproductnum.setText(String.valueOf(orangeShoppingcart.getNum()));
}
return view;
}
*/
}

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

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

@ -0,0 +1,64 @@
package com.example.orangesale_end.entity;
import java.math.BigDecimal;
import java.sql.Timestamp;
public class OrangeProduct {
private Integer id;
private String name;
private BigDecimal price;
private String imgUrl;
@Override
public String toString() {
return "OrangeProduct{" +
"id=" + id +
", name='" + name + '\'' +
", price=" + price +
", imgUrl='" + imgUrl + '\'' +
", addTime=" + addTime +
'}';
}
public Timestamp getAddTime() {
return addTime;
}
public void setAddTime(Timestamp addTime) {
this.addTime = addTime;
}
private Timestamp addTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public BigDecimal getPrice() {
return price;
}
public void setPrice(BigDecimal price) {
this.price = price;
}
public String getImgUrl() {
return imgUrl;
}
public void setImgUrl(String imgUrl) {
this.imgUrl = imgUrl;
}
}

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

@ -0,0 +1,99 @@
package com.example.orangesale_end.entity;
import java.io.Serializable;
public class OrangeShoppingcart implements Serializable {
/**
*
*
* @mbg.generated
*/
private String id;
/**
* id
*
* @mbg.generated
*/
private String userId;
/**
* id
*
* @mbg.generated
*/
private String productId;
/**
*
*
* @mbg.generated
*/
private String num;
private Integer imgUrl;
private static final long serialVersionUID = 1L;
public OrangeShoppingcart() {
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getProductId() {
return productId;
}
public void setProductId(String productId) {
this.productId = productId;
}
public String getNum() {
return num;
}
public void setNum(String num) {
this.num = num;
}
@Override
public String toString() {
return "OrangeShoppingcart{" +
"id=" + id +
", userId=" + userId +
", productId=" + productId +
", num=" + num +
", imgUrl=" + imgUrl +
'}';
}
public OrangeShoppingcart(String id, String userId, String productId,String num, int imgUrl) {
this.id = id;
this.userId = userId;
this.productId = productId;
this.num = num;
this.imgUrl = imgUrl;
}
public int getImgUrl() {
return imgUrl;
}
public void setImgUrl(int imgUrl) {
this.imgUrl = imgUrl;
}
}

@ -1,4 +1,4 @@
package com.yemamacake.cn.entity;
package com.example.orangesale_end.entity;
public class OrangeUser {
private Integer id;

@ -1,25 +1,8 @@
package com.yemamacake.cn.entity;
package com.example.orangesale_end.entity;
import java.math.BigDecimal;
public class Product {
private Integer imageUrlId;
private String productName;
private BigDecimal productPrice;
private String productIntroduce;
public Product() {
}
public Integer getImageUrlId() {
return imageUrlId;
}
public void setImageUrlId(Integer imageUrlId) {
this.imageUrlId = imageUrlId;
}
public String getProductName() {
return productName;
@ -37,11 +20,24 @@ public class Product {
this.productPrice = productPrice;
}
public String getProductIntroduce() {
return productIntroduce;
public Integer getImageUrlId() {
return imageUrlId;
}
public void setImageUrlId(Integer imageUrlId) {
this.imageUrlId = imageUrlId;
}
public void setProductIntroduce(String productIntroduce) {
this.productIntroduce = productIntroduce;
private Integer imageUrlId;
private String productName;
private BigDecimal productPrice;
@Override
public String toString() {
return "Product{" +
"imageUrlId=" + imageUrlId +
", productName='" + productName + '\'' +
", productPrice=" + productPrice +
'}';
}
}

@ -0,0 +1,44 @@
package com.example.orangesale_end.entity;
public class ShoppingCart {
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public Integer getProductId() {
return ProductId;
}
public void setProductId(Integer productId) {
ProductId = productId;
}
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
private Integer id;
private Integer userId;
private Integer ProductId;
/**
*
*/
private Integer number;
}

@ -1,6 +1,7 @@
package com.yemamacake.cn.fragment;
package com.example.orangesale_end.fragment;
import android.app.Fragment;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
@ -12,20 +13,25 @@ import android.widget.SearchView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.yemamacake.cn.R;
import com.yemamacake.cn.adapter.ProductAdapter;
import com.yemamacake.cn.entity.Product;
import com.example.orangesale_end.R;
import com.example.orangesale_end.adapter.ProductAdapter;
import com.example.orangesale_end.entity.OrangeProductPack;
import com.example.orangesale_end.entity.Product;
import com.example.orangesale_end.netrequest.OkHttpClientProduct;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
public class IndexFragment extends Fragment implements View.OnClickListener {
private SearchView searchView;
private LinearLayout orangeLine, youziLine, juziLine, xiguaLine, liLine, appleLine, lemonLine, mangguoLine;
private GridView gridView;
private List<Product> productList;
private ProductAdapter productAdapter;
private List<Product> productList;
private List<OrangeProductPack> list = new ArrayList<>();
@Nullable
@Override
@ -41,6 +47,7 @@ public class IndexFragment extends Fragment implements View.OnClickListener {
private void init(View view) {
searchView = view.findViewById(R.id.searchView);
searchView.setOnClickListener(this);
<<<<<<< HEAD
orangeLine = view.findViewById(R.id.breakfast);
orangeLine.setOnClickListener(this);
youziLine = view.findViewById(R.id.);
@ -56,11 +63,27 @@ public class IndexFragment extends Fragment implements View.OnClickListener {
mangguoLine = view.findViewById(R.id.fruit_tea);
mangguoLine.setOnClickListener(this);
appleLine = view.findViewById(R.id.birthcake);
=======
orangeLine = view.findViewById(R.id.chengzi);
orangeLine.setOnClickListener(this);
youziLine = view.findViewById(R.id.youzi);
youziLine.setOnClickListener(this);
juziLine = view.findViewById(R.id.juzi);
juziLine.setOnClickListener(this);
xiguaLine = view.findViewById(R.id.xigua);
xiguaLine.setOnClickListener(this);
liLine = view.findViewById(R.id.li);
liLine.setOnClickListener(this);
lemonLine = view.findViewById(R.id.lemon);
lemonLine.setOnClickListener(this);
mangguoLine = view.findViewById(R.id.mangguo);
mangguoLine.setOnClickListener(this);
appleLine = view.findViewById(R.id.apple);
>>>>>>> 76999d0 (last)
appleLine.setOnClickListener(this);
gridView = view.findViewById(R.id.index_famous_gridview);
initData();
productAdapter = new ProductAdapter(getActivity(), productList);
gridView.setAdapter(productAdapter);
//initData();
new SearchProductTask().execute();
}
@ -75,6 +98,7 @@ public class IndexFragment extends Fragment implements View.OnClickListener {
private void initData() {
productList = new ArrayList<>();
Product product = new Product();
<<<<<<< HEAD
product.setImageUrlId(R.drawable.strawberrybread);
product.setProductName("草莓蛋糕");
product.setProductPrice(new BigDecimal("29.9"));
@ -97,6 +121,30 @@ public class IndexFragment extends Fragment implements View.OnClickListener {
Product product5 = new Product();
product5.setImageUrlId(R.drawable.user_cake);
product5.setProductName("慕斯卷");
=======
product.setImageUrlId(R.drawable.juzip);
product.setProductName("橘子");
product.setProductPrice(new BigDecimal("9.9"));
Product product1 = new Product();
product1.setImageUrlId(R.drawable.orange);
product1.setProductName("橙子");
product1.setProductPrice(new BigDecimal("29.9"));
Product product2 = new Product();
product2.setImageUrlId(R.drawable.youzip);
product2.setProductName("柚子");
product2.setProductPrice(new BigDecimal("19.9"));
Product product3 = new Product();
product3.setImageUrlId(R.drawable.xiguap);
product3.setProductName("西瓜");
product3.setProductPrice(new BigDecimal("19.9"));
Product product4 = new Product();
product4.setImageUrlId(R.drawable.applep);
product4.setProductName("苹果");
product4.setProductPrice(new BigDecimal("49.9"));
Product product5 = new Product();
product5.setImageUrlId(R.drawable.lemonp);
product5.setProductName("柠檬");
>>>>>>> 76999d0 (last)
product5.setProductPrice(new BigDecimal("9.9"));
productList.add(product);
productList.add(product1);
@ -104,7 +152,32 @@ public class IndexFragment extends Fragment implements View.OnClickListener {
productList.add(product3);
productList.add(product4);
productList.add(product5);
<<<<<<< HEAD
=======
>>>>>>> 76999d0 (last)
}
}
/**
*
*/
class SearchProductTask extends AsyncTask<Void, Void, List<OrangeProductPack>> {
@Override
protected List<OrangeProductPack> doInBackground(Void... voids) {
OkHttpClientProduct clientProduct = new OkHttpClientProduct();
try {
list = clientProduct.getProductPack();
} catch (IOException e) {
e.printStackTrace();
}
return list;
}
@Override
protected void onPostExecute(List<OrangeProductPack> orangeProducts) {
productAdapter = new ProductAdapter(getActivity(), list);
gridView.setAdapter(productAdapter);
}
}
}

@ -1,4 +1,4 @@
package com.yemamacake.cn.fragment;
package com.example.orangesale_end.fragment;
import android.app.Fragment;
import android.os.Bundle;
@ -12,7 +12,7 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.yemamacake.cn.R;
import com.example.orangesale_end.R;
public class PearsonFragment extends Fragment implements View.OnClickListener {
private ImageView userIconImage;

@ -0,0 +1,102 @@
package com.example.orangesale_end.fragment;
import android.app.Fragment;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.GridView;
import android.widget.Spinner;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.example.orangesale_end.R;
import com.example.orangesale_end.adapter.ListViewAdapter;
import com.example.orangesale_end.adapter.ProductAdapter;
import com.example.orangesale_end.entity.Condition;
import com.example.orangesale_end.entity.OrangeProductPack;
import com.example.orangesale_end.netrequest.OkHttpClientProduct;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class ProductFragment extends Fragment {
private Spinner conditonListSpinner;
private ListViewAdapter listViewAdapter;
private List<Condition> conditionList;
private GridView productGridView;
private List<OrangeProductPack> orangeProductList = new ArrayList<>();
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = LayoutInflater.from(getActivity()).inflate(R.layout.content_product, container, false);
init(view);
return view;
}
/**
*
*
* @param view
*/
private void init(View view) {
conditonListSpinner = view.findViewById(R.id.product_select_condition);
initCondList();
listViewAdapter = new ListViewAdapter(getActivity(), conditionList);
conditonListSpinner.setAdapter(listViewAdapter);
productGridView = view.findViewById(R.id.product_list);
new SearchProductTask().execute();
}
/**
* conditionList
*/
private void initCondList() {
conditionList = new ArrayList<>();
Condition allCondition = new Condition();
allCondition.setConditionIcon(R.drawable.all);
allCondition.setConditionName("全部");
Condition saleCondition = new Condition();
saleCondition.setConditionIcon(R.drawable.salenum);
saleCondition.setConditionName("按销量高低排序");
Condition timeCondition = new Condition();
timeCondition.setConditionIcon(R.drawable.time);
timeCondition.setConditionName("按上市时间排序");
Condition priceCondition = new Condition();
priceCondition.setConditionIcon(R.drawable.price);
priceCondition.setConditionName("按商品价格排序");
conditionList.add(allCondition);
conditionList.add(saleCondition);
conditionList.add(timeCondition);
conditionList.add(priceCondition);
}
/**
*
*/
class SearchProductTask extends AsyncTask<Void, Void, List<OrangeProductPack>> {
@Override
protected List<OrangeProductPack> doInBackground(Void... voids) {
OkHttpClientProduct clientProduct = new OkHttpClientProduct();
try {
orangeProductList = clientProduct.getProductPack();
} catch (IOException e) {
e.printStackTrace();
}
return orangeProductList;
}
@Override
protected void onPostExecute(List<OrangeProductPack> orangeProducts) {
ProductAdapter productAdapter = new ProductAdapter(getActivity(), orangeProductList);
productGridView.setAdapter(productAdapter);
}
}
}

@ -1,5 +1,4 @@
package com.yemamacake.cn.fragment;
package com.example.orangesale_end.fragment;
import android.annotation.SuppressLint;
import android.app.Fragment;
@ -14,21 +13,21 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.yemamacake.cn.R;
import com.yemamacake.cn.activity.CategoryActivity;
import com.example.orangesale_end.R;
import com.example.orangesale_end.activity.CategoryActivity;
import java.util.Objects;
public class SetDetailFragment extends Fragment {
private View view;
private ImageView imageView;
private TextView nameText, priceText,produceText;
private TextView nameText, priceText;
@SuppressLint("SetTextI18n")
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
view = inflater.inflate(R.layout.category_detail_content, container, false);
view = inflater.inflate(R.layout.categoty_detail_content, container, false);
if (view != null) {
init();
}
@ -38,7 +37,6 @@ public class SetDetailFragment extends Fragment {
imageView.setBackgroundResource(product.getImageUrlId());
nameText.setText(product.getProductName());
priceText.setText(product.getProductPrice().toString());
produceText.setText(product.getProductIntroduce());
});
return view;
}

@ -0,0 +1,149 @@
package com.example.orangesale_end.fragment;
<<<<<<< HEAD
import android.app.Fragment;
import android.app.FragmentTransaction;
=======
import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.app.Fragment;
import android.app.FragmentTransaction;
import android.content.DialogInterface;
>>>>>>> 76999d0 (last)
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
<<<<<<< HEAD
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.example.orangesale_end.R;
=======
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.example.orangesale_end.R;
import com.example.orangesale_end.adapter.ShoppingcartAdapter;
import com.example.orangesale_end.entity.OrangeShoppingcart;
>>>>>>> 76999d0 (last)
import com.example.orangesale_end.entity.ShoppingCart;
import java.util.ArrayList;
import java.util.List;
public class ShoppingCartFragment extends Fragment implements View.OnClickListener {
private Button walkButton;
<<<<<<< HEAD
private List<ShoppingCart> cartList = new ArrayList<>();
private ProductFragment productFragment;
=======
private List<OrangeShoppingcart> cartList=new ArrayList<>();
private ProductFragment productFragment;
private RecyclerView recyclerView;
public ShoppingCartFragment() {
}
@SuppressLint("ValidFragment")
public ShoppingCartFragment(List<OrangeShoppingcart> cartList) {
this.cartList = cartList;
}
>>>>>>> 76999d0 (last)
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view;
<<<<<<< HEAD
if (cartList.size() > 0) {
//有商品
view = LayoutInflater.from(getActivity()).inflate(R.layout.cart_have_product, container, false);
} else {
view = LayoutInflater.from(getActivity()).inflate(R.layout.cart_no_product, container, false);
}
init(view);
=======
//有商品
view = LayoutInflater.from(getActivity()).inflate(R.layout.cart_have_product, container, false);
init(view);
>>>>>>> 76999d0 (last)
return view;
}
/**
*
*/
private void init(View view) {
<<<<<<< HEAD
walkButton = view.findViewById(R.id.random_search);
walkButton.setOnClickListener(this);
=======
recyclerView=view.findViewById(R.id.cart_productList);
LinearLayoutManager linearLayoutManager=new LinearLayoutManager(getActivity());
recyclerView.setLayoutManager(linearLayoutManager);
ShoppingcartAdapter shoppingcartAdapter = new ShoppingcartAdapter(cartList, getActivity());
recyclerView.setAdapter(shoppingcartAdapter);
onClick(view);
>>>>>>> 76999d0 (last)
}
@Override
public void onClick(View v) {
switch (v.getId()) {
<<<<<<< HEAD
case R.id.random_search:
//开启事务fragment的控制是由事务来实现的
FragmentTransaction transaction = getFragmentManager().beginTransaction();
if (productFragment == null) {
productFragment = new ProductFragment();
}
transaction.replace(R.id.main_content0, productFragment);
transaction.commit();
break;
=======
case R.id.jiesuan:
{
Button b1=(Button) getActivity().findViewById(R.id.jiesuan);
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
AlertDialog.Builder builder=new AlertDialog.Builder(getActivity());//设置图标
builder.setTitle("确认结算商品吗");//设置对话框的标题
builder.setMessage("请确认好自己所结算的商品");//设置对话框的内容
builder.setPositiveButton("确定", new DialogInterface.OnClickListener() { //这个是设置确定按钮
@Override
public void onClick(DialogInterface arg0, int arg1) {
Toast.makeText(getActivity(), "结算成功", Toast.LENGTH_SHORT).show();
}
});
builder.setNegativeButton("取消", new DialogInterface.OnClickListener() { //取消按钮
@Override
public void onClick(DialogInterface arg0, int arg1) {
Toast.makeText(getActivity(), "您取消结算!",Toast.LENGTH_SHORT).show();
}
});
AlertDialog b=builder.create();
b.show(); //必须show一下才能看到对话框跟Toast一样的道理
}
});
break;}
>>>>>>> 76999d0 (last)
}
}
}

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

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

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

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

@ -0,0 +1,65 @@
package com.example.orangesale_end.util;
/**
*
* @author llw
*/
public class Constant {
public static final String CAR_JSON = "{ \"code\" : 200 ,\n" +
" \"orderData\" : [\n" +
" {\n" +
"\n" +
" \"productproduce\":\"活力早餐\",\n" +
" \"cartlist\": [\n" +
" {\n" +
" \"id\": 1,\n" +
" \"productproduce\": \"活力早餐\",\n" +
" \"defaultPic\": \"https://tse2-mm.cn.bing.net/th/id/OIP-C.FKgYJy9NYrL4RZKo42VCIAHaE8?w=292&h=195&c=7&r=0&o=5&dpr=1.3&pid=1.7\",\n" +
" \"productId\": 1,\n" +
" \"productName\": \"纯奶吐司\",\n"+
" \"price\": 10,\n" +
" \"count\":1\n" +
" },\n" +
" {\n" +
" \"id\": 2,\n" +
" \"productproduce\": \"甜品慕斯\",\n" +
" \"defaultPic\": \"https://img14.360buyimg.com/n0/jfs/t2971/15/167732091/93002/204c1016/574d9d9aNe4e6fa7a.jpg\",\n" +
" \"productId\": 2,\n" +
" \"productName\": \"草莓慕斯蛋糕\",\n"+
" \"price\": 19.9,\n" +
" \"count\": 1\n" +
" }\n" +
" ]\n" +
" }\n" +
" ,\n" +
" {\n" +
" \"productproduce\":\"中式传统糕点\",\n" +
" \"cartlist\": [\n" +
" {\n" +
" \"id\": 1,\n" +
" \"productp\": \"中式传统糕点\",\n" +
" \"defaultPic\": \"https://img.alicdn.com/imgextra/i4/2208137990237/O1CN01ap4J4O1DcaTrhAIvA_!!2208137990237.jpg\",\n" +
" \"productId\": 1,\n" +
" \"productName\": \"桃酥\",\n" +
" \"price\": 10.9,\n" +
" \"count\":1\n" +
" }\n" +
" ]\n" +
" }\n" +
" ,\n" +
" {\n" +
" \"productproduce\":\"中式新糕点\",\n" +
" \"cartlist\": [\n" +
" {\n" +
" \"id\": 1,\n" +
" \"productproduce\":\"中式新糕点\",\n" +
" \"defaultPic\": \"https://ts1.cn.mm.bing.net/th/id/R-C.528c10e20ecf8276a0d05363506924e1?rik=wzIkFM3Eu7TH6A&riu=http%3a%2f%2fimg.zcool.cn%2fcommunity%2f011f6258d54bc5a801219c77be307c.jpg%401280w_1l_2o_100sh.jpg&ehk=fM6ac87gUuwrvLINm7jeR804iZweyvlAWbbCi2%2bEknU%3d&risl=&pid=ImgRaw&r=0\",\n" +
" \"productId\": 1,\n" +
" \"productName\": \"冰皮绿豆糕\",\n" +
" \"price\": 15.9,\n" +
" \"count\":1\n" +
" },\n" +
"}";
}

@ -1,98 +0,0 @@
package com.yemamacake.cn.activity;
import android.app.Activity;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.os.Bundle;
import android.widget.ListView;
import androidx.annotation.Nullable;
import com.yemamacake.cn.R;
import com.yemamacake.cn.adapter.Myadapter;
import com.yemamacake.cn.entity.Product;
import com.yemamacake.cn.fragment.SetDetailFragment;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
public class CategoryActivity extends Activity {
private OnChangeListener onchangedListener;
private List <Product> productList;
private List <String> productCategory=new ArrayList <>();
private ListView titleList;
private Myadapter adapter;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.content_category);
initData();//初始化数据
init();
SetDetailFragment fragment = new SetDetailFragment();
FragmentManager fragmentManager = getFragmentManager();
FragmentTransaction transaction = fragmentManager.beginTransaction();
transaction.replace(R.id.category_detail,fragment);
transaction.commit();
titleList.setOnItemClickListener((parent, view, position, id) -> {
adapter.setSelectedPosition(position);
adapter.notifyDataSetInvalidated();
if (onchangedListener != null) {
onchangedListener.changeText(productList.get(position));
}
});
}
private void initData() {
productList= new ArrayList<>();//在此进行新建
productCategory.add("美味面包");
productCategory.add("酥松蛋糕");
productCategory.add("甜品慕斯");
productCategory.add("生日蛋糕");
Product product = new Product();
product.setProductIntroduce("选用高筋面粉、优质牛奶制作,不加一滴水");
product.setImageUrlId(R.drawable.img_4);
product.setProductName("手工奶香吐司");
product.setProductPrice(new BigDecimal("9.9"));//需将9.9进行bigdecimal类型转化
Product product1 = new Product();
product1.setProductIntroduce("选用低筋面粉、新鲜草莓制作满满果粒get!");
product1.setImageUrlId(R.drawable.img_5);
product1.setProductName("草莓戚风");
product1.setProductPrice(new BigDecimal("15.9"));
Product product2 = new Product();
product2.setProductIntroduce("动物奶油、新鲜芒果,诚意满满");
product2.setImageUrlId(R.drawable.img_6);
product2.setProductName("芒果盒子");
product2.setProductPrice(new BigDecimal("10.9"));
Product product3=new Product();
product3.setProductIntroduce("我们承诺,纯动物奶油、新鲜水果,只为您带来最好的体验");
product3.setProductPrice(new BigDecimal(99));
product3.setProductName("八寸水果生日蛋糕");
product3.setImageUrlId(R.drawable.cake);
productList.add(product);
productList.add(product1);
productList.add(product2);
productList.add(product3);
}
private void init()
{
titleList = findViewById(R.id.category_title_list);
adapter=new Myadapter(productCategory,CategoryActivity.this);
titleList.setAdapter(adapter);
}
public void setOnChangeListener(OnChangeListener onChangeListener) {
this.onchangedListener = onChangeListener;
}
public interface OnChangeListener {
void changeText(Product product);
}
}

@ -1,75 +0,0 @@
package com.yemamacake.cn.activity;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import com.yemamacake.cn.R;
import com.yemamacake.cn.database.MamacakeUser;
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.user_login);
init();
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.register:
Intent intent = new Intent(MainActivity.this, RegisterActivity.class);
startActivity(intent);
break;
case R.id.login:
if(validateLogin())
{
Intent intent1 = new Intent(MainActivity.this,UserActivity.class);
Bundle bundle = new Bundle();
MamacakeUser mamacakeUser = new MamacakeUser(MainActivity.this);
bundle.putString("username",usernameText.getText().toString());
bundle = mamacakeUser.queryUserInfo(mamacakeUser.getReadableDatabase(), bundle);
intent1.putExtras(bundle);
startActivity(intent1);
}
else {
Toast.makeText(MainActivity.this, "账号或密码错误", Toast.LENGTH_SHORT).show();
}
break;
}
}
//界面组件初始化
private void init() {
usernameText = findViewById(R.id.username);
paswdEdit = findViewById(R.id.password);
loginButton = findViewById(R.id.login);
loginButton.setOnClickListener(this);
registerButton = findViewById(R.id.register);
registerButton.setOnClickListener(this);
}
private boolean validateLogin() {
String username = usernameText.getText().toString();
MamacakeUser mamacakeUser = new MamacakeUser(MainActivity.this);
String password = paswdEdit.getText().toString();
SQLiteDatabase sqLiteDatabase = mamacakeUser.getReadableDatabase();
Cursor cursor = sqLiteDatabase.rawQuery("select * from cake_user where username=? and password=?", new String[]{username, password});
if (cursor.getCount() > 0) {
return true;
}
return false;
}
}

@ -1,52 +0,0 @@
package com.yemamacake.cn.database;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.os.Bundle;
import androidx.annotation.Nullable;
public class MamacakeUser extends SQLiteOpenHelper {
public MamacakeUser(@Nullable Context context) {
super(context, "yemamadatabase", null, 1);
}
@Override
public void onCreate(SQLiteDatabase sqLiteDatabase) {
String sql = "create table cake_user(id integer primary key autoincrement, username varchar(50), password varchar(50),sex varchar(10),city carchar(50))";
sqLiteDatabase.execSQL(sql);
}
@Override
public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {
}
//插入操作
public void insertUser(SQLiteDatabase sqLiteDatabase, String username, String password, String sex, String city) {
ContentValues contentValues = new ContentValues();
contentValues.put("username", username);
contentValues.put("password", password);
contentValues.put("sex", sex);
contentValues.put("city", city);
sqLiteDatabase.insert("cake_user", null, contentValues);
sqLiteDatabase.close();
}
public Bundle queryUserInfo(SQLiteDatabase sqLiteDatabase, Bundle bundle) {
String username = bundle.getString("username");
Cursor cursor = sqLiteDatabase.rawQuery("select * from cake_user where username=?", new String[]{username});
if (cursor != null) {
while (cursor.moveToNext()) {
bundle.putString("sex", cursor.getString(3));
bundle.putString("city", cursor.getString(4));
}
}
cursor.close();
sqLiteDatabase.close();
return bundle;
}
}

@ -1,21 +0,0 @@
package com.yemamacake.cn.fragment;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.yemamacake.cn.R;
public class ProductFragment extends Fragment {
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = LayoutInflater.from(getActivity()).inflate(R.layout.content_product, container, false);
return view;
}
}

@ -1,21 +0,0 @@
package com.yemamacake.cn.fragment;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.yemamacake.cn.R;
public class ShoppingCartFragment extends Fragment {
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = LayoutInflater.from(getActivity()).inflate(R.layout.content_shopping, container, false);
return view;
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<stroke android:color="#000"
android:width="0.5dp"/>
</shape>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<stroke android:color="#000"
android:width="0.5dp"/>
<corners android:topRightRadius="4dp"
android:bottomRightRadius="4dp" />
</shape>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<stroke android:color="#000"
android:width="0.5dp"/>
<corners android:topLeftRadius="4dp"
android:bottomLeftRadius="4dp" />
</shape>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="20dp"/>
<gradient
android:startColor="#FF5C13"
android:endColor="#FC7D0B"
android:angle="90" />
</shape>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="20dp"/>
<gradient
android:startColor="#FF5C13"
android:endColor="#FC7D0B"
android:angle="90" />
</shape>

@ -2,13 +2,21 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="false">
<shape>
<<<<<<< HEAD
<solid android:color="#cac0ff" />
=======
<solid android:color="#EFB81C" />
>>>>>>> 76999d0 (last)
<corners android:radius="5dp" />
</shape>
</item>
<item android:state_pressed="true">
<shape>
<<<<<<< HEAD
<solid android:color="#f5ffc0" />
=======
<solid android:color="#c0c0c0" />
>>>>>>> 76999d0 (last)
<corners android:radius="5dp" />
</shape>
</item>

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:pathData="M12,22.5c-5.79,0 -10.5,-4.71 -10.5,-10.5S6.21,1.5 12,1.5 22.5,6.21 22.5,12 17.79,22.5 12,22.5zM12,3c-4.963,0 -9,4.037 -9,9s4.037,9 9,9 9,-4.037 9,-9S16.963,3 12,3z"
android:fillColor="#a9b7b7"/>
</vector>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#eb4f38"
android:pathData="M12,1.546c-5.764,0 -10.454,4.69 -10.454,10.454 0,5.765 4.689,10.454 10.454,10.454S22.454,17.765 22.454,12C22.454,6.236 17.765,1.546 12,1.546zM17.044,10.276 L11.039,16.346c-0.001,0.001 -0.005,0.002 -0.006,0.005 -0.002,0.001 -0.002,0.005 -0.005,0.006 -0.048,0.046 -0.107,0.075 -0.163,0.107 -0.028,0.016 -0.05,0.04 -0.08,0.051 -0.09,0.036 -0.185,0.055 -0.28,0.055 -0.096,0 -0.193,-0.019 -0.284,-0.056 -0.03,-0.013 -0.054,-0.038 -0.082,-0.054 -0.056,-0.031 -0.113,-0.059 -0.161,-0.107 -0.001,-0.001 -0.002,-0.005 -0.004,-0.006 -0.001,-0.002 -0.005,-0.002 -0.006,-0.005l-2.954,-3.035c-0.289,-0.297 -0.282,-0.772 0.015,-1.061 0.297,-0.288 0.771,-0.283 1.061,0.015l2.42,2.487 5.467,-5.527c0.291,-0.295 0.767,-0.298 1.061,-0.006C17.333,9.506 17.335,9.981 17.044,10.276z" />
</vector>

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 536 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

@ -7,6 +7,8 @@
android:orientation="vertical"
tools:context=".activity.IndexActivity">
<<<<<<< HEAD
<<<<<<< HEAD
<!-- <LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
@ -16,6 +18,22 @@
</LinearLayout>-->
<FrameLayout
android:id="@+id/main_content"
=======
=======
>>>>>>> 76999d0 (last)
<!-- <LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="5">
<include layout="@layout/content_user"/>
</LinearLayout>-->
<FrameLayout
android:id="@+id/main_content0"
<<<<<<< HEAD
>>>>>>> 8d271bc (end_code)
=======
>>>>>>> 76999d0 (last)
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include layout="@layout/shoppingcart_title" />
<!--有商品时的布局-->
<<<<<<< HEAD
<GridView
=======
<androidx.recyclerview.widget.RecyclerView
>>>>>>> 76999d0 (last)
android:id="@+id/cart_productList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:numColumns="1" />
<<<<<<< HEAD
=======
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/colorAccent"
android:text="结算商品"
android:id="@+id/jiesuan"
/>
>>>>>>> 76999d0 (last)
</LinearLayout>

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

@ -4,6 +4,8 @@
android:layout_height="match_parent"
android:orientation="vertical">
<<<<<<< HEAD
<<<<<<< HEAD
<TextView
android:layout_width="331dp"
android:layout_height="wrap_content"
@ -17,6 +19,20 @@
android:numColumns="4"
android:verticalSpacing="30dp"
android:horizontalSpacing="20dp"
=======
=======
>>>>>>> 76999d0 (last)
<GridView
android:id="@+id/category_detail_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:numColumns="3"
android:verticalSpacing="10dp"
android:horizontalSpacing="10dp"
<<<<<<< HEAD
>>>>>>> 8d271bc (end_code)
=======
>>>>>>> 76999d0 (last)
android:gravity="center"/>
</LinearLayout>

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

@ -2,6 +2,8 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
<<<<<<< HEAD
<<<<<<< HEAD
android:background="#ffeff2"
android:layout_marginTop="20dp"
android:orientation="vertical">
@ -42,4 +44,35 @@
android:layout_weight="3"
android:id="@+id/category_detail"/>
</LinearLayout>
=======
=======
>>>>>>> 76999d0 (last)
android:background="#E8E8E8"
android:orientation="vertical">
<include layout="@layout/content_product_title" />
<!--分类标题和内容-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<!--标题-->
<ListView
android:id="@+id/category_title_list"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1" />
<!--内容-->
<FrameLayout
android:id="@+id/category_detail"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3" />
</LinearLayout>
<<<<<<< HEAD
>>>>>>> 8d271bc (end_code)
=======
>>>>>>> 76999d0 (last)
</LinearLayout>

@ -1,6 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<<<<<<< HEAD
xmlns:tools="http://schemas.android.com/tools"
=======
>>>>>>> 76999d0 (last)
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#E8E8E8"
@ -31,7 +34,11 @@
android:orientation="horizontal">
<LinearLayout
<<<<<<< HEAD
android:id="@+id/breakfast"
=======
android:id="@+id/chengzi"
>>>>>>> 76999d0 (last)
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
@ -39,6 +46,7 @@
android:orientation="vertical">
<ImageView
<<<<<<< HEAD
android:layout_width="69dp"
android:layout_height="82dp"
android:adjustViewBounds="true"
@ -99,12 +107,27 @@
android:layout_height="50dp"
android:layout_marginTop="5dp"
android:text="西式蛋糕"
=======
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/chengzi" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="橙子"
>>>>>>> 76999d0 (last)
android:textColor="#696969"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
<<<<<<< HEAD
android:id="@+id/chinese_tradional_cake"
=======
android:id="@+id/youzi"
>>>>>>> 76999d0 (last)
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
@ -112,6 +135,7 @@
android:orientation="vertical">
<ImageView
<<<<<<< HEAD
android:layout_width="match_parent"
android:layout_height="82dp"
android:src="@drawable/taosu" />
@ -121,6 +145,61 @@
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="中式传统糕点"
=======
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/youzi" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="柚子"
android:textColor="#696969"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/juzi"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/juzi" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="橘子"
android:textColor="#696969"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/xigua"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/xigua" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="西瓜"
>>>>>>> 76999d0 (last)
android:textColor="#696969"
android:textSize="20sp" />
</LinearLayout>
@ -134,7 +213,11 @@
android:orientation="horizontal">
<LinearLayout
<<<<<<< HEAD
android:id="@+id/chinese_newcake"
=======
android:id="@+id/li"
>>>>>>> 76999d0 (last)
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
@ -142,6 +225,7 @@
android:orientation="vertical">
<ImageView
<<<<<<< HEAD
android:layout_width="77dp"
android:layout_height="102dp"
android:src="@drawable/lvdou" />
@ -167,18 +251,31 @@
android:layout_width="79dp"
android:layout_height="117dp"
android:src="@drawable/naiyoubread" />
=======
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/li" />
>>>>>>> 76999d0 (last)
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
<<<<<<< HEAD
android:text="吐司餐包"
=======
android:text="香梨"
>>>>>>> 76999d0 (last)
android:textColor="#696969"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
<<<<<<< HEAD
android:id="@+id/fruit_tea"
=======
android:id="@+id/apple"
>>>>>>> 76999d0 (last)
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
@ -186,21 +283,35 @@
android:orientation="vertical">
<ImageView
<<<<<<< HEAD
android:layout_width="72dp"
android:layout_height="119dp"
android:src="@drawable/peachtea" />
=======
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/apple" />
>>>>>>> 76999d0 (last)
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
<<<<<<< HEAD
android:text="鲜果茶饮"
=======
android:text="苹果"
>>>>>>> 76999d0 (last)
android:textColor="#696969"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
<<<<<<< HEAD
android:id="@+id/birthcake"
=======
android:id="@+id/lemon"
>>>>>>> 76999d0 (last)
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
@ -208,15 +319,47 @@
android:orientation="vertical">
<ImageView
<<<<<<< HEAD
android:layout_width="89dp"
android:layout_height="107dp"
android:src="@drawable/birthcake" />
=======
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/lemon" />
>>>>>>> 76999d0 (last)
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
<<<<<<< HEAD
android:text="生日蛋糕"
=======
android:text="柠檬"
android:textColor="#696969"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/mangguo"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/mangguo" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="芒果"
>>>>>>> 76999d0 (last)
android:textColor="#696969"
android:textSize="20sp" />
</LinearLayout>

@ -3,17 +3,43 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> 8d271bc (end_code)
=======
>>>>>>> 76999d0 (last)
<!--首页-->
<LinearLayout
android:id="@+id/content_index"
android:layout_width="0dp"
<<<<<<< HEAD
<<<<<<< HEAD
android:layout_height="wrap_content"
=======
android:layout_height="74dp"
>>>>>>> 8d271bc (end_code)
=======
android:layout_height="wrap_content"
>>>>>>> 76999d0 (last)
android:layout_weight="1"
android:orientation="vertical">
<ImageView
<<<<<<< HEAD
<<<<<<< HEAD
android:layout_width="match_parent"
android:layout_height="43dp"
=======
android:layout_width="71dp"
android:layout_height="49dp"
>>>>>>> 8d271bc (end_code)
=======
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>>>>>>> 76999d0 (last)
android:layout_gravity="center"
android:layout_marginTop="2dp"
android:src="@drawable/index" />
@ -70,10 +96,23 @@
android:orientation="vertical">
<ImageView
<<<<<<< HEAD
<<<<<<< HEAD
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_gravity="center"
android:src="@drawable/shopping" />
=======
=======
>>>>>>> 76999d0 (last)
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/shoppingcart" />
<<<<<<< HEAD
>>>>>>> 8d271bc (end_code)
=======
>>>>>>> 76999d0 (last)
<TextView
android:layout_width="wrap_content"
@ -114,4 +153,12 @@
android:textSize="18sp" />
</LinearLayout>
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> 8d271bc (end_code)
=======
>>>>>>> 76999d0 (last)
</LinearLayout>

@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<<<<<<< HEAD
<<<<<<< HEAD
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
@ -8,4 +10,35 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="product" />
=======
=======
>>>>>>> 76999d0 (last)
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include layout="@layout/content_product_title" />
<Spinner
android:id="@+id/product_select_condition"
android:layout_width="match_parent"
android:paddingHorizontal="1dp"
android:layout_height="wrap_content" />
<GridView
android:id="@+id/product_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="#E8E8E8"
android:horizontalSpacing="10dp"
android:verticalSpacing="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:numColumns="2"/>
<<<<<<< HEAD
>>>>>>> 8d271bc (end_code)
=======
>>>>>>> 76999d0 (last)
</LinearLayout>

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

@ -1,6 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<<<<<<< HEAD
<<<<<<< HEAD
xmlns:tools="http://schemas.android.com/tools"
=======
>>>>>>> 8d271bc (end_code)
=======
>>>>>>> 76999d0 (last)
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#E8E8E8"
@ -24,14 +30,30 @@
android:orientation="horizontal">
<TextView
<<<<<<< HEAD
<<<<<<< HEAD
android:layout_height="35dp"
=======
android:layout_height="45dp"
>>>>>>> 8d271bc (end_code)
=======
android:layout_height="45dp"
>>>>>>> 76999d0 (last)
android:layout_weight="1"
android:drawableLeft="@drawable/user_pay"
android:textColor="#000"
android:text="卡券"
android:gravity="center_vertical"
android:drawablePadding="8dp"
<<<<<<< HEAD
<<<<<<< HEAD
android:textSize="14sp"
=======
android:textSize="16sp"
>>>>>>> 8d271bc (end_code)
=======
android:textSize="16sp"
>>>>>>> 76999d0 (last)
android:layout_marginLeft="5dp"
android:layout_width="0dp" />
@ -53,14 +75,30 @@
<TextView
android:id="@+id/user_username"
<<<<<<< HEAD
<<<<<<< HEAD
android:layout_height="35dp"
=======
android:layout_height="45dp"
>>>>>>> 8d271bc (end_code)
=======
android:layout_height="45dp"
>>>>>>> 76999d0 (last)
android:layout_weight="1"
android:drawableLeft="@drawable/user_account"
android:textColor="#000"
android:text="账号:"
android:gravity="center_vertical"
android:drawablePadding="8dp"
<<<<<<< HEAD
<<<<<<< HEAD
android:textSize="14sp"
=======
android:textSize="16sp"
>>>>>>> 8d271bc (end_code)
=======
android:textSize="16sp"
>>>>>>> 76999d0 (last)
android:layout_marginLeft="5dp"
android:layout_width="0dp" />
@ -83,15 +121,36 @@
<TextView
android:id="@+id/user_sex"
<<<<<<< HEAD
<<<<<<< HEAD
android:layout_height="35dp"
=======
android:layout_height="45dp"
>>>>>>> 8d271bc (end_code)
=======
android:layout_height="45dp"
>>>>>>> 76999d0 (last)
android:layout_weight="1"
android:layout_marginLeft="5dp"
android:drawableLeft="@drawable/user_sex"
android:textColor="#000"
<<<<<<< HEAD
<<<<<<< HEAD
android:text="城市:"
android:gravity="center_vertical"
android:drawablePadding="8dp"
android:textSize="14sp"
=======
=======
>>>>>>> 76999d0 (last)
android:text="性别:"
android:gravity="center_vertical"
android:drawablePadding="8dp"
android:textSize="16sp"
<<<<<<< HEAD
>>>>>>> 8d271bc (end_code)
=======
>>>>>>> 76999d0 (last)
android:layout_width="0dp" />
<ImageView
@ -113,14 +172,30 @@
<TextView
android:id="@+id/user_city"
<<<<<<< HEAD
<<<<<<< HEAD
android:layout_height="35dp"
=======
android:layout_height="45dp"
>>>>>>> 8d271bc (end_code)
=======
android:layout_height="45dp"
>>>>>>> 76999d0 (last)
android:layout_weight="1"
android:drawableLeft="@drawable/city"
android:textColor="#000"
android:text="城市:"
android:gravity="center_vertical"
android:drawablePadding="8dp"
<<<<<<< HEAD
<<<<<<< HEAD
android:textSize="14sp"
=======
android:textSize="16sp"
>>>>>>> 8d271bc (end_code)
=======
android:textSize="16sp"
>>>>>>> 76999d0 (last)
android:layout_marginLeft="5dp"
android:layout_width="0dp" />
@ -142,14 +217,30 @@
android:orientation="horizontal">
<TextView
<<<<<<< HEAD
<<<<<<< HEAD
android:layout_height="35dp"
=======
android:layout_height="45dp"
>>>>>>> 8d271bc (end_code)
=======
android:layout_height="45dp"
>>>>>>> 76999d0 (last)
android:layout_weight="1"
android:drawableLeft="@drawable/user_general"
android:textColor="#000"
android:text="通用"
android:gravity="center_vertical"
android:drawablePadding="8dp"
<<<<<<< HEAD
<<<<<<< HEAD
android:textSize="14sp"
=======
android:textSize="16sp"
>>>>>>> 8d271bc (end_code)
=======
android:textSize="16sp"
>>>>>>> 76999d0 (last)
android:layout_marginLeft="5dp"
android:layout_width="0dp" />
@ -160,6 +251,16 @@
android:src="@drawable/arrow_right" />
</LinearLayout>
<<<<<<< HEAD
<<<<<<< HEAD
=======
<!-- &lt;!&ndash;查看商品&ndash;&gt;
>>>>>>> 8d271bc (end_code)
=======
<!-- &lt;!&ndash;查看商品&ndash;&gt;
>>>>>>> 76999d0 (last)
<LinearLayout
android:id="@+id/user_searchProduct"
android:layout_width="match_parent"
@ -169,6 +270,8 @@
android:orientation="horizontal">
<TextView
<<<<<<< HEAD
<<<<<<< HEAD
android:layout_width="0dp"
android:layout_height="35dp"
android:layout_marginLeft="5dp"
@ -180,12 +283,43 @@
android:textColor="#000"
android:textSize="14sp"
/>
=======
=======
>>>>>>> 76999d0 (last)
android:layout_height="45dp"
android:layout_weight="1"
android:drawableLeft="@drawable/search"
android:textColor="#000"
android:text="查看消息"
android:gravity="center_vertical"
android:drawablePadding="8dp"
android:textSize="16sp"
android:layout_marginLeft="5dp"
android:layout_width="0dp" />
<<<<<<< HEAD
>>>>>>> 8d271bc (end_code)
=======
>>>>>>> 76999d0 (last)
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_gravity="center"
<<<<<<< HEAD
<<<<<<< HEAD
android:src="@drawable/arrow_right"/>
</LinearLayout>
=======
=======
>>>>>>> 76999d0 (last)
android:src="@drawable/arrow_right" />
</LinearLayout>-->
<<<<<<< HEAD
>>>>>>> 8d271bc (end_code)
=======
>>>>>>> 76999d0 (last)
<!--设置-->
<LinearLayout
android:id="@+id/user_setting"
@ -196,14 +330,30 @@
android:orientation="horizontal">
<TextView
<<<<<<< HEAD
<<<<<<< HEAD
android:layout_height="35dp"
=======
android:layout_height="45dp"
>>>>>>> 8d271bc (end_code)
=======
android:layout_height="45dp"
>>>>>>> 76999d0 (last)
android:layout_weight="1"
android:drawableLeft="@drawable/setting"
android:textColor="#000"
android:text="设置"
android:gravity="center_vertical"
android:drawablePadding="8dp"
<<<<<<< HEAD
<<<<<<< HEAD
android:textSize="14sp"
=======
android:textSize="16sp"
>>>>>>> 8d271bc (end_code)
=======
android:textSize="16sp"
>>>>>>> 76999d0 (last)
android:layout_marginLeft="5dp"
android:layout_width="0dp" />
@ -217,11 +367,25 @@
<Button
android:layout_width="fill_parent"
<<<<<<< HEAD
<<<<<<< HEAD
android:layout_height="48dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:textSize="18sp"
android:layout_marginTop="150dp"
=======
=======
>>>>>>> 76999d0 (last)
android:layout_height="40dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:textSize="18sp"
android:layout_marginTop="90dp"
<<<<<<< HEAD
>>>>>>> 8d271bc (end_code)
=======
>>>>>>> 76999d0 (last)
android:text="退出登录"
android:textColor="#FFFFFF"
android:layout_gravity="center"

@ -19,7 +19,15 @@
android:layout_height="50dp"
android:layout_marginLeft="5dp"
android:layout_weight="1"
<<<<<<< HEAD
<<<<<<< HEAD
android:drawableLeft="@drawable/famous_cake"
=======
android:drawableLeft="@drawable/shuiguo"
>>>>>>> 8d271bc (end_code)
=======
android:drawableLeft="@drawable/shuiguo"
>>>>>>> 76999d0 (last)
android:drawablePadding="8dp"
android:gravity="center_vertical"
android:text="热门商品"
@ -46,7 +54,15 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#E8E8E8"
<<<<<<< HEAD
<<<<<<< HEAD
android:verticalSpacing="20dp"
=======
android:verticalSpacing="10dp"
>>>>>>> 8d271bc (end_code)
=======
android:verticalSpacing="10dp"
>>>>>>> 76999d0 (last)
android:horizontalSpacing="10dp"
android:numColumns="2" />
</LinearLayout>

@ -0,0 +1,48 @@
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/shid"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="商品序号"
app:layout_constraintBaseline_toBaselineOf="@+id/shproductid"
app:layout_constraintStart_toStartOf="@+id/shoppingproductpicture" />
<TextView
android:id="@+id/shproductid"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="商品id"
app:layout_constraintStart_toStartOf="@+id/shid"
app:layout_constraintTop_toTopOf="@+id/shoppingproductpicture" />
<TextView
android:id="@+id/userid"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="用户id"
app:layout_constraintBaseline_toBaselineOf="@+id/shid"
app:layout_constraintStart_toStartOf="@+id/shid" />
<ImageView
android:id="@+id/shoppingproductpicture"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toTopOf="parent"
app:layout_constraintEnd_toStartOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/shproductnum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="商品数量"
app:layout_constraintBaseline_toBaselineOf="@+id/shid"
app:layout_constraintStart_toStartOf="@+id/shid" />
</LinearLayout>

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

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

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

@ -3,6 +3,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
<<<<<<< HEAD
android:background="#ffeff2">
<!--APPLogo及名字-->
@ -26,6 +27,30 @@
android:textColor="#000000"
android:textSize="22sp"
android:textStyle="italic" />
=======
android:background="#E8E8E8">
<!--APPLogo及名字-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:layout_marginTop="40dp"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:src="@drawable/orange" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="22sp"
android:textColor="#000000"
android:textStyle="italic"
android:text="Orange" />
>>>>>>> 76999d0 (last)
</LinearLayout>
<LinearLayout

@ -3,7 +3,11 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
<<<<<<< HEAD
android:background="#ffeff2">
=======
android:background="#E8E8E8">
>>>>>>> 76999d0 (last)
<!--APPLogo及名字-->
<LinearLayout
@ -15,9 +19,15 @@
<ImageView
android:layout_width="wrap_content"
<<<<<<< HEAD
android:layout_height="74dp"
android:layout_gravity="center_horizontal"
android:src="@drawable/search" />
=======
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:src="@drawable/orange" />
>>>>>>> 76999d0 (last)
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -38,7 +48,11 @@
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center_vertical"
<<<<<<< HEAD
android:src="@drawable/user_cake" />
=======
android:src="@drawable/user" />
>>>>>>> 76999d0 (last)
<EditText
android:id="@+id/reg_username"
@ -61,7 +75,11 @@
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center_vertical"
<<<<<<< HEAD
android:src="@drawable/user_ps" />
=======
android:src="@drawable/password" />
>>>>>>> 76999d0 (last)
<EditText
android:id="@+id/reg_password"
android:layout_width="290dp"
@ -158,11 +176,20 @@
android:id="@+id/reg_register"
android:layout_width="280dp"
android:layout_height="50dp"
<<<<<<< HEAD
android:layout_gravity="center_horizontal"
android:layout_marginTop="80dp"
android:background="@drawable/button_login"
android:text="注&#160;&#160;&#160;&#160;&#160;册"
android:textColor="#FFFFFF"
android:textSize="18sp" />
=======
android:layout_marginTop="80dp"
android:textSize="18sp"
android:layout_gravity="center_horizontal"
android:background="@drawable/button_login"
android:textColor="#FFFFFF"
android:text="注&#160;&#160;&#160;&#160;&#160;册" />
>>>>>>> 76999d0 (last)
</LinearLayout>

@ -1,6 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<<<<<<< HEAD
<color name="colorPrimary">#ffc0cb</color>
<color name="colorPrimaryDark">#ffc0cb</color>
<color name="colorAccent">#ffc0cb</color>
=======
<color name="colorPrimary">#008577</color>
<color name="colorPrimaryDark">#00574B</color>
<color name="colorAccent">#D81B60</color>
>>>>>>> 76999d0 (last)
</resources>

@ -1,6 +1,15 @@
<resources>
<<<<<<< HEAD
<string name="app_name">叶妈妈烘焙店</string>
<string name="Username">用户名:</string>
<string name="Password">&#160;&#160;&#160;&#160;码:</string>
<<<<<<< HEAD
<string name="introduce">只销售当日现做面包,新鲜看得到!</string>
=======
>>>>>>> 8d271bc (end_code)
=======
<string name="app_name">橙一色</string>
<string name="Username">用户名:</string>
<string name="Password">&#160;&#160;&#160;&#160;码:</string>
>>>>>>> 76999d0 (last)
</resources>

@ -0,0 +1,17 @@
package com.example.orangesale_end;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}

@ -18,4 +18,3 @@ android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true

@ -1,6 +1,18 @@
<<<<<<< HEAD
<<<<<<< HEAD
#Tue Mar 21 10:55:58 CST 2023
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
=======
#Wed Apr 26 17:34:52 CST 2023
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
>>>>>>> 8d271bc (end_code)
=======
#Wed May 17 09:41:29 CST 2023
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
>>>>>>> 76999d0 (last)
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

@ -1,2 +1,10 @@
include ':app'
<<<<<<< HEAD
<<<<<<< HEAD
rootProject.name='yemamacake'
=======
rootProject.name='OrangeSale_End'
>>>>>>> 8d271bc (end_code)
=======
rootProject.name='OrangeSale_End'
>>>>>>> 76999d0 (last)

Loading…
Cancel
Save