@ -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,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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.5 MiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 176 KiB |
After Width: | Height: | Size: 263 KiB |
After Width: | Height: | Size: 1.4 MiB |
After Width: | Height: | Size: 244 KiB |
After Width: | Height: | Size: 459 KiB |
After Width: | Height: | Size: 1.1 MiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 32 KiB |
After Width: | Height: | Size: 193 KiB |
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 21 KiB |
After Width: | Height: | Size: 162 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 168 KiB |
After Width: | Height: | Size: 6.7 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 510 KiB |
After Width: | Height: | Size: 9.7 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 32 KiB |
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>
|