第三次提交

master
Cyh020229 2 years ago
parent aaec989b4f
commit 167a63a129

@ -8,6 +8,7 @@
<option name="distributionType" value="DEFAULT_WRAPPED" /> <option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" /> <option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleHome" value="$PROJECT_DIR$/../../../java tool/AN_gradle/gradle-7.5" /> <option name="gradleHome" value="$PROJECT_DIR$/../../../java tool/AN_gradle/gradle-7.5" />
<option name="gradleJvm" value="Embedded JDK" />
<option name="modules"> <option name="modules">
<set> <set>
<option value="$PROJECT_DIR$" /> <option value="$PROJECT_DIR$" />

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" /> <component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="Android Studio default JDK" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="jbr-11" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" /> <output url="file://$PROJECT_DIR$/build/classes" />
</component> </component>
<component name="ProjectType"> <component name="ProjectType">

@ -6,7 +6,7 @@ android {
defaultConfig { defaultConfig {
applicationId "com.example.orangesale_02" applicationId "com.example.orangesale_02"
minSdkVersion 23 minSdkVersion 23
targetSdkVersion 30 targetSdkVersion 31
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@ -17,6 +17,10 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
} }
} }
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
} }
dependencies { dependencies {

@ -9,7 +9,8 @@
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/AppTheme"> android:theme="@style/AppTheme">
<activity android:name=".MainActivity"> <activity android:name=".MainActivity" android:exported="true">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
@ -19,6 +20,7 @@
<activity android:name=".UserActivity" /> <activity android:name=".UserActivity" />
<activity android:name=".RegisterActivity"/> <activity android:name=".RegisterActivity"/>
<activity android:name=".CategoryActivity" />
</application> </application>
</manifest> </manifest>

@ -0,0 +1,69 @@
package com.example.orangesale_02;
import android.content.Context;
import android.graphics.Color;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.example.orangesale_02.R;
import java.util.List;
public class Adapter extends BaseAdapter {
private List<String> productCategory;
private LayoutInflater layoutInflater;
private int selectionPosition = -1;
public Adapter(List<String> productCategory, Context context) {
this.productCategory = productCategory;
this.layoutInflater = LayoutInflater.from(context);
}
@Override
public int getCount() {
return productCategory.size();
}
@Override
public Object getItem(int position) {
return productCategory.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder viewHolder = null;
if (convertView == null) {
viewHolder = new ViewHolder();
convertView = layoutInflater.inflate(R.layout.category_title, null);
Log.i("adapts", "getView: " + convertView);
viewHolder.tv = convertView.findViewById(R.id.category_titles);
convertView.setTag(viewHolder);
} else {
viewHolder = (ViewHolder) convertView.getTag();
}
viewHolder.tv.setText(productCategory.get(position));
if (selectionPosition == position) {
viewHolder.tv.setBackgroundColor(Color.YELLOW);
} else {
viewHolder.tv.setBackgroundColor(Color.WHITE);
}
return convertView;
}
public void setSelectedPosition(int position) {
this.selectionPosition = position;
}
class ViewHolder {
TextView tv;
}
}

@ -0,0 +1,163 @@
package com.example.orangesale_02;
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_02.R;
import com.example.orangesale_02.Adapter;
import com.example.orangesale_02.Product;
import com.example.orangesale_02.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("柚子");
productCategory.add("桃子");
productCategory.add("西瓜");
productCategory.add("苹果");
productCategory.add("梨子");
productCategory.add("葡萄");
Product product = new Product();
product.setImageUrlId(R.drawable.huangyanmiju);
product.setProductName("黄岩蜜桔");
product.setProductPrice(new BigDecimal("5.5"));
product.setProductContent(new String("黄岩蜜桔,浙江省台州市黄岩区特产,黄岩蜜桔为宽皮橘类,果皮橙黄色,肾形,中心柱空,果肉柔软化渣,甜酸适口。"));
product.setImageUrlId(R.drawable.shatangju);
product.setProductName("沙糖桔");
product.setProductPrice(new BigDecimal("3.5"));
product.setProductContent(new String("沙糖桔,又名:十月桔。原产地在四会市,现在我国的很多地区都有种植。沙糖桔果实扁圆形,顶部有瘤状突起,蒂脐端凹陷,色泽橙黄至橙红,果壁薄,易剥离。沙糖桔尤以四会黄田镇出产的为正宗,唯其鲜美而极甜,无渣,口感细腻,实为佳品。"));
Product product1 = new Product();
product1.setImageUrlId(R.drawable.bingtangcheng);
product1.setProductName("冰糖橙");
product1.setProductPrice(new BigDecimal("3.5"));
product.setProductContent(new String("又名冰糖柑,原产湖南黔阳县(今洪江市),冰糖橙以品种优良、味浓香甜、果皮薄、不塞牙、肉质脆嫩等而倍受市场欢迎。系当地普通甜橙的变异,湖南栽培较多,四川、重庆、贵州、云南、两广有少量栽培。"));
product1.setImageUrlId(R.drawable.xuecheng);
product1.setProductName("血橙");
product1.setProductPrice(new BigDecimal("6.5"));
product1.setProductContent(new String("果圆球形,扁圆形或椭圆形,橙红色,果皮难或稍易剥离,中果皮的颜色血红或暗紫红色,但未成熟的果则不着色,果心实或半充实,果肉成熟时橙红或紫红色,味甜或稍偏酸。"));
Product product2 = new Product();
product2.setImageUrlId(R.drawable.shatianyou);
product2.setProductName("沙田柚");
product2.setProductPrice(new BigDecimal("5"));
product2.setProductContent(new String("果实呈梨或者葫芦形,果肉爽脆,味道浓甜,有其独特的风味。但是水分较少,籽颇多,所以经常被人误解,认为是不新鲜导致水分较少。"));
product2.setImageUrlId(R.drawable.wendanyou);
product2.setProductName("文旦柚");
product2.setProductPrice(new BigDecimal("4"));
product2.setProductContent(new String("文旦柚果型呈扁平状,有籽,清甜且带有独特的清香味,果粒细小但汁水丰富,吃的时候可以配备一次性手套,免去汁水流满手的尴尬。"));
Product product3=new Product();
product3.setImageUrlId(R.drawable.shuimitao);
product3.setProductName("水蜜桃");
product3.setProductPrice(new BigDecimal("6.5"));
product3.setProductContent(new String("水蜜桃略呈球形,表面裹着一层细小的绒毛,青里泛白,白里透红。水蜜桃皮很薄,果肉丰富,宜于生食,入口滑润不留渣子。"));
product3.setImageUrlId(R.drawable.youtao);
product3.setProductName("油桃");
product3.setProductPrice(new BigDecimal("7.5"));
product3.setProductContent(new String("近球形核果表面有毛茸肉质可食为橙黄色泛红色直径7.5厘米,有带深麻点和沟纹的核,内含白色种子。 "));
Product product4=new Product();
product4.setImageUrlId(R.drawable.qilingua);
product4.setProductName("麒麟瓜");
product4.setProductPrice(new BigDecimal("3"));
product4.setProductContent(new String("属于西瓜种类的一种是经过培植的科研新品种瓜种对生长环境和土壤以及日照的要求非常高。由于从种下到开花、从开花到收瓜只需60天左右因此即使种植讲究但因周期短、口感好、效益见得快因此温州和海南农民还是很乐意种植的。"));
product4.setImageUrlId(R.drawable.heimeirenxigua);
product4.setProductName("黑美人西瓜");
product4.setProductPrice(new BigDecimal("4.5"));
product4.setProductContent(new String("这种西瓜果实呈长椭圆形,瓜较小,果皮深黑绿色,有不明显的条纹。一般较为早熟,果皮薄而坚韧,肉质鲜嫩多汁。"));
Product product5=new Product();
product5.setImageUrlId(R.drawable.hongfushi);
product5.setProductName("红富士");
product5.setProductPrice(new BigDecimal("7.5"));
product5.setProductContent(new String("富士苹果的特点是体积很大遍体通红形状很圆平均大小如棒球一般。果实的重量中有9-11%是单糖,而且其果肉紧密,比其他很多苹果变种都要甜美和清脆。"));
product5.setImageUrlId(R.drawable.hongjiangjunpinguo);
product5.setProductName("红将军苹果");
product5.setProductPrice(new BigDecimal("6.0"));
product5.setProductContent(new String("它的口感的确比较出众, 果肉呈黄白色, 质地比红富士略松、甜脆爽口、香气馥郁、皮薄多汁。"));
Product product6=new Product();
product6.setImageUrlId(R.drawable.baili);
product6.setProductName("白梨");
product6.setProductPrice(new BigDecimal("4.5"));
product6.setProductContent(new String("白梨的果实有蜡质光泽,果皮薄,果肉厚,果核小,肉质细腻,酥脆多汁,甘甜爽口,含多种营养成分,具有生津、止渴、润肺、宽肠、强心、利尿等医疗作用。"));
product6.setImageUrlId(R.drawable.shali);
product6.setProductName("沙梨");
product6.setProductPrice(new BigDecimal("5.0"));
product6.setProductContent(new String("其肉质酥脆细腻,汁液丰富,酸甜浓郁。并具有显著的润肺止咳、养颜排毒、软化血管、健脑益智、延缓衰老等保健功效。"));
Product product7=new Product();
product7.setImageUrlId(R.drawable.yangguangmeigui);
product7.setProductName("阳光玫瑰葡萄");
product7.setProductPrice(new BigDecimal("25"));
product7.setProductContent(new String("阳光玫瑰葡萄丰产、稳产大粒抗病耐贮性好栽培简单。果粒着生紧密椭圆形黄绿色果面有光泽果粉少。果肉鲜脆多汁有玫瑰香味可溶性固形物含量20%左右最高可达26%,鲜食品质极优。不裂果,不脱粒,丰产,抗逆性较强,综合性状优良。"));
product7.setImageUrlId(R.drawable.jufeng);
product7.setProductName("巨峰葡萄");
product7.setProductPrice(new BigDecimal("19.6"));
product7.setProductContent(new String("果粒椭圆形,紫黑色,果粉厚,粒大。果皮中等厚,与果肉易分离;果肉软,肉瓢不明显,汁多,果粒硕大,果色鲜艳,味酸甜,果粒柔软多汁,有草莓香味,营养丰富。"));
productList.add(product);
productList.add(product1);
productList.add(product2);
productList.add(product3);
productList.add(product4);
productList.add(product5);
productList.add(product6);
productList.add(product7);
}
/**
*
*/
private void init() {
titleList = findViewById(R.id.category_title_list);
adapter = new Adapter(productCategory, CategoryActivity.this);
titleList.setAdapter(adapter);
}
}

@ -0,0 +1,47 @@
package com.example.orangesale_02;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
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();
//组件初始化
}
//组件初始化
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);
}
@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:
Intent intent2 = new Intent(MainActivity.this, CategoryActivity.class);
startActivity(intent2);
break;
}
}
}

@ -0,0 +1,59 @@
package com.example.orangesale_02;
public class OrangeUser {
private Integer id;
private String username;
private String password;
private String sex;
private String city;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
@Override
public String toString() {
return "OrangeUser{" +
"username='" + username + '\'' +
", password='" + password + '\'' +
", sex='" + sex + '\'' +
", city='" + city + '\'' +
'}';
}
}

@ -0,0 +1,43 @@
package com.example.orangesale_02;
import java.math.BigDecimal;
public class Product {
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public BigDecimal getProductPrice() {
return productPrice;
}
public String getProductContent() {
return productContent;
}
public void setProductContent(String productContent) {
this.productContent = productContent;
}
public void setProductPrice(BigDecimal productPrice) {
this.productPrice = productPrice;
}
public Integer getImageUrlId() {
return imageUrlId;
}
public void setImageUrlId(Integer imageUrlId) {
this.imageUrlId = imageUrlId;
}
private Integer imageUrlId;
private String productName;
private BigDecimal productPrice;
private String productContent;
}

@ -0,0 +1,143 @@
package com.example.orangesale_02;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import com.lljjcoder.citypickerview.widget.CityPicker;
public class RegisterActivity extends AppCompatActivity implements View.OnClickListener, RadioGroup.OnCheckedChangeListener {
private EditText usernameEdit, passwordEdit, surePasswordEdit;
private TextView cityText;
private CityPicker cityPicker;
private Button regButton;
private RadioGroup sexGroup;
private String sexStr="男";
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.user_register);
init();
}
/**
*
*/
private void init() {
cityText = findViewById(R.id.reg_province);
cityText.setOnClickListener(this);
usernameEdit = findViewById(R.id.reg_username);
passwordEdit = findViewById(R.id.reg_password);
surePasswordEdit = findViewById(R.id.reg_sure_password);
regButton = findViewById(R.id.reg_register);
regButton.setOnClickListener(this);
sexGroup = findViewById(R.id.sex);
sexGroup.setOnCheckedChangeListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.reg_province:
initCityPicker();
cityPicker.show();
break;
case R.id.reg_register:
//注册验证方法
validateRegister();
break;
}
}
/**
*
*/
public void initCityPicker() {
cityPicker = new CityPicker.Builder(RegisterActivity.this)
.textSize(16)
.title("地址选择")
.backgroundPop(0xa0000000)
.titleBackgroundColor("#EFB81C")
.titleTextColor("#000000")
.backgroundPop(0xa0000000)
.confirTextColor("#000000")
.cancelTextColor("#000000")
.province("江西省")
.city("赣州市")
.district("章贡区")
.textColor(Color.parseColor("#000000"))
.provinceCyclic(true)
.cityCyclic(false)
.districtCyclic(false)
.visibleItemsCount(7)
.itemPadding(10)
.onlyShowProvinceAndCity(false)
.build();
cityPicker.setOnCityItemClickListener(new CityPicker.OnCityItemClickListener() {
@Override
public void onSelected(String... strings) {
String province = strings[0];
String city = strings[1];
String district = strings[2];
cityText.setText(String.format("%s %s %s", province, city, district));
}
@Override
public void onCancel() {
}
});
}
/**
*
*/
public void validateRegister() {
Intent intent = new Intent(RegisterActivity.this, UserActivity.class);
String username = usernameEdit.getText().toString();
String password = passwordEdit.getText().toString();
String surePassword = surePasswordEdit.getText().toString();
String city = cityText.getText().toString();
//判断两次密码是否输入一致
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);
intent.putExtras(bundle);
startActivity(intent);
} else {
Toast.makeText(RegisterActivity.this, "请选择地址", Toast.LENGTH_SHORT).show();
}
} else {
Toast.makeText(RegisterActivity.this, "账号或密码未填写", Toast.LENGTH_SHORT).show();
}
} else {
Toast.makeText(RegisterActivity.this, "两次密码输入不一致", Toast.LENGTH_SHORT).show();
}
}
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
//根据用户选择来改变sex的值
sexStr = checkedId == R.id.reg_man ? "男" : "女";
}
}

@ -0,0 +1,69 @@
package com.example.orangesale_02;
import android.annotation.SuppressLint;
import android.app.Fragment;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.example.orangesale_02.R;
import com.example.orangesale_02.CategoryActivity;
import java.util.Objects;
public class SetDetailFragment extends Fragment {
private View view;
private ImageView imageView;
private ImageView imageView2;
private TextView nameText, priceText,contentText;
private TextView nameText2, priceText2,contentText2;
@SuppressLint("SetTextI18n")
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
view = inflater.inflate(R.layout.categoty_detail_content, container, false);
if (view != null) {
init();
}
CategoryActivity categoryActivity = (CategoryActivity) getActivity();
Objects.requireNonNull(categoryActivity).setOnChangeListener(product -> {
Log.i("sss", "onCreateView: " + product.getProductName());
imageView.setBackgroundResource(product.getImageUrlId());
nameText.setText(product.getProductName());
priceText.setText(product.getProductPrice().toString());
contentText.setText(product.getProductContent());
imageView2.setBackgroundResource(product.getImageUrlId());
nameText2.setText(product.getProductName());
priceText2.setText(product.getProductPrice().toString());
contentText2.setText(product.getProductContent());
});
return view;
}
/**
*
*/
private void init() {
imageView = view.findViewById(R.id.category_product_image);
nameText = view.findViewById(R.id.category_product_name);
priceText = view.findViewById(R.id.category_product_price);
contentText = view.findViewById(R.id.category_product_content);
imageView2 = view.findViewById(R.id.category_product_image1);
nameText2 = view.findViewById(R.id.category_product_name1);
priceText2 = view.findViewById(R.id.category_product_price1);
contentText2 = view.findViewById(R.id.category_product_content1);
}
}

@ -0,0 +1,73 @@
package com.example.orangesale_02;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.Nullable;
import com.example.orangesale_02.R;
import com.example.orangesale_02.MainActivity;
public class UserActivity extends Activity implements View.OnClickListener{
private ImageView userIconImage;
private TextView usernameText, userSexText, userCityText;
private LinearLayout usernameLine, userSexline, userCityLine, userPayLine, userSettingLine, userGeneralLine,userSearchProductLine;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.content_user);
init();
}
/**
*
*/
private void init() {
userIconImage = findViewById(R.id.user_icon);
usernameText = findViewById(R.id.user_username);
userSexText = findViewById(R.id.user_sex);
userCityText = findViewById(R.id.user_city);
usernameLine = findViewById(R.id.user_username_line);
userSexline = findViewById(R.id.user_sex_line);
userCityLine = findViewById(R.id.user_city_line);
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.setOnClickListener(this);
setData();
}
private void setData() {
Intent intent = UserActivity.this.getIntent();
Bundle bundle = intent.getExtras();
usernameText.setText(String.format("用户名:%s", bundle.getString("username")));
userSexText.setText(String.format("性别:%s", bundle.getString("sex")));
userCityText.setText(String.format("城市:%s", bundle.getString("city")));
}
public void click(View view)
{
Intent intent=new Intent(UserActivity.this,MainActivity.class);
startActivity(intent);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.user_searchProduct:
Intent intent1 = new Intent(UserActivity.this, CategoryActivity.class);
startActivity(intent1);
break;
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 459 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 510 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

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

@ -0,0 +1,19 @@
<?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">
<ImageView
android:layout_width="90dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/category_titles"
android:textSize="20sp"
android:text="标题"/>
</LinearLayout>

@ -0,0 +1,110 @@
<?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">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<ImageView
android:id="@+id/category_product_image"
android:layout_width="90dp"
android:layout_height="90dp"
android:layout_gravity="center"
/>
<TextView
android:id="@+id/category_product_name"
android:layout_width="100dp"
android:layout_height="30dp"
android:layout_marginLeft="50dp"
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_marginLeft="20dp"
android:layout_gravity="center"
android:layout_marginTop="2dp"
android:gravity="center"
android:textColor="#050505"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#FFEFA549">
<TextView
android:id="@+id/category_product_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_gravity="center"
android:layout_marginTop="2dp"
android:gravity="center"
android:textColor="#050505"
android:textSize="16sp"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="@+id/category_product_image1"
android:layout_width="90dp"
android:layout_height="90dp"
android:layout_gravity="center" />
<TextView
android:id="@+id/category_product_name1"
android:layout_width="100dp"
android:layout_height="30dp"
android:layout_gravity="center"
android:layout_marginTop="2dp"
android:textColor="#050505"
android:layout_marginLeft="50dp"
android:textSize="16sp" />
<TextView
android:id="@+id/category_product_price1"
android:layout_width="50dp"
android:layout_height="30dp"
android:layout_marginLeft="20dp"
android:layout_gravity="center"
android:layout_marginTop="2dp"
android:gravity="center"
android:textColor="#050505"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#FFEFA549">
<TextView
android:id="@+id/category_product_content1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_gravity="center"
android:layout_marginTop="2dp"
android:gravity="center"
android:textColor="#000000"
android:textSize="16sp"
/>
</LinearLayout>
</LinearLayout>

@ -0,0 +1,48 @@
<?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="#7EEDBF9B"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#EDBB64"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/category_return"
android:layout_gravity="center"
android:src="@drawable/arrow_down"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:layout_weight="1"
android:gravity="center"
android:text="商品种类"
android:textSize="20sp"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<ListView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:id="@+id/category_title_list"/>
<FrameLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3"
android:id="@+id/category_detail"
/>
</LinearLayout>
</LinearLayout>

@ -15,8 +15,7 @@
android:layout_width="120dp" android:layout_width="120dp"
android:layout_height="120dp" android:layout_height="120dp"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginTop="40dp" android:layout_marginTop="40dp" />
android:src="@drawable/orange" />
<LinearLayout <LinearLayout
android:id="@+id/user_pay" android:id="@+id/user_pay"
@ -139,6 +138,29 @@
</LinearLayout> </LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/user_searchProduct"
android:background="#EDBB64"
android:layout_marginTop="20dp"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="35dp"
android:drawableLeft="@drawable/setting"
android:text="查看商品"
android:gravity="center_vertical"
android:drawablePadding="8dp"
android:textSize="20sp"
android:layout_marginLeft="5dp"
android:layout_weight="1"/>
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_gravity="center"
android:src="@drawable/arrow_down"/>
</LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/user_general" android:id="@+id/user_general"
android:layout_width="match_parent" android:layout_width="match_parent"

Loading…
Cancel
Save