Compare commits
36 Commits
main
...
liuqirui_p
| Author | SHA1 | Date |
|---|---|---|
|
|
d86c0e6c70 | 2 months ago |
|
|
5b3b5c1923 | 2 months ago |
|
|
be3945fb1e | 2 months ago |
|
|
fc2ab52293 | 2 months ago |
|
|
8acf678eba | 2 months ago |
|
|
0aa8412c57 | 2 months ago |
|
|
a9de196957 | 2 months ago |
|
|
ab66af1810 | 2 months ago |
|
|
582e64efb4 | 2 months ago |
|
|
d13982857f | 2 months ago |
|
|
26b6390c5d | 2 months ago |
|
|
a1ecc77bbf | 2 months ago |
|
|
659b971314 | 2 months ago |
|
|
384eb58528 | 2 months ago |
|
|
0210408f49 | 2 months ago |
|
|
005589ac49 | 2 months ago |
|
|
f6563858e3 | 2 months ago |
|
|
33aa051fb3 | 2 months ago |
|
|
ed4abf927e | 2 months ago |
|
|
d79fbbb4ea | 2 months ago |
|
|
9b3e8e0e54 | 2 months ago |
|
|
885d563780 | 2 months ago |
|
|
dfc96a769c | 2 months ago |
|
|
b925012b78 | 2 months ago |
|
|
09c08ba9f3 | 2 months ago |
|
|
17e6b564ea | 2 months ago |
|
|
e8244c0fad | 2 months ago |
|
|
a69b944ab2 | 2 months ago |
|
|
5c48c5d87e | 2 months ago |
|
|
70024a0ce4 | 2 months ago |
|
|
5d8ed8b1e3 | 2 months ago |
|
|
a67ea7cfee | 2 months ago |
|
|
94548cb17d | 2 months ago |
|
|
9f74135f2d | 2 months ago |
|
|
f9857ad318 | 2 months ago |
|
|
aa1935e759 | 2 months ago |
@ -0,0 +1,3 @@
|
||||
# 默认忽略的文件
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/LLRiseTabBarDemo.iml" filepath="$PROJECT_DIR$/.idea/LLRiseTabBarDemo.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
@ -1,6 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
<component name="VcsProjectSettings">
|
||||
<option name="detectVcsMappingsAutomatically" value="false" />
|
||||
</component>
|
||||
</project>
|
||||
@ -0,0 +1,84 @@
|
||||
package com.startsmake.llrisetabbardemo.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.startsmake.llrisetabbardemo.R;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ImageAdapter extends BaseAdapter {
|
||||
|
||||
private Context context;
|
||||
private List<Uri> imageUris;
|
||||
private static final int MAX_IMAGES = 9;
|
||||
|
||||
public ImageAdapter(Context context, List<Uri> imageUris) {
|
||||
this.context = context;
|
||||
this.imageUris = imageUris;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return Math.min(imageUris.size() + 1, MAX_IMAGES);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getItem(int position) {
|
||||
if (position < imageUris.size()) {
|
||||
return imageUris.get(position);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
ViewHolder holder;
|
||||
if (convertView == null) {
|
||||
convertView = LayoutInflater.from(context).inflate(R.layout.item_image, parent, false);
|
||||
holder = new ViewHolder();
|
||||
holder.imageView = convertView.findViewById(R.id.imageView);
|
||||
holder.deleteButton = convertView.findViewById(R.id.btnDelete);
|
||||
convertView.setTag(holder);
|
||||
} else {
|
||||
holder = (ViewHolder) convertView.getTag();
|
||||
}
|
||||
|
||||
if (position < imageUris.size()) {
|
||||
// 显示已选择的图片
|
||||
Uri imageUri = imageUris.get(position);
|
||||
Glide.with(context)
|
||||
.load(imageUri)
|
||||
.placeholder(android.R.drawable.ic_menu_gallery) // 使用系统图标作为占位符
|
||||
.into(holder.imageView);
|
||||
|
||||
holder.deleteButton.setVisibility(View.VISIBLE);
|
||||
holder.deleteButton.setOnClickListener(v -> {
|
||||
imageUris.remove(position);
|
||||
notifyDataSetChanged();
|
||||
});
|
||||
} else {
|
||||
// 显示添加按钮
|
||||
holder.imageView.setImageResource(android.R.drawable.ic_input_add); // 使用系统图标
|
||||
holder.deleteButton.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
return convertView;
|
||||
}
|
||||
|
||||
static class ViewHolder {
|
||||
ImageView imageView;
|
||||
ImageView deleteButton;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,76 @@
|
||||
package adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.startsmake.llrisetabbardemo.R;
|
||||
import com.startsmake.llrisetabbardemo.model.Item;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ProductAdapter extends RecyclerView.Adapter<ProductAdapter.ViewHolder> {
|
||||
|
||||
private Context context;
|
||||
private List<Item> itemList;
|
||||
private OnItemClickListener listener;
|
||||
|
||||
public interface OnItemClickListener {
|
||||
void onItemClick(Item item);
|
||||
}
|
||||
|
||||
public ProductAdapter(Context context, List<Item> itemList, OnItemClickListener listener) {
|
||||
this.context = context;
|
||||
this.itemList = itemList;
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(context).inflate(R.layout.item_product, parent, false);
|
||||
return new ViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
Item item = itemList.get(position);
|
||||
|
||||
holder.tvTitle.setText(item.getTitle());
|
||||
holder.tvDescription.setText(item.getDescription());
|
||||
holder.tvPrice.setText(String.format("¥%.2f", item.getPrice()));
|
||||
holder.tvCategory.setText(item.getCategory());
|
||||
|
||||
// 设置点击事件
|
||||
holder.itemView.setOnClickListener(v -> {
|
||||
if (listener != null) {
|
||||
listener.onItemClick(item);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return itemList.size();
|
||||
}
|
||||
|
||||
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView tvTitle;
|
||||
TextView tvDescription;
|
||||
TextView tvCategory;
|
||||
TextView tvPrice;
|
||||
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
tvTitle = itemView.findViewById(R.id.product_name);
|
||||
tvDescription = itemView.findViewById(R.id.product_description);
|
||||
tvCategory = itemView.findViewById(R.id.product_category);
|
||||
tvPrice = itemView.findViewById(R.id.product_price);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,179 @@
|
||||
package com.startsmake.llrisetabbardemo.activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.google.android.material.textfield.TextInputEditText;
|
||||
import com.startsmake.llrisetabbardemo.R;
|
||||
import com.startsmake.llrisetabbardemo.manager.UserManager;
|
||||
import com.startsmake.llrisetabbardemo.model.User;
|
||||
|
||||
public class LoginActivity extends AppCompatActivity {
|
||||
|
||||
private TextInputEditText etPhone, etPassword;
|
||||
private Button btnLogin, btnSkipLogin;
|
||||
private TextView tvForgotPassword, tvRegister;
|
||||
private UserManager userManager;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_login);
|
||||
|
||||
// 初始化用户管理器
|
||||
userManager = UserManager.getInstance(this);
|
||||
|
||||
// 移除自动登录检查,让用户手动登录
|
||||
// if (userManager.isLoggedIn()) {
|
||||
// navigateToMain();
|
||||
// return;
|
||||
// }
|
||||
|
||||
initViews();
|
||||
setupClickListeners();
|
||||
|
||||
// 检查是否有从其他页面传递过来的手机号
|
||||
handleIntentData();
|
||||
}
|
||||
|
||||
private void initViews() {
|
||||
etPhone = findViewById(R.id.et_phone);
|
||||
etPassword = findViewById(R.id.et_password);
|
||||
btnLogin = findViewById(R.id.btn_login);
|
||||
btnSkipLogin = findViewById(R.id.btn_skip_login);
|
||||
tvForgotPassword = findViewById(R.id.tv_forgot_password);
|
||||
tvRegister = findViewById(R.id.tv_register);
|
||||
}
|
||||
|
||||
private void setupClickListeners() {
|
||||
// 登录按钮
|
||||
btnLogin.setOnClickListener(v -> attemptLogin());
|
||||
|
||||
// 跳过登录按钮
|
||||
btnSkipLogin.setOnClickListener(v -> skipToMain());
|
||||
|
||||
// 忘记密码
|
||||
tvForgotPassword.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(LoginActivity.this, ForgotPasswordActivity.class);
|
||||
startActivity(intent);
|
||||
});
|
||||
|
||||
// 注册
|
||||
tvRegister.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(LoginActivity.this, RegisterActivity.class);
|
||||
startActivity(intent);
|
||||
});
|
||||
}
|
||||
|
||||
private void handleIntentData() {
|
||||
Intent intent = getIntent();
|
||||
if (intent != null && intent.hasExtra("phone")) {
|
||||
String phone = intent.getStringExtra("phone");
|
||||
if (phone != null && !phone.isEmpty()) {
|
||||
etPhone.setText(phone);
|
||||
// 自动聚焦到密码输入框
|
||||
etPassword.requestFocus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void attemptLogin() {
|
||||
String phone = etPhone.getText().toString().trim();
|
||||
String password = etPassword.getText().toString().trim();
|
||||
|
||||
if (!validateInput(phone, password)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 使用 UserManager 进行登录验证
|
||||
User user = userManager.loginUser(phone, password);
|
||||
|
||||
if (user != null) {
|
||||
// 登录成功
|
||||
performLoginSuccess(user);
|
||||
} else {
|
||||
// 登录失败
|
||||
showLoginError();
|
||||
}
|
||||
}
|
||||
|
||||
private boolean validateInput(String phone, String password) {
|
||||
if (phone.isEmpty()) {
|
||||
etPhone.setError("请输入手机号");
|
||||
etPhone.requestFocus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (password.isEmpty()) {
|
||||
etPassword.setError("请输入密码");
|
||||
etPassword.requestFocus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (phone.length() != 11) {
|
||||
etPhone.setError("手机号格式不正确");
|
||||
etPhone.requestFocus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!phone.startsWith("1")) {
|
||||
etPhone.setError("手机号格式不正确");
|
||||
etPhone.requestFocus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (password.length() < 6) {
|
||||
etPassword.setError("密码至少6位");
|
||||
etPassword.requestFocus();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void performLoginSuccess(User user) {
|
||||
// 保存登录状态和用户信息
|
||||
saveLoginState(user);
|
||||
Toast.makeText(this, "登录成功!", Toast.LENGTH_SHORT).show();
|
||||
navigateToMain();
|
||||
}
|
||||
|
||||
private void saveLoginState(User user) {
|
||||
SharedPreferences sp = getSharedPreferences("user_info", MODE_PRIVATE);
|
||||
SharedPreferences.Editor editor = sp.edit();
|
||||
editor.putBoolean("is_logged_in", true);
|
||||
editor.putString("user_phone", user.getPhone());
|
||||
editor.putString("user_name", user.getUsername());
|
||||
editor.putString("user_token", "mock_token_" + System.currentTimeMillis());
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
private void showLoginError() {
|
||||
Toast.makeText(this, "手机号或密码错误", Toast.LENGTH_SHORT).show();
|
||||
etPassword.setError("密码错误");
|
||||
etPassword.requestFocus();
|
||||
}
|
||||
|
||||
private void skipToMain() {
|
||||
Toast.makeText(this, "游客模式进入", Toast.LENGTH_SHORT).show();
|
||||
navigateToMain();
|
||||
}
|
||||
|
||||
private void navigateToMain() {
|
||||
Intent intent = new Intent(LoginActivity.this, MainActivity.class);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
// 清理资源
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,260 @@
|
||||
package com.startsmake.llrisetabbardemo.activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.CountDownTimer;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.google.android.material.textfield.TextInputEditText;
|
||||
import com.startsmake.llrisetabbardemo.R;
|
||||
import com.startsmake.llrisetabbardemo.manager.UserManager;
|
||||
import com.startsmake.llrisetabbardemo.model.User;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class RegisterActivity extends AppCompatActivity {
|
||||
|
||||
private TextInputEditText etPhone, etVerificationCode, etPassword;
|
||||
private Button btnSendCode, btnRegister;
|
||||
private ImageButton btnBack;
|
||||
private TextView tvLogin;
|
||||
|
||||
private CountDownTimer countDownTimer;
|
||||
private boolean isCounting = false;
|
||||
private String verificationCode = "";
|
||||
private UserManager userManager;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_register);
|
||||
|
||||
userManager = UserManager.getInstance(this);
|
||||
initViews();
|
||||
setupClickListeners();
|
||||
}
|
||||
|
||||
private void initViews() {
|
||||
etPhone = findViewById(R.id.et_phone);
|
||||
etVerificationCode = findViewById(R.id.et_verification_code);
|
||||
etPassword = findViewById(R.id.et_password);
|
||||
btnSendCode = findViewById(R.id.btn_send_code);
|
||||
btnRegister = findViewById(R.id.btn_register);
|
||||
btnBack = findViewById(R.id.btn_back);
|
||||
tvLogin = findViewById(R.id.tv_login);
|
||||
}
|
||||
|
||||
private void setupClickListeners() {
|
||||
// 返回按钮
|
||||
btnBack.setOnClickListener(v -> finish());
|
||||
|
||||
// 发送验证码
|
||||
btnSendCode.setOnClickListener(v -> sendVerificationCode());
|
||||
|
||||
// 注册按钮
|
||||
btnRegister.setOnClickListener(v -> attemptRegister());
|
||||
|
||||
// 立即登录
|
||||
tvLogin.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(RegisterActivity.this, LoginActivity.class);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
});
|
||||
}
|
||||
|
||||
private void sendVerificationCode() {
|
||||
String phone = etPhone.getText().toString().trim();
|
||||
|
||||
if (!validatePhone(phone)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 检查用户是否已存在
|
||||
if (userManager.isPhoneRegistered(phone)) {
|
||||
etPhone.setError("该手机号已注册");
|
||||
etPhone.requestFocus();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isCounting) {
|
||||
// 生成随机验证码
|
||||
verificationCode = generateVerificationCode();
|
||||
startCountDown();
|
||||
|
||||
// 模拟发送验证码(在实际应用中应该通过短信发送)
|
||||
Toast.makeText(this, "验证码已发送: " + verificationCode, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
|
||||
private boolean validatePhone(String phone) {
|
||||
if (phone.isEmpty()) {
|
||||
etPhone.setError("请输入手机号");
|
||||
etPhone.requestFocus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (phone.length() != 11) {
|
||||
etPhone.setError("手机号格式不正确");
|
||||
etPhone.requestFocus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!phone.startsWith("1")) {
|
||||
etPhone.setError("手机号格式不正确");
|
||||
etPhone.requestFocus();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private String generateVerificationCode() {
|
||||
Random random = new Random();
|
||||
int code = 100000 + random.nextInt(900000);
|
||||
return String.valueOf(code);
|
||||
}
|
||||
|
||||
private void startCountDown() {
|
||||
isCounting = true;
|
||||
btnSendCode.setEnabled(false);
|
||||
|
||||
countDownTimer = new CountDownTimer(60000, 1000) {
|
||||
@Override
|
||||
public void onTick(long millisUntilFinished) {
|
||||
btnSendCode.setText(millisUntilFinished / 1000 + "秒后重发");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
isCounting = false;
|
||||
btnSendCode.setEnabled(true);
|
||||
btnSendCode.setText("发送验证码");
|
||||
// 验证码过期
|
||||
verificationCode = "";
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
|
||||
private void attemptRegister() {
|
||||
String phone = etPhone.getText().toString().trim();
|
||||
String code = etVerificationCode.getText().toString().trim();
|
||||
String password = etPassword.getText().toString().trim();
|
||||
|
||||
if (!validateRegisterInput(phone, code, password)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 验证验证码
|
||||
if (!code.equals(verificationCode)) {
|
||||
etVerificationCode.setError("验证码错误");
|
||||
etVerificationCode.requestFocus();
|
||||
Toast.makeText(this, "请输入正确的验证码", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
// 检查验证码是否过期
|
||||
if (verificationCode.isEmpty()) {
|
||||
etVerificationCode.setError("验证码已过期,请重新获取");
|
||||
etVerificationCode.requestFocus();
|
||||
Toast.makeText(this, "验证码已过期,请重新获取", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
// 注册用户
|
||||
boolean success = userManager.registerUser(phone, password);
|
||||
if (success) {
|
||||
performRegisterSuccess(phone, password);
|
||||
} else {
|
||||
Toast.makeText(this, "注册失败,该手机号已注册", Toast.LENGTH_SHORT).show();
|
||||
etPhone.setError("该手机号已注册");
|
||||
etPhone.requestFocus();
|
||||
}
|
||||
}
|
||||
|
||||
private boolean validateRegisterInput(String phone, String code, String password) {
|
||||
// 验证手机号
|
||||
if (phone.isEmpty()) {
|
||||
etPhone.setError("请输入手机号");
|
||||
etPhone.requestFocus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (phone.length() != 11) {
|
||||
etPhone.setError("手机号格式不正确");
|
||||
etPhone.requestFocus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!phone.startsWith("1")) {
|
||||
etPhone.setError("手机号格式不正确");
|
||||
etPhone.requestFocus();
|
||||
return false;
|
||||
}
|
||||
|
||||
// 验证验证码
|
||||
if (code.isEmpty()) {
|
||||
etVerificationCode.setError("请输入验证码");
|
||||
etVerificationCode.requestFocus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (code.length() != 6) {
|
||||
etVerificationCode.setError("验证码格式不正确");
|
||||
etVerificationCode.requestFocus();
|
||||
return false;
|
||||
}
|
||||
|
||||
// 验证密码
|
||||
if (password.isEmpty()) {
|
||||
etPassword.setError("请输入密码");
|
||||
etPassword.requestFocus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (password.length() < 6) {
|
||||
etPassword.setError("密码至少6位");
|
||||
etPassword.requestFocus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (password.length() > 20) {
|
||||
etPassword.setError("密码最多20位");
|
||||
etPassword.requestFocus();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void performRegisterSuccess(String phone, String password) {
|
||||
Toast.makeText(this, "注册成功!", Toast.LENGTH_SHORT).show();
|
||||
|
||||
// 自动登录
|
||||
User user = userManager.loginUser(phone, password);
|
||||
if (user != null) {
|
||||
// 跳转到主页面
|
||||
Intent intent = new Intent(RegisterActivity.this, MainActivity.class);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
} else {
|
||||
// 如果自动登录失败,跳转到登录页面
|
||||
Toast.makeText(this, "注册成功,请登录", Toast.LENGTH_SHORT).show();
|
||||
Intent intent = new Intent(RegisterActivity.this, LoginActivity.class);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (countDownTimer != null) {
|
||||
countDownTimer.cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,357 @@
|
||||
package com.startsmake.llrisetabbardemo.activity;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.provider.MediaStore;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.content.FileProvider;
|
||||
|
||||
import com.startsmake.llrisetabbardemo.R;
|
||||
import com.startsmake.llrisetabbardemo.model.Product;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
|
||||
public class SearchActivity extends AppCompatActivity {
|
||||
|
||||
private EditText searchEditText;
|
||||
private ImageButton backButton;
|
||||
private ImageButton cameraButton;
|
||||
private com.google.android.flexbox.FlexboxLayout historyContainer;
|
||||
private com.google.android.flexbox.FlexboxLayout recommendContainer;
|
||||
private TextView clearHistoryText;
|
||||
private TextView expandHistoryText;
|
||||
|
||||
private SharedPreferences sharedPreferences;
|
||||
private static final String SEARCH_HISTORY = "search_history";
|
||||
private static final int MAX_HISTORY_COUNT = 6; // 最大存储6条
|
||||
private static final int VISIBLE_HISTORY_COUNT = 4; // 默认显示4条
|
||||
private boolean isHistoryExpanded = false;
|
||||
|
||||
// 相机相关变量
|
||||
private static final int CAMERA_REQUEST_CODE = 1001;
|
||||
private static final int CAMERA_PERMISSION_REQUEST_CODE = 1002;
|
||||
private String currentPhotoPath;
|
||||
|
||||
private List<Product> allProducts;
|
||||
private List<String> recommendKeywords;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_search);
|
||||
|
||||
initViews();
|
||||
initData();
|
||||
loadSearchHistory();
|
||||
setupRecommendations();
|
||||
}
|
||||
|
||||
private void initViews() {
|
||||
searchEditText = findViewById(R.id.search_edit_text);
|
||||
backButton = findViewById(R.id.back_button);
|
||||
cameraButton = findViewById(R.id.camera_button);
|
||||
historyContainer = findViewById(R.id.history_container);
|
||||
recommendContainer = findViewById(R.id.recommend_container);
|
||||
clearHistoryText = findViewById(R.id.clear_history_text);
|
||||
expandHistoryText = findViewById(R.id.expand_history_text);
|
||||
TextView searchButton = findViewById(R.id.search_button);
|
||||
|
||||
// 设置返回按钮
|
||||
backButton.setOnClickListener((View v) -> finish());
|
||||
|
||||
// 设置搜索按钮点击事件
|
||||
searchButton.setOnClickListener((View v) -> {
|
||||
performSearch();
|
||||
});
|
||||
|
||||
// 设置搜索页面的相机按钮
|
||||
cameraButton.setOnClickListener((View v) -> {
|
||||
if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED) {
|
||||
openCamera();
|
||||
} else {
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
|
||||
requestPermissions(new String[]{Manifest.permission.CAMERA}, CAMERA_PERMISSION_REQUEST_CODE);
|
||||
} else {
|
||||
openCamera();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 设置搜索功能
|
||||
searchEditText.setOnEditorActionListener((v, actionId, event) -> {
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH) {
|
||||
performSearch();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
// 清空历史记录
|
||||
clearHistoryText.setOnClickListener((View v) -> clearSearchHistory());
|
||||
|
||||
// 设置展开/收起按钮
|
||||
expandHistoryText.setOnClickListener((View v) -> {
|
||||
isHistoryExpanded = !isHistoryExpanded;
|
||||
loadSearchHistory();
|
||||
});
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
sharedPreferences = getSharedPreferences("search_prefs", MODE_PRIVATE);
|
||||
|
||||
// 初始化商品数据
|
||||
allProducts = new ArrayList<>();
|
||||
allProducts.add(new Product("1", "Java编程思想", "计算机专业教材", "学习资料", 45.0, ""));
|
||||
allProducts.add(new Product("2", "高等数学教材", "大学数学课本", "学习资料", 30.0, ""));
|
||||
allProducts.add(new Product("3", "笔记本电脑", "二手联想笔记本", "数码产品", 1200.0, ""));
|
||||
allProducts.add(new Product("4", "台灯", "护眼学习台灯", "生活用品", 25.0, ""));
|
||||
allProducts.add(new Product("5", "Python入门", "编程学习书籍", "学习资料", 35.0, ""));
|
||||
allProducts.add(new Product("6", "机械键盘", "客制化机械键盘", "数码产品", 150.0, ""));
|
||||
allProducts.add(new Product("7", "电钢琴", "雅马哈电钢琴", "乐器", 800.0, ""));
|
||||
allProducts.add(new Product("8", "笔记本", "八成新游戏本", "数码产品", 2000.0, ""));
|
||||
allProducts.add(new Product("9", "电动车", "二手电动车", "交通工具", 600.0, ""));
|
||||
allProducts.add(new Product("10", "厚外套", "冬季保暖外套", "服装", 80.0, ""));
|
||||
|
||||
// 初始化推荐关键词
|
||||
recommendKeywords = Arrays.asList(
|
||||
"Java编程教材", "Python入门书籍", "高等数学课本", "英语四级真题", "考研政治资料", "计算机专业课", "电路分析教程", "机械制图教材", "经济学原理", "心理学导论", "设计素描本", "专业课程笔记","二手笔记本电脑", "机械键盘", "无线鼠标", "蓝牙耳机", "平板电脑", "智能手机", "充电宝", "U盘硬盘", "显示器", "路由器", "相机镜头", "游戏手柄","台灯", "插排", "收纳箱", "穿衣镜",
|
||||
"瑜伽垫", "体重秤", "电风扇", "暖手宝", "床上桌", "衣柜", "鞋架", "晾衣架","羽毛球拍", "篮球足球", "滑板轮滑", "吉他乐器",
|
||||
"画笔画具", "围棋象棋", "游泳装备", "健身器材", "登山背包", "帐篷睡袋", "摄影三脚架", "书法字帖"
|
||||
);
|
||||
}
|
||||
|
||||
private void loadSearchHistory() {
|
||||
Set<String> historySet = sharedPreferences.getStringSet(SEARCH_HISTORY, new HashSet<>());
|
||||
List<String> historyList = new ArrayList<>(historySet);
|
||||
|
||||
// 按照搜索顺序排序(后搜索的在前)
|
||||
Collections.reverse(historyList);
|
||||
|
||||
historyContainer.removeAllViews();
|
||||
|
||||
if (historyList.isEmpty()) {
|
||||
findViewById(R.id.history_title).setVisibility(View.GONE);
|
||||
clearHistoryText.setVisibility(View.GONE);
|
||||
expandHistoryText.setVisibility(View.GONE);
|
||||
} else {
|
||||
findViewById(R.id.history_title).setVisibility(View.VISIBLE);
|
||||
clearHistoryText.setVisibility(View.VISIBLE);
|
||||
|
||||
// 计算要显示的历史记录数量
|
||||
int showCount = historyList.size();
|
||||
if (!isHistoryExpanded && historyList.size() > VISIBLE_HISTORY_COUNT) {
|
||||
showCount = VISIBLE_HISTORY_COUNT;
|
||||
}
|
||||
|
||||
// 显示历史记录标签
|
||||
for (int i = 0; i < showCount; i++) {
|
||||
String keyword = historyList.get(i);
|
||||
TextView historyTag = createTagView(keyword, true);
|
||||
historyContainer.addView(historyTag);
|
||||
}
|
||||
|
||||
// 显示展开/收起按钮
|
||||
if (historyList.size() > VISIBLE_HISTORY_COUNT) {
|
||||
expandHistoryText.setVisibility(View.VISIBLE);
|
||||
if (isHistoryExpanded) {
|
||||
expandHistoryText.setText("收起");
|
||||
} else {
|
||||
expandHistoryText.setText("展开更多(" + (historyList.size() - VISIBLE_HISTORY_COUNT) + ")");
|
||||
}
|
||||
} else {
|
||||
expandHistoryText.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void saveSearchHistory(String query) {
|
||||
Set<String> historySet = sharedPreferences.getStringSet(SEARCH_HISTORY, new HashSet<>());
|
||||
Set<String> newSet = new LinkedHashSet<>(); // 使用LinkedHashSet保持顺序
|
||||
|
||||
// 先添加新的搜索(确保在最前面)
|
||||
newSet.add(query);
|
||||
|
||||
// 添加其他历史记录(排除重复项)
|
||||
for (String item : historySet) {
|
||||
if (!item.equals(query)) {
|
||||
newSet.add(item);
|
||||
}
|
||||
}
|
||||
|
||||
// 如果超过最大数量,移除最旧的
|
||||
if (newSet.size() > MAX_HISTORY_COUNT) {
|
||||
List<String> list = new ArrayList<>(newSet);
|
||||
// 保留最新的6条
|
||||
List<String> newList = list.subList(0, MAX_HISTORY_COUNT);
|
||||
newSet = new LinkedHashSet<>(newList);
|
||||
}
|
||||
|
||||
sharedPreferences.edit().putStringSet(SEARCH_HISTORY, newSet).apply();
|
||||
}
|
||||
|
||||
// 相机相关方法保持不变
|
||||
private void openCamera() {
|
||||
Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
|
||||
if (takePictureIntent.resolveActivity(getPackageManager()) != null) {
|
||||
File photoFile = null;
|
||||
try {
|
||||
photoFile = createImageFile();
|
||||
} catch (IOException ex) {
|
||||
Toast.makeText(this, "创建文件失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
if (photoFile != null) {
|
||||
currentPhotoPath = photoFile.getAbsolutePath();
|
||||
Uri photoURI = FileProvider.getUriForFile(this,
|
||||
getPackageName() + ".fileprovider",
|
||||
photoFile);
|
||||
takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);
|
||||
startActivityForResult(takePictureIntent, CAMERA_REQUEST_CODE);
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(this, "未找到相机应用", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
private File createImageFile() throws IOException {
|
||||
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.getDefault()).format(new Date());
|
||||
String imageFileName = "JPEG_" + timeStamp + "_";
|
||||
File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);
|
||||
return File.createTempFile(
|
||||
imageFileName,
|
||||
".jpg",
|
||||
storageDir
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (requestCode == CAMERA_REQUEST_CODE && resultCode == RESULT_OK) {
|
||||
if (currentPhotoPath != null) {
|
||||
Toast.makeText(this, "拍照成功,开始搜索...", Toast.LENGTH_SHORT).show();
|
||||
searchEditText.setText("图片搜索中...");
|
||||
performImageSearch();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
if (requestCode == CAMERA_PERMISSION_REQUEST_CODE) {
|
||||
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
||||
openCamera();
|
||||
} else {
|
||||
Toast.makeText(this, "需要相机权限才能拍照搜索", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 图片搜索功能
|
||||
private void performImageSearch() {
|
||||
List<Product> similarProducts = findSimilarProducts();
|
||||
|
||||
if (similarProducts.isEmpty()) {
|
||||
searchEditText.setText("未找到相似商品");
|
||||
Toast.makeText(this, "未找到相似商品", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Intent intent = new Intent(this, SearchResultsActivity.class);
|
||||
intent.putExtra("search_type", "image");
|
||||
intent.putExtra("search_query", "图片搜索结果");
|
||||
ArrayList<Product> productList = new ArrayList<>(similarProducts);
|
||||
intent.putExtra("similar_products", productList);
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
|
||||
private List<Product> findSimilarProducts() {
|
||||
List<Product> similarProducts = new ArrayList<>();
|
||||
Collections.shuffle(allProducts);
|
||||
similarProducts = allProducts.subList(0, Math.min(5, allProducts.size()));
|
||||
return similarProducts;
|
||||
}
|
||||
|
||||
private void setupRecommendations() {
|
||||
List<String> randomRecommends = new ArrayList<>(recommendKeywords);
|
||||
Collections.shuffle(randomRecommends);
|
||||
List<String> selectedRecommends = randomRecommends.subList(0, Math.min(6, randomRecommends.size()));
|
||||
|
||||
recommendContainer.removeAllViews();
|
||||
|
||||
for (String keyword : selectedRecommends) {
|
||||
TextView recommendTag = createTagView(keyword, false);
|
||||
recommendContainer.addView(recommendTag);
|
||||
}
|
||||
}
|
||||
|
||||
private TextView createTagView(String keyword, boolean isHistory) {
|
||||
TextView tagView = new TextView(this);
|
||||
com.google.android.flexbox.FlexboxLayout.LayoutParams params = new com.google.android.flexbox.FlexboxLayout.LayoutParams(
|
||||
com.google.android.flexbox.FlexboxLayout.LayoutParams.WRAP_CONTENT,
|
||||
com.google.android.flexbox.FlexboxLayout.LayoutParams.WRAP_CONTENT
|
||||
);
|
||||
params.setMargins(0, 0, 16, 16);
|
||||
tagView.setLayoutParams(params);
|
||||
|
||||
tagView.setPadding(32, 16, 32, 16);
|
||||
tagView.setText(keyword);
|
||||
tagView.setTextSize(14);
|
||||
tagView.setBackgroundResource(R.drawable.tag_background);
|
||||
tagView.setTextColor(getResources().getColor(android.R.color.darker_gray));
|
||||
|
||||
tagView.setOnClickListener(v -> {
|
||||
searchEditText.setText(keyword);
|
||||
performSearch();
|
||||
});
|
||||
|
||||
return tagView;
|
||||
}
|
||||
|
||||
private void performSearch() {
|
||||
String query = searchEditText.getText().toString().trim();
|
||||
if (!TextUtils.isEmpty(query)) {
|
||||
saveSearchHistory(query);
|
||||
Intent intent = new Intent(this, SearchResultsActivity.class);
|
||||
intent.putExtra("search_query", query);
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
|
||||
private void clearSearchHistory() {
|
||||
sharedPreferences.edit().remove(SEARCH_HISTORY).apply();
|
||||
loadSearchHistory();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
loadSearchHistory();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,115 @@
|
||||
package com.startsmake.llrisetabbardemo.activity;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.startsmake.llrisetabbardemo.R;
|
||||
import com.startsmake.llrisetabbardemo.adapter.SearchAdapter;
|
||||
import com.startsmake.llrisetabbardemo.model.Product;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SearchResultsActivity extends AppCompatActivity {
|
||||
|
||||
private RecyclerView resultsRecyclerView;
|
||||
private TextView searchQueryText;
|
||||
private SearchAdapter searchAdapter;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_search_results);
|
||||
|
||||
initViews();
|
||||
loadSearchResults();
|
||||
}
|
||||
|
||||
private void initViews() {
|
||||
resultsRecyclerView = findViewById(R.id.results_recycler_view);
|
||||
searchQueryText = findViewById(R.id.search_query_text);
|
||||
|
||||
String query = getIntent().getStringExtra("search_query");
|
||||
searchQueryText.setText("搜索结果: " + query);
|
||||
|
||||
searchAdapter = new SearchAdapter(new ArrayList<>());
|
||||
resultsRecyclerView.setLayoutManager(new LinearLayoutManager(this));
|
||||
resultsRecyclerView.setAdapter(searchAdapter);
|
||||
|
||||
// 设置返回按钮 - 修复Lambda表达式参数类型
|
||||
findViewById(R.id.back_button).setOnClickListener((View v) -> {
|
||||
// 确保数据保存后再返回
|
||||
finish();
|
||||
});
|
||||
}
|
||||
|
||||
// 在 loadSearchResults() 方法中添加对图片搜索的支持
|
||||
private void loadSearchResults() {
|
||||
String searchType = getIntent().getStringExtra("search_type");
|
||||
String query = getIntent().getStringExtra("search_query");
|
||||
|
||||
if ("image".equals(searchType)) {
|
||||
// 图片搜索结果
|
||||
List<Product> similarProducts = (List<Product>) getIntent().getSerializableExtra("similar_products");
|
||||
if (similarProducts != null && !similarProducts.isEmpty()) {
|
||||
searchQueryText.setText("图片搜索结果");
|
||||
searchAdapter.updateData(similarProducts);
|
||||
findViewById(R.id.no_results_text).setVisibility(View.GONE);
|
||||
resultsRecyclerView.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
searchQueryText.setText("图片搜索结果");
|
||||
findViewById(R.id.no_results_text).setVisibility(View.VISIBLE);
|
||||
resultsRecyclerView.setVisibility(View.GONE);
|
||||
}
|
||||
} else {
|
||||
// 文本搜索结果(原有逻辑)
|
||||
if (query != null) {
|
||||
searchQueryText.setText("搜索结果: " + query);
|
||||
|
||||
List<Product> searchResults = searchProducts(query);
|
||||
|
||||
if (searchResults.isEmpty()) {
|
||||
findViewById(R.id.no_results_text).setVisibility(View.VISIBLE);
|
||||
resultsRecyclerView.setVisibility(View.GONE);
|
||||
} else {
|
||||
findViewById(R.id.no_results_text).setVisibility(View.GONE);
|
||||
resultsRecyclerView.setVisibility(View.VISIBLE);
|
||||
searchAdapter.updateData(searchResults);
|
||||
}
|
||||
} else {
|
||||
// 处理没有查询参数的情况
|
||||
searchQueryText.setText("搜索结果");
|
||||
findViewById(R.id.no_results_text).setVisibility(View.VISIBLE);
|
||||
resultsRecyclerView.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
private List<Product> searchProducts(String keyword) {
|
||||
List<Product> results = new ArrayList<>();
|
||||
// 这里使用模拟数据,实际应该从数据库或网络加载
|
||||
List<Product> allProducts = getMockProducts();
|
||||
|
||||
for (Product product : allProducts) {
|
||||
if (product.getName().toLowerCase().contains(keyword.toLowerCase()) ||
|
||||
product.getDescription().toLowerCase().contains(keyword.toLowerCase()) ||
|
||||
product.getCategory().toLowerCase().contains(keyword.toLowerCase())) {
|
||||
results.add(product);
|
||||
}
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
private List<Product> getMockProducts() {
|
||||
List<Product> products = new ArrayList<>();
|
||||
products.add(new Product("1", "Java编程思想", "计算机专业教材", "学习资料", 45.0, ""));
|
||||
products.add(new Product("2", "高等数学教材", "大学数学课本", "学习资料", 30.0, ""));
|
||||
products.add(new Product("3", "笔记本电脑", "二手联想笔记本", "数码产品", 1200.0, ""));
|
||||
products.add(new Product("4", "台灯", "护眼学习台灯", "生活用品", 25.0, ""));
|
||||
products.add(new Product("5", "Python入门", "编程学习书籍", "学习资料", 35.0, ""));
|
||||
return products;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,74 @@
|
||||
package com.startsmake.llrisetabbardemo.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.startsmake.llrisetabbardemo.R;
|
||||
import com.startsmake.llrisetabbardemo.model.ChatMessage;
|
||||
import java.util.List;
|
||||
|
||||
public class ChatMessageAdapter extends RecyclerView.Adapter<ChatMessageAdapter.ViewHolder> {
|
||||
|
||||
private Context context;
|
||||
private List<ChatMessage> messageList;
|
||||
|
||||
public ChatMessageAdapter(Context context, List<ChatMessage> messageList) {
|
||||
this.context = context;
|
||||
this.messageList = messageList;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(context).inflate(R.layout.item_chat_message, parent, false);
|
||||
return new ViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
ChatMessage message = messageList.get(position);
|
||||
|
||||
if (message.isMe()) {
|
||||
// 自己发送的消息 - 右侧显示
|
||||
holder.layoutLeft.setVisibility(View.GONE);
|
||||
holder.layoutRight.setVisibility(View.VISIBLE);
|
||||
holder.tvRightMessage.setText(message.getContent());
|
||||
holder.tvRightTime.setText(message.getTime());
|
||||
} else {
|
||||
// 对方发送的消息 - 左侧显示
|
||||
holder.layoutRight.setVisibility(View.GONE);
|
||||
holder.layoutLeft.setVisibility(View.VISIBLE);
|
||||
holder.tvLeftMessage.setText(message.getContent());
|
||||
holder.tvLeftTime.setText(message.getTime());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return messageList.size();
|
||||
}
|
||||
|
||||
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
LinearLayout layoutLeft;
|
||||
LinearLayout layoutRight;
|
||||
TextView tvLeftMessage;
|
||||
TextView tvRightMessage;
|
||||
TextView tvLeftTime;
|
||||
TextView tvRightTime;
|
||||
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
layoutLeft = itemView.findViewById(R.id.layoutLeft);
|
||||
layoutRight = itemView.findViewById(R.id.layoutRight);
|
||||
tvLeftMessage = itemView.findViewById(R.id.tvLeftMessage);
|
||||
tvRightMessage = itemView.findViewById(R.id.tvRightMessage);
|
||||
tvLeftTime = itemView.findViewById(R.id.tvLeftTime);
|
||||
tvRightTime = itemView.findViewById(R.id.tvRightTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,84 @@
|
||||
package com.startsmake.llrisetabbardemo.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.startsmake.llrisetabbardemo.R;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ImageAdapter extends BaseAdapter {
|
||||
|
||||
private Context context;
|
||||
private List<Uri> imageUris;
|
||||
private static final int MAX_IMAGES = 9;
|
||||
|
||||
public ImageAdapter(Context context, List<Uri> imageUris) {
|
||||
this.context = context;
|
||||
this.imageUris = imageUris;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return Math.min(imageUris.size() + 1, MAX_IMAGES);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getItem(int position) {
|
||||
if (position < imageUris.size()) {
|
||||
return imageUris.get(position);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
ViewHolder holder;
|
||||
if (convertView == null) {
|
||||
convertView = LayoutInflater.from(context).inflate(R.layout.item_image, parent, false);
|
||||
holder = new ViewHolder();
|
||||
holder.imageView = convertView.findViewById(R.id.imageView);
|
||||
holder.deleteButton = convertView.findViewById(R.id.btnDelete);
|
||||
convertView.setTag(holder);
|
||||
} else {
|
||||
holder = (ViewHolder) convertView.getTag();
|
||||
}
|
||||
|
||||
if (position < imageUris.size()) {
|
||||
// 显示已选择的图片
|
||||
Uri imageUri = imageUris.get(position);
|
||||
Glide.with(context)
|
||||
.load(imageUri)
|
||||
.placeholder(android.R.drawable.ic_menu_gallery) // 使用系统图标作为占位符
|
||||
.into(holder.imageView);
|
||||
|
||||
holder.deleteButton.setVisibility(View.VISIBLE);
|
||||
holder.deleteButton.setOnClickListener(v -> {
|
||||
imageUris.remove(position);
|
||||
notifyDataSetChanged();
|
||||
});
|
||||
} else {
|
||||
// 显示添加按钮
|
||||
holder.imageView.setImageResource(android.R.drawable.ic_input_add); // 使用系统图标
|
||||
holder.deleteButton.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
return convertView;
|
||||
}
|
||||
|
||||
static class ViewHolder {
|
||||
ImageView imageView;
|
||||
ImageView deleteButton;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,102 @@
|
||||
package com.startsmake.llrisetabbardemo.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.startsmake.llrisetabbardemo.R;
|
||||
import com.startsmake.llrisetabbardemo.model.MessageItem;
|
||||
import java.util.List;
|
||||
|
||||
public class MessageAdapter extends RecyclerView.Adapter<MessageAdapter.ViewHolder> {
|
||||
|
||||
private Context context;
|
||||
private List<MessageItem> messageList;
|
||||
private OnItemClickListener onItemClickListener;
|
||||
|
||||
public MessageAdapter(Context context, List<MessageItem> messageList) {
|
||||
this.context = context;
|
||||
this.messageList = messageList;
|
||||
}
|
||||
|
||||
// 添加点击监听接口
|
||||
public interface OnItemClickListener {
|
||||
void onItemClick(MessageItem item);
|
||||
}
|
||||
|
||||
public void setOnItemClickListener(OnItemClickListener listener) {
|
||||
this.onItemClickListener = listener;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(context).inflate(R.layout.item_message, parent, false);
|
||||
return new ViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
MessageItem item = messageList.get(position);
|
||||
|
||||
// 设置默认白色头像背景
|
||||
holder.ivAvatar.setBackgroundResource(R.drawable.bg_avatar_placeholder);
|
||||
|
||||
holder.tvTitle.setText(item.getTitle());
|
||||
holder.tvContent.setText(item.getContent());
|
||||
holder.tvTime.setText(item.getTime());
|
||||
|
||||
// 未读消息数量
|
||||
if (item.getUnreadCount() > 0) {
|
||||
holder.tvUnreadCount.setVisibility(View.VISIBLE);
|
||||
holder.tvUnreadCount.setText(String.valueOf(item.getUnreadCount()));
|
||||
} else {
|
||||
holder.tvUnreadCount.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
// 官方标识
|
||||
if (item.isOfficial()) {
|
||||
holder.ivOfficial.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
holder.ivOfficial.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
// 添加点击事件
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (onItemClickListener != null) {
|
||||
onItemClickListener.onItemClick(item);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return messageList.size();
|
||||
}
|
||||
|
||||
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
ImageView ivAvatar;
|
||||
TextView tvTitle;
|
||||
TextView tvContent;
|
||||
TextView tvTime;
|
||||
TextView tvUnreadCount;
|
||||
ImageView ivOfficial;
|
||||
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
ivAvatar = itemView.findViewById(R.id.ivAvatar);
|
||||
tvTitle = itemView.findViewById(R.id.tvTitle);
|
||||
tvContent = itemView.findViewById(R.id.tvContent);
|
||||
tvTime = itemView.findViewById(R.id.tvTime);
|
||||
tvUnreadCount = itemView.findViewById(R.id.tvUnreadCount);
|
||||
ivOfficial = itemView.findViewById(R.id.ivOfficial);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
package com.startsmake.llrisetabbardemo.adapter;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.startsmake.llrisetabbardemo.R;
|
||||
import com.startsmake.llrisetabbardemo.model.Product;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SearchAdapter extends RecyclerView.Adapter<SearchAdapter.ViewHolder> {
|
||||
private List<Product> productList;
|
||||
|
||||
public SearchAdapter(List<Product> productList) {
|
||||
this.productList = productList;
|
||||
}
|
||||
|
||||
public void updateData(List<Product> newList) {
|
||||
this.productList = newList;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext())
|
||||
.inflate(R.layout.item_product, parent, false);
|
||||
return new ViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
Product product = productList.get(position);
|
||||
holder.productName.setText(product.getName());
|
||||
holder.productDescription.setText(product.getDescription());
|
||||
holder.productCategory.setText(product.getCategory());
|
||||
holder.productPrice.setText(String.format("¥%.2f", product.getPrice()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return productList.size();
|
||||
}
|
||||
|
||||
static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView productName;
|
||||
TextView productDescription;
|
||||
TextView productCategory;
|
||||
TextView productPrice;
|
||||
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
productName = itemView.findViewById(R.id.product_name);
|
||||
productDescription = itemView.findViewById(R.id.product_description);
|
||||
productCategory = itemView.findViewById(R.id.product_category);
|
||||
productPrice = itemView.findViewById(R.id.product_price);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,89 @@
|
||||
package com.startsmake.llrisetabbardemo.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.startsmake.llrisetabbardemo.R;
|
||||
import com.startsmake.llrisetabbardemo.model.Item;
|
||||
|
||||
public class ItemDetailFragment extends Fragment {
|
||||
|
||||
private static final String ARG_ITEM = "item";
|
||||
|
||||
private Item item;
|
||||
|
||||
public static ItemDetailFragment newInstance(Item item) {
|
||||
ItemDetailFragment fragment = new ItemDetailFragment();
|
||||
Bundle args = new Bundle();
|
||||
args.putSerializable(ARG_ITEM, item);
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
if (getArguments() != null) {
|
||||
item = (Item) getArguments().getSerializable(ARG_ITEM);
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.fragment_item_detail, container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
|
||||
if (item == null) {
|
||||
Toast.makeText(getContext(), "商品信息加载失败", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
// 初始化视图
|
||||
ImageView ivItemImage = view.findViewById(R.id.ivItemImage);
|
||||
TextView tvTitle = view.findViewById(R.id.tvTitle);
|
||||
TextView tvPrice = view.findViewById(R.id.tvPrice);
|
||||
TextView tvDescription = view.findViewById(R.id.tvDescription);
|
||||
TextView tvCategory = view.findViewById(R.id.tvCategory);
|
||||
TextView tvLocation = view.findViewById(R.id.tvLocation);
|
||||
TextView tvContact = view.findViewById(R.id.tvContact);
|
||||
TextView tvPublishTime = view.findViewById(R.id.tvPublishTime);
|
||||
|
||||
// 设置商品信息
|
||||
tvTitle.setText(item.getTitle());
|
||||
tvPrice.setText(String.format("¥%.2f", item.getPrice()));
|
||||
tvDescription.setText(item.getDescription());
|
||||
tvCategory.setText("分类:" + item.getCategory());
|
||||
tvLocation.setText("位置:" + item.getLocation());
|
||||
tvContact.setText("联系方式:" + item.getContact());
|
||||
|
||||
// 设置发布时间
|
||||
String time = android.text.format.DateFormat.format("yyyy-MM-dd HH:mm", item.getPublishTime()).toString();
|
||||
tvPublishTime.setText("发布时间:" + time);
|
||||
|
||||
// 加载图片(这里使用第一张图片作为主图)
|
||||
if (item.getImageUrls() != null && !item.getImageUrls().isEmpty()) {
|
||||
// 实际项目中这里应该加载网络图片,这里用占位符
|
||||
ivItemImage.setImageResource(R.mipmap.ic_launcher);
|
||||
}
|
||||
|
||||
// 联系卖家按钮
|
||||
view.findViewById(R.id.btnContact).setOnClickListener(v -> {
|
||||
Toast.makeText(getContext(), "联系卖家:" + item.getContact(), Toast.LENGTH_SHORT).show();
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package com.startsmake.llrisetabbardemo.model;
|
||||
|
||||
public class ChatMessage {
|
||||
private String sender;
|
||||
private String content;
|
||||
private String time;
|
||||
private boolean isMe;
|
||||
|
||||
public ChatMessage(String sender, String content, String time, boolean isMe) {
|
||||
this.sender = sender;
|
||||
this.content = content;
|
||||
this.time = time;
|
||||
this.isMe = isMe;
|
||||
}
|
||||
|
||||
// Getter and Setter methods
|
||||
public String getSender() { return sender; }
|
||||
public void setSender(String sender) { this.sender = sender; }
|
||||
|
||||
public String getContent() { return content; }
|
||||
public void setContent(String content) { this.content = content; }
|
||||
|
||||
public String getTime() { return time; }
|
||||
public void setTime(String time) { this.time = time; }
|
||||
|
||||
public boolean isMe() { return isMe; }
|
||||
public void setMe(boolean me) { isMe = me; }
|
||||
}
|
||||
@ -0,0 +1,111 @@
|
||||
package com.startsmake.llrisetabbardemo.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Item implements Serializable {
|
||||
private String id;
|
||||
private String title;
|
||||
private String description;
|
||||
private double price;
|
||||
private List<String> imageUrls;
|
||||
private String category;
|
||||
private String location;
|
||||
private String contact;
|
||||
private String contactQQ; // 新增QQ联系方式
|
||||
private String contactWechat; // 新增微信联系方式
|
||||
private long publishTime;
|
||||
private String userId;
|
||||
private int viewCount; // 浏览数
|
||||
private int likeCount; // 点赞数
|
||||
|
||||
public Item() {
|
||||
imageUrls = new ArrayList<>();
|
||||
viewCount = 0;
|
||||
likeCount = 0;
|
||||
}
|
||||
|
||||
// 构造函数
|
||||
public Item(String title, String description, double price, String category, String location, String contact) {
|
||||
this();
|
||||
this.title = title;
|
||||
this.description = description;
|
||||
this.price = price;
|
||||
this.category = category;
|
||||
this.location = location;
|
||||
this.contact = contact;
|
||||
this.publishTime = System.currentTimeMillis();
|
||||
this.userId = "user_" + System.currentTimeMillis();
|
||||
}
|
||||
|
||||
// Getter 和 Setter 方法
|
||||
public String getId() { return id; }
|
||||
public void setId(String id) { this.id = id; }
|
||||
|
||||
public String getTitle() { return title; }
|
||||
public void setTitle(String title) { this.title = title; }
|
||||
|
||||
public String getDescription() { return description; }
|
||||
public void setDescription(String description) { this.description = description; }
|
||||
|
||||
public double getPrice() { return price; }
|
||||
public void setPrice(double price) { this.price = price; }
|
||||
|
||||
public List<String> getImageUrls() { return imageUrls; }
|
||||
public void setImageUrls(List<String> imageUrls) { this.imageUrls = imageUrls; }
|
||||
public void addImageUrl(String imageUrl) { this.imageUrls.add(imageUrl); }
|
||||
|
||||
public String getCategory() { return category; }
|
||||
public void setCategory(String category) { this.category = category; }
|
||||
|
||||
public String getLocation() { return location; }
|
||||
public void setLocation(String location) { this.location = location; }
|
||||
|
||||
public String getContact() { return contact; }
|
||||
public void setContact(String contact) { this.contact = contact; }
|
||||
|
||||
public String getContactQQ() { return contactQQ; }
|
||||
public void setContactQQ(String contactQQ) { this.contactQQ = contactQQ; }
|
||||
|
||||
public String getContactWechat() { return contactWechat; }
|
||||
public void setContactWechat(String contactWechat) { this.contactWechat = contactWechat; }
|
||||
|
||||
public long getPublishTime() { return publishTime; }
|
||||
public void setPublishTime(long publishTime) { this.publishTime = publishTime; }
|
||||
|
||||
public String getUserId() { return userId; }
|
||||
public void setUserId(String userId) { this.userId = userId; }
|
||||
|
||||
public int getViewCount() { return viewCount; }
|
||||
public void setViewCount(int viewCount) { this.viewCount = viewCount; }
|
||||
|
||||
public int getLikeCount() { return likeCount; }
|
||||
public void setLikeCount(int likeCount) { this.likeCount = likeCount; }
|
||||
|
||||
/**
|
||||
* 增加浏览数
|
||||
*/
|
||||
public void incrementViewCount() {
|
||||
this.viewCount++;
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加点赞数
|
||||
*/
|
||||
public void incrementLikeCount() {
|
||||
this.likeCount++;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Item{" +
|
||||
"id='" + id + '\'' +
|
||||
", title='" + title + '\'' +
|
||||
", price=" + price +
|
||||
", category='" + category + '\'' +
|
||||
", location='" + location + '\'' +
|
||||
", publishTime=" + publishTime +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
package com.startsmake.llrisetabbardemo.model;
|
||||
|
||||
public class MessageItem {
|
||||
private String title;
|
||||
private String content;
|
||||
private String time;
|
||||
private int unreadCount;
|
||||
private boolean isOfficial;
|
||||
|
||||
public MessageItem(String title, String content, String time, int unreadCount, boolean isOfficial) {
|
||||
this.title = title;
|
||||
this.content = content;
|
||||
this.time = time;
|
||||
this.unreadCount = unreadCount;
|
||||
this.isOfficial = isOfficial;
|
||||
}
|
||||
|
||||
// Getter and Setter methods
|
||||
public String getTitle() { return title; }
|
||||
public void setTitle(String title) { this.title = title; }
|
||||
|
||||
public String getContent() { return content; }
|
||||
public void setContent(String content) { this.content = content; }
|
||||
|
||||
public String getTime() { return time; }
|
||||
public void setTime(String time) { this.time = time; }
|
||||
|
||||
public int getUnreadCount() { return unreadCount; }
|
||||
public void setUnreadCount(int unreadCount) { this.unreadCount = unreadCount; }
|
||||
|
||||
public boolean isOfficial() { return isOfficial; }
|
||||
public void setOfficial(boolean official) { isOfficial = official; }
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
package com.startsmake.llrisetabbardemo.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
public class Product implements Serializable {
|
||||
private String id;
|
||||
private String name;
|
||||
private String description;
|
||||
private String category;
|
||||
private double price;
|
||||
private String imageUrl;
|
||||
|
||||
public Product() {
|
||||
}
|
||||
|
||||
public Product(String id, String name, String description, String category, double price, String imageUrl) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
this.category = category;
|
||||
this.price = price;
|
||||
this.imageUrl = imageUrl;
|
||||
}
|
||||
|
||||
// Getter 和 Setter 方法
|
||||
public String getId() { return id; }
|
||||
public void setId(String id) { this.id = id; }
|
||||
|
||||
public String getName() { return name; }
|
||||
public void setName(String name) { this.name = name; }
|
||||
|
||||
public String getDescription() { return description; }
|
||||
public void setDescription(String description) { this.description = description; }
|
||||
|
||||
public String getCategory() { return category; }
|
||||
public void setCategory(String category) { this.category = category; }
|
||||
|
||||
public double getPrice() { return price; }
|
||||
public void setPrice(double price) { this.price = price; }
|
||||
|
||||
public String getImageUrl() { return imageUrl; }
|
||||
public void setImageUrl(String imageUrl) { this.imageUrl = imageUrl; }
|
||||
|
||||
// 添加 equals 和 hashCode 方法
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
Product product = (Product) o;
|
||||
return Objects.equals(id, product.id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id);
|
||||
}
|
||||
|
||||
// 可选:添加 toString 方法便于调试
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Product{" +
|
||||
"id='" + id + '\'' +
|
||||
", name='" + name + '\'' +
|
||||
", category='" + category + '\'' +
|
||||
", price=" + price +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
package com.startsmake.llrisetabbardemo.model;
|
||||
|
||||
public class User {
|
||||
private String phone;
|
||||
private String password;
|
||||
private String username;
|
||||
private long registerTime;
|
||||
|
||||
public User(String phone, String password) {
|
||||
this.phone = phone;
|
||||
this.password = password;
|
||||
this.username = "用户_" + phone.substring(7);
|
||||
this.registerTime = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
// Getters and Setters
|
||||
public String getPhone() { return phone; }
|
||||
public void setPhone(String phone) { this.phone = phone; }
|
||||
|
||||
public String getPassword() { return password; }
|
||||
public void setPassword(String password) { this.password = password; }
|
||||
|
||||
public String getUsername() { return username; }
|
||||
public void setUsername(String username) { this.username = username; }
|
||||
|
||||
public long getRegisterTime() { return registerTime; }
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@android:color/white" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#e0e0e0" />
|
||||
<corners android:radius="4dp" />
|
||||
</shape>
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#20FFD700" />
|
||||
<corners android:radius="8dp" />
|
||||
</shape>
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#FFD700" />
|
||||
<corners android:radius="24dp" />
|
||||
</shape>
|
||||
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#20FFD700" />
|
||||
<corners android:radius="24dp" />
|
||||
<stroke android:width="1dp" android:color="#FFD700" />
|
||||
</shape>
|
||||
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#f5f5f5" />
|
||||
<corners android:radius="24dp" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#e0e0e0" />
|
||||
</shape>
|
||||
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@android:color/white" />
|
||||
<corners
|
||||
android:topLeftRadius="0dp"
|
||||
android:topRightRadius="16dp"
|
||||
android:bottomLeftRadius="16dp"
|
||||
android:bottomRightRadius="16dp" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#e0e0e0" />
|
||||
</shape>
|
||||
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#07C160" />
|
||||
<corners
|
||||
android:topLeftRadius="16dp"
|
||||
android:topRightRadius="0dp"
|
||||
android:bottomLeftRadius="16dp"
|
||||
android:bottomRightRadius="16dp" />
|
||||
</shape>
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#99000000" />
|
||||
<corners android:radius="12dp" />
|
||||
</shape>
|
||||
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#FFFFFF" />
|
||||
<stroke android:width="1dp" android:color="#E0E0E0" />
|
||||
<corners android:radius="8dp" />
|
||||
</shape>
|
||||
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#f0f0f0" />
|
||||
<corners android:radius="4dp" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#e0e0e0" />
|
||||
</shape>
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#f5f5f5" />
|
||||
<corners android:radius="18dp" />
|
||||
</shape>
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#FF5000" />
|
||||
<corners android:radius="9dp" />
|
||||
</shape>
|
||||
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
|
||||
<solid android:color="#FFFFFFFF" />
|
||||
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#FFE0E0E0" />
|
||||
|
||||
<!-- 添加阴影效果 -->
|
||||
<padding
|
||||
android:left="2dp"
|
||||
android:top="2dp"
|
||||
android:right="2dp"
|
||||
android:bottom="2dp" />
|
||||
|
||||
</shape>
|
||||
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="12dp" />
|
||||
<solid android:color="#FF00BCD4" />
|
||||
<stroke
|
||||
android:width="0.5dp"
|
||||
android:color="#FF0097A7" />
|
||||
<padding
|
||||
android:left="8dp"
|
||||
android:top="2dp"
|
||||
android:right="8dp"
|
||||
android:bottom="2dp" />
|
||||
</shape>
|
||||
@ -0,0 +1,15 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FF666666"
|
||||
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2z M12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z"/>
|
||||
<path
|
||||
android:fillColor="#FF666666"
|
||||
android:pathData="M12,6c-3.31,0 -6,2.69 -6,6s2.69,6 6,6 6,-2.69 6,-6 -2.69,-6 -6,-6z M12,16c-2.21,0 -4,-1.79 -4,-4s1.79,-4 4,-4 4,1.79 4,4 -1.79,4 -4,4z"/>
|
||||
<path
|
||||
android:fillColor="#FF666666"
|
||||
android:pathData="M12,9.5c-1.38,0 -2.5,1.12 -2.5,2.5s1.12,2.5 2.5,2.5 2.5,-1.12 2.5,-2.5 -1.12,-2.5 -2.5,-2.5z"/>
|
||||
</vector>
|
||||
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="@color/white">
|
||||
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
|
||||
|
||||
</vector>
|
||||
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="#333333">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
|
||||
</vector>
|
||||
@ -0,0 +1,11 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:strokeColor="#FF666666"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="@android:color/transparent"
|
||||
android:pathData="M9,6l6,6l-6,6"/>
|
||||
</vector>
|
||||
|
After Width: | Height: | Size: 39 KiB |
@ -0,0 +1,15 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FFE44D"
|
||||
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2z M12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z"/>
|
||||
<path
|
||||
android:fillColor="#FFE44D"
|
||||
android:pathData="M12.5,7H11v6l5.25,3.15l0.75,-1.23l-4.5,-2.67z"/>
|
||||
<path
|
||||
android:fillColor="#FFE44D"
|
||||
android:pathData="M7,12.5h10v-1H7z"/>
|
||||
</vector>
|
||||
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FFE44D"
|
||||
android:pathData="M20,6h-2.18c0.11,-0.31 0.18,-0.65 0.18,-1c0,-1.66 -1.34,-3 -3,-3c-1.05,0 -1.96,0.54 -2.5,1.35C12.96,2.54 12.05,2 11,2C9.34,2 8,3.34 8,5c0,0.35 0.07,0.69 0.18,1H4c-1.11,0 -1.99,0.89 -1.99,2L2,19c0,1.11 0.89,2 2,2h16c1.11,0 2,-0.89 2,-2V8C22,6.89 21.11,6 20,6z M15,4c0.55,0 1,0.45 1,1s-0.45,1 -1,1s-1,-0.45 -1,-1S14.45,4 15,4z M11,4c0.55,0 1,0.45 1,1s-0.45,1 -1,1s-1,-0.45 -1,-1S10.45,4 11,4z M4,19v-6h6v6H4z M14,19v-6h6v6H14z"/>
|
||||
</vector>
|
||||
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FF757575"
|
||||
android:pathData="M12,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM12,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z"/>
|
||||
</vector>
|
||||
@ -0,0 +1,12 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FF4CAF50"
|
||||
android:pathData="M20,2H4C2.9,2 2,2.9 2,4v12c0,1.1 0.9,2 2,2h4v3c0,0.55 0.45,1 1,1h0.5c0.25,0 0.49,-0.09 0.67,-0.26L13.9,18H20c1.1,0 2,-0.9 2,-2V4C22,2.9 21.1,2 20,2z M20,16h-6.09c-0.18,0 -0.35,0.06 -0.49,0.17l-1.42,1.42V16H4V4h16V16z"/>
|
||||
<path
|
||||
android:fillColor="#FF4CAF50"
|
||||
android:pathData="M11,11h2v2h-2z M11,7h2v2h-2z"/>
|
||||
</vector>
|
||||
@ -0,0 +1,15 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FFE44D"
|
||||
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2z M12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z"/>
|
||||
<path
|
||||
android:fillColor="#FFE44D"
|
||||
android:pathData="M11,16h2v2h-2z"/>
|
||||
<path
|
||||
android:fillColor="#FFE44D"
|
||||
android:pathData="M12,6c-2.21,0 -4,1.79 -4,4h2c0,-1.1 0.9,-2 2,-2s2,0.9 2,2c0,2 -3,1.75 -3,5h2c0,-2.25 3,-2.5 3,-5C16,7.79 14.21,6 12,6z"/>
|
||||
</vector>
|
||||
@ -0,0 +1,12 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FFE44D"
|
||||
android:pathData="M16,11c1.66,0 2.99,-1.34 2.99,-3S17.66,5 16,5c-1.66,0 -3,1.34 -3,3S14.34,11 16,11z M8,11c1.66,0 2.99,-1.34 2.99,-3S9.66,5 8,5C6.34,5 5,6.34 5,8S6.34,11 8,11z M8,13c-2.33,0 -7,1.17 -7,3.5V19h14v-2.5C15,14.17 10.33,13 8,13z M16,13c-0.29,0 -0.62,0.02 -0.97,0.05c1.16,0.84 1.97,1.97 1.97,3.45V19h6v-2.5C23,14.17 18.33,13 16,13z"/>
|
||||
<path
|
||||
android:fillColor="#FFE44D"
|
||||
android:pathData="M20,2H4C2.9,2 2,2.9 2,4v12c0,1.1 0.9,2 2,2h4v-2H4V4h16v12h-4v2h4c1.1,0 2,-0.9 2,-2V4C22,2.9 21.1,2 20,2z"/>
|
||||
</vector>
|
||||
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FF666666"
|
||||
android:pathData="M17,7l-1.41,1.41L18.17,11H8v2h10.17l-2.58,2.58L17,17l5,-5L17,7z M4,5h8V3H4C2.9,3 2,3.9 2,5v14c0,1.1 0.9,2 2,2h8v-2H4V5z"/>
|
||||
</vector>
|
||||
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FF666666"
|
||||
android:pathData="M6,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2z M18,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2z M12,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2z"/>
|
||||
</vector>
|
||||
@ -0,0 +1,15 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FFE44D"
|
||||
android:pathData="M19,3H5C3.9,3 3,3.9 3,5v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2V5C21,3.9 20.1,3 19,3zM19,19H5V5h14V19z"/>
|
||||
<path
|
||||
android:fillColor="#FFE44D"
|
||||
android:pathData="M8.5,15H6.5l4,-7 4,7h-2l-1.5,-2.5L8.5,15z"/>
|
||||
<path
|
||||
android:fillColor="#FFE44D"
|
||||
android:pathData="M17,12.5h-4V11h4V12.5z"/>
|
||||
</vector>
|
||||
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="12dp"
|
||||
android:height="12dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FF5000"
|
||||
android:pathData="M12,2L4,5v6.09c0,5.05 3.41,9.76 8,10.91c4.59,-1.15 8,-5.86 8,-10.91V5L12,2z"/>
|
||||
</vector>
|
||||
@ -0,0 +1,12 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FFE44D"
|
||||
android:pathData="M12,22c1.1,0 2,-0.9 2,-2h-4C10,21.1 10.9,22 12,22z M18,16v-5c0,-3.07 -1.64,-5.64 -4.5,-6.32V4c0,-0.83 -0.67,-1.5 -1.5,-1.5s-1.5,0.67 -1.5,1.5v0.68C7.63,5.36 6,7.92 6,11v5l-2,2v1h16v-1L18,16z"/>
|
||||
<path
|
||||
android:fillColor="#FFE44D"
|
||||
android:pathData="M15,9H9v2h1v3h4v-3h1V9z"/>
|
||||
</vector>
|
||||
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#BDBDBD"
|
||||
android:pathData="M19,5v14H5V5h14m0-2H5c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2V5c0,-1.1 -0.9,-2 -2,-2z"/>
|
||||
<path
|
||||
android:fillColor="#BDBDBD"
|
||||
android:pathData="M12,12c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM14,16v2h-4v-2c0,-1.1 0.9,-2 2,-2s2,0.9 2,2z"/>
|
||||
</vector>
|
||||
@ -0,0 +1,12 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FFE44D"
|
||||
android:pathData="M13,3c-4.97,0 -9,4.03 -9,9H1l3.89,3.89l0.07,0.14L9,12H6c0,-3.87 3.13,-7 7,-7s7,3.13 7,7s-3.13,7 -7,7c-1.93,0 -3.68,-0.79 -4.94,-2.06l-1.42,1.42C8.27,19.99 10.51,21 13,21c4.97,0 9,-4.03 9,-9s-4.03,-9 -9,-9z"/>
|
||||
<path
|
||||
android:fillColor="#FFE44D"
|
||||
android:pathData="M12,8v5l4.25,2.52l0.77,-1.28l-3.52,-2.09V8z"/>
|
||||
</vector>
|
||||
@ -0,0 +1,39 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FF666666"
|
||||
android:pathData="M3,11h8V3H3V11zM5,5h4v4H5V5z"/>
|
||||
<path
|
||||
android:fillColor="#FF666666"
|
||||
android:pathData="M3,21h8v-8H3V21zM5,15h4v4H5V15z"/>
|
||||
<path
|
||||
android:fillColor="#FF666666"
|
||||
android:pathData="M13,3v8h8V3H13zM19,9h-4V5h4V9z"/>
|
||||
<path
|
||||
android:fillColor="#FF666666"
|
||||
android:pathData="M21,19h-2v2h2V19z"/>
|
||||
<path
|
||||
android:fillColor="#FF666666"
|
||||
android:pathData="M13,13h2v2h-2V13z"/>
|
||||
<path
|
||||
android:fillColor="#FF666666"
|
||||
android:pathData="M15,15h2v2h-2V15z"/>
|
||||
<path
|
||||
android:fillColor="#FF666666"
|
||||
android:pathData="M13,17h2v2h-2V17z"/>
|
||||
<path
|
||||
android:fillColor="#FF666666"
|
||||
android:pathData="M15,19h2v2h-2V19z"/>
|
||||
<path
|
||||
android:fillColor="#FF666666"
|
||||
android:pathData="M17,17h2v2h-2V17z"/>
|
||||
<path
|
||||
android:fillColor="#FF666666"
|
||||
android:pathData="M19,15h2v2h-2V15z"/>
|
||||
<path
|
||||
android:fillColor="#FF666666"
|
||||
android:pathData="M17,13h2v2h-2V13z"/>
|
||||
</vector>
|
||||
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FF666666"
|
||||
android:pathData="M19.14,12.94c0.04,-0.3 0.06,-0.61 0.06,-0.94c0,-0.32 -0.02,-0.64 -0.07,-0.94l2.03,-1.58c0.18,-0.14 0.23,-0.41 0.12,-0.61l-1.92,-3.32c-0.12,-0.22 -0.37,-0.29 -0.59,-0.22l-2.39,0.96c-0.5,-0.38 -1.03,-0.7 -1.62,-0.94L14.4,2.81c-0.04,-0.24 -0.24,-0.41 -0.48,-0.41h-3.84c-0.24,0 -0.43,0.17 -0.47,0.41L9.25,5.35C8.66,5.59 8.12,5.92 7.63,6.29L5.24,5.33c-0.22,-0.08 -0.47,0 -0.59,0.22L2.74,8.87C2.62,9.08 2.66,9.34 2.86,9.48l2.03,1.58C4.84,11.36 4.82,11.69 4.82,12s0.02,0.64 0.07,0.94l-2.03,1.58c-0.18,0.14 -0.23,0.41 -0.12,0.61l1.92,3.32c0.12,0.22 0.37,0.29 0.59,0.22l2.39,-0.96c0.5,0.38 1.03,0.7 1.62,0.94l0.36,2.54c0.05,0.24 0.24,0.41 0.48,0.41h3.84c0.24,0 0.44,-0.17 0.47,-0.41l0.36,-2.54c0.59,-0.24 1.13,-0.56 1.62,-0.94l2.39,0.96c0.22,0.08 0.47,0 0.59,-0.22l1.92,-3.32c0.12,-0.22 0.07,-0.47 -0.12,-0.61L19.14,12.94zM12,15.6c-1.98,0 -3.6,-1.62 -3.6,-3.6s1.62,-3.6 3.6,-3.6s3.6,1.62 3.6,3.6S13.98,15.6 12,15.6z"/>
|
||||
</vector>
|
||||
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#2196F3"
|
||||
android:pathData="M19,6h-2c0,-2.8 -2.2,-5 -5,-5S7,3.2 7,6H5C3.9,6 3,6.9 3,8v12c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2V8C21,6.9 20.1,6 19,6z M12,3c1.7,0 3,1.3 3,3H9C9,4.3 10.3,3 12,3z M19,20H5V8h2v2c0,0.6 0.4,1 1,1s1,-0.4 1,-1V8h6v2c0,0.6 0.4,1 1,1s1,-0.4 1,-1V8h2V20z"/>
|
||||
</vector>
|
||||
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FFE44D"
|
||||
android:pathData="M12,17.27L18.18,21l-1.64,-7.03L22,9.24l-7.19,-0.61L12,2L9.19,8.63L2,9.24l5.46,4.73L5.82,21z"/>
|
||||
</vector>
|
||||
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="12dp" />
|
||||
|
||||
<!-- 银白色渐变 -->
|
||||
<gradient
|
||||
android:type="linear"
|
||||
android:startColor="#FFE8E8E8"
|
||||
android:centerColor="#FFD6D6D6"
|
||||
android:endColor="#FFC0C0C0"
|
||||
android:angle="45" />
|
||||
|
||||
<stroke
|
||||
android:width="0.8dp"
|
||||
android:color="#FFA0A0A0" />
|
||||
|
||||
<padding
|
||||
android:left="8dp"
|
||||
android:top="2dp"
|
||||
android:right="8dp"
|
||||
android:bottom="2dp" />
|
||||
</shape>
|
||||
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<!-- 设置圆角半径 -->
|
||||
<corners android:radius="20dp" />
|
||||
|
||||
<!-- 背景颜色 -->
|
||||
<solid android:color="@android:color/white" />
|
||||
|
||||
</shape>
|
||||
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<corners android:radius="25dp" />
|
||||
|
||||
<!-- 渐变背景 -->
|
||||
<gradient
|
||||
android:type="linear"
|
||||
android:startColor="#FFFFFF"
|
||||
android:endColor="#F8F9FA"
|
||||
android:angle="90" />
|
||||
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#E0E0E0" />
|
||||
|
||||
</shape>
|
||||
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@android:color/transparent" />
|
||||
<stroke
|
||||
android:width="0.8dp"
|
||||
android:color="#999999" />
|
||||
<corners android:radius="18dp" />
|
||||
</shape>
|
||||
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#f5f5f5" />
|
||||
<corners android:radius="20dp" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#e0e0e0" />
|
||||
</shape>
|
||||
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<!-- 圆角 -->
|
||||
<corners android:radius="16dp" />
|
||||
|
||||
<!-- 背景色 - 白色 -->
|
||||
<solid android:color="@color/white" />
|
||||
|
||||
<!-- 灰色边框 -->
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="@color/gray_300" />
|
||||
|
||||
<!-- 内边距 -->
|
||||
<padding
|
||||
android:left="8dp"
|
||||
android:top="4dp"
|
||||
android:right="8dp"
|
||||
android:bottom="4dp" />
|
||||
|
||||
</shape>
|
||||
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<corners android:radius="16dp" />
|
||||
|
||||
<!-- 渐变背景 -->
|
||||
<gradient
|
||||
android:type="linear"
|
||||
android:startColor="@color/primary_blue_light"
|
||||
android:endColor="@color/primary_blue"
|
||||
android:angle="90" />
|
||||
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="@color/primary_blue_dark" />
|
||||
|
||||
</shape>
|
||||
@ -0,0 +1,71 @@
|
||||
<?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"
|
||||
android:background="#f5f5f5">
|
||||
|
||||
<!-- 标题栏 -->
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:background="@android:color/white"
|
||||
android:elevation="2dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivBack"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:src="@android:drawable/ic_menu_close_clear_cancel"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="16dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="聊天"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_centerInParent="true" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<!-- 聊天消息列表 -->
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvChatMessages"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<!-- 输入框区域 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/white"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp"
|
||||
android:elevation="4dp">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etMessage"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_chat_input"
|
||||
android:hint="输入消息..."
|
||||
android:maxLines="3"
|
||||
android:padding="12dp"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/btnSend"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:src="@android:drawable/ic_menu_send"
|
||||
android:layout_marginStart="8dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView 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:background="#FFFFFF"
|
||||
android:fillViewport="true">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="32dp">
|
||||
|
||||
<!-- 返回按钮 -->
|
||||
<ImageButton
|
||||
android:id="@+id/btn_back"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:src="@drawable/ic_arrow_back"
|
||||
android:tint="#333333" />
|
||||
|
||||
<!-- 标题 -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="40dp"
|
||||
android:text="忘记密码"
|
||||
android:textColor="#333333"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<!-- 手机号输入框 -->
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
app:boxCornerRadiusBottomEnd="12dp"
|
||||
app:boxCornerRadiusBottomStart="12dp"
|
||||
app:boxCornerRadiusTopEnd="12dp"
|
||||
app:boxCornerRadiusTopStart="12dp"
|
||||
app:boxStrokeColor="#FFD700"
|
||||
app:hintTextColor="#999999">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/et_phone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="手机号"
|
||||
android:inputType="phone"
|
||||
android:maxLines="1"
|
||||
android:padding="16dp"
|
||||
android:textColor="#333333"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<!-- 验证码输入框 -->
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
app:boxCornerRadiusBottomEnd="12dp"
|
||||
app:boxCornerRadiusBottomStart="12dp"
|
||||
app:boxCornerRadiusTopEnd="12dp"
|
||||
app:boxCornerRadiusTopStart="12dp"
|
||||
app:boxStrokeColor="#FFD700"
|
||||
app:hintTextColor="#999999">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/et_verification_code"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:hint="验证码"
|
||||
android:inputType="number"
|
||||
android:maxLines="1"
|
||||
android:padding="16dp"
|
||||
android:textColor="#333333"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_send_code"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="8dp"
|
||||
android:background="@drawable/bg_button_code"
|
||||
android:text="发送验证码"
|
||||
android:textColor="#FFD700"
|
||||
android:textSize="12sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<!-- 新密码输入框 -->
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="32dp"
|
||||
app:boxCornerRadiusBottomEnd="12dp"
|
||||
app:boxCornerRadiusBottomStart="12dp"
|
||||
app:boxCornerRadiusTopEnd="12dp"
|
||||
app:boxCornerRadiusTopStart="12dp"
|
||||
app:boxStrokeColor="#FFD700"
|
||||
app:hintTextColor="#999999">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/et_new_password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="设置新密码"
|
||||
android:inputType="textPassword"
|
||||
android:maxLines="1"
|
||||
android:padding="16dp"
|
||||
android:textColor="#333333"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<!-- 重置密码按钮 -->
|
||||
<Button
|
||||
android:id="@+id/btn_reset_password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:background="@drawable/bg_button_primary"
|
||||
android:text="重置密码"
|
||||
android:textColor="#333333"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<!-- 底部链接 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="想起密码?"
|
||||
android:textColor="#666666"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_login"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="返回登录"
|
||||
android:textColor="#FFD700"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
@ -0,0 +1,145 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView 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:background="#FFFFFF"
|
||||
android:fillViewport="true">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="32dp">
|
||||
|
||||
<!-- Logo -->
|
||||
<ImageView
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="60dp"
|
||||
android:layout_marginBottom="40dp"
|
||||
android:src="@mipmap/ic_launcher"
|
||||
android:tint="#FFD700" />
|
||||
|
||||
<!-- 标题 -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginBottom="40dp"
|
||||
android:text="BudgetFindly"
|
||||
android:textColor="#333333"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<!-- 手机号输入框 -->
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
app:boxCornerRadiusBottomEnd="12dp"
|
||||
app:boxCornerRadiusBottomStart="12dp"
|
||||
app:boxCornerRadiusTopEnd="12dp"
|
||||
app:boxCornerRadiusTopStart="12dp"
|
||||
app:boxStrokeColor="#FFD700"
|
||||
app:hintTextColor="#999999">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/et_phone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="手机号"
|
||||
android:inputType="phone"
|
||||
android:maxLines="1"
|
||||
android:padding="16dp"
|
||||
android:textColor="#333333"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<!-- 密码输入框 -->
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="32dp"
|
||||
app:boxCornerRadiusBottomEnd="12dp"
|
||||
app:boxCornerRadiusBottomStart="12dp"
|
||||
app:boxCornerRadiusTopEnd="12dp"
|
||||
app:boxCornerRadiusTopStart="12dp"
|
||||
app:boxStrokeColor="#FFD700"
|
||||
app:hintTextColor="#999999">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/et_password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="密码"
|
||||
android:inputType="textPassword"
|
||||
android:maxLines="1"
|
||||
android:padding="16dp"
|
||||
android:textColor="#333333"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<!-- 登录按钮 -->
|
||||
<Button
|
||||
android:id="@+id/btn_login"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:background="@drawable/bg_button_primary"
|
||||
android:text="登录"
|
||||
android:textColor="#333333"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<!-- 跳过登录按钮 -->
|
||||
<Button
|
||||
android:id="@+id/btn_skip_login"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:background="@drawable/bg_button_secondary"
|
||||
android:text="跳过登录"
|
||||
android:textColor="#FFD700"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<!-- 底部链接 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_forgot_password"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="忘记密码?"
|
||||
android:textColor="#FFD700"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="12dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:background="#DDDDDD" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_register"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="立即注册"
|
||||
android:textColor="#FFD700"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView 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:background="#FFFFFF"
|
||||
android:fillViewport="true">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="32dp">
|
||||
|
||||
<!-- 返回按钮 -->
|
||||
<ImageButton
|
||||
android:id="@+id/btn_back"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:src="@drawable/ic_arrow_back"
|
||||
android:tint="#333333" />
|
||||
|
||||
<!-- 标题 -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="40dp"
|
||||
android:text="注册账号"
|
||||
android:textColor="#333333"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<!-- 手机号输入框 -->
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
app:boxCornerRadiusBottomEnd="12dp"
|
||||
app:boxCornerRadiusBottomStart="12dp"
|
||||
app:boxCornerRadiusTopEnd="12dp"
|
||||
app:boxCornerRadiusTopStart="12dp"
|
||||
app:boxStrokeColor="#FFD700"
|
||||
app:hintTextColor="#999999">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/et_phone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="手机号"
|
||||
android:inputType="phone"
|
||||
android:maxLines="1"
|
||||
android:padding="16dp"
|
||||
android:textColor="#333333"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<!-- 验证码输入框 -->
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
app:boxCornerRadiusBottomEnd="12dp"
|
||||
app:boxCornerRadiusBottomStart="12dp"
|
||||
app:boxCornerRadiusTopEnd="12dp"
|
||||
app:boxCornerRadiusTopStart="12dp"
|
||||
app:boxStrokeColor="#FFD700"
|
||||
app:hintTextColor="#999999">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/et_verification_code"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:hint="验证码"
|
||||
android:inputType="number"
|
||||
android:maxLines="1"
|
||||
android:padding="16dp"
|
||||
android:textColor="#333333"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_send_code"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="8dp"
|
||||
android:background="@drawable/bg_button_code"
|
||||
android:text="发送验证码"
|
||||
android:textColor="#FFD700"
|
||||
android:textSize="12sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<!-- 密码输入框 -->
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="32dp"
|
||||
app:boxCornerRadiusBottomEnd="12dp"
|
||||
app:boxCornerRadiusBottomStart="12dp"
|
||||
app:boxCornerRadiusTopEnd="12dp"
|
||||
app:boxCornerRadiusTopStart="12dp"
|
||||
app:boxStrokeColor="#FFD700"
|
||||
app:hintTextColor="#999999">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/et_password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="设置密码"
|
||||
android:inputType="textPassword"
|
||||
android:maxLines="1"
|
||||
android:padding="16dp"
|
||||
android:textColor="#333333"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<!-- 注册按钮 -->
|
||||
<Button
|
||||
android:id="@+id/btn_register"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:background="@drawable/bg_button_primary"
|
||||
android:text="注册"
|
||||
android:textColor="#333333"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<!-- 底部链接 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="已有账号?"
|
||||
android:textColor="#666666"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_login"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="立即登录"
|
||||
android:textColor="#FFD700"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
@ -0,0 +1,176 @@
|
||||
<?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"
|
||||
android:background="@android:color/white">
|
||||
|
||||
<!-- 搜索栏 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#FFDD59"
|
||||
android:orientation="horizontal"
|
||||
android:padding="12dp">
|
||||
|
||||
<!-- 返回按钮 -->
|
||||
<ImageButton
|
||||
android:id="@+id/back_button"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="50dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:src="@drawable/ic_back"
|
||||
android:scaleType="centerInside"
|
||||
android:padding="6dp"
|
||||
android:contentDescription="返回" />
|
||||
|
||||
<!-- 搜索框 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:alpha="0.8"
|
||||
android:background="@drawable/rounded_background1"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp">
|
||||
|
||||
<!-- 摄像头按钮 -->
|
||||
<ImageButton
|
||||
android:id="@+id/camera_button"
|
||||
android:layout_width="23dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:padding="0.5dp"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@android:drawable/ic_menu_camera"
|
||||
android:contentDescription="拍照搜索" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/search_edit_text"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="8dp"
|
||||
android:background="@null"
|
||||
android:hint="搜索教材、数码、生活用品..."
|
||||
android:imeOptions="actionSearch"
|
||||
android:inputType="text"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textColor="#333333"
|
||||
android:textColorHint="#999999"
|
||||
android:textSize="14sp"
|
||||
android:cursorVisible="true"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"/>
|
||||
|
||||
|
||||
<!-- 搜索按钮 - 放在输入框外面右侧 -->
|
||||
<TextView
|
||||
android:id="@+id/search_button"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="27dp"
|
||||
android:layout_marginStart="2dp"
|
||||
android:layout_marginTop="0dp"
|
||||
android:gravity="center"
|
||||
android:text="搜索"
|
||||
android:textColor="#333333"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
android:clickable="true"
|
||||
android:focusable="true" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 内容区域 -->
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- 历史搜索 -->
|
||||
<TextView
|
||||
android:id="@+id/history_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="历史搜索"
|
||||
android:textColor="#333333"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginBottom="12dp" />
|
||||
|
||||
<!-- 历史记录容器 - 使用 FlexboxLayout -->
|
||||
<com.google.android.flexbox.FlexboxLayout
|
||||
android:id="@+id/history_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:flexWrap="wrap"
|
||||
app:alignItems="flex_start"
|
||||
app:justifyContent="flex_start" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<!-- 展开/收起按钮 -->
|
||||
<TextView
|
||||
android:id="@+id/expand_history_text"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="展开更多"
|
||||
android:textColor="#666666"
|
||||
android:textSize="12sp"
|
||||
android:padding="8dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<!-- 清空历史 -->
|
||||
<TextView
|
||||
android:id="@+id/clear_history_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="清空历史记录"
|
||||
android:textColor="#666666"
|
||||
android:textSize="12sp"
|
||||
android:padding="8dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 猜你可能在找 -->
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="猜你可能在找"
|
||||
android:textColor="#333333"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginTop="24dp"
|
||||
android:layout_marginBottom="12dp" />
|
||||
|
||||
<!-- 推荐容器 - 使用 FlexboxLayout -->
|
||||
<com.google.android.flexbox.FlexboxLayout
|
||||
android:id="@+id/recommend_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:flexWrap="wrap"
|
||||
app:alignItems="flex_start"
|
||||
app:justifyContent="flex_start" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
@ -0,0 +1,59 @@
|
||||
<?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"
|
||||
android:background="@android:color/white">
|
||||
|
||||
<!-- 搜索栏 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#FFDD59"
|
||||
android:orientation="horizontal"
|
||||
android:padding="16dp">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/back_button"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="28dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:src="@drawable/ic_back"
|
||||
android:scaleType="centerInside"
|
||||
android:padding="6dp"
|
||||
android:contentDescription="返回" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/search_query_text"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="16dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="搜索结果"
|
||||
android:textColor="#333333"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 搜索结果 -->
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/results_recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="8dp" />
|
||||
|
||||
<!-- 无结果提示 -->
|
||||
<TextView
|
||||
android:id="@+id/no_results_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="120dp"
|
||||
android:text="没有找到相关商品"
|
||||
android:textColor="#666666"
|
||||
android:textSize="16sp"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
@ -1,14 +1,244 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<FrameLayout 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:background="#fffaf0"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
<!-- 顶部搜索栏区域 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="首页"/>
|
||||
android:background="#FFDD59"
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp">
|
||||
|
||||
<!-- 搜索框 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2.5dp"
|
||||
android:alpha="0.8"
|
||||
android:background="@drawable/rounded_background1"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp">
|
||||
|
||||
<!-- 搜索图标 -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha="1"
|
||||
android:text="🔍"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<!-- 搜索输入框 -->
|
||||
<EditText
|
||||
android:id="@+id/search_edit_text"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:alpha="1"
|
||||
android:background="@null"
|
||||
android:focusable="false"
|
||||
android:focusableInTouchMode="false"
|
||||
android:hint="搜索教材、数码、生活用品..."
|
||||
android:inputType="none"
|
||||
android:maxLines="1"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="#333333"
|
||||
android:textColorHint="#999999"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<!-- 摄像头按钮 -->
|
||||
<ImageButton
|
||||
android:id="@+id/camera_button"
|
||||
android:layout_width="23dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:padding="0.5dp"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@android:drawable/ic_menu_camera"
|
||||
android:contentDescription="拍照搜索" />
|
||||
|
||||
<!-- 搜索按钮 - 放在输入框外面右侧 -->
|
||||
<TextView
|
||||
android:id="@+id/home_search_button"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="27dp"
|
||||
android:layout_marginStart="2dp"
|
||||
android:layout_marginTop="0dp"
|
||||
android:gravity="center"
|
||||
android:text="搜索"
|
||||
android:textColor="#333333"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
android:clickable="true"
|
||||
android:focusable="true" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 导航标签区域 -->
|
||||
<HorizontalScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="65dp"
|
||||
android:background="@android:color/white"
|
||||
android:paddingVertical="8dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/tab_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<!-- 关注标签 -->
|
||||
<RadioButton
|
||||
android:id="@+id/tab_follow"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:text="关注"
|
||||
android:button="@null"
|
||||
android:textColor="#ff6b35"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true" />
|
||||
|
||||
<!-- 推荐标签 -->
|
||||
<TextView
|
||||
android:id="@+id/tab_recommend"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:text="推荐"
|
||||
android:textColor="#666666"
|
||||
android:textSize="14sp"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true" />
|
||||
|
||||
<!-- 新发布标签 -->
|
||||
<TextView
|
||||
android:id="@+id/tab_new"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:text="新发布"
|
||||
android:textColor="#666666"
|
||||
android:textSize="14sp"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true" />
|
||||
|
||||
<!-- 学习资料标签 -->
|
||||
<TextView
|
||||
android:id="@+id/tab_study"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:text="学习资料"
|
||||
android:textColor="#666666"
|
||||
android:textSize="14sp"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true" />
|
||||
|
||||
<!-- 生活用品标签 -->
|
||||
<TextView
|
||||
android:id="@+id/tab_living"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:text="生活用品"
|
||||
android:textColor="#666666"
|
||||
android:textSize="14sp"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true" />
|
||||
|
||||
</LinearLayout>
|
||||
</HorizontalScrollView>
|
||||
|
||||
<!-- 在导航标签区域后面添加商品展示区域 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- 商品展示区域 -->
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/home_products_recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone" />
|
||||
|
||||
<!-- 暂无商品提示 -->
|
||||
<TextView
|
||||
android:id="@+id/home_no_products_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="暂无商品"
|
||||
android:textColor="#666666"
|
||||
android:textSize="16sp"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
<!-- 搜索结果RecyclerView -->
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/search_results_recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone" />
|
||||
|
||||
<!-- 无结果提示 -->
|
||||
<TextView
|
||||
android:id="@+id/no_results_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:text="没有找到相关商品"
|
||||
android:textSize="16sp"
|
||||
android:textColor="#666666"
|
||||
android:visibility="gone" />
|
||||
|
||||
<!-- 首页默认内容区域 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/default_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:padding="16dp">
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</FrameLayout>
|
||||
@ -0,0 +1,142 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="16dp"
|
||||
android:background="#f5f5f5">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- 商品图片 -->
|
||||
<ImageView
|
||||
android:id="@+id/ivItemImage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:background="@drawable/bg_image_border"
|
||||
android:src="@mipmap/ic_launcher" />
|
||||
|
||||
<!-- 商品基本信息 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:background="@android:color/white"
|
||||
android:padding="16dp"
|
||||
android:layout_marginTop="8dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="商品标题"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvPrice"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="¥0.00"
|
||||
android:textColor="#ff4444"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginTop="8dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 商品详情 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:background="@android:color/white"
|
||||
android:padding="16dp"
|
||||
android:layout_marginTop="8dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="商品详情"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDescription"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="商品描述"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:lineSpacingExtra="4dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 商品信息 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:background="@android:color/white"
|
||||
android:padding="16dp"
|
||||
android:layout_marginTop="8dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="商品信息"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCategory"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="分类:"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginTop="8dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvLocation"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="位置:"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginTop="4dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvContact"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="联系方式:"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginTop="4dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvPublishTime"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="发布时间:"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginTop="4dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 联系卖家按钮 -->
|
||||
<Button
|
||||
android:id="@+id/btnContact"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:text="联系卖家"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:background="@drawable/bg_button_primary"
|
||||
android:textColor="@android:color/white"
|
||||
android:layout_marginTop="16dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
@ -1,14 +1,60 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:background="#f5f5f5">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="消息"/>
|
||||
<!-- 标题栏 -->
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:background="@android:color/white"
|
||||
android:elevation="2dp">
|
||||
|
||||
</FrameLayout>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="消息"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_centerInParent="true" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<!-- 搜索栏 -->
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:background="@android:color/white"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:layout_marginTop="8dp">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etSearch"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="36dp"
|
||||
android:background="@drawable/bg_search_edittext"
|
||||
android:hint="搜索聊天记录/联系人/服务号"
|
||||
android:paddingStart="40dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:singleLine="true"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:src="@android:drawable/ic_menu_search"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="12dp" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<!-- 消息列表 -->
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvMessageList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="8dp" />
|
||||
|
||||
</LinearLayout>
|
||||
@ -1,14 +1,629 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
android:background="#f5f5f5">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="我的"/>
|
||||
android:orientation="vertical">
|
||||
|
||||
</FrameLayout>
|
||||
<!-- 顶部用户信息区域 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="120dp"
|
||||
android:background="@color/white"
|
||||
android:orientation="horizontal"
|
||||
android:padding="16dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_avatar"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:src="@drawable/ic_default_avatar"
|
||||
android:background="@drawable/circle_bg"
|
||||
android:layout_marginEnd="16dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_username"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="点击登录"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/black" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_user_desc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="省钱达人,精明购物"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/gray"
|
||||
android:layout_marginTop="4dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="8dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_credit_score"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="信用极好"
|
||||
android:textSize="10sp"
|
||||
android:background="@drawable/credit_bg"
|
||||
android:paddingHorizontal="8dp"
|
||||
android:paddingVertical="2dp"
|
||||
android:textColor="@color/white" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_member_level"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="省钱会员"
|
||||
android:textSize="10sp"
|
||||
android:background="@drawable/member_bg"
|
||||
android:paddingHorizontal="8dp"
|
||||
android:paddingVertical="2dp"
|
||||
android:textColor="@color/white"
|
||||
android:layout_marginStart="8dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_qr_code"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:src="@drawable/ic_qr_code"
|
||||
android:layout_marginEnd="16dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_settings"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:src="@drawable/ic_settings" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 数据统计区域 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:background="@color/white"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="8dp"
|
||||
android:padding="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_want_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="0"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/black" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="想买"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/gray"
|
||||
android:layout_marginTop="4dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="30dp"
|
||||
android:background="#eeeeee"
|
||||
android:layout_gravity="center" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_selling_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="0"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/black" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="在售"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/gray"
|
||||
android:layout_marginTop="4dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="30dp"
|
||||
android:background="#eeeeee"
|
||||
android:layout_gravity="center" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_sold_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="0"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/black" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="已售"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/gray"
|
||||
android:layout_marginTop="4dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="30dp"
|
||||
android:background="#eeeeee"
|
||||
android:layout_gravity="center" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_saved_money"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="¥0"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/green" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="已省钱"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/gray"
|
||||
android:layout_marginTop="4dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 我的工具区域 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginTop="8dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="我的工具"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@color/black"
|
||||
android:padding="16dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingBottom="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:src="@drawable/ic_my_listings"
|
||||
android:layout_marginBottom="8dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="我发布的"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/gray" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:src="@drawable/ic_purchase_history"
|
||||
android:layout_marginBottom="8dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="购买记录"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/gray" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:src="@drawable/ic_wishlist"
|
||||
android:layout_marginBottom="8dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="心愿单"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/gray" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:src="@drawable/ic_budget_tracker"
|
||||
android:layout_marginBottom="8dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="预算追踪"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/gray" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingBottom="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:src="@drawable/ic_price_alert"
|
||||
android:layout_marginBottom="8dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="价格提醒"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/gray" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:src="@drawable/ic_coupons"
|
||||
android:layout_marginBottom="8dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="优惠券"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/gray" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:src="@drawable/ic_help"
|
||||
android:layout_marginBottom="8dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="帮助中心"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/gray" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:src="@drawable/ic_more"
|
||||
android:layout_marginBottom="8dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="更多"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/gray" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 推荐功能区 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="16dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="推荐功能"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@color/black"
|
||||
android:padding="16dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#eeeeee" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:src="@drawable/ic_invite_friends"
|
||||
android:layout_marginEnd="12dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="邀请好友"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@color/black" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:src="@drawable/ic_arrow_right" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#eeeeee" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:src="@drawable/ic_feedback"
|
||||
android:layout_marginEnd="12dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="意见反馈"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@color/black" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:src="@drawable/ic_arrow_right" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#eeeeee" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:src="@drawable/ic_about"
|
||||
android:layout_marginEnd="12dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="关于BudgetFindly"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@color/black" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:src="@drawable/ic_arrow_right" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#eeeeee" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_logout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:gravity="center_vertical"
|
||||
android:background="?android:attr/selectableItemBackground">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:src="@drawable/ic_logout"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:color="#FF5722" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="退出登录"
|
||||
android:textSize="14sp"
|
||||
android:textColor="#FF5722" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:src="@drawable/ic_arrow_right"
|
||||
android:color="#FF5722" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
@ -0,0 +1,148 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="16dp"
|
||||
android:background="#f5f5f5">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- 图片上传区域 -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="上传图片"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginBottom="8dp" />
|
||||
|
||||
<GridView
|
||||
android:id="@+id/gridViewImages"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:numColumns="3"
|
||||
android:verticalSpacing="8dp"
|
||||
android:horizontalSpacing="8dp"
|
||||
android:stretchMode="columnWidth"
|
||||
android:background="@drawable/bg_edittext"
|
||||
android:padding="8dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="最多可上传9张图片"
|
||||
android:textSize="12sp"
|
||||
android:textColor="#666"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginBottom="16dp" />
|
||||
|
||||
<!-- 商品信息区域 -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="商品信息"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginBottom="8dp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="商品标题"
|
||||
android:maxLines="1"
|
||||
android:background="@drawable/bg_edittext"
|
||||
android:padding="12dp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etDescription"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="120dp"
|
||||
android:hint="商品描述"
|
||||
android:gravity="top"
|
||||
android:maxLines="5"
|
||||
android:background="@drawable/bg_edittext"
|
||||
android:padding="12dp"
|
||||
android:layout_marginTop="8dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="8dp">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etPrice"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:hint="价格"
|
||||
android:inputType="numberDecimal"
|
||||
android:background="@drawable/bg_edittext"
|
||||
android:padding="12dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="元"
|
||||
android:textSize="14sp"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 分类和位置 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="8dp">
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/spinnerCategory"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_edittext"
|
||||
android:padding="8dp" />
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/spinnerLocation"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="8dp"
|
||||
android:background="@drawable/bg_edittext"
|
||||
android:padding="8dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 联系方式 -->
|
||||
<EditText
|
||||
android:id="@+id/etContact"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="联系方式(微信/电话)"
|
||||
android:maxLines="1"
|
||||
android:background="@drawable/bg_edittext"
|
||||
android:padding="12dp"
|
||||
android:layout_marginTop="8dp" />
|
||||
|
||||
<!-- 发布按钮 -->
|
||||
<Button
|
||||
android:id="@+id/btnPublish"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:text="发布商品"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:background="@drawable/bg_button_primary"
|
||||
android:textColor="@android:color/white"
|
||||
android:layout_marginTop="24dp" />
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
@ -0,0 +1,118 @@
|
||||
<?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"
|
||||
android:padding="8dp">
|
||||
|
||||
<!-- 对方消息(左侧) -->
|
||||
<LinearLayout
|
||||
android:id="@+id/layoutLeft"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingEnd="48dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_chat_message_left"
|
||||
android:orientation="vertical"
|
||||
android:padding="12dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvLeftMessage"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="对方消息"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvLeftTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="时间"
|
||||
android:textColor="#999999"
|
||||
android:textSize="10sp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginStart="12dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 自己消息(右侧) -->
|
||||
<LinearLayout
|
||||
android:id="@+id/layoutRight"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="end"
|
||||
android:paddingStart="48dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_chat_message_right"
|
||||
android:orientation="vertical"
|
||||
android:padding="12dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvRightMessage"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="我的消息"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvRightTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="时间"
|
||||
android:textColor="#999999"
|
||||
android:textSize="10sp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginEnd="12dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
android:padding="2dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:background="@drawable/bg_image_border" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btnDelete"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:src="@android:drawable/ic_delete"
|
||||
android:background="@drawable/bg_delete_button" />
|
||||
|
||||
</RelativeLayout>
|
||||
@ -0,0 +1,76 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="72dp"
|
||||
android:background="@android:color/white"
|
||||
android:padding="12dp">
|
||||
|
||||
<!-- 白色头像占位 -->
|
||||
<ImageView
|
||||
android:id="@+id/ivAvatar"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:background="@drawable/bg_avatar_placeholder" />
|
||||
|
||||
<!-- 官方标识 -->
|
||||
<ImageView
|
||||
android:id="@+id/ivOfficial"
|
||||
android:layout_width="12dp"
|
||||
android:layout_height="12dp"
|
||||
android:src="@drawable/ic_official"
|
||||
android:layout_alignTop="@id/ivAvatar"
|
||||
android:layout_alignEnd="@id/ivAvatar" />
|
||||
|
||||
<!-- 标题 -->
|
||||
<TextView
|
||||
android:id="@+id/tvTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="标题"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_toEndOf="@id/ivAvatar"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_alignTop="@id/ivAvatar" />
|
||||
|
||||
<!-- 内容 -->
|
||||
<TextView
|
||||
android:id="@+id/tvContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="内容"
|
||||
android:textSize="14sp"
|
||||
android:textColor="#666666"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:layout_toEndOf="@id/ivAvatar"
|
||||
android:layout_below="@id/tvTitle"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginTop="4dp" />
|
||||
|
||||
<!-- 时间 -->
|
||||
<TextView
|
||||
android:id="@+id/tvTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="时间"
|
||||
android:textSize="12sp"
|
||||
android:textColor="#999999"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignTop="@id/tvTitle" />
|
||||
|
||||
<!-- 未读消息计数 -->
|
||||
<TextView
|
||||
android:id="@+id/tvUnreadCount"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minWidth="18dp"
|
||||
android:background="@drawable/bg_unread_count"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="10sp"
|
||||
android:gravity="center"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_below="@id/tvTime"
|
||||
android:layout_marginTop="4dp" />
|
||||
|
||||
</RelativeLayout>
|
||||
@ -0,0 +1,55 @@
|
||||
<?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"
|
||||
android:padding="16dp"
|
||||
android:background="@android:color/white"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:elevation="2dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/product_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="商品名称"
|
||||
android:textColor="#333333"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/product_description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="商品描述"
|
||||
android:textColor="#666666"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/product_category"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="类别"
|
||||
android:textColor="#999999"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/product_price"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="¥0.00"
|
||||
android:textColor="#ff6b35"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@ -1,3 +1,4 @@
|
||||
<resources>
|
||||
<string name="app_name">LLRiseTabBarDemo</string>
|
||||
<string name="search_hint">Searchforproducts</string>
|
||||
</resources>
|
||||
|
||||
@ -1,11 +1,9 @@
|
||||
<resources>
|
||||
|
||||
<!-- Base application theme. -->
|
||||
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
<!--<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>-->
|
||||
<item name="colorPrimary">@color/xianyu_yellow</item>
|
||||
<item name="colorPrimaryDark">@color/xianyu_yellow_dark</item>
|
||||
<item name="colorAccent">@color/xianyu_yellow</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<paths>
|
||||
<external-path name="external_files" path="." />
|
||||
<cache-path name="cache_files" path="." />
|
||||
</paths>
|
||||
@ -1,6 +1,7 @@
|
||||
#Sat Oct 11 19:07:18 CST 2025
|
||||
# gradle-wrapper.properties
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0-milestone-1-bin.zip
|
||||
distributionUrl=https://mirrors.cloud.tencent.com/gradle/gradle-8.6-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue