new #7

Merged
px8tqwyol merged 2 commits from master into wangze_part 2 months ago

@ -2,16 +2,8 @@
<project version="4">
<component name="deploymentTargetSelector">
<selectionStates>
<SelectionState runConfigName="app">
<SelectionState runConfigName="未命名">
<option name="selectionMode" value="DROPDOWN" />
<DropdownSelection timestamp="2025-10-11T11:49:33.560456900Z">
<Target type="DEFAULT_BOOT">
<handle>
<DeviceId pluginId="LocalEmulator" identifier="path=C:\Users\asus\.android\avd\Pixel.avd" />
</handle>
</Target>
</DropdownSelection>
<DialogSelection />
</SelectionState>
</selectionStates>
</component>

@ -54,6 +54,11 @@ dependencies {
//
implementation project(':mainnavigatetabbar')
//
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.squareup.okhttp3:logging-interceptor:4.11.0'
//
configurations {
all {

@ -4,6 +4,8 @@
package="com.startsmake.llrisetabbardemo">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"

@ -12,6 +12,8 @@ import androidx.appcompat.app.AppCompatActivity;
import com.google.android.material.textfield.TextInputEditText;
import com.startsmake.llrisetabbardemo.R;
import com.startsmake.llrisetabbardemo.manager.SmsManager;
import com.startsmake.llrisetabbardemo.manager.UserManager;
public class ForgotPasswordActivity extends AppCompatActivity {
@ -22,14 +24,23 @@ public class ForgotPasswordActivity extends AppCompatActivity {
private CountDownTimer countDownTimer;
private boolean isCounting = false;
private String verificationCode = "";
private UserManager userManager;
private SmsManager smsManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_forgot_password);
userManager = UserManager.getInstance(this);
smsManager = SmsManager.getInstance(this);
initViews();
setupClickListeners();
// 预填充手机号(如果从登录页传递过来)
handleIntentExtras();
}
private void initViews() {
@ -53,31 +64,78 @@ public class ForgotPasswordActivity extends AppCompatActivity {
btnResetPassword.setOnClickListener(v -> attemptResetPassword());
// 返回登录
tvLogin.setOnClickListener(v -> {
Intent intent = new Intent(ForgotPasswordActivity.this, LoginActivity.class);
startActivity(intent);
finish();
});
tvLogin.setOnClickListener(v -> navigateToLogin());
}
private void handleIntentExtras() {
Intent intent = getIntent();
if (intent != null) {
String phone = intent.getStringExtra("phone");
if (phone != null && !phone.isEmpty()) {
etPhone.setText(phone);
etVerificationCode.requestFocus();
}
}
}
private void sendVerificationCode() {
String phone = etPhone.getText().toString().trim();
if (phone.isEmpty()) {
etPhone.setError("请输入手机号");
if (!validatePhone(phone)) {
return;
}
if (phone.length() != 11) {
etPhone.setError("手机号格式不正确");
// 检查用户是否存在
if (!userManager.isUserExists(phone)) {
etPhone.setError("该手机号未注册");
etPhone.requestFocus();
return;
}
if (!isCounting) {
startCountDown();
Toast.makeText(this, "验证码已发送", Toast.LENGTH_SHORT).show();
// 这里应该调用后端API发送验证码
// 使用短信服务发送验证码
smsManager.sendVerificationCode(phone, new SmsManager.SmsSendCallback() {
@Override
public void onSuccess(String code) {
verificationCode = code;
Toast.makeText(ForgotPasswordActivity.this,
"验证码已发送到手机尾号" + phone.substring(7),
Toast.LENGTH_SHORT).show();
}
@Override
public void onFailure(String error) {
Toast.makeText(ForgotPasswordActivity.this,
"验证码发送失败: " + error,
Toast.LENGTH_SHORT).show();
resetCountDown();
}
});
}
}
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 void startCountDown() {
@ -99,43 +157,111 @@ public class ForgotPasswordActivity extends AppCompatActivity {
}.start();
}
private void resetCountDown() {
if (countDownTimer != null) {
countDownTimer.cancel();
}
isCounting = false;
btnSendCode.setEnabled(true);
btnSendCode.setText("发送验证码");
}
private void attemptResetPassword() {
String phone = etPhone.getText().toString().trim();
String code = etVerificationCode.getText().toString().trim();
String newPassword = etNewPassword.getText().toString().trim();
if (!validateResetInput(phone, code, newPassword)) {
return;
}
// 验证验证码
if (!code.equals(verificationCode)) {
etVerificationCode.setError("验证码错误");
etVerificationCode.requestFocus();
return;
}
// 重置密码
if (userManager.updatePassword(phone, newPassword)) {
performResetSuccess(phone);
} else {
Toast.makeText(this, "重置密码失败,请检查手机号是否正确", Toast.LENGTH_SHORT).show();
}
}
private boolean validateResetInput(String phone, String code, String newPassword) {
if (phone.isEmpty()) {
etPhone.setError("请输入手机号");
return;
etPhone.requestFocus();
return false;
}
if (code.isEmpty()) {
etVerificationCode.setError("请输入验证码");
return;
etVerificationCode.requestFocus();
return false;
}
if (newPassword.isEmpty()) {
etNewPassword.setError("请输入新密码");
return;
etNewPassword.requestFocus();
return false;
}
if (phone.length() != 11) {
etPhone.setError("手机号格式不正确");
return;
etPhone.requestFocus();
return false;
}
if (newPassword.length() < 6) {
etNewPassword.setError("密码至少6位");
return;
etNewPassword.requestFocus();
return false;
}
// 检查密码强度(可选)
if (!isPasswordStrong(newPassword)) {
etNewPassword.setError("密码过于简单,建议包含字母和数字");
etNewPassword.requestFocus();
return false;
}
return true;
}
private boolean isPasswordStrong(String password) {
// 简单的密码强度检查:至少包含字母和数字
boolean hasLetter = false;
boolean hasDigit = false;
for (char c : password.toCharArray()) {
if (Character.isLetter(c)) {
hasLetter = true;
} else if (Character.isDigit(c)) {
hasDigit = true;
}
}
// 模拟重置密码成功
performResetPassword();
return hasLetter && hasDigit;
}
private void performResetPassword() {
private void performResetSuccess(String phone) {
Toast.makeText(this, "密码重置成功!", Toast.LENGTH_SHORT).show();
// 重置成功后跳转到登录页面
// 重置成功后跳转到登录页面,并传递手机号
navigateToLoginWithPhone(phone);
}
private void navigateToLoginWithPhone(String phone) {
Intent intent = new Intent(ForgotPasswordActivity.this, LoginActivity.class);
intent.putExtra("phone", phone);
startActivity(intent);
finish();
}
private void navigateToLogin() {
Intent intent = new Intent(ForgotPasswordActivity.this, LoginActivity.class);
startActivity(intent);
finish();
@ -148,4 +274,4 @@ public class ForgotPasswordActivity extends AppCompatActivity {
countDownTimer.cancel();
}
}
}
}

@ -10,20 +10,43 @@ 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();
setupDemoUsers();
handleIntentExtras();
// 显示当前登录状态
if (userManager.isLoggedIn()) {
User currentUser = userManager.getCurrentUser();
etPhone.setText(currentUser.getPhone());
Toast.makeText(this, "已登录用户: " + currentUser.getPhone(), Toast.LENGTH_LONG).show();
}
}
private void initViews() {
@ -55,36 +78,84 @@ public class LoginActivity extends AppCompatActivity {
});
}
// 处理从其他页面传递过来的数据
private void handleIntentExtras() {
Intent intent = getIntent();
if (intent != null) {
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;
}
// 验证用户登录
if (userManager.validateLogin(phone, password)) {
// 登录成功
userManager.saveUserLogin(phone, password);
performLoginSuccess();
} else {
// 登录失败
showLoginError();
}
}
private boolean validateInput(String phone, String password) {
if (phone.isEmpty()) {
etPhone.setError("请输入手机号");
return;
etPhone.requestFocus();
return false;
}
if (password.isEmpty()) {
etPassword.setError("请输入密码");
return;
etPassword.requestFocus();
return false;
}
if (phone.length() != 11) {
etPhone.setError("手机号格式不正确");
return;
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;
}
// 模拟登录成功(因为没有后端)
performLogin();
return true;
}
private void performLogin() {
private void performLoginSuccess() {
Toast.makeText(this, "登录成功!", Toast.LENGTH_SHORT).show();
navigateToMain();
}
private void showLoginError() {
Toast.makeText(this, "手机号或密码错误", Toast.LENGTH_SHORT).show();
etPassword.setError("密码错误");
etPassword.requestFocus();
}
private void skipToMain() {
Toast.makeText(this, "跳过登录,进入主界面", Toast.LENGTH_SHORT).show();
Toast.makeText(this, "游客模式进入", Toast.LENGTH_SHORT).show();
navigateToMain();
}
@ -93,4 +164,18 @@ public class LoginActivity extends AppCompatActivity {
startActivity(intent);
finish();
}
}
// 设置演示用户,便于测试
private void setupDemoUsers() {
// 注册几个演示用户
userManager.registerUser("13800138000", "123456");
userManager.registerUser("13900139000", "123456");
userManager.registerUser("15000150000", "123456");
// 可选:在控制台输出演示用户信息,便于测试
System.out.println("演示用户已创建:");
System.out.println("手机号13800138000密码123456");
System.out.println("手机号13900139000密码123456");
System.out.println("手机号15000150000密码123456");
}
}

@ -12,6 +12,10 @@ import androidx.appcompat.app.AppCompatActivity;
import com.google.android.material.textfield.TextInputEditText;
import com.startsmake.llrisetabbardemo.R;
import com.startsmake.llrisetabbardemo.manager.SmsManager;
import com.startsmake.llrisetabbardemo.manager.UserManager;
import java.util.Random;
public class RegisterActivity extends AppCompatActivity {
@ -22,12 +26,18 @@ public class RegisterActivity extends AppCompatActivity {
private CountDownTimer countDownTimer;
private boolean isCounting = false;
private String verificationCode = "";
private UserManager userManager;
private SmsManager smsManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register);
userManager = UserManager.getInstance(this);
smsManager = SmsManager.getInstance(this); // 初始化 SmsManager
initViews();
setupClickListeners();
}
@ -63,21 +73,62 @@ public class RegisterActivity extends AppCompatActivity {
private void sendVerificationCode() {
String phone = etPhone.getText().toString().trim();
if (phone.isEmpty()) {
etPhone.setError("请输入手机号");
if (!validatePhone(phone)) {
return;
}
if (phone.length() != 11) {
etPhone.setError("手机号格式不正确");
// 检查用户是否已存在
if (userManager.isUserExists(phone)) {
etPhone.setError("该手机号已注册");
etPhone.requestFocus();
return;
}
if (!isCounting) {
startCountDown();
Toast.makeText(this, "验证码已发送", Toast.LENGTH_SHORT).show();
// 这里应该调用后端API发送验证码
// 使用短信服务发送验证码
smsManager.sendVerificationCode(phone, new SmsManager.SmsSendCallback() {
@Override
public void onSuccess(String code) {
verificationCode = code;
Toast.makeText(RegisterActivity.this,
"验证码已发送到手机尾号" + phone.substring(7),
Toast.LENGTH_SHORT).show();
}
@Override
public void onFailure(String error) {
Toast.makeText(RegisterActivity.this,
"验证码发送失败: " + error,
Toast.LENGTH_SHORT).show();
// 重置倒计时
resetCountDown();
}
});
}
}
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 void startCountDown() {
@ -99,44 +150,83 @@ public class RegisterActivity extends AppCompatActivity {
}.start();
}
private void resetCountDown() {
if (countDownTimer != null) {
countDownTimer.cancel();
}
isCounting = false;
btnSendCode.setEnabled(true);
btnSendCode.setText("发送验证码");
}
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();
return;
}
// 注册用户
if (userManager.registerUser(phone, password)) {
performRegisterSuccess();
} else {
Toast.makeText(this, "注册失败,用户已存在", Toast.LENGTH_SHORT).show();
}
}
private boolean validateRegisterInput(String phone, String code, String password) {
if (phone.isEmpty()) {
etPhone.setError("请输入手机号");
return;
etPhone.requestFocus();
return false;
}
if (code.isEmpty()) {
etVerificationCode.setError("请输入验证码");
return;
etVerificationCode.requestFocus();
return false;
}
if (password.isEmpty()) {
etPassword.setError("请输入密码");
return;
etPassword.requestFocus();
return false;
}
if (phone.length() != 11) {
etPhone.setError("手机号格式不正确");
return;
etPhone.requestFocus();
return false;
}
if (password.length() < 6) {
etPassword.setError("密码至少6位");
return;
etPassword.requestFocus();
return false;
}
// 模拟注册成功
performRegister();
return true;
}
private void performRegister() {
private void performRegisterSuccess() {
Toast.makeText(this, "注册成功!", Toast.LENGTH_SHORT).show();
// 注册成功后跳转到登录页面
Intent intent = new Intent(RegisterActivity.this, LoginActivity.class);
// 自动登录
String phone = etPhone.getText().toString().trim();
String password = etPassword.getText().toString().trim();
userManager.saveUserLogin(phone, password);
// 跳转到主页面
Intent intent = new Intent(RegisterActivity.this, MainActivity.class);
startActivity(intent);
finish();
}

@ -1,26 +1,68 @@
package com.startsmake.llrisetabbardemo.fragment;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
// 改为 AndroidX
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import com.startsmake.llrisetabbardemo.R;
import com.startsmake.llrisetabbardemo.activity.LoginActivity;
import com.startsmake.llrisetabbardemo.manager.UserManager;
import com.startsmake.llrisetabbardemo.model.User;
/**
* User:Shine
* Date:2015-10-20
* Description:
*/
public class PersonFragment extends Fragment {
private TextView tvUserInfo;
private Button btnLogout;
private UserManager userManager;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_person, container, false);
View view = inflater.inflate(R.layout.fragment_person, container, false);
userManager = UserManager.getInstance(requireContext());
initViews(view);
setupUserInfo();
setupClickListeners();
return view;
}
private void initViews(View view) {
tvUserInfo = view.findViewById(R.id.tv_user_info);
btnLogout = view.findViewById(R.id.btn_logout);
}
private void setupUserInfo() {
if (userManager.isLoggedIn()) {
User user = userManager.getCurrentUser();
tvUserInfo.setText("欢迎," + user.getNickname() + "\n手机号: " + user.getPhone());
btnLogout.setVisibility(View.VISIBLE);
} else {
tvUserInfo.setText("游客模式");
btnLogout.setVisibility(View.GONE);
}
}
private void setupClickListeners() {
btnLogout.setOnClickListener(v -> logout());
}
private void logout() {
userManager.logout();
Toast.makeText(getContext(), "已登出", Toast.LENGTH_SHORT).show();
// 跳转回登录页面
Intent intent = new Intent(getActivity(), LoginActivity.class);
startActivity(intent);
getActivity().finish();
}
}

@ -22,7 +22,7 @@ import com.startsmake.llrisetabbardemo.R;
import com.startsmake.llrisetabbardemo.activity.MainActivity;
import com.startsmake.llrisetabbardemo.adapter.ImageAdapter;
import com.startsmake.llrisetabbardemo.model.Item;
import model.Item;
import java.util.ArrayList;
import java.util.List;

@ -1,4 +1,4 @@
package com.startsmake.llrisetabbardemo.model;
package model;
import java.io.Serializable;
import java.util.ArrayList;

@ -49,7 +49,7 @@
android:id="@+id/et_phone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="手机号"
android:hint="注册手机号"
android:inputType="phone"
android:maxLines="1"
android:padding="16dp"

@ -1,14 +1,627 @@
<?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: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>
Loading…
Cancel
Save