二次修改

This commit is contained in:
fengjignqi
2026-11-07 08:08:39 +08:00
parent 38d75cf271
commit 0dc9b21e62
85 changed files with 2176 additions and 6511 deletions

View File

@@ -121,6 +121,10 @@
android:name="com.ckkj.griddle.custom.view.PhotoViewActivity"
android:screenOrientation="portrait" />
<activity android:name="com.yalantis.ucrop.UCropActivity"/>
<activity
android:name=".device.BltDeviceListActivity"
android:exported="false"
android:screenOrientation="portrait" />
<activity
android:name="com.ckkj.griddle.main.activity.MainActivity"
android:launchMode="singleTask"
@@ -152,53 +156,17 @@
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize"/>
<activity
android:name=".mine.WebviewUserAgreement"
android:name=".base.WebviewUserAgreement"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize"/>
<activity
android:name=".plate.PaipanDetailActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize"/>
<activity
android:name=".mine.SettingsActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize"/>
<activity
android:name=".mine.ChangePhoneActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize"/>
<activity
android:name=".mine.UserLogOffAccountActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize"/>
<activity
android:name=".guide.GuideActivity"
android:theme="@style/AppTheme.FullScreen"
android:screenOrientation="portrait" />
<activity
android:name=".mine.CommitServiceActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize"/>
<activity
android:name=".mine.SelectComboActivity"
android:theme="@style/AppTheme.FullScreen"
android:screenOrientation="portrait" />
<activity
android:name=".mine.VipProtocolActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize"/>
<activity
android:name=".mine.RecommendActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize"/>
<activity
android:name=".mine.MyInviteeListActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize"/>
<activity
android:name=".mine.RewardRecordsActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize"/>
</application>
</manifest>

View File

@@ -71,9 +71,11 @@ public class MyApplication extends Application {
if(isUserAgreed){
initializeUmengSDK();
}
NetWorkManager.getInstance().init(this);
AppConfig.USER_LOGIN = SharePreUtil.getBoolean(ConstantUtil.SHARE_PRE_NAME,context,ConstantUtil.USER_LOGIN);
// 先恢复登录会话,再初始化网络模块。
AppConfig.USER_TOKEN = SharePreUtil.getString(ConstantUtil.SHARE_PRE_NAME,context,ConstantUtil.USER_TOKEN);
AppConfig.USER_LOGIN = SharePreUtil.getBoolean(ConstantUtil.SHARE_PRE_NAME,context,ConstantUtil.USER_LOGIN)
&& !TextUtils.isEmpty(AppConfig.USER_TOKEN);
NetWorkManager.getInstance().init(this);
AppConfig.USER_SET_BIRTH_INFO = SharePreUtil.getBoolean(ConstantUtil.SHARE_PRE_NAME,context,ConstantUtil.USER_HAS_SET_BIRTH);
//单位JSON
AppConfig.PRODUCT_UNIT_JSON = SharePreUtil.getString(ConstantUtil.SHARE_PRE_NAME,context,ConstantUtil.GOODS_UNIT_JSON);

View File

@@ -1,4 +1,4 @@
package com.ckkj.griddle.mine;
package com.ckkj.griddle.base;
import android.net.http.SslError;
import android.os.Build;

View File

@@ -0,0 +1,54 @@
package com.ckkj.griddle.base.repository;
import com.ckkj.griddle.base.entity.MineUserInfoBean;
import com.ckkj.griddle.login.mvp.LoginContract;
import com.ckkj.griddle.network.BaseBean;
import com.ckkj.griddle.network.NetWorkManager;
import java.util.Map;
import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.annotations.NonNull;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
/** 供登录、主页等模块共用的用户资料查询。 */
public class UserInfoRepository {
public void getUserInfo(Map<String, Object> map, LoginContract.CallBack<MineUserInfoBean> callBack) {
NetWorkManager.getRequest().getMineUserInfo(NetWorkManager.getToken(), map)
.subscribeOn(Schedulers.io())
.unsubscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<BaseBean<MineUserInfoBean>>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
}
@Override
public void onNext(@NonNull BaseBean<MineUserInfoBean> bean) {
if (bean != null && bean.getCode() == 200 && bean.getData() != null) {
callBack.success(bean.getData());
} else {
callBack.fail(getErrorMessage(bean));
}
}
@Override
public void onError(@NonNull Throwable e) {
callBack.fail(e.getMessage());
}
@Override
public void onComplete() {
}
});
}
private String getErrorMessage(BaseBean bean) {
if (bean != null && bean.getMessage() != null && !bean.getMessage().isEmpty()) {
return bean.getMessage();
}
return "用户资料加载失败";
}
}

View File

@@ -0,0 +1,59 @@
package com.ckkj.griddle.device;
import android.os.Bundle;
import android.text.TextUtils;
import com.gyf.immersionbar.ImmersionBar;
import com.ckkj.griddle.R;
import com.ckkj.griddle.base.BaseActivity;
import com.ckkj.griddle.databinding.BlDeviceListBinding;
import com.ckkj.griddle.device.mvp.BltDeviceListContract;
import com.ckkj.griddle.device.mvp.BltDeviceListImpl;
import com.ckkj.griddle.device.mvp.BltDeviceListPresenter;
import com.ckkj.griddle.network.BaseBean;
import com.ckkj.griddle.utils.show.ToastUtil;
/**
* 蓝牙设备列表
*/
public class BltDeviceListActivity
extends BaseActivity<BlDeviceListBinding, BltDeviceListPresenter>
implements BltDeviceListContract.BltDeviceListView {
@Override
public BltDeviceListPresenter createPresenter() {
return new BltDeviceListPresenter(new BltDeviceListImpl());
}
@Override
public void initData(Bundle savedInstanceState) {
super.initData(savedInstanceState);
ImmersionBar.with(this)
.statusBarColor(R.color.device_home_background)
.statusBarDarkFont(true)
.init();
// 列表布局已配置 LinearLayoutManager,后续接入扫描适配器与重新搜索事件。
}
@Override
public int getLayoutResId(Bundle savedInstanceState) {
// 布局由 BaseActivity 通过 BlDeviceListBinding 自动加载。
return 0;
}
@Override
public void onNetChange(int netModel) {
}
@Override
public void showError(String message) {
hideDialogLoading();
if (!TextUtils.isEmpty(message)) {
ToastUtil.showShort(this, message);
}
}
@Override
public void logOut(BaseBean bean) {
}
}

View File

@@ -0,0 +1,134 @@
package com.ckkj.griddle.device;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;
import com.ckkj.griddle.base.BaseFragment;
import com.ckkj.griddle.databinding.DeviceIndexFragmentBinding;
import com.ckkj.griddle.device.mvp.DeviceContract;
import com.ckkj.griddle.device.mvp.DeviceImpl;
import com.ckkj.griddle.device.mvp.DevicePresenter;
import com.ckkj.griddle.network.BaseBean;
import com.ckkj.griddle.utils.show.ToastUtil;
import java.util.List;
/**
* 设备首页。
*/
public class DeviceFragment extends BaseFragment<DeviceIndexFragmentBinding, DevicePresenter>
implements DeviceContract.DeviceView {
private RecyclerView.Adapter<?> mDeviceAdapter;
private RecyclerView.Adapter<?> mObservedAdapter;
private final RecyclerView.AdapterDataObserver mDeviceDataObserver =
new RecyclerView.AdapterDataObserver() {
@Override
public void onChanged() {
updateDeviceEmptyState();
}
@Override
public void onItemRangeInserted(int positionStart, int itemCount) {
updateDeviceEmptyState();
}
@Override
public void onItemRangeRemoved(int positionStart, int itemCount) {
updateDeviceEmptyState();
}
};
@Override
public DevicePresenter createPresenter() {
return new DevicePresenter(new DeviceImpl());
}
@Override
public void initData(Bundle state) {
bindDeviceAdapter();
View.OnClickListener openDeviceList = v -> openBluetoothDeviceList();
viewBinding.tvHomeTitle.setOnClickListener(openDeviceList);
viewBinding.cvAddDevice.setOnClickListener(openDeviceList);
viewBinding.ivAddDevice.setOnClickListener(openDeviceList);
viewBinding.btnEmptyAddDevice.setOnClickListener(openDeviceList);
}
private void openBluetoothDeviceList() {
startActivity(new Intent(requireContext(), BltDeviceListActivity.class));
}
/**
* 后续接入设备数据时,通过此方法设置适配器;notify 数据变化后自动更新空状态。
*/
public void setDeviceAdapter(@Nullable RecyclerView.Adapter<?> adapter) {
mDeviceAdapter = adapter;
if (getView() != null && viewBinding != null) {
bindDeviceAdapter();
}
}
private void bindDeviceAdapter() {
unregisterDeviceObserver();
viewBinding.rvDevices.setAdapter(mDeviceAdapter);
if (mDeviceAdapter != null) {
mObservedAdapter = mDeviceAdapter;
mObservedAdapter.registerAdapterDataObserver(mDeviceDataObserver);
}
updateDeviceEmptyState();
}
private void updateDeviceEmptyState() {
if (getView() == null || viewBinding == null) {
return;
}
boolean empty = mDeviceAdapter == null || mDeviceAdapter.getItemCount() == 0;
viewBinding.svEmptyDevices.setVisibility(empty ? View.VISIBLE : View.GONE);
viewBinding.rvDevices.setVisibility(empty ? View.GONE : View.VISIBLE);
}
private void unregisterDeviceObserver() {
if (mObservedAdapter != null) {
mObservedAdapter.unregisterAdapterDataObserver(mDeviceDataObserver);
mObservedAdapter = null;
}
}
@Override
public void onDestroyView() {
unregisterDeviceObserver();
if (viewBinding != null) {
viewBinding.rvDevices.setAdapter(null);
}
super.onDestroyView();
}
@Override
public void onNetChange(int netModel) {
}
@Override
public void showError(String message) {
hideDialogLoading();
if (mContext != null && message != null && !message.isEmpty()) {
ToastUtil.showShort(mContext, message);
}
}
@Override
public void logOut(BaseBean bean) {
}
@Override
public void onPermissionsGranted(int requestCode, @NonNull List<String> perms) {
}
@Override
public void onPermissionsDenied(int requestCode, @NonNull List<String> perms) {
}
}

View File

@@ -0,0 +1,21 @@
package com.ckkj.griddle.device.mvp;
import com.ckkj.griddle.base.IView;
/** 蓝牙设备列表页面与数据层协议。 */
public class BltDeviceListContract {
public interface CallBack<T> {
void success(T data);
void fail(String message);
}
public interface DataModel {
// 后续定义蓝牙扫描、停止扫描等数据操作。
}
public interface BltDeviceListView extends IView {
// 后续定义扫描状态及设备列表回调。
}
}

View File

@@ -0,0 +1,5 @@
package com.ckkj.griddle.device.mvp;
/** 蓝牙设备列表数据层,后续接入实际扫描逻辑。 */
public class BltDeviceListImpl implements BltDeviceListContract.DataModel {
}

View File

@@ -0,0 +1,14 @@
package com.ckkj.griddle.device.mvp;
import com.ckkj.griddle.base.BasePresenter;
/** 蓝牙设备列表业务协调层。 */
public class BltDeviceListPresenter
extends BasePresenter<BltDeviceListContract.BltDeviceListView> {
private final BltDeviceListContract.DataModel impl;
public BltDeviceListPresenter(BltDeviceListContract.DataModel impl) {
this.impl = impl;
}
}

View File

@@ -0,0 +1,23 @@
package com.ckkj.griddle.device.mvp;
import com.ckkj.griddle.base.IView;
/**
* 设备模块的数据与页面协议。
*/
public class DeviceContract {
public interface CallBack<T> {
void success(T data);
void fail(String message);
}
public interface DataModel {
// 在此定义设备模块的数据请求。
}
public interface DeviceView extends IView {
// 在此定义设备页面的数据回调。
}
}

View File

@@ -0,0 +1,7 @@
package com.ckkj.griddle.device.mvp;
/**
* 设备模块的数据请求实现。
*/
public class DeviceImpl implements DeviceContract.DataModel {
}

View File

@@ -0,0 +1,15 @@
package com.ckkj.griddle.device.mvp;
import com.ckkj.griddle.base.BasePresenter;
/**
* 设备模块的业务协调层。
*/
public class DevicePresenter extends BasePresenter<DeviceContract.DeviceView> {
private final DeviceContract.DataModel impl;
public DevicePresenter(DeviceContract.DataModel impl) {
this.impl = impl;
}
}

View File

@@ -20,7 +20,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ckkj.griddle.R;
import com.ckkj.griddle.mine.entity.ReportEntity;
import com.ckkj.griddle.dialog.entity.ReportEntity;
import com.ckkj.griddle.utils.show.ToastUtil;
import java.util.ArrayList;

View File

@@ -1,4 +1,4 @@
package com.ckkj.griddle.mine.entity;
package com.ckkj.griddle.dialog.entity;
import java.io.Serializable;

View File

@@ -9,9 +9,8 @@ import com.ckkj.griddle.fate.entity.FateHistoryEntity;
import com.ckkj.griddle.fate.entity.TodayFateEntity;
import com.ckkj.griddle.login.mvp.LoginContract;
import com.ckkj.griddle.main.MainPresenter;
import com.ckkj.griddle.mine.mvp.MineImpl;
import com.ckkj.griddle.base.repository.UserInfoRepository;
import com.ckkj.griddle.network.BaseBean;
import com.ckkj.griddle.plate.mvp.PlatePresenter;
import org.json.JSONObject;
@@ -150,7 +149,7 @@ public class FatePresenter extends BasePresenter<FateContract.FateView> {
*/
public void getUserInfo() {
Map<String,Object> map = new HashMap<>();
new MineImpl().getUserInfo(map, new LoginContract.CallBack<MineUserInfoBean>() {
new UserInfoRepository().getUserInfo(map, new LoginContract.CallBack<MineUserInfoBean>() {
@Override
public void success(MineUserInfoBean bean) {
if( FatePresenter.this.getView() != null){

View File

@@ -3,6 +3,8 @@ package com.ckkj.griddle.guide;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import android.view.View;
import com.gyf.immersionbar.ImmersionBar;
@@ -20,7 +22,7 @@ import com.ckkj.griddle.main.MainImpl;
import com.ckkj.griddle.main.MainPresenter;
import com.ckkj.griddle.main.activity.MainActivity;
import com.ckkj.griddle.main.entity.CheckVersionEntity;
import com.ckkj.griddle.mine.WebviewUserAgreement;
import com.ckkj.griddle.base.WebviewUserAgreement;
import com.ckkj.griddle.network.BaseBean;
import com.ckkj.griddle.utils.dataUtil.SharePreUtil;
import com.ckkj.griddle.utils.manager.ActivityManager;
@@ -33,6 +35,7 @@ import com.ckkj.griddle.utils.manager.ActivityManager;
public class LaunchActivity extends BaseActivity<GuideLayoutBinding, MainPresenter> implements MainContract.MainView {
private boolean mIsFirstEnterApp = false;
private final Handler mLaunchHandler = new Handler(Looper.getMainLooper());
@Override
public void initData(Bundle savedInstanceState) {
@@ -82,12 +85,20 @@ public class LaunchActivity extends BaseActivity<GuideLayoutBinding, MainPresent
}
}, false, true);
} else {
new Handler().postDelayed(new Runnable() {
mLaunchHandler.postDelayed(new Runnable() {
@Override
public void run() {
if (isFinishing() || isDestroyed()) {
return;
}
if(AppConfig.USER_LOGIN && !TextUtils.isEmpty(AppConfig.USER_TOKEN)){
goTo(mContext, MainActivity.class, null);
}else{
Intent intent = new Intent(mContext, LoginActivity.class);
startActivity(intent);
}
finish();
}
}, 2000);
@@ -95,6 +106,12 @@ public class LaunchActivity extends BaseActivity<GuideLayoutBinding, MainPresent
}
@Override
protected void onDestroy() {
mLaunchHandler.removeCallbacksAndMessages(null);
super.onDestroy();
}
@Override
public void onBackPressed() {
if (dialog != null && dialog.isShowing()) {

View File

@@ -28,7 +28,7 @@ import com.ckkj.griddle.login.mvp.LoginContract;
import com.ckkj.griddle.login.mvp.LoginImpl;
import com.ckkj.griddle.login.mvp.LoginPresenter;
import com.ckkj.griddle.main.activity.MainActivity;
import com.ckkj.griddle.mine.WebviewUserAgreement;
import com.ckkj.griddle.base.WebviewUserAgreement;
import com.ckkj.griddle.network.BaseBean;
import com.ckkj.griddle.utils.click.ClickUtil;
import com.ckkj.griddle.utils.number.PhoneNumberUtils;

View File

@@ -26,7 +26,7 @@ import com.ckkj.griddle.login.entity.LoginEntity;
import com.ckkj.griddle.login.mvp.LoginContract;
import com.ckkj.griddle.login.mvp.LoginImpl;
import com.ckkj.griddle.login.mvp.LoginPresenter;
import com.ckkj.griddle.mine.WebviewUserAgreement;
import com.ckkj.griddle.base.WebviewUserAgreement;
import com.ckkj.griddle.network.BaseBean;
import com.ckkj.griddle.utils.click.ClickUtil;
import com.ckkj.griddle.utils.number.PhoneNumberUtils;

View File

@@ -137,7 +137,8 @@ public class LoginImpl implements LoginContract.DataModel {
@Override
public void onNext(@NonNull BaseBean<LoginEntity> bean) {
if (bean != null && bean.getCode() == 0 && bean.getData() != null
if (bean != null && (bean.getCode() == 200 || bean.getCode() == 0)
&& bean.getData() != null
&& bean.getData().getAccess_token() != null
&& !bean.getData().getAccess_token().isEmpty()) {
LoginStateManager.reset();
@@ -163,7 +164,7 @@ public class LoginImpl implements LoginContract.DataModel {
*/
private Observer<BaseBean> createAuthObserver(
LoginContract.CallBack<BaseBean> callBack) {
return createAuthObserver(callBack, 0);
return createAuthObserver(callBack, 200);
}
private Observer<BaseBean> createAuthObserver(

View File

@@ -11,7 +11,7 @@ import com.ckkj.griddle.base.BasePresenter;
import com.ckkj.griddle.base.entity.MineUserInfoBean;
import com.ckkj.griddle.base.entity.UserInfoEntity;
import com.ckkj.griddle.login.entity.LoginEntity;
import com.ckkj.griddle.mine.mvp.MineImpl;
import com.ckkj.griddle.base.repository.UserInfoRepository;
import com.ckkj.griddle.network.BaseBean;
import com.ckkj.griddle.utils.dataUtil.SharePreUtil;
import com.ckkj.griddle.utils.manager.MingDengUserInfoManager;
@@ -183,16 +183,19 @@ public class LoginPresenter extends BasePresenter<LoginContract.LoginView> {
}
String token = entity.getAccess_token();
if (!SharePreUtil.saveLoginSession(MyApplication.getContext(), token)) {
if (getView() != null) {
getView().showError("登录状态保存失败,请重试");
}
return;
}
UserInfoEntity userInfo = entity.getUser_info();
AppConfig.USER_LOGIN = true;
AppConfig.USER_TOKEN = token;
AppConfig.USER_ID = userInfo == null ? "" : String.valueOf(userInfo.getUserId());
AppConfig.USER_INFO_AVATAR = userInfo == null ? "" : safeText(userInfo.getAvatar());
SharePreUtil.putBoolean(ConstantUtil.SHARE_PRE_NAME, MyApplication.getContext(),
ConstantUtil.USER_LOGIN, true);
SharePreUtil.putString(ConstantUtil.SHARE_PRE_NAME, MyApplication.getContext(),
ConstantUtil.USER_TOKEN, token);
SharePreUtil.putString(ConstantUtil.SHARE_PRE_NAME, MyApplication.getContext(),
ConstantUtil.USER_ID, AppConfig.USER_ID);
SharePreUtil.putString(ConstantUtil.SHARE_PRE_NAME, MyApplication.getContext(),
@@ -216,7 +219,7 @@ public class LoginPresenter extends BasePresenter<LoginContract.LoginView> {
*/
public void getUserInfo() {
Map<String, Object> map = new HashMap<>();
new MineImpl().getUserInfo(map, new LoginContract.CallBack<MineUserInfoBean>() {
new UserInfoRepository().getUserInfo(map, new LoginContract.CallBack<MineUserInfoBean>() {
@Override
public void success(MineUserInfoBean bean) {
if (bean == null || bean.getUserInfo() == null) {

View File

@@ -4,7 +4,7 @@ import com.ckkj.griddle.base.BasePresenter;
import com.ckkj.griddle.base.entity.MineUserInfoBean;
import com.ckkj.griddle.login.mvp.LoginContract;
import com.ckkj.griddle.main.entity.CheckVersionEntity;
import com.ckkj.griddle.mine.mvp.MineImpl;
import com.ckkj.griddle.base.repository.UserInfoRepository;
import com.ckkj.griddle.network.BaseBean;
import org.json.JSONException;
@@ -71,7 +71,7 @@ public class MainPresenter extends BasePresenter<MainContract.MainView> {
*/
public void getUserInfo() {
Map<String,Object> map = new HashMap<>();
new MineImpl().getUserInfo(map, new LoginContract.CallBack<MineUserInfoBean>() {
new UserInfoRepository().getUserInfo(map, new LoginContract.CallBack<MineUserInfoBean>() {
@Override
public void success(MineUserInfoBean bean) {
if( MainPresenter.this.getView() != null){

View File

@@ -31,7 +31,7 @@ import com.ckkj.griddle.main.MainPresenter;
import com.ckkj.griddle.main.entity.CheckVersionEntity;
import com.ckkj.griddle.mine.MineFragment;
import com.ckkj.griddle.network.BaseBean;
import com.ckkj.griddle.plate.PlateFragment;
import com.ckkj.griddle.device.DeviceFragment;
import com.ckkj.griddle.utils.AppInfoUtil;
import com.ckkj.griddle.utils.dataUtil.SharePreUtil;
import com.ckkj.griddle.utils.manager.ActivityManager;
@@ -107,9 +107,10 @@ public class MainActivity extends BaseActivity<MainActivityLayoutBinding, MainPr
mPresenter.checkNewVersion();
// 清空Fragment列表,避免状态恢复问题
mFragmentList.clear();
mFragmentList.add(new PlateFragment());
mFragmentList.add(new DeviceFragment());
mFragmentList.add(new ChatFragment());
mFragmentList.add(new FateFragment());
mFragmentList.add(new Fragment(R.layout.fragment_placeholder)); // 文化页占位
mFragmentList.add(new MineFragment());
// 重新设置适配器
@@ -138,7 +139,7 @@ public class MainActivity extends BaseActivity<MainActivityLayoutBinding, MainPr
switch (position) {
case 0:
viewBinding.navView.getMenu().getItem(position).setChecked(true);
viewBinding.navView.setSelectedItemId(R.id.navigation_plate);
viewBinding.navView.setSelectedItemId(R.id.navigation_device);
break;
case 1:
viewBinding.navView.getMenu().getItem(position).setChecked(true);
@@ -163,7 +164,7 @@ public class MainActivity extends BaseActivity<MainActivityLayoutBinding, MainPr
// BottomNavigationView 点击监听,切换 ViewPager2 页面
viewBinding.navView.setOnNavigationItemSelectedListener(item -> {
switch (item.getItemId()) {
case R.id.navigation_plate:
case R.id.navigation_device:
viewBinding.navViewpage2.setCurrentItem(0);
return true;
case R.id.navigation_index:

View File

@@ -1,197 +0,0 @@
package com.ckkj.griddle.mine;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.Handler;
import android.text.TextUtils;
import android.view.View;
import com.gyf.immersionbar.ImmersionBar;
import com.ckkj.griddle.AppConfig;
import com.ckkj.griddle.R;
import com.ckkj.griddle.base.BaseActivity;
import com.ckkj.griddle.base.entity.MineUserInfoBean;
import com.ckkj.griddle.base.entity.UserInfoEntity;
import com.ckkj.griddle.databinding.ChangePhoneActivityBinding;
import com.ckkj.griddle.login.LoginActivity;
import com.ckkj.griddle.main.entity.CheckVersionEntity;
import com.ckkj.griddle.mine.entity.MemberComboEntity;
import com.ckkj.griddle.mine.mvp.MineContract;
import com.ckkj.griddle.mine.mvp.MineImpl;
import com.ckkj.griddle.mine.mvp.MinePresenter;
import com.ckkj.griddle.network.BaseBean;
import com.ckkj.griddle.utils.manager.ActivityManager;
import com.ckkj.griddle.utils.manager.MingDengUserInfoManager;
import com.ckkj.griddle.utils.number.PhoneNumberUtils;
import com.ckkj.griddle.utils.show.ToastUtil;
import java.util.List;
import butterknife.OnClick;
/**
* @Description TODO
* @systemUser 86133
* @Author FengJingQi
* @Date 04-08-2025 周二 14:03
*/
public class ChangePhoneActivity extends BaseActivity<ChangePhoneActivityBinding, MinePresenter> implements MineContract.MineView {
@Override
public MinePresenter createPresenter() {
return new MinePresenter(new MineImpl());
}
@Override
public int getLayoutResId(Bundle savedInstanceState) {
return 0;
}
@Override
public void initData(Bundle savedInstanceState) {
super.initData(savedInstanceState);
ImmersionBar.with(this)
.statusBarColor(R.color.white) // 设置状态栏颜色
.statusBarDarkFont(true) // 设置状态栏字体为黑色
.titleBar(viewBinding.rlTitle)
.init();
viewBinding.includeTitle.tvTitle.setText("更换手机号");
UserInfoEntity userInfo = MingDengUserInfoManager.getInstance().getUserInfo();
if (userInfo != null) {
viewBinding.tvUserPhone.setText(userInfo.getMobile());
}
}
@OnClick({ R.id.img_back,R.id.tv_get_code,R.id.tv_commit})
public void onClick(View v) {
switch (v.getId()){
case R.id.img_back:
finish();
break;
case R.id.tv_get_code:
if(TextUtils.isEmpty(viewBinding.edPhoneNum.getText().toString().trim())){
ToastUtil.showShort(mContext,"请填写手机号码");
return;
}
if(!PhoneNumberUtils.checkPhoneNum(viewBinding.edPhoneNum.getText().toString().trim())){
ToastUtil.showShort(mContext,"请填写正确的手机号码");
return;
}
showLoadingDialog();
mPresenter.getPhoneCode(viewBinding.edPhoneNum.getText().toString().trim(), AppConfig.SMS_CODE_TYPE_CHANGE_PHONE);
break;
case R.id.tv_commit:
if(TextUtils.isEmpty(viewBinding.edPhoneNum.getText().toString().trim())){
ToastUtil.showShort(mContext,"请填写手机号码");
return;
}
if(!PhoneNumberUtils.checkPhoneNum(viewBinding.edPhoneNum.getText().toString().trim())){
ToastUtil.showShort(mContext,"请填写正确的手机号码");
return;
}
if(TextUtils.isEmpty(viewBinding.edVerCode.getText().toString().trim())){
ToastUtil.showShort(mContext,"请填写验证码");
return;
}
if(viewBinding.edVerCode.getText().toString().trim().length() < 6){
ToastUtil.showShort(mContext,"请填写6位验证码");
return;
}
// showLoadingDialog();
mPresenter.updateUserPhone(viewBinding.edPhoneNum.getText().toString().trim(),
viewBinding.edVerCode.getText().toString().trim());
break;
}
}
private CountDownTimer cdTimer = new CountDownTimer(60000, 1000) {
@Override
public void onTick(long millisUntilFinished) {
viewBinding.tvGetCode.setText("(" + millisUntilFinished / 1000 + ")秒后重发");
viewBinding.tvGetCode.setSelected(true);
viewBinding.tvGetCode.setClickable(false);
viewBinding.tvGetCode.setTextColor(mContext.getColor(R.color.color_c8c8c8));
}
@Override
public void onFinish() {
viewBinding.tvGetCode.setText("重新发送");
viewBinding.tvGetCode.setSelected(false);
viewBinding.tvGetCode.setClickable(true);
viewBinding.tvGetCode.setTextColor(mContext.getColor(R.color.color_zhu));
}
};
@Override
public void getUserInfoSuccess(MineUserInfoBean bean) {
}
@Override
public void updateUserAvatarSuccess(BaseBean bean, String url) {
}
@Override
public void getSmsCodeSuccess(BaseBean bean) {
cdTimer.start();
hideDialogLoading();
ToastUtil.showShort(mContext,"验证码已发送");
}
@Override
public void updateMobileSuccess(BaseBean bean) {
hideDialogLoading();
ToastUtil.showShort(mContext,"手机号修改成功,即将跳转到登录页面");
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
ActivityManager.removeAllActivity();
goTo(mContext, LoginActivity.class,null);
}
},800);
}
@Override
public void getAppVersionSuccess(CheckVersionEntity bean) {
}
@Override
public void userLogoffSuccess(BaseBean bean) {
}
@Override
public void commitFeedbackSuccess(BaseBean bean) {
}
@Override
public void getMemberComboListSuccess(List<MemberComboEntity> list) {
}
@Override
public void getPaySignSuccess(BaseBean bean) {
}
@Override
public void showError(String message) {
hideDialogLoading();
ToastUtil.showShort(mContext,message);
}
@Override
public void logOut(BaseBean bean) {
}
}

View File

@@ -1,364 +1,90 @@
package com.ckkj.griddle.mine;
import static android.app.Activity.RESULT_OK;
import android.Manifest;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.alibaba.sdk.android.oss.ClientException;
import com.alibaba.sdk.android.oss.ServiceException;
//import com.alipay.sdk.app.PayTask;
import com.bumptech.glide.Glide;
import com.esafirm.imagepicker.features.ImagePicker;
import com.esafirm.imagepicker.model.Image;
import com.ckkj.griddle.AppConfig;
import com.ckkj.griddle.EventMessage;
import com.ckkj.griddle.R;
import com.ckkj.griddle.base.BaseFragment;
import com.ckkj.griddle.base.entity.MineUserInfoBean;
import com.ckkj.griddle.base.entity.UserInfoEntity;
import com.ckkj.griddle.base.inter.UploadCallback;
import com.ckkj.griddle.databinding.MineFragmentBinding;
import com.ckkj.griddle.login.LoginActivity;
import com.ckkj.griddle.main.entity.CheckVersionEntity;
import com.ckkj.griddle.mine.entity.MemberComboEntity;
import com.ckkj.griddle.mine.entity.PayResult;
import com.ckkj.griddle.databinding.MineFragmentLayoutBinding;
import com.ckkj.griddle.mine.mvp.MineContract;
import com.ckkj.griddle.mine.mvp.MineImpl;
import com.ckkj.griddle.mine.mvp.MinePresenter;
import com.ckkj.griddle.network.BaseBean;
import com.ckkj.griddle.utils.LubanCompressUtil;
import com.ckkj.griddle.utils.PreviewFileUtil;
import com.ckkj.griddle.utils.click.ClickUtil;
import com.ckkj.griddle.utils.dataUtil.FileUtil;
import com.ckkj.griddle.utils.manager.MingDengUserInfoManager;
import com.ckkj.griddle.utils.oss.OssUploadHelper;
import com.ckkj.griddle.utils.show.ToastUtil;
import com.ckkj.griddle.utils.time.ZYTimeUtils;
import com.lxj.xpopup.XPopup;
import com.lxj.xpopup.interfaces.OnSelectListener;
import com.yalantis.ucrop.UCrop;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import butterknife.OnClick;
import de.greenrobot.event.EventBus;
import pub.devrel.easypermissions.EasyPermissions;
/**
* @author fengxiaoyang 新分支
* @date 2025/7/7
* @description TODO: 描述该类的作用
*/
public class MineFragment extends BaseFragment<MineFragmentBinding, MinePresenter>
/** 新项目个人中心,业务入口保留独立 ID,后续接入对应页面。 */
public class MineFragment extends BaseFragment<MineFragmentLayoutBinding, MinePresenter>
implements MineContract.MineView {
@Override
public void initData(Bundle state) {
viewBinding.includedTitle.imgBack.setVisibility(View.GONE);
viewBinding.includedTitle.imgSetting.setVisibility(View.VISIBLE);
ClickUtil.addClickPart(viewBinding.includedTitle.imgSetting, 50);
ClickUtil.addClickPart(viewBinding.imgEdit, 50);
viewBinding.includedTitle.tvTitle.setText("个人中心");
}
@Override
protected void onResumeInitData() {
super.onResumeInitData();
if (AppConfig.USER_LOGIN) {
mPresenter.getUserinfo();
} else {
viewBinding.tvDefaulBirthtime.setVisibility(View.VISIBLE);
viewBinding.tvDefaulStar.setVisibility(View.VISIBLE);
viewBinding.tvUserBirthTime.setVisibility(View.GONE);
viewBinding.tvUserStar.setVisibility(View.GONE);
}
}
@Override
public MinePresenter createPresenter() {
return new MinePresenter(new MineImpl());
}
@OnClick({R.id.img_user_head, R.id.img_setting, R.id.img_edit, R.id.linear_tobe_vip
, R.id.tv_detail_vip, R.id.lienar_share_be_vip, R.id.tv_share_be_vip,R.id.ll_invite_record})
public void onClick(View v) {
switch (v.getId()) {
case R.id.img_user_head:
if (!AppConfig.USER_LOGIN) {
goTo(mContext, LoginActivity.class, null);
@Override
public void initData(Bundle state) {
viewBinding.tvMinePoints.setText(getString(R.string.mine_points, "0"));
viewBinding.tvDevicesStatus.setText(getString(R.string.mine_device_count, 0));
viewBinding.tvRepairsStatus.setText(getString(R.string.mine_repair_count, 0));
mPresenter.loadProfile();
}
@Override
protected void onResumeInitData() {
super.onResumeInitData();
mPresenter.loadProfile();
}
@Override
public void showProfile(@Nullable UserInfoEntity userInfo) {
viewBinding.tvMineName.setText(R.string.mine_default_name);
viewBinding.tvMineContact.setText(R.string.mine_contact_empty);
if (userInfo == null) {
return;
}
new XPopup.Builder(mContext).asBottomList("头像", new String[]{"上传头像", "查看大图"}, new OnSelectListener() {
@Override
public void onSelect(int position, String text) {
switch (position) {
case 0:
String readPermission = Manifest.permission.READ_EXTERNAL_STORAGE;
if (!hasRecordPermission(readPermission)) {
// 没有权限,只在ACTION_DOWN时去申请
getPermissionRequst(readPermission, "相机、文件访问权限申请",
"星语明灯需要您的授权,获取文件访问权限来修改头像", REQUEST_CODE_100);
return;
} else {
imagePicker(1, REQUEST_CODE_100, MineFragment.this);
if (!TextUtils.isEmpty(userInfo.getNickname())) {
viewBinding.tvMineName.setText(userInfo.getNickname());
} else if (!TextUtils.isEmpty(userInfo.getUsername())) {
viewBinding.tvMineName.setText(userInfo.getUsername());
}
break;
case 1:
UserInfoEntity userInfo =
MingDengUserInfoManager.getInstance().getUserInfo();
if (userInfo == null || TextUtils.isEmpty(userInfo.getAvatar())) {
ToastUtil.showShort(mContext, "暂无头像");
return;
String phone = userInfo.getMobile();
String email = userInfo.getEmail();
if (!TextUtils.isEmpty(phone) && !TextUtils.isEmpty(email)) {
viewBinding.tvMineContact.setText(getString(R.string.mine_contact, phone, email));
} else if (!TextUtils.isEmpty(phone)) {
viewBinding.tvMineContact.setText(phone);
} else if (!TextUtils.isEmpty(email)) {
viewBinding.tvMineContact.setText(email);
}
String avatar = userInfo.getAvatar();
String suffix = FileUtil.getFileSuffixWithQuestion(avatar);
PreviewFileUtil.previewFiles(mContext, suffix, avatar);
break;
}
}
}).show();
break;
case R.id.img_setting:
goTo(mContext, SettingsActivity.class, null);
break;
case R.id.img_edit://编辑出生日期
if (!AppConfig.USER_LOGIN) {
goTo(mContext, LoginActivity.class, null);
return;
}
// 发送EventBus消息,让MainActivity切换到FateFragment
EventBus.getDefault().post(new EventMessage(EventMessage.SWITCH_TO_FATE_FRAGMENT));
break;
case R.id.linear_tobe_vip:
case R.id.lienar_share_be_vip:
}
}
@Override
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == RESULT_OK) {
switch (requestCode) {
case 100://头像
List<Image> images = ImagePicker.getImages(data);
Uri sourceUri = Uri.fromFile(new File(images.get(0).getPath()));
Uri destinationUri = Uri.fromFile(new File(mContext.getCacheDir(), "cropped_image.jpg"));
UCrop.of(sourceUri, destinationUri)
.withAspectRatio(1, 1) // 设置裁剪框比例,1:1 为正方形
.withMaxResultSize(1000, 1000) // 设置裁剪后的最大图片尺寸
.start(requireContext(), this);
break;
case UCrop.REQUEST_CROP:
showLoadingDialog();
Uri resultUri = UCrop.getOutput(data);
String filePath = resultUri.getPath();
if (!TextUtils.isEmpty(filePath)) {
getCompressFile(new File(filePath));
}
break;
}
}
}
private void getCompressFile(File file) {
LubanCompressUtil.getInstance().getCompressFile(mContext, file, new LubanCompressUtil.CompressCallback() {
@Override
public void success(File file) {
if (file != null) {
if (file.exists()) {
long fileSizeInBytes = file.length(); // 获取文件大小(字节)
long fileSizeInMB = fileSizeInBytes / (1024 * 1024); // 转换为MB
String fileName = file.getName();
if (fileSizeInMB > 5) {
hideDialogLoading();
ToastUtil.showShort(mContext, "文件大小超出5M");
return;
}
if (!fileName.toLowerCase().endsWith(".png") &&
!fileName.toLowerCase().endsWith(".jpg") &&
!fileName.toLowerCase().endsWith(".jpeg")) {
ToastUtil.showShort(mContext, "文件格式不正确");
hideDialogLoading();
return;
}
List<String> filePath = new ArrayList<>();
filePath.add(file.getPath());
OssUploadHelper helper = new OssUploadHelper(mContext);
helper.upload(AppConfig.UPLOAD_TYPE_200, fileName, filePath, new UploadCallback() {
@Override
public void onSuccess(List<String> urls) {
mContext.runOnUiThread(new Runnable() {
@Override
public void run() {
if (!TextUtils.isEmpty(urls.get(0))) {
mPresenter.updateUserAvatar(urls.get(0));
}
}
});
}
@Override
public void onFailure(ClientException clientException, ServiceException serviceException) {
}
});
} else {
ToastUtil.showShort(mContext, "文件不存在");
}
}
}
@Override
public void fail(String failMsg) {
}
});
}
@Override
public void onNetChange(int netModel) {
}
@Override
public void showError(String message) {
hideDialogLoading();
if (mContext != null && !TextUtils.isEmpty(message)) {
ToastUtil.showShort(mContext, message);
}
}
@Override
public void logOut(BaseBean bean) {
}
@Override
public void getUserInfoSuccess(MineUserInfoBean bean) {
if (bean == null || bean.getUserInfo() == null) {
return;
}
//头像
Glide.with(mContext).load(bean.getUserInfo().getAvatar()).error
(mContext.getDrawable(R.mipmap.icon_mine_user_head_defaul)).into(viewBinding.imgUserHead);
//命里档案
//用户设置了生辰八字
if (bean.isHasEightCharacters()) {
viewBinding.tvUserBirthTime.setVisibility(View.VISIBLE);
viewBinding.tvUserStar.setVisibility(View.VISIBLE);
viewBinding.tvDefaulBirthtime.setVisibility(View.GONE);
viewBinding.tvDefaulStar.setVisibility(View.GONE);
if (!TextUtils.isEmpty(bean.getBirthTime())) {
viewBinding.tvUserBirthTime.setText(ZYTimeUtils.formatDateString(bean.getBirthTime()));
}
if (!TextUtils.isEmpty(bean.getConstellation())) {
viewBinding.tvUserStar.setText(bean.getConstellation());
}
} else {//用户没有设置生辰八字
viewBinding.tvDefaulBirthtime.setVisibility(View.VISIBLE);
viewBinding.tvDefaulStar.setVisibility(View.VISIBLE);
}
}
@Override
public void updateUserAvatarSuccess(BaseBean bean, String url) {
hideDialogLoading();
ToastUtil.showShort(mContext, "头像修改成功");
Glide.with(mContext)
.load(url)
.error(mContext.getDrawable(R.mipmap.icon_mine_user_head_defaul))
.into(viewBinding.imgUserHead);
}
/**
* 获取支付信息成功 a
*
* @param bean
*/
@Override
public void getPaySignSuccess(BaseBean bean) {
}
@Override
public void getSmsCodeSuccess(BaseBean bean) {
}
@Override
public void updateMobileSuccess(BaseBean bean) {
}
@Override
public void getAppVersionSuccess(CheckVersionEntity bean) {
}
@Override
public void userLogoffSuccess(BaseBean bean) {
}
@Override
public void commitFeedbackSuccess(BaseBean bean) {
}
@Override
public void getMemberComboListSuccess(List<MemberComboEntity> list) {
}
@Override
public void onPermissionsGranted(int requestCode, @NonNull List<String> perms) {
}
@Override
public void onPermissionsDenied(int requestCode, @NonNull List<String> perms) {
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
EasyPermissions.onRequestPermissionsResult(requestCode, permissions, grantResults, this);
hidePermissionDialog();
if (requestCode == REQUEST_CODE_100) {
imagePicker(1, REQUEST_CODE_100, this);
}
}
}

View File

@@ -1,104 +0,0 @@
package com.ckkj.griddle.mine;
import android.os.Bundle;
import com.gyf.immersionbar.ImmersionBar;
import com.ckkj.griddle.R;
import com.ckkj.griddle.base.BaseActivity;
import com.ckkj.griddle.databinding.ActivityRewardRecordLayoutBinding;
import com.ckkj.griddle.mine.entity.InviteeRecordEntity;
import com.ckkj.griddle.mine.entity.RecommendDataEntity;
import com.ckkj.griddle.mine.entity.RewardRecordEntity;
import com.ckkj.griddle.mine.mvp.MineContract;
import com.ckkj.griddle.mine.mvp.RecommendImpl;
import com.ckkj.griddle.mine.mvp.RecommendPresenter;
import com.ckkj.griddle.network.BaseBean;
/**
* @author fengxiaoyang
* @date 2025/10/17
* @description 奖励记录
*/
public class RewardRecordsActivity extends BaseActivity<ActivityRewardRecordLayoutBinding, RecommendPresenter>
implements MineContract.RecommendView {
private int mCurrentPage = 1;
private static final int PAGE_SIZE = 10;
@Override
public RecommendPresenter createPresenter() {
return new RecommendPresenter(new RecommendImpl());
}
@Override
public int getLayoutResId(Bundle savedInstanceState) {
return 0;
}
@Override
public void initData(Bundle savedInstanceState) {
super.initData(savedInstanceState);
ImmersionBar.with(this)
.statusBarColor(R.color.white)
.statusBarDarkFont(true)
.titleBar(viewBinding.rlTitle) // 替换为你的标题栏View
.keyboardEnable(true)
.navigationBarDarkIcon(true)
.init();
viewBinding.includedTitle.tvTitle.setText("奖励记录");
viewBinding.includedTitle.imgBack.setOnClickListener(c -> finish());
// 查询奖励记录
loadRewardRecords();
}
/**
* 加载奖励记录
*/
private void loadRewardRecords() {
if (mPresenter != null) {
mPresenter.getRewardRecords(mCurrentPage, PAGE_SIZE);
}
}
@Override
public void getRecommendDatasSuccess(RecommendDataEntity bean) {
// 不需要实现
}
@Override
public void bindInvterCodeSuccess(BaseBean bean) {
// 不需要实现
}
@Override
public void getMyInviteesResultSuccess(InviteeRecordEntity bean) {
// 不需要实现
}
/**
* 奖励记录
* @param bean
*/
@Override
public void getRewardRecordsSuccess(RewardRecordEntity bean) {
// TODO: 处理奖励记录数据,更新UI
// 可以在这里设置RecyclerView的数据
if (bean != null) {
// 示例:处理返回的数据
// WalletEntity entity = (WalletEntity) bean.getData();
// viewBinding.tvBalance.setText(String.valueOf(entity.getBalance()));
}
}
@Override
public void showError(String message) {
}
@Override
public void logOut(BaseBean bean) {
}
}

View File

@@ -1,295 +0,0 @@
package com.ckkj.griddle.mine;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import com.gyf.immersionbar.ImmersionBar;
import com.ckkj.griddle.AppConfig;
import com.ckkj.griddle.EventMessage;
import com.ckkj.griddle.R;
import com.ckkj.griddle.base.BaseActivity;
import com.ckkj.griddle.base.BaseFragment;
import com.ckkj.griddle.base.entity.MineUserInfoBean;
import com.ckkj.griddle.base.entity.UserInfoEntity;
import com.ckkj.griddle.databinding.ActivitySettingsLayoutBinding;
import com.ckkj.griddle.dialog.DialogAppUpdate;
import com.ckkj.griddle.login.LoginActivity;
import com.ckkj.griddle.main.entity.CheckVersionEntity;
import com.ckkj.griddle.mine.entity.MemberComboEntity;
import com.ckkj.griddle.mine.mvp.MineContract;
import com.ckkj.griddle.mine.mvp.MineImpl;
import com.ckkj.griddle.mine.mvp.MinePresenter;
import com.ckkj.griddle.network.BaseBean;
import com.ckkj.griddle.utils.AppInfoUtil;
import com.ckkj.griddle.utils.manager.ActivityManager;
import com.ckkj.griddle.utils.manager.MingDengUserInfoManager;
import com.ckkj.griddle.utils.show.ToastUtil;
import java.io.File;
import java.util.List;
import butterknife.OnClick;
import de.greenrobot.event.EventBus;
/**
* @author fengxiaoyang
* @date 2025/8/18
* @description TODO: 设置页面
*/
public class SettingsActivity extends BaseActivity<ActivitySettingsLayoutBinding, MinePresenter>
implements MineContract.MineView {
@Override
public void initData(Bundle savedInstanceState) {
super.initData(savedInstanceState);
ImmersionBar.with(this)
.statusBarColor(R.color.white)
.statusBarDarkFont(true)
.titleBar(viewBinding.rlTitle) // 替换为你的标题栏View
.keyboardEnable(true)
.navigationBarDarkIcon(true)
.init();
viewBinding.includeTitle.tvTitle.setText("设置");
viewBinding.includeTitle.imgBack.setOnClickListener(c -> finish());
if(AppConfig.USER_LOGIN){
UserInfoEntity userInfo = MingDengUserInfoManager.getInstance().getUserInfo();
if (userInfo != null) {
viewBinding.tvUserPhone.setText(userInfo.getMobile());
}
viewBinding.tvLogOut.setVisibility(View.VISIBLE);
}
//获取本应用所占用的缓存
displayCacheSize();
try {
// 获取 PackageManager 实例
PackageManager packageManager = mContext.getPackageManager();
// 获取应用信息
PackageInfo packageInfo = packageManager.getPackageInfo(mContext.getPackageName(), 0);
// 获取版本名称
String versionName = packageInfo.versionName;
viewBinding.tvVersionName.setText("version " + versionName);
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
}
@Override
public MinePresenter createPresenter() {
return new MinePresenter(new MineImpl());
}
@Override
public int getLayoutResId(Bundle savedInstanceState) {
return 0;
}
@OnClick({R.id.rl_change_phone, R.id.rl_set_cache,R.id.tv_log_out,R.id.rl_log_off,
R.id.rl_user_agreement,R.id.rl_user_privacy,R.id.rl_commit_service,
R.id.rl_check_version})
public void onClick(View v) {
switch (v.getId()){
case R.id.rl_change_phone:
goTo(mContext, ChangePhoneActivity.class,null);
break;
case R.id.rl_check_version://版本检测
//版本检测更新
mPresenter.checkNewVersion();
break;
case R.id.rl_commit_service:
break;
case R.id.rl_set_cache:
showLoadingDialog();
clearCache();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
hideDialogLoading();
ToastUtil.showShort(mContext,"缓存清除成功");
displayCacheSize();
}
},800);
break;
case R.id.tv_log_out:
showDialogtext(mContext.getResources().getDrawable(R.mipmap.img_location), false, false,true,
"提示", "确定要退出当前账号?",
"取消", "确定", new BaseFragment.OnDialogClick() {
@Override
public void onCancelClick() {
}
@Override
public void onConfirmClick() {
MingDengUserInfoManager.getInstance().clearUser(mContext);
ActivityManager.removeAllActivity();
goTo(mContext, LoginActivity.class,null);
EventBus.getDefault().post(new EventMessage(EventMessage.USER_LOGIN_LOST));
}
});
break;
case R.id.rl_user_agreement://用户协议
Bundle bundle = new Bundle();
bundle.putInt("from_requse_code",WebviewUserAgreement.AGREEMENT_CODE);
goToWihoutNoPresent(mContext, WebviewUserAgreement.class,bundle);
break;
case R.id.rl_user_privacy://隐私政策
Bundle bundleYS = new Bundle();
bundleYS.putInt("from_requse_code",WebviewUserAgreement.PRIVACY_CODE);
goToWihoutNoPresent(mContext, WebviewUserAgreement.class,bundleYS);
break;
case R.id.rl_log_off://注销账号
goTo(mContext, UserLogOffAccountActivity.class,null);
break;
}
}
@Override
public void getUserInfoSuccess(MineUserInfoBean bean) {
}
@Override
public void updateUserAvatarSuccess(BaseBean bean, String url) {
}
@Override
public void getSmsCodeSuccess(BaseBean bean) {
}
@Override
public void updateMobileSuccess(BaseBean bean) {
}
private boolean isForceUpdate;
private DialogAppUpdate mUpdateDialog;
@Override
public void getAppVersionSuccess(CheckVersionEntity entity) {
int versionCode = (int) AppInfoUtil.getAppVersionCode(mContext);
if(entity == null){
return;
}
if(entity.getVersionCoercion().equals("0")){//不强制
isForceUpdate = false;
}else{
isForceUpdate = true;
}
if(entity.getVersionNumber() > versionCode){
//App更新dialog
mUpdateDialog = new DialogAppUpdate(mContext,R.layout.dialog_app_update,isForceUpdate,entity);
mUpdateDialog.show();
mUpdateDialog.setOnDialogListener(new DialogAppUpdate.DialogListener() {
@Override
public void callBackGetPermisson(String permission) {
if (!hasRecordPermission(permission)) {
// 没有权限,只在ACTION_DOWN时去申请
getPermissionRequst(permission,"文件存储权限申请",
"叮叮车需要您的授权,获取存储权限来更新您的应用",PICK_IMAGE_REQUEST_300);
}
}
@Override
public void downLoadFinish() {
runOnUiThread(new Runnable() {
@Override
public void run() {
ToastUtil.showShort(mContext,"下载完成,正在安装");
}
});
}
});
}else{
ToastUtil.showShort(mContext,"当前已是最新版本");
}
}
@Override
public void userLogoffSuccess(BaseBean bean) {
}
@Override
public void commitFeedbackSuccess(BaseBean bean) {
}
@Override
public void getMemberComboListSuccess(List<MemberComboEntity> list) {
}
@Override
public void getPaySignSuccess(BaseBean bean) {
}
@Override
public void showError(String message) {
}
@Override
public void logOut(BaseBean bean) {
}
private void displayCacheSize() {
long cacheSize = getCacheSize();
String sizeString;
if (cacheSize >= 1024 * 1024) {
sizeString = String.format("%.2f MB", cacheSize / (1024.0 * 1024.0));
} else {
sizeString = String.format("%d KB", cacheSize / 1024);
}
viewBinding.tvCacheSize.setText(sizeString);
}
private long getCacheSize() {
File cacheDir = mContext.getCacheDir();
return getFolderSize(cacheDir);
}
private long getFolderSize(File dir) {
long size = 0;
if (dir != null && dir.isDirectory()) {
for (File file : dir.listFiles()) {
if (file.isFile()) {
size += file.length();
} else {
size += getFolderSize(file);
}
}
}
return size;
}
private void clearCache() {
File cacheDir = getCacheDir();
deleteDir(cacheDir);
}
private boolean deleteDir(File dir) {
if (dir != null && dir.isDirectory()) {
String[] children = dir.list();
if (children != null) {
for (String child : children) {
deleteDir(new File(dir, child));
}
}
}
return dir.delete();
}
}

View File

@@ -1,202 +0,0 @@
package com.ckkj.griddle.mine;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.Handler;
import android.text.TextUtils;
import android.view.View;
import com.gyf.immersionbar.ImmersionBar;
import com.ckkj.griddle.AppConfig;
import com.ckkj.griddle.R;
import com.ckkj.griddle.base.BaseActivity;
import com.ckkj.griddle.base.entity.MineUserInfoBean;
import com.ckkj.griddle.base.entity.UserInfoEntity;
import com.ckkj.griddle.databinding.UserLogOffActivityBinding;
import com.ckkj.griddle.login.LoginActivity;
import com.ckkj.griddle.main.entity.CheckVersionEntity;
import com.ckkj.griddle.mine.entity.MemberComboEntity;
import com.ckkj.griddle.mine.mvp.MineContract;
import com.ckkj.griddle.mine.mvp.MineImpl;
import com.ckkj.griddle.mine.mvp.MinePresenter;
import com.ckkj.griddle.network.BaseBean;
import com.ckkj.griddle.utils.manager.ActivityManager;
import com.ckkj.griddle.utils.manager.MingDengUserInfoManager;
import com.ckkj.griddle.utils.number.PhoneNumberUtils;
import com.ckkj.griddle.utils.show.ToastUtil;
import java.util.List;
import butterknife.OnClick;
/**
* @Description 用户注销账号
* @systemUser 86133
* @Author FengJingQi
* @Date 04-28-2025 周一 12:22
*/
public class UserLogOffAccountActivity extends BaseActivity<UserLogOffActivityBinding, MinePresenter> implements MineContract.MineView {
@Override
public MinePresenter createPresenter() {
return new MinePresenter(new MineImpl());
}
@Override
public int getLayoutResId(Bundle savedInstanceState) {
return 0;
}
@Override
public void initData(Bundle savedInstanceState) {
super.initData(savedInstanceState);
ImmersionBar.with(this)
.statusBarColor(R.color.white) // 设置状态栏颜色
.statusBarDarkFont(true) // 设置状态栏字体为黑色
.titleBar(viewBinding.rlTitle)
.init();
viewBinding.includeTitle.tvTitle.setText("注销账号");
if(AppConfig.USER_LOGIN){
String phoneNum = getUserPhone();
if(!TextUtils.isEmpty(phoneNum)){
viewBinding.tvUserPhone.setText(PhoneNumberUtils.hidePhoneNumber(phoneNum));
}
}
}
@OnClick({ R.id.img_back,R.id.tv_get_code,R.id.tv_commit})
public void onClick(View v) {
switch (v.getId()){
case R.id.img_back:
finish();
break;
case R.id.tv_get_code:
String getCodePhone = getUserPhone();
if (TextUtils.isEmpty(getCodePhone)) {
ToastUtil.showShort(mContext, "未获取到当前手机号");
return;
}
showLoadingDialog();
mPresenter.getPhoneCode(getCodePhone, AppConfig.SMS_CODE_TYPE_LOG_OFF);
break;
case R.id.tv_commit:
if(TextUtils.isEmpty(viewBinding.edVerCode.getText().toString().trim())){
ToastUtil.showShort(mContext,"请填写验证码");
return;
}
if(viewBinding.edVerCode.getText().toString().trim().length() < 6){
ToastUtil.showShort(mContext,"请填写6位验证码");
return;
}
String logOffPhone = getUserPhone();
if (TextUtils.isEmpty(logOffPhone)) {
ToastUtil.showShort(mContext, "未获取到当前手机号");
return;
}
showLoadingDialog();
mPresenter.logOffAccount(logOffPhone, viewBinding.edVerCode.getText().toString().trim());
break;
}
}
private String getUserPhone() {
UserInfoEntity userInfo = MingDengUserInfoManager.getInstance().getUserInfo();
return userInfo == null ? "" : userInfo.getMobile();
}
private CountDownTimer cdTimer = new CountDownTimer(60000, 1000) {
@Override
public void onTick(long millisUntilFinished) {
viewBinding.tvGetCode.setText("(" + millisUntilFinished / 1000 + ")秒后重发");
viewBinding.tvGetCode.setSelected(true);
viewBinding.tvGetCode.setClickable(false);
viewBinding.tvGetCode.setTextColor(mContext.getColor(R.color.color_c8c8c8));
}
@Override
public void onFinish() {
viewBinding.tvGetCode.setText("重新发送");
viewBinding.tvGetCode.setSelected(false);
viewBinding.tvGetCode.setClickable(true);
viewBinding.tvGetCode.setTextColor(mContext.getColor(R.color.color_zhu));
}
};
@Override
public void getUserInfoSuccess(MineUserInfoBean bean) {
}
@Override
public void updateUserAvatarSuccess(BaseBean bean, String url) {
}
/**
* 用户注销成功
* @param bean
*/
@Override
public void userLogoffSuccess(BaseBean bean) {
ToastUtil.showShort(mContext,"账号已注销,即将跳转到登录页面");
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
ActivityManager.removeAllActivity();
goTo(mContext, LoginActivity.class,null);
}
},500);
}
@Override
public void getAppVersionSuccess(CheckVersionEntity entity) {
}
@Override
public void commitFeedbackSuccess(BaseBean bean) {
}
@Override
public void getMemberComboListSuccess(List<MemberComboEntity> list) {
}
@Override
public void getPaySignSuccess(BaseBean bean) {
}
@Override
public void getSmsCodeSuccess(BaseBean bean) {
cdTimer.start();
hideDialogLoading();
ToastUtil.showShort(mContext,"验证码已发送");
}
@Override
public void updateMobileSuccess(BaseBean bean) {
}
@Override
public void showError(String message) {
hideDialogLoading();
ToastUtil.showShort(mContext,message);
}
@Override
public void logOut(BaseBean bean) {
}
}

View File

@@ -1,81 +0,0 @@
package com.ckkj.griddle.mine.adapter;
import android.content.Context;
import android.graphics.Paint;
import android.text.TextUtils;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ckkj.griddle.R;
import com.ckkj.griddle.mine.entity.MemberComboEntity;
import java.util.List;
/**
* @author fengxiaoyang
* @date 2025/8/27
* @description TODO: 描述该类的作用
*/
public class ComboAdapter extends BaseQuickAdapter<MemberComboEntity, BaseViewHolder> {
private Context mContext;
private int mSelectPos = -1;
public int getmSelectPos() {
return mSelectPos;
}
public void setmSelectPos(int mSelectPos) {
this.mSelectPos = mSelectPos;
notifyDataSetChanged();
}
public ComboAdapter(Context context, int layoutResId, @Nullable List<MemberComboEntity> data) {
super(layoutResId, data);
this.mContext = context;
}
@Override
public void setNewData(@Nullable List<MemberComboEntity> data) {
super.setNewData(data);
for(int i=0;i<data.size();i++){
if(data.get(i).getId().equals("2")){
mSelectPos = i;
}
}
}
@Override
protected void convert(BaseViewHolder holder, MemberComboEntity item) {
LinearLayout linearItem = holder.getView(R.id.linear_item);
TextView tvOldPrice = holder.getView(R.id.tv_price_old);
holder.setText(R.id.tv_combo_name,item.getName());
if(!TextUtils.isEmpty(item.getOffers())){
holder.setText(R.id.tv_jiesheng,item.getOffers());
holder.setGone(R.id.tv_jiesheng,true);
}else{
holder.setGone(R.id.tv_jiesheng,false);
}
if(!TextUtils.isEmpty(item.getOriginal())){
holder.setText(R.id.tv_price_old,item.getOriginal());
holder.setGone(R.id.tv_price_old,true);
tvOldPrice.setPaintFlags(tvOldPrice.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
}else{
holder.setGone(R.id.tv_price_old,false);
}
holder.setText(R.id.tv_price_type,"¥" + item.getMoney() + "/" + item.getType());
holder.setText(R.id.tv_price_day,"¥"+ item.getMoneyC());
if(holder.getLayoutPosition() == mSelectPos){
linearItem.setBackground(ContextCompat.getDrawable(mContext,R.drawable.shape_combo_selected));
holder.setChecked(R.id.checkbox,true);
}else{
linearItem.setBackground(ContextCompat.getDrawable(mContext,R.drawable.shape_trans_touming));
holder.setChecked(R.id.checkbox,false);
}
}
}

View File

@@ -1,43 +0,0 @@
package com.ckkj.griddle.mine.adapter;
import androidx.annotation.Nullable;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ckkj.griddle.R;
import com.ckkj.griddle.mine.entity.InviteeRecordEntity;
import java.util.List;
/**
* @author fengxiaoyang
* @date 2025/10/10
* @description TODO: 描述该类的作用
*/
public class MyInvteeAdapter extends BaseQuickAdapter<InviteeRecordEntity.RowsDTO, BaseViewHolder> {
public MyInvteeAdapter(int layoutResId, @Nullable List<InviteeRecordEntity.RowsDTO> data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper, InviteeRecordEntity.RowsDTO item) {
// 处理手机号,将中间4位替换为****
String phone = item.getInviteeMobile();
String maskedPhone = maskPhone(phone);
helper.setText(R.id.tv_phone, maskedPhone);
helper.setText(R.id.tv_bind_time, item.getBindTime());
}
/**
* 手机号脱敏处理,将中间4位替换为****
* 例如:13812345678 -> 138****5678
*/
private String maskPhone(String phone) {
if (phone == null || phone.length() != 11) {
return phone; // 如果不是11位手机号,直接返回原值
}
return phone.substring(0, 3) + "****" + phone.substring(7);
}
}

View File

@@ -1,71 +0,0 @@
package com.ckkj.griddle.mine.adapter;
import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import androidx.annotation.Nullable;
import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ckkj.griddle.R;
import java.util.List;
public class PublishCarImgAdapter extends BaseQuickAdapter<String,BaseViewHolder>{
private Context mContext;
private List<String> dataList;
public PublishCarImgAdapter(Context context, int layoutResId, @Nullable List<String> data) {
super(layoutResId, data);
this.mContext = context;
this.dataList = data;
}
@Override
public void setNewData(@Nullable List<String> data) {
super.setNewData(data);
this.dataList = data;
}
@Override
protected void convert(BaseViewHolder helper, String item) {
ImageView imgDelte = helper.getView(R.id.img_delete);
ImageView imgPic = helper.getView(R.id.img_pic);
if(dataList.size() == 1){
if(TextUtils.isEmpty(item)){
Glide.with(mContext).load(mContext.getDrawable(R.mipmap.icon_add_pic)).into(imgPic);
imgDelte.setVisibility(View.GONE);
}
}else{
if(helper.getLayoutPosition() == dataList.size() -1){
if(helper.getLayoutPosition() == 3){
if(!TextUtils.isEmpty(item)){
Glide.with(mContext).load(item).into(imgPic);
imgDelte.setVisibility(View.VISIBLE);
}else{
Glide.with(mContext).load(mContext.getDrawable(R.mipmap.icon_add_pic)).into(imgPic);
imgDelte.setVisibility(View.GONE);
}
}else{
Glide.with(mContext).load(mContext.getDrawable(R.mipmap.icon_add_pic)).into(imgPic);
imgDelte.setVisibility(View.GONE);
}
}else{
if(!TextUtils.isEmpty(item)){
Glide.with(mContext).load(item).into(imgPic);
imgDelte.setVisibility(View.VISIBLE);
}
}
}
helper.addOnClickListener(R.id.img_delete);
helper.addOnClickListener(R.id.img_pic);
}
public void removeItem(int position) {
notifyItemRemoved(position);
// 这里可以执行实际的删除操作,如items.remove(position)
dataList.remove(position);
}
}

View File

@@ -1,46 +0,0 @@
package com.ckkj.griddle.mine.entity;
import com.google.gson.annotations.SerializedName;
import java.io.Serializable;
import java.util.List;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author fengxiaoyang
* @date 2025/10/10
* @description TODO: 邀请记录
*/
@NoArgsConstructor
@Data
public class InviteeRecordEntity implements Serializable {
@SerializedName("rows")
private List<RowsDTO> rows;
@SerializedName("total")
private Integer total;
@SerializedName("pageNum")
private Integer pageNum;
@SerializedName("pageSize")
private Integer pageSize;
@SerializedName("pages")
private Integer pages;
@NoArgsConstructor
@Data
public static class RowsDTO {
@SerializedName("relationId")
private Integer relationId;
@SerializedName("inviteeMobile")
private String inviteeMobile;
@SerializedName("bindTime")
private String bindTime;
@SerializedName("bindStatus")
private Integer bindStatus;
@SerializedName("rewardStatus")
private Integer rewardStatus;
}
}

View File

@@ -1,36 +0,0 @@
package com.ckkj.griddle.mine.entity;
import com.google.gson.annotations.SerializedName;
import java.io.Serializable;
import java.util.List;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author fengxiaoyang
* @date 2025/8/27
* @description TODO: 描述该类的作用
*/
@NoArgsConstructor
@Data
public class MemberComboEntity implements Serializable {
@SerializedName("id")
private String id;
@SerializedName("name")
private String name;
@SerializedName("type")
private String type;
@SerializedName("money")
private String money;
@SerializedName("money_c")
private String moneyC;
@SerializedName("offers")
private String offers;
@SerializedName("day")
private String day;
@SerializedName("original")
private String original;
}

View File

@@ -1 +0,0 @@
package com.ckkj.griddle.mine.entity;

View File

@@ -1,28 +0,0 @@
package com.ckkj.griddle.mine.entity;
import com.google.gson.annotations.SerializedName;
import java.io.Serializable;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author fengxiaoyang
* @date 2025/9/29
* @description 邀请数据
*/
@NoArgsConstructor
@Data
public class RecommendDataEntity implements Serializable {
@SerializedName("totalInviteCount")
private Integer totalInviteCount;
@SerializedName("memberActiveCount")
private Integer memberActiveCount;
@SerializedName("rewardCount")
private Integer rewardCount;
@SerializedName("isBoundToOthers")
private Boolean isBoundToOthers;
}

View File

@@ -1,60 +0,0 @@
package com.ckkj.griddle.mine.entity;
import com.google.gson.annotations.SerializedName;
import java.io.Serializable;
import java.util.List;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author fengxiaoyang
* @date 2025/10/17
* @description TODO: 奖励记录
*/
@NoArgsConstructor
@Data
public class RewardRecordEntity implements Serializable {
@SerializedName("rows")
private List<RowsDTO> rows;
@SerializedName("total")
private Integer total;
@SerializedName("pageNum")
private Integer pageNum;
@SerializedName("pageSize")
private Integer pageSize;
@SerializedName("pages")
private Integer pages;
@NoArgsConstructor
@Data
public static class RowsDTO {
@SerializedName("transactionId")
private Integer transactionId;
@SerializedName("transactionType")
private String transactionType;
@SerializedName("memberType")
private String memberType;
@SerializedName("actualPayment")
private Double actualPayment;
@SerializedName("discountAmount")
private Double discountAmount;
@SerializedName("memberDays")
private Integer memberDays;
@SerializedName("expireTime")
private String expireTime;
@SerializedName("beforeExpireTime")
private String beforeExpireTime;
@SerializedName("transactionStatus")
private Integer transactionStatus;
@SerializedName("remark")
private String remark;
@SerializedName("rewardTime")
private String rewardTime;
@SerializedName("rewardTypeDesc")
private String rewardTypeDesc;
}
}

View File

@@ -1,90 +1,25 @@
package com.ckkj.griddle.mine.mvp;
import androidx.annotation.Nullable;
import com.ckkj.griddle.base.IView;
import com.ckkj.griddle.base.entity.MineUserInfoBean;
import com.ckkj.griddle.login.mvp.LoginContract;
import com.ckkj.griddle.main.entity.CheckVersionEntity;
import com.ckkj.griddle.mine.entity.InviteeRecordEntity;
import com.ckkj.griddle.mine.entity.MemberComboEntity;
import com.ckkj.griddle.mine.entity.RecommendDataEntity;
import com.ckkj.griddle.mine.entity.RewardRecordEntity;
import com.ckkj.griddle.network.BaseBean;
import org.json.JSONObject;
import java.util.List;
import java.util.Map;
/**
* @author fengxiaoyang
* @date 2025/7/28
* @description TODO: 描述该类的作用
*/
import com.ckkj.griddle.base.entity.UserInfoEntity;
/** 个人中心页面与数据层协议。 */
public class MineContract {
public interface CallBack<T> {
void success(T msg);
void fail(String msg);
}
public interface DataModel{
//获取个人信息
void getUserInfo(Map<String,Object> map, LoginContract.CallBack callBack);
//更新个人用户头像
void updateUserAvatar(Map<String,Object> map,CallBack callBack);
//确认修改手机号
void modifyPhone(JSONObject json, CallBack callBack);
//用户注销账号
void userLogoffAccount(JSONObject json , CallBack callBack);
//查询会员套餐
void getVipComboList(Map<String,Object> map,CallBack callBack);
//获取支付信息
void getPayOrderInfo(JSONObject json, CallBack callBack);
//提交反馈
void commitFeedback(Map<String,Object> map , CallBack callBack);
void success(T data);
void fail(String message);
}
public interface DataModel {
@Nullable
UserInfoEntity getCachedProfile();
}
public interface MineView extends IView {
//获取个人信息成功
void getUserInfoSuccess(MineUserInfoBean bean);
//修改头像成功
void updateUserAvatarSuccess(BaseBean bean,String url);
//获取手机验证码
void getSmsCodeSuccess(BaseBean bean);
//用户更新手机号码成功
void updateMobileSuccess(BaseBean bean);
//更新版本
void getAppVersionSuccess(CheckVersionEntity bean);
//用户注销账号成功
void userLogoffSuccess(BaseBean bean);
//问题反馈成功
void commitFeedbackSuccess(BaseBean bean);
//查询会员套餐成功返回
void getMemberComboListSuccess(List<MemberComboEntity> list);
//生成订单,并返回签名
void getPaySignSuccess(BaseBean bean);
}
public interface RecommendModel{
//查询邀请数据
void getRecommendDatas(Map<String,Object> map,CallBack callBack);
//绑定邀请码
void bindInvterCode(JSONObject json, CallBack callBack);
//查询邀请记录
void getMyInviteesResult(Map<String,Object> map,CallBack callBack);
//获取奖励记录
void getRewardRecords(Map<String,Object> map,CallBack callBack);
}
public interface RecommendView extends IView {
//查询邀请数据
void getRecommendDatasSuccess(RecommendDataEntity bean);
//绑定邀请码成功
void bindInvterCodeSuccess(BaseBean bean);
//查询邀请记录成功
void getMyInviteesResultSuccess(InviteeRecordEntity bean);
//获取奖励记录成功
void getRewardRecordsSuccess(RewardRecordEntity bean);
void showProfile(@Nullable UserInfoEntity userInfo);
}
}

View File

@@ -1,294 +1,17 @@
package com.ckkj.griddle.mine.mvp;
import com.ckkj.griddle.base.entity.MineUserInfoBean;
import com.ckkj.griddle.login.mvp.LoginContract;
import com.ckkj.griddle.mine.entity.MemberComboEntity;
import com.ckkj.griddle.network.BaseBean;
import com.ckkj.griddle.network.NetWorkManager;
import androidx.annotation.Nullable;
import org.json.JSONObject;
import java.util.List;
import java.util.Map;
import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.annotations.NonNull;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
/**
* @author fengxiaoyang
* @date 2025/7/28
* @description TODO: 描述该类的作用
*/
import com.ckkj.griddle.AppConfig;
import com.ckkj.griddle.base.entity.UserInfoEntity;
import com.ckkj.griddle.utils.manager.MingDengUserInfoManager;
/** 读取已缓存的用户资料,后续在此接入新个人中心接口。 */
public class MineImpl implements MineContract.DataModel {
@Nullable
@Override
public void getUserInfo(Map<String, Object> map, LoginContract.CallBack callBack) {
NetWorkManager.getRequest().getMineUserInfo(NetWorkManager.getToken(), map)
.subscribeOn(Schedulers.io())
.unsubscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<BaseBean<MineUserInfoBean>>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
}
@Override
public void onNext(@NonNull BaseBean<MineUserInfoBean> bean) {
if (bean != null && bean.getCode() == 200 && bean.getData() != null) {
callBack.success(bean.getData());
} else {
callBack.fail(getErrorMessage(bean));
}
}
@Override
public void onError(@NonNull Throwable e) {
callBack.fail(e.getMessage());
}
@Override
public void onComplete() {
}
});
}
private String getErrorMessage(BaseBean bean) {
if (bean != null && bean.getMessage() != null && !bean.getMessage().isEmpty()) {
return bean.getMessage();
}
return "用户资料加载失败";
}
/**
* 更新用户头像
*
* @param map
* @param callBack
*/
@Override
public void updateUserAvatar(Map<String, Object> map, MineContract.CallBack callBack) {
NetWorkManager.getRequest().updateUseravatar(NetWorkManager.getToken(), map)
.subscribeOn(Schedulers.io())
.unsubscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<BaseBean>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
}
@Override
public void onNext(@NonNull BaseBean bean) {
if (bean.getCode() == 200) {
callBack.success(bean);
}
}
@Override
public void onError(@NonNull Throwable e) {
callBack.fail(e.getMessage());
}
@Override
public void onComplete() {
}
});
}
/**
* 确认修改手机号
*
* @param json
* @param callBack
*/
@Override
public void modifyPhone(JSONObject json, MineContract.CallBack callBack) {
try {
NetWorkManager.getRequest().modifyPhone(NetWorkManager.getToken(), NetWorkManager.toRequestBody(json))
.subscribeOn(Schedulers.io())
.unsubscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<BaseBean>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
}
@Override
public void onNext(@NonNull BaseBean bean) {
if (bean.getCode() == 200) {
callBack.success(bean);
} else {
callBack.fail(bean.getMessage());
}
}
@Override
public void onError(@NonNull Throwable e) {
callBack.fail(e.getMessage());
}
@Override
public void onComplete() {
}
});
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 注销账号
*
* @param json
* @param callBack
*/
@Override
public void userLogoffAccount(JSONObject json, MineContract.CallBack callBack) {
try {
NetWorkManager.getRequest().logoffAccount(NetWorkManager.getToken(), NetWorkManager.toRequestBody(json))
.subscribeOn(Schedulers.io())
.unsubscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<BaseBean>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
}
@Override
public void onNext(@NonNull BaseBean bean) {
if (bean.getCode() == 200) {
callBack.success(bean);
} else {
callBack.fail(bean.getMessage());
}
}
@Override
public void onError(@NonNull Throwable e) {
callBack.fail(e.getMessage());
}
@Override
public void onComplete() {
}
});
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 查询会员套餐
* @param map
* @param callBack
*/
@Override
public void getVipComboList(Map<String, Object> map, MineContract.CallBack callBack) {
NetWorkManager.getRequest().getMemberComboList(NetWorkManager.getToken())
.subscribeOn(Schedulers.io())
.unsubscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<BaseBean<List<MemberComboEntity>>>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
}
@Override
public void onNext(@NonNull BaseBean<List<MemberComboEntity>> bean) {
if(bean.getCode() == 200){
callBack.success(bean.getData());
}
}
@Override
public void onError(@NonNull Throwable e) {
callBack.fail(e.getMessage());
}
@Override
public void onComplete() {
}
});
}
/**
* 获取支付信息
* @param json
* @param callBack
*/
@Override
public void getPayOrderInfo(JSONObject json, MineContract.CallBack callBack) {
try {
NetWorkManager.getRequest().getPayOrderInfo(NetWorkManager.getToken(), NetWorkManager.toRequestBody(json))
.subscribeOn(Schedulers.io())
.unsubscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<BaseBean>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
}
@Override
public void onNext(@NonNull BaseBean bean) {
if (bean.getCode() == 200) {
callBack.success(bean);
} else {
callBack.fail(bean.getMessage());
}
}
@Override
public void onError(@NonNull Throwable e) {
callBack.fail(e.getMessage());
}
@Override
public void onComplete() {
}
});
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 提交反馈
*
* @param map
* @param callBack
*/
@Override
public void commitFeedback(Map<String, Object> map, MineContract.CallBack callBack) {
NetWorkManager.getRequsestTwo().commitFeedback(NetWorkManager.getToken(), map)
.subscribeOn(Schedulers.io())
.unsubscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<BaseBean>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
}
@Override
public void onNext(@NonNull BaseBean bean) {
if (bean.getCode() == 200) {
callBack.success(bean);
} else {
callBack.fail(bean.getMessage());
}
}
@Override
public void onError(@NonNull Throwable e) {
callBack.fail(e.getMessage());
}
@Override
public void onComplete() {
}
});
public UserInfoEntity getCachedProfile() {
return AppConfig.USER_LOGIN
? MingDengUserInfoManager.getInstance().getUserInfo() : null;
}
}

View File

@@ -1,287 +1,18 @@
package com.ckkj.griddle.mine.mvp;
import android.text.TextUtils;
import com.ckkj.griddle.base.BasePresenter;
import com.ckkj.griddle.base.entity.MineUserInfoBean;
import com.ckkj.griddle.base.entity.UserInfoEntity;
import com.ckkj.griddle.login.mvp.LoginContract;
import com.ckkj.griddle.login.mvp.LoginImpl;
import com.ckkj.griddle.main.MainContract;
import com.ckkj.griddle.main.MainImpl;
import com.ckkj.griddle.main.entity.CheckVersionEntity;
import com.ckkj.griddle.mine.entity.MemberComboEntity;
import com.ckkj.griddle.network.BaseBean;
import com.ckkj.griddle.utils.manager.MingDengUserInfoManager;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author fengxiaoyang
* @date 2025/7/28
* @description TODO: 描述该类的作用
*/
/** 个人中心业务协调层。 */
public class MinePresenter extends BasePresenter<MineContract.MineView> {
private MineImpl impl;
private final MineContract.DataModel impl;
public MinePresenter(MineImpl impl) {
public MinePresenter(MineContract.DataModel impl) {
this.impl = impl;
}
/**
* 获取个人信息
*/
public void getUserinfo() {
Map<String,Object> map = new HashMap<>();
impl.getUserInfo(map, new LoginContract.CallBack<MineUserInfoBean>() {
@Override
public void success(MineUserInfoBean bean) {
if (bean == null || bean.getUserInfo() == null) {
if (MinePresenter.this.getView() != null) {
MinePresenter.this.getView().showError("用户资料缺失,请稍后重试");
public void loadProfile() {
if (getView() != null) {
getView().showProfile(impl.getCachedProfile());
}
return;
}
UserInfoEntity entity = bean.getUserInfo();
if (!TextUtils.isEmpty(bean.getBirthTime())) {
entity.setBirthTime(bean.getBirthTime());
}
if (!TextUtils.isEmpty(bean.getConstellation())) {
entity.setConstellation(bean.getConstellation());
}
MingDengUserInfoManager.getInstance().setUserInfo(entity);
if (MinePresenter.this.getView() != null) {
MinePresenter.this.getView().getUserInfoSuccess(bean);
}
}
@Override
public void fail(String msg) {
if(MinePresenter.this.getView() != null){
MinePresenter.this.getView().showError(msg);
}
}
});
}
/**
* 更新用户头像
* @param path
*/
public void updateUserAvatar(String path) {
Map<String,Object> map = new HashMap<>();
map.put("avatarFile",path);
impl.updateUserAvatar(map, new MineContract.CallBack<BaseBean>() {
@Override
public void success(BaseBean bean) {
if(MinePresenter.this.getView() != null){
MinePresenter.this.getView().updateUserAvatarSuccess(bean,path);
}
}
@Override
public void fail(String msg) {
if(MinePresenter.this.getView() != null){
MinePresenter.this.getView().showError(msg);
}
}
});
}
/**
* 获取手机验证码
* @param phoneNum
* @param codeType
*/
public void getPhoneCode(String phoneNum, String codeType) {
try {
JSONObject json = new JSONObject();
json.put("mobile", phoneNum);
json.put("type", codeType);
new LoginImpl().getPhoneCode(json, new LoginContract.CallBack<BaseBean>() {
@Override
public void success(BaseBean bean) {
if (MinePresenter.this.getView() != null) {
MinePresenter.this.getView().getSmsCodeSuccess(bean);
}
}
@Override
public void fail(String msg) {
if (MinePresenter.this.getView() != null) {
MinePresenter.this.getView().showError(msg);
}
}
});
} catch (JSONException e) {
if (MinePresenter.this.getView() != null) {
MinePresenter.this.getView().showError("请求参数异常,请稍后重试");
}
}
}
/**
* 确认修改手机号
* @param phone
* @param code
*/
public void updateUserPhone(String phone, String code) {
try {
JSONObject json = new JSONObject();
json.put("newMobile",phone);
json.put("code",code);
impl.modifyPhone(json, new MineContract.CallBack<BaseBean>() {
@Override
public void success(BaseBean bean) {
if (MinePresenter.this.getView() != null) {
MinePresenter.this.getView().updateMobileSuccess(bean);
}
}
@Override
public void fail(String msg) {
if (MinePresenter.this.getView() != null) {
MinePresenter.this.getView().showError(msg);
}
}
});
} catch (JSONException e) {
if (MinePresenter.this.getView() != null) {
MinePresenter.this.getView().showError("请求参数异常,请稍后重试");
}
}
}
/**
* 检测版本号
*/
public void checkNewVersion() {
JSONObject json = new JSONObject();
new MainImpl().checkAppVersionCode(json, new MainContract.CallBack<CheckVersionEntity>() {
@Override
public void success(CheckVersionEntity bean) {
if( MinePresenter.this.getView() != null){
MinePresenter.this.getView().getAppVersionSuccess(bean);
}
}
@Override
public void fail(String msg) {
if( MinePresenter.this.getView() != null){
MinePresenter.this.getView().showError(msg);
}
}
});
}
/**
* 注销账号
* @param mobile
* @param code
*/
public void logOffAccount(String mobile, String code) {
try {
JSONObject json = new JSONObject();
json.put("phone",mobile);
json.put("code",code);
impl.userLogoffAccount(json, new MineContract.CallBack<BaseBean>() {
@Override
public void success(BaseBean bean) {
if( MinePresenter.this.getView() != null){
MinePresenter.this.getView().userLogoffSuccess(bean);
}
}
@Override
public void fail(String msg) {
if( MinePresenter.this.getView() != null){
MinePresenter.this.getView().showError(msg);
}
}
});
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* 查询会员套餐
*/
public void getComboList() {
Map<String,Object> map = new HashMap<>();
impl.getVipComboList(map, new MineContract.CallBack<List<MemberComboEntity>>() {
@Override
public void success(List<MemberComboEntity> list) {
if(MinePresenter.this.getView() != null){
MinePresenter.this.getView().getMemberComboListSuccess(list);
}
}
@Override
public void fail(String msg) {
if(MinePresenter.this.getView() != null){
MinePresenter.this.getView().showError(msg);
}
}
});
}
/**
* 发起支付,获取支付信息
* @param payTypeID
*/
public void creatPayOrder(String payTypeID) {
try {
JSONObject json = new JSONObject();
json.put("end","android");
json.put("id",payTypeID);
impl.getPayOrderInfo(json, new MineContract.CallBack<BaseBean>() {
@Override
public void success(BaseBean bean) {
if(MinePresenter.this.getView() != null){
MinePresenter.this.getView().getPaySignSuccess(bean);
}
}
@Override
public void fail(String msg) {
if( MinePresenter.this.getView() != null){
MinePresenter.this.getView().showError(msg);
}
}
});
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* 提交问题反馈
*/
public void commitFeedback(String content, String imgStr) {
Map<String,Object> map = new HashMap<>();
map.put("content",content);
if(!TextUtils.isEmpty(imgStr)){
map.put("url",imgStr);
}
impl.commitFeedback(map, new MineContract.CallBack<BaseBean>() {
@Override
public void success(BaseBean bean) {
MinePresenter.this.getView().commitFeedbackSuccess(bean);
}
@Override
public void fail(String msg) {
MinePresenter.this.getView().showError(msg);
}
});
}
}

View File

@@ -1,175 +0,0 @@
package com.ckkj.griddle.mine.mvp;
import com.ckkj.griddle.base.entity.MineUserInfoBean;
import com.ckkj.griddle.chat.entity.CharHistoryEntity;
import com.ckkj.griddle.mine.entity.InviteeRecordEntity;
import com.ckkj.griddle.mine.entity.RecommendDataEntity;
import com.ckkj.griddle.mine.entity.RewardRecordEntity;
import com.ckkj.griddle.network.BaseBean;
import com.ckkj.griddle.network.NetWorkManager;
import org.json.JSONObject;
import java.util.Map;
import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.annotations.NonNull;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
/**
* @author fengxiaoyang
* @date 2025/9/29
* @description TODO: 描述该类的作用
*/
public class RecommendImpl implements MineContract.RecommendModel{
/**
* 查询邀请数据
* @param map
* @param callBack
*/
@Override
public void getRecommendDatas(Map<String, Object> map, MineContract.CallBack callBack) {
NetWorkManager.getRequest().getRecommendDatas(NetWorkManager.getToken(), map)
.subscribeOn(Schedulers.io())
.unsubscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<BaseBean<RecommendDataEntity>>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
}
@Override
public void onNext(@NonNull BaseBean<RecommendDataEntity> bean) {
if (bean.getCode() == 200) {
callBack.success(bean.getData());
}
}
@Override
public void onError(@NonNull Throwable e) {
callBack.fail(e.getMessage());
}
@Override
public void onComplete() {
}
});
}
/**
* 绑定邀请码
* @param json
* @param callBack
*/
@Override
public void bindInvterCode(JSONObject json, MineContract.CallBack callBack) {
try {
NetWorkManager.getRequest().bindInvterCode(NetWorkManager.getToken(), NetWorkManager.toRequestBody(json))
.subscribeOn(Schedulers.io())
.unsubscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<BaseBean>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
}
@Override
public void onNext(@NonNull BaseBean bean) {
if (bean.getCode() == 200) {
callBack.success(bean);
} else {
callBack.fail(bean.getMessage());
}
}
@Override
public void onError(@NonNull Throwable e) {
callBack.fail(e.getMessage());
}
@Override
public void onComplete() {
}
});
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void getMyInviteesResult(Map<String, Object> map, MineContract.CallBack callBack) {
try {
NetWorkManager.getRequest().myInvitees(NetWorkManager.getToken(),map)
.subscribeOn(Schedulers.io())
.unsubscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<BaseBean<InviteeRecordEntity>>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
}
@Override
public void onNext(@NonNull BaseBean<InviteeRecordEntity> bean) {
if(bean.getCode() == 200){
callBack.success(bean.getData());
}else{
callBack.fail(bean.getMessage());
}
}
@Override
public void onError(@NonNull Throwable e) {
callBack.fail(e.getMessage());
}
@Override
public void onComplete() {
}
});
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* 获取奖励记录
* @param map
* @param callBack
*/
@Override
public void getRewardRecords(Map<String, Object> map, MineContract.CallBack callBack) {
NetWorkManager.getRequest().getRewardRecords(NetWorkManager.getToken(), map)
.subscribeOn(Schedulers.io())
.unsubscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<BaseBean<RewardRecordEntity>>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
}
@Override
public void onNext(@NonNull BaseBean<RewardRecordEntity> bean) {
if (bean.getCode() == 200) {
callBack.success(bean.getData());
} else {
callBack.fail(bean.getMessage());
}
}
@Override
public void onError(@NonNull Throwable e) {
callBack.fail(e.getMessage());
}
@Override
public void onComplete() {
}
});
}
}

View File

@@ -1,131 +0,0 @@
package com.ckkj.griddle.mine.mvp;
import com.ckkj.griddle.base.BasePresenter;
import com.ckkj.griddle.chat.entity.CharHistoryEntity;
import com.ckkj.griddle.chat.mvp.IndexContract;
import com.ckkj.griddle.chat.mvp.IndexPresenter;
import com.ckkj.griddle.mine.entity.InviteeRecordEntity;
import com.ckkj.griddle.mine.entity.RecommendDataEntity;
import com.ckkj.griddle.mine.entity.RewardRecordEntity;
import com.ckkj.griddle.network.BaseBean;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.HashMap;
import java.util.Map;
/**
* @author fengxiaoyang
* @date 2025/9/29
* @description TODO: 描述该类的作用
*/
public class RecommendPresenter extends BasePresenter<MineContract.RecommendView> {
private RecommendImpl impl;
public RecommendPresenter(RecommendImpl impl) {
this.impl = impl;
}
/**
* 获取邀请数据
*/
public void getRecommendDatas() {
Map<String,Object> map = new HashMap<>();
impl.getRecommendDatas(map, new MineContract.CallBack<RecommendDataEntity>() {
@Override
public void success(RecommendDataEntity bean) {
if(RecommendPresenter.this.getView() != null){
RecommendPresenter.this.getView().getRecommendDatasSuccess(bean);
}
}
@Override
public void fail(String msg) {
if(RecommendPresenter.this.getView() != null){
RecommendPresenter.this.getView().showError(msg);
}
}
});
}
/**
* 绑定邀请码
* @param code
*/
public void bindInvterCode(String code) {
try {
JSONObject json = new JSONObject();
json.put("inviteCode",code);
impl.bindInvterCode(json, new MineContract.CallBack<BaseBean>() {
@Override
public void success(BaseBean bean) {
if(RecommendPresenter.this.getView() != null){
RecommendPresenter.this.getView().bindInvterCodeSuccess(bean);
}
}
@Override
public void fail(String msg) {
if(RecommendPresenter.this.getView() != null){
RecommendPresenter.this.getView().showError(msg);
}
}
});
} catch (JSONException e) {
throw new RuntimeException(e);
}
}
/**
* 查询邀请记录
* @param mCurrentPage
*/
public void getInviteeList(int mCurrentPage) {
Map<String, Object> map = new HashMap<>();
map.put("pageNum", mCurrentPage);
map.put("pageSize", 10);
impl.getMyInviteesResult(map, new MineContract.CallBack<InviteeRecordEntity>() {
@Override
public void success(InviteeRecordEntity entity) {
if (RecommendPresenter.this.getView() != null) {
RecommendPresenter.this.getView().getMyInviteesResultSuccess(entity);
}
}
@Override
public void fail(String msg) {
if (RecommendPresenter.this.getView() != null) {
RecommendPresenter.this.getView().showError(msg);
}
}
});
}
/**
* 获取奖励记录
* @param page 页码
* @param pageSize 每页数量
*/
public void getRewardRecords(int page, int pageSize) {
Map<String, Object> map = new HashMap<>();
map.put("pageNum", page);
map.put("pageSize", pageSize);
impl.getRewardRecords(map, new MineContract.CallBack<RewardRecordEntity>() {
@Override
public void success(RewardRecordEntity bean) {
if (RecommendPresenter.this.getView() != null) {
RecommendPresenter.this.getView().getRewardRecordsSuccess(bean);
}
}
@Override
public void fail(String msg) {
if (RecommendPresenter.this.getView() != null) {
RecommendPresenter.this.getView().showError(msg);
}
}
});
}
}

View File

@@ -12,10 +12,6 @@ import com.ckkj.griddle.chat.entity.ChatAiMsgEntity;
import com.ckkj.griddle.chat.entity.IndexTemplateEntity;
import com.ckkj.griddle.login.entity.LoginEntity;
import com.ckkj.griddle.main.entity.CheckVersionEntity;
import com.ckkj.griddle.mine.entity.InviteeRecordEntity;
import com.ckkj.griddle.mine.entity.MemberComboEntity;
import com.ckkj.griddle.mine.entity.RecommendDataEntity;
import com.ckkj.griddle.mine.entity.RewardRecordEntity;
import com.ckkj.griddle.plate.entity.BaziResultBean;
import com.ckkj.griddle.plate.entity.BaziSaveSuccessEntity;
import com.ckkj.griddle.plate.entity.PaipanHistoryEntity;
@@ -96,9 +92,6 @@ public interface Request {
//获取个人信息
@GET("mobile/userInfo")
Observable<BaseBean<MineUserInfoBean>> getMineUserInfo(@HeaderMap Map<String, String> headMap, @QueryMap Map<String, Object> map);
//更新用户头像
@POST("mobile/modifyAvatar")
Observable<BaseBean> updateUseravatar(@HeaderMap Map<String, String> headMap, @QueryMap Map<String, Object> map);
//获取今日运势
@POST("mobile/yourhoroscope/today")
Observable<BaseBean<TodayFateEntity>> getUserTodayFateDatas(@HeaderMap Map<String, String> headMap);
@@ -120,35 +113,8 @@ public interface Request {
//删除历史记录
@POST("mobile/paiPan/record")
Observable<BaseBean> deletePaipanRecordById(@HeaderMap Map<String, String> headMap, @QueryMap Map<String, Object> map);
//修改手机号
@POST("mobile/modifyPhone")
Observable<BaseBean> modifyPhone(@HeaderMap Map<String, String> headMap, @Body RequestBody requestBody);
//注销账号
@POST("mobile/DeactivateAccount")
Observable<BaseBean> logoffAccount(@HeaderMap Map<String, String> headMap, @Body RequestBody requestBody);
//查询会员套餐
@GET("mobile/memberInFo")
Observable<BaseBean<List<MemberComboEntity>>> getMemberComboList(@HeaderMap Map<String, String> headMap);
//获取支付信息
@POST("mobile/alipay")
Observable<BaseBean> getPayOrderInfo(@HeaderMap Map<String, String> headMap, @Body RequestBody requestBody);
//问题反馈
@POST("mobile/appfeedback")
Observable<BaseBean> commitFeedback(@HeaderMap Map<String, String> headMap,@QueryMap Map<String, Object> map);
//问题反馈
@POST("mobile/reporting")
Observable<BaseBean> commitReporting(@HeaderMap Map<String, String> headMap,@QueryMap Map<String, Object> map);
//邀请数据
@GET("mobile/invitationStatistics")
Observable<BaseBean<RecommendDataEntity>> getRecommendDatas(@HeaderMap Map<String, String> headMap, @QueryMap Map<String, Object> map);
//邀请记录
@GET("mobile/myInvitees")
Observable<BaseBean<InviteeRecordEntity>> myInvitees(@HeaderMap Map<String, String> headMap, @QueryMap Map<String, Object> map);
//注销账号
@POST("mobile/bind")
Observable<BaseBean> bindInvterCode(@HeaderMap Map<String, String> headMap, @Body RequestBody requestBody);
//奖励记录
@GET("mobile/rewardHistoryDetail")
Observable<BaseBean<RewardRecordEntity>> getRewardRecords(@HeaderMap Map<String, String> headMap, @QueryMap Map<String, Object> map);
/***************************钱包********************************/
}

View File

@@ -1,134 +0,0 @@
package com.ckkj.griddle.plate;
import android.os.Bundle;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import com.ckkj.griddle.AppConfig;
import com.ckkj.griddle.R;
import com.ckkj.griddle.base.BaseFragment;
import com.ckkj.griddle.databinding.PlateFragmentBinding;
import com.ckkj.griddle.login.LoginActivity;
import com.ckkj.griddle.network.BaseBean;
import com.ckkj.griddle.plate.adapter.ViewPagerAdapter;
import com.ckkj.griddle.plate.entity.BaziResultBean;
import com.ckkj.griddle.plate.entity.BaziSaveSuccessEntity;
import com.ckkj.griddle.plate.entity.PaipanHistoryEntity;
import com.ckkj.griddle.plate.mvp.PlateContract;
import com.ckkj.griddle.plate.mvp.PlateImpl;
import com.ckkj.griddle.plate.mvp.PlatePresenter;
import java.util.ArrayList;
import java.util.List;
import butterknife.OnClick;
/**
* @author fengxiaoyang
* @date 2025/7/30
* @description TODO: 排盘页面
*/
public class PlateFragment extends BaseFragment<PlateFragmentBinding, PlatePresenter>
implements PlateContract.PlateView {
private List<Fragment> mFragmentList = new ArrayList<>();
@Override
public PlatePresenter createPresenter() {
return new PlatePresenter(new PlateImpl());
}
@Override
public void initData(Bundle state) {
viewBinding.includedTitle.imgBack.setVisibility(View.GONE);
viewBinding.includedTitle.tvTitle.setText("信息录入");
ViewPagerAdapter adapter = new ViewPagerAdapter(this, mFragmentList);
viewBinding.viewpage.setAdapter(adapter);
viewBinding.tvPaipan.setSelected(true);
viewBinding.viewpage.setCurrentItem(0);
//viewpage2 特有的 api,禁止滑动
viewBinding.viewpage.setUserInputEnabled(false);
}
@OnClick({ R.id.tv_paipan,R.id.tv_jilu})
public void onClick(View v) {
switch (v.getId()) {
case R.id.tv_paipan:
viewBinding.tvPaipan.setSelected(true);
viewBinding.tvJilu.setSelected(false);
viewBinding.viewpage.setCurrentItem(0);
break;
case R.id.tv_jilu:
if(!AppConfig.USER_LOGIN){
goTo(mContext, LoginActivity.class,null);
return;
}
viewBinding.tvPaipan.setSelected(false);
viewBinding.tvJilu.setSelected(true);
viewBinding.viewpage.setCurrentItem(1);
break;
}
}
@Override
public void onNetChange(int netModel) {
}
@Override
public void showError(String message) {
}
@Override
public void logOut(BaseBean bean) {
}
@Override
public void getPaipanResult(BaziResultBean bean) {
}
@Override
public void saveBaziResultSuccess(BaziSaveSuccessEntity bean) {
}
@Override
public void getHistorySuccess(PaipanHistoryEntity entity) {
}
@Override
public void deletePaipanHistorySuccess(int pos) {
}
@Override
public void onStreamMessageReceived(String messageChunk) {
}
@Override
public void onStreamComplete(String complateMsg) {
}
@Override
public void commitReportSuccess(BaseBean bean) {
}
@Override
public void onPermissionsGranted(int requestCode, @NonNull List<String> perms) {
}
@Override
public void onPermissionsDenied(int requestCode, @NonNull List<String> perms) {
}
}

View File

@@ -1,30 +0,0 @@
package com.ckkj.griddle.plate.adapter;
import android.content.Context;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.viewpager2.adapter.FragmentStateAdapter;
import java.util.List;
public class ViewPagerAdapter extends FragmentStateAdapter {
private final List<Fragment> fragmentList;
public ViewPagerAdapter(@NonNull Fragment context, List<Fragment> fragments) {
super(context);
this.fragmentList = fragments;
}
@NonNull
@Override
public Fragment createFragment(int position) {
return fragmentList.get(position);
}
@Override
public int getItemCount() {
return fragmentList.size();
}
}

View File

@@ -1,63 +0,0 @@
package com.ckkj.griddle.plate.mvp;
import com.ckkj.griddle.base.IView;
import com.ckkj.griddle.network.BaseBean;
import com.ckkj.griddle.plate.entity.BaziResultBean;
import com.ckkj.griddle.plate.entity.BaziSaveSuccessEntity;
import com.ckkj.griddle.plate.entity.PaipanHistoryEntity;
import org.json.JSONObject;
import java.util.Map;
/**
* @author fengxiaoyang
* @date 2025/7/30
* @description TODO: 描述该类的作用
*/
public class PlateContract {
public interface CallBack<T> {
void success(T msg);
void fail(String msg);
}
public interface DataModel{
//保存八字排盘结果
void saveUserBirthInfo(JSONObject json, CallBack callBack);
//开始排盘
void startPaiPanByYfjApi(Map<String,Object> map , CallBack callBack);
//获取排盘结果
void getPaipanHistoryList(Map<String,Object> map, CallBack callBack);
//删除记录
void deleteRecordByID(Map<String,Object> map, CallBack callBack);
//根据八字排盘结果,ai 解析
void aiParseBaziResult(JSONObject json, CallBack callBack);
//发送消息给 AI
void sendMsgToAi(JSONObject json, AiStreamCallback callBack);
}
public interface AiStreamCallback {
void onMessage(String messageChunk); // 每次返回一段内容
void onError(String error);
void onComplete(String complateContent); // 结束
void onSessionReceived(String sessionId); // 新增:接收sessionId
void loginLost();
}
public interface PlateView extends IView {
//排盘成功
void getPaipanResult(BaziResultBean bean);
//保存八字成功
void saveBaziResultSuccess(BaziSaveSuccessEntity bean);
//历史记录
void getHistorySuccess(PaipanHistoryEntity entity);
//删除成功
void deletePaipanHistorySuccess(int pos);
// 新增流式回调方法
void onStreamMessageReceived(String messageChunk);
//完成
void onStreamComplete(String complateMsg);
//提交举报完成
void commitReportSuccess(BaseBean bean);
}
}

View File

@@ -1,425 +0,0 @@
package com.ckkj.griddle.plate.mvp;
import static android.content.ContentValues.TAG;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import com.ckkj.griddle.AppConfig;
import com.ckkj.griddle.fate.entity.FateHistoryEntity;
import com.ckkj.griddle.network.BaseBean;
import com.ckkj.griddle.network.BaseYfjApiBean;
import com.ckkj.griddle.network.NetWorkManager;
import com.ckkj.griddle.plate.entity.BaziResultBean;
import com.ckkj.griddle.plate.entity.BaziSaveSuccessEntity;
import com.ckkj.griddle.plate.entity.PaipanHistoryEntity;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Map;
import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.annotations.NonNull;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import org.json.JSONException;
/**
* @author fengxiaoyang
* @date 2025/7/30
* @description TODO: 描述该类的作用
*/
public class PlateImpl implements PlateContract.DataModel{
/**
* 保存八字排盘记录
* @param json
* @param callBack
*/
@Override
public void saveUserBirthInfo(JSONObject json, PlateContract.CallBack callBack) {
try {
NetWorkManager.getRequest().startPaipan(NetWorkManager.getToken(), NetWorkManager.toRequestBody(json))
.subscribeOn(Schedulers.io())
.unsubscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<BaseBean<BaziSaveSuccessEntity>>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
}
@Override
public void onNext(@NonNull BaseBean<BaziSaveSuccessEntity> bean) {
if (bean.getCode() == 200) {
callBack.success(bean.getData());
} else {
callBack.fail(bean.getMessage());
}
}
@Override
public void onError(@NonNull Throwable e) {
callBack.fail(e.getMessage());
}
@Override
public void onComplete() {
}
});
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 排盘数据,调用三方 api
* @param map
* @param callBack
*/
@Override
public void startPaiPanByYfjApi(Map<String, Object> map, PlateContract.CallBack callBack) {
try {
// 使用getNoBaseUrlRequest()调用第三方API,因为API URL是完整的
NetWorkManager.getNoBaseUrlRequest().startPaipanByYfj(NetWorkManager.getToken(), map)
.subscribeOn(Schedulers.io())
.unsubscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<BaseYfjApiBean<BaziResultBean>>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
}
@Override
public void onNext(@NonNull BaseYfjApiBean<BaziResultBean> bean) {
if (bean.getErrcode() == 0) {
// 成功返回数据
callBack.success(bean.getData());
} else {
// API返回错误
callBack.fail(bean.getErrmsg());
}
}
@Override
public void onError(@NonNull Throwable e) {
callBack.fail(e.getMessage());
}
@Override
public void onComplete() {
}
});
} catch (Exception e) {
e.printStackTrace();
callBack.fail(e.getMessage());
}
}
/**
* 排盘历史记录
* @param map
* @param callBack
*/
@Override
public void getPaipanHistoryList(Map<String, Object> map, PlateContract.CallBack callBack) {
try {
NetWorkManager.getRequest().getPaipanHistoryList(NetWorkManager.getToken())
.subscribeOn(Schedulers.io())
.unsubscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<BaseBean<PaipanHistoryEntity>>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
}
@Override
public void onNext(@NonNull BaseBean<PaipanHistoryEntity> bean) {
if(bean.getCode() == 200){
callBack.success(bean.getData());
}else{
callBack.fail(bean.getMessage());
}
}
@Override
public void onError(@NonNull Throwable e) {
callBack.fail(e.getMessage());
}
@Override
public void onComplete() {
}
});
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 删除记录
* @param map
* @param callBack
*/
@Override
public void deleteRecordByID(Map<String, Object> map, PlateContract.CallBack callBack) {
try {
NetWorkManager.getRequest().deletePaipanRecordById(NetWorkManager.getToken(),map)
.subscribeOn(Schedulers.io())
.unsubscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<BaseBean>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
}
@Override
public void onNext(@NonNull BaseBean bean) {
if(bean.getCode() == 200){
callBack.success(bean);
}else{
callBack.fail(bean.getMessage());
}
}
@Override
public void onError(@NonNull Throwable e) {
callBack.fail(e.getMessage());
}
@Override
public void onComplete() {
}
});
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* 八字排盘结果,AI 解析
* @param json
* @param callBack
*/
@Override
public void aiParseBaziResult(JSONObject json, PlateContract.CallBack callBack) {
try {
NetWorkManager.getRequest().aiParesBaziResult(NetWorkManager.getToken(), NetWorkManager.toRequestBody(json))
.subscribeOn(Schedulers.io())
.unsubscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<BaseBean>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
}
@Override
public void onNext(@NonNull BaseBean bean) {
if (bean.getCode() == 200) {
callBack.success(bean.getData());
} else {
callBack.fail(bean.getMessage());
}
}
@Override
public void onError(@NonNull Throwable e) {
callBack.fail(e.getMessage());
}
@Override
public void onComplete() {
}
});
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* AI解盘
* @param json
* @param callBack
*/
private final OkHttpClient client = new OkHttpClient();
private Call currentCall = null; // 新增:保存当前请求的Call对象
private volatile boolean isRequestStopped = false; // 新增:标记是否已停止请求
@Override
public void sendMsgToAi(JSONObject json, PlateContract.AiStreamCallback callBack) {
try {
String finalUrl = AppConfig.BASE_URL + "mobile/paiPan/ai";
Log.d(TAG, "Request URL: " + finalUrl);
Request request = new Request.Builder()
.addHeader("Authorization", "Bearer " + AppConfig.USER_TOKEN)
.post(NetWorkManager.toRequestBody(json))
.url(finalUrl)
.build();
currentCall = client.newCall(request);
isRequestStopped = false;
currentCall.enqueue(new Callback() {
@Override
public void onFailure(Call call, IOException e) {
if (isRequestStopped) return; // 如果已停止,不处理失败回调
new Handler(Looper.getMainLooper()).post(() -> {
if (callBack != null) callBack.onError(e.getMessage());
});
}
@Override
public void onResponse(Call call, Response response) {
if (isRequestStopped) return;
if (!response.isSuccessful()) {
new Handler(Looper.getMainLooper()).post(() -> {
if (callBack != null) callBack.onError("请求失败: " + response.code());
});
return;
}
InputStream inputStream = response.body().byteStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
try {
// 处理SSE流式数据
handleSSEStream(reader, callBack);
} catch (Exception e) {
new Handler(Looper.getMainLooper()).post(() -> {
if (callBack != null) callBack.onError("解析异常: " + e.getMessage());
});
} finally {
try {
reader.close();
response.close();
} catch (IOException ignored) {}
}
}
});
} catch (Exception e) {
new Handler(Looper.getMainLooper()).post(() -> {
if (callBack != null) callBack.onError("请求异常: " + e.getMessage());
});
}
}
/**
* 处理SSE流式数据
*/
private void handleSSEStream(BufferedReader reader, PlateContract.AiStreamCallback callBack) throws IOException {
String line;
StringBuilder currentEvent = new StringBuilder();
String currentEventType = null;
while ((line = reader.readLine()) != null && !isRequestStopped) {
if (line.trim().isEmpty()) {
// 空行表示一个事件结束,处理当前事件
if (currentEventType != null && currentEvent.length() > 0) {
processEvent(currentEventType, currentEvent.toString(), callBack);
currentEvent.setLength(0);
currentEventType = null;
}
} else if (line.startsWith("event:")) {
// 事件类型
currentEventType = line.substring(6).trim();
} else if (line.startsWith("data:")) {
// 事件数据
String data = line.substring(5).trim();
currentEvent.append(data);
}
}
// 处理最后一个事件
if (currentEventType != null && currentEvent.length() > 0) {
processEvent(currentEventType, currentEvent.toString(), callBack);
}
}
/**
* 处理单个事件
*/
private void processEvent(String eventType, String data, PlateContract.AiStreamCallback callBack) {
new Handler(Looper.getMainLooper()).post(() -> {
try {
switch (eventType) {
case "start":
// 开始事件,可以在这里做一些初始化
Log.d(TAG, "AI解盘开始: " + data);
break;
case "paiPanInfo":
// 排盘信息事件
Log.d(TAG, "排盘信息: " + data);
break;
case "api-info":
// API信息事件
Log.d(TAG, "API信息: " + data);
break;
case "chunk":
// 内容块事件,这是主要的文本内容
try {
JSONObject chunkData = new JSONObject(data);
String content = chunkData.optString("content", "");
boolean hasNewline = chunkData.optBoolean("hasNewline", false);
boolean isMarkdown = chunkData.optBoolean("isMarkdown", false);
// 发送内容块到回调
if (callBack != null && !content.isEmpty()) {
callBack.onMessage(content);
}
} catch (JSONException e) {
Log.e(TAG, "解析chunk数据失败: " + e.getMessage());
}
break;
case "request-id":
// 请求ID事件
Log.d(TAG, "请求ID: " + data);
break;
case "complete":
// 完成事件
Log.d(TAG, "AI解盘完成: " + data);
if (callBack != null) {
callBack.onComplete(data);
}
break;
default:
Log.d(TAG, "未知事件类型: " + eventType + ", 数据: " + data);
break;
}
} catch (Exception e) {
Log.e(TAG, "处理事件失败: " + e.getMessage());
}
});
}
/**
* 停止当前请求
*/
public void stopCurrentRequest() {
isRequestStopped = true;
if (currentCall != null && !currentCall.isCanceled()) {
currentCall.cancel();
currentCall = null;
}
}
}

View File

@@ -1,234 +0,0 @@
package com.ckkj.griddle.plate.mvp;
import com.google.gson.annotations.SerializedName;
import com.ckkj.griddle.base.BasePresenter;
import com.ckkj.griddle.chat.mvp.IndexContract;
import com.ckkj.griddle.chat.mvp.IndexImpl;
import com.ckkj.griddle.chat.mvp.IndexPresenter;
import com.ckkj.griddle.fate.entity.CityDataEntity;
import com.ckkj.griddle.network.BaseBean;
import com.ckkj.griddle.plate.entity.BaziResultBean;
import com.ckkj.griddle.plate.entity.BaziSaveSuccessEntity;
import com.ckkj.griddle.plate.entity.PaipanHistoryEntity;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author fengxiaoyang
* @date 2025/7/30
* @description TODO: 描述该类的作用
*/
public class PlatePresenter extends BasePresenter<PlateContract.PlateView> {
private PlateImpl impl;
public PlatePresenter(PlateImpl impl) {
this.impl = impl;
}
/**
* 排盘,直接调用缘份居 Api
* @param map
*/
public void startPaiPan(Map<String, Object> map) {
impl.startPaiPanByYfjApi(map, new PlateContract.CallBack<BaziResultBean>() {
@Override
public void success(BaziResultBean entity) {
if(PlatePresenter.this.getView() != null){
if(PlatePresenter.this.getView() != null){
PlatePresenter.this.getView().getPaipanResult(entity);
}
}
}
@Override
public void fail(String msg) {
if(PlatePresenter.this.getView() != null){
PlatePresenter.this.getView().showError(msg);
}
}
});
}
/**
* 上传八字结果
*
* @param result
* @param cityData
* @param timeType
*/
public void uploadBaziResult(BaziResultBean result, CityDataEntity cityData, int timeType) {
try {
BaziResultBean.BaseInfoDTO baseInfoDTO = result.getBaseInfo();
BaziResultBean.DetailInfoDTO.SizhuInfoDTO sizhuInfoDTO = result.getDetailInfo().getSizhuInfo();
JSONObject json = new JSONObject();
json.put("name",baseInfoDTO.getName());
json.put("gender",baseInfoDTO.getSex().equals("乾造")? "0" : "1");
json.put("birthType",timeType == 2001 ? "1":"0");
json.put("yangLiBirthTime",baseInfoDTO.getGongli());
json.put("yinLiBirthTime",baseInfoDTO.getNongli());
json.put("birthPlace",cityData == null ? "北京市": cityData.getCityName());
json.put("province",cityData == null ? "北京市": cityData.getProvinceName());
json.put("city",cityData == null ? "北京": cityData.getCityName());
json.put("openSolarTime","2");
json.put("nianZhu",sizhuInfoDTO.getYear().getTg() + "," + sizhuInfoDTO.getYear().getDz());
json.put("yueZhu",sizhuInfoDTO.getMonth().getTg() + "," + sizhuInfoDTO.getMonth().getDz());
json.put("riZhu",sizhuInfoDTO.getDay().getTg() + "," + sizhuInfoDTO.getDay().getDz());
json.put("shiZhu",sizhuInfoDTO.getHour().getTg() + "," + sizhuInfoDTO.getHour().getDz());
impl.saveUserBirthInfo(json, new PlateContract.CallBack<BaziSaveSuccessEntity>() {
@Override
public void success(BaziSaveSuccessEntity bean) {
if(PlatePresenter.this.getView() != null){
if(PlatePresenter.this.getView() != null){
PlatePresenter.this.getView().saveBaziResultSuccess(bean);
}
}
}
@Override
public void fail(String msg) {
if(PlatePresenter.this.getView() != null){
if(PlatePresenter.this.getView() != null){
PlatePresenter.this.getView().showError(msg);
}
}
}
});
} catch (JSONException e) {
throw new RuntimeException(e);
}
}
/**
* 获取历史运势
* @param page
*/
public void getHistoryDatas(int page) {
Map<String, Object> map = new HashMap<>();
map.put("pageNum", page);
map.put("pageSize", 10);
impl.getPaipanHistoryList(map, new PlateContract.CallBack<PaipanHistoryEntity>() {
@Override
public void success(PaipanHistoryEntity entity) {
if(PlatePresenter.this.getView() != null){
PlatePresenter.this.getView().getHistorySuccess(entity);
}
}
@Override
public void fail(String msg) {
if(PlatePresenter.this.getView() != null){
PlatePresenter.this.getView().showError(msg);
}
}
});
}
/**
* 删除记录
* @param id
*/
public void deleteRecordByID(String id,int pos) {
Map<String, Object> map = new HashMap<>();
map.put("recordId", id);
impl.deleteRecordByID(map, new PlateContract.CallBack<BaseBean>() {
@Override
public void success(BaseBean bean) {
if(PlatePresenter.this.getView() != null){
PlatePresenter.this.getView().deletePaipanHistorySuccess(pos);
}
}
@Override
public void fail(String msg) {
if(PlatePresenter.this.getView() != null){
PlatePresenter.this.getView().showError(msg);
}
}
});
}
/**
* ai 分析八字
* @param mSaveEntity
*/
public void AiParseBaziResult(BaziSaveSuccessEntity mSaveEntity) {
try {
JSONObject json = new JSONObject();
json.put("resultId", mSaveEntity.getRecordId());
impl.sendMsgToAi(json, new PlateContract.AiStreamCallback() {
@Override
public void onMessage(String messageChunk) {
if (PlatePresenter.this.getView() != null) {
PlatePresenter.this.getView().onStreamMessageReceived(messageChunk);
}
}
@Override
public void onError(String error) {
if (PlatePresenter.this.getView() != null) {
PlatePresenter.this.getView().showError(error);
}
}
@Override
public void onComplete(String complateContent) {
if (PlatePresenter.this.getView() != null) {
PlatePresenter.this.getView().onStreamComplete(complateContent);
}
}
@Override
public void onSessionReceived(String sessionId) {
// 这个回调在当前场景下可能不需要,但保留接口一致性
// Log.d("PlatePresenter", "Session received: " + sessionId);
}
@Override
public void loginLost() {
if (PlatePresenter.this.getView() != null) {
// 处理登录失效的情况
// 这里可以根据需要跳转到登录页面
// Log.w("PlatePresenter", "Login lost");
}
}
});
} catch (JSONException e) {
throw new RuntimeException(e);
}
}
/**
* 举报
* @param reason
*/
public void commitReport(String reason) {
Map<String, Object> map = new HashMap<>();
map.put("content", reason);
new IndexImpl().commitReport(map, new IndexContract.CallBack<BaseBean>() {
@Override
public void success(BaseBean bean) {
if (PlatePresenter.this.getView() != null) {
PlatePresenter.this.getView().commitReportSuccess(bean);
}
}
@Override
public void fail(String msg) {
if (PlatePresenter.this.getView() != null) {
PlatePresenter.this.getView().showError(msg);
}
}
});
}
}

View File

@@ -21,6 +21,20 @@ import java.util.List;
*/
public class SharePreUtil {
/**
* 一次性保存登录凭证和登录状态,避免两个字段分别写入造成状态不一致。
*/
public static boolean saveLoginSession(Context context, String token) {
if (TextUtils.isEmpty(token)) {
return false;
}
return context.getSharedPreferences(ConstantUtil.SHARE_PRE_NAME, Context.MODE_PRIVATE)
.edit()
.putString(ConstantUtil.USER_TOKEN, token)
.putBoolean(ConstantUtil.USER_LOGIN, true)
.commit();
}
/**
* 删除键值对
*/

View File

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

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="#E9F7EF" />
<corners android:radius="999dp" />
</shape>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="#FDECEC" />
<corners android:radius="999dp" />
</shape>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android">
<solid
android:color="#FFFFFF" />
<corners
android:radius="999dp" />
</shape>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android">
<solid
android:color="#80FFFFFF" />
<corners
android:radius="999dp" />
</shape>

View File

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

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_selected="true">
<shape>
<solid
android:color="@color/device_home_orange" />
<corners
android:radius="999dp" />
</shape>
</item>
<item>
<shape>
<solid
android:color="@android:color/white" />
<stroke
android:width="1dp"
android:color="#ECEEF2" />
<corners
android:radius="999dp" />
</shape>
</item>
</selector>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid
android:color="#33FFFFFF" />
<corners
android:radius="999dp" />
</shape>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid
android:color="#FFF3EA" />
<corners
android:radius="12dp" />
</shape>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid
android:color="@color/device_home_orange" />
<corners
android:radius="999dp" />
</shape>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid
android:color="#FFF3EA" />
<corners
android:radius="999dp" />
</shape>

View File

@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/rl_title"
android:layout_width="match_parent"
android:layout_height="48dp">
<include
android:id="@+id/included_title"
layout="@layout/include_activity_back_layout" />
</RelativeLayout>
</LinearLayout>

View File

@@ -1,267 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/rl_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white">
<include
android:id="@+id/include_title"
layout="@layout/include_activity_back_layout"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_change_phone"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_48"
android:layout_marginLeft="@dimen/dp_12"
android:layout_marginRight="@dimen/dp_12">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textColor="@color/color_333333"
android:text="我的账号"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"/>
<TextView
android:id="@+id/tv_user_phone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="13sp"
android:textColor="@color/color_666666"
android:text=""
android:layout_centerVertical="true"
android:layout_marginRight="@dimen/dp_10"
android:layout_toLeftOf="@+id/img_point_right1"/>
<ImageView
android:id="@+id/img_point_right1"
android:layout_width="@dimen/dp_15"
android:layout_height="@dimen/dp_15"
android:src="@mipmap/img_point_right_gray"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"/>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="@color/color_gray2"
android:layout_alignParentBottom="true"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_check_version"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_48"
android:layout_marginLeft="@dimen/dp_12"
android:layout_marginRight="@dimen/dp_12">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textColor="@color/color_333333"
android:text="检查更新"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"/>
<TextView
android:id="@+id/tv_version_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="12sp"
android:textColor="@color/color_ff999999"
android:text="version 1.2.3"
android:layout_centerVertical="true"
android:layout_marginRight="@dimen/dp_12"
android:layout_toLeftOf="@+id/img_point_right2"/>
<ImageView
android:id="@+id/img_point_right2"
android:layout_width="@dimen/dp_15"
android:layout_height="@dimen/dp_15"
android:src="@mipmap/img_point_right_gray"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"/>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="@color/color_gray2"
android:layout_alignParentBottom="true"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_set_cache"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_48"
android:layout_marginLeft="@dimen/dp_12"
android:layout_marginRight="@dimen/dp_12">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textColor="@color/color_333333"
android:text="清除缓存"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"/>
<TextView
android:id="@+id/tv_cache_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="13sp"
android:textColor="@color/color_666666"
android:text=""
android:layout_centerVertical="true"
android:layout_marginRight="@dimen/dp_10"
android:layout_toLeftOf="@+id/img_point_right3"/>
<ImageView
android:id="@+id/img_point_right3"
android:layout_width="@dimen/dp_15"
android:layout_height="@dimen/dp_15"
android:src="@mipmap/img_point_right_gray"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"/>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="@color/color_gray2"
android:layout_alignParentBottom="true"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_commit_service"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_48"
android:layout_marginLeft="@dimen/dp_12"
android:layout_marginRight="@dimen/dp_12">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textColor="@color/color_333333"
android:text="问题反馈"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"/>
<ImageView
android:id="@+id/img_point_right7"
android:layout_width="@dimen/dp_15"
android:layout_height="@dimen/dp_15"
android:src="@mipmap/img_point_right_gray"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"/>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="@color/color_gray2"
android:layout_alignParentBottom="true"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_user_agreement"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_48"
android:layout_marginLeft="@dimen/dp_12"
android:layout_marginRight="@dimen/dp_12">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textColor="@color/color_333333"
android:text="用户协议"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"/>
<ImageView
android:id="@+id/img_point_right4"
android:layout_width="@dimen/dp_15"
android:layout_height="@dimen/dp_15"
android:src="@mipmap/img_point_right_gray"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"/>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="@color/color_gray2"
android:layout_alignParentBottom="true"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_user_privacy"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_48"
android:layout_marginLeft="@dimen/dp_12"
android:layout_marginRight="@dimen/dp_12">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textColor="@color/color_333333"
android:text="隐私政策"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"/>
<ImageView
android:id="@+id/img_point_right5"
android:layout_width="@dimen/dp_15"
android:layout_height="@dimen/dp_15"
android:src="@mipmap/img_point_right_gray"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"/>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="@color/color_gray2"
android:layout_alignParentBottom="true"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_log_off"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_48"
android:layout_marginLeft="@dimen/dp_12"
android:layout_marginRight="@dimen/dp_12">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textColor="@color/color_333333"
android:text="注销账号"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"/>
<ImageView
android:id="@+id/img_point_right6"
android:layout_width="@dimen/dp_15"
android:layout_height="@dimen/dp_15"
android:src="@mipmap/img_point_right_gray"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"/>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="@color/color_gray2"
android:layout_alignParentBottom="true"/>
</RelativeLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_22"
android:layout_marginRight="@dimen/dp_12"
android:layout_marginTop="@dimen/dp_10"
android:textSize="12sp"
android:textColor="@color/color_666666"
android:text="如有问题,请联系我们: kunyanzhiyao@outlook.com"
android:layout_centerVertical="true"/>
<TextView
android:id="@+id/tv_log_out"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textColor="@color/white"
android:text="退出登录"
android:gravity="center"
android:paddingTop="@dimen/dp_12"
android:paddingBottom="@dimen/dp_12"
android:layout_marginTop="@dimen/dp_20"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_20"
android:background="@drawable/shape_red_radius8"
android:visibility="gone"/>
</LinearLayout>

View File

@@ -0,0 +1,101 @@
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/device_home_background"
android:fitsSystemWindows="true"
android:clipChildren="false"
android:clipToPadding="false"
tools:locale="zh">
<FrameLayout
android:id="@+id/rl_title"
android:layout_width="match_parent"
android:layout_height="48dp">
<TextView
android:id="@+id/tv_title"
style="@style/LoginDesignText"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:text="@string/bl_device_title"
android:textColor="#252529"
android:textSize="18sp"
android:textStyle="bold" />
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="32dp"
android:layout_marginStart="30dp"
android:layout_marginEnd="22dp"
android:layout_marginTop="14dp"
android:layout_marginBottom="12dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_nearby_devices"
style="@style/LoginDesignText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/bl_device_nearby"
android:textColor="#252529"
android:textSize="16sp"
android:textStyle="bold" />
<LinearLayout
android:id="@+id/ll_search_again"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:minHeight="32dp"
android:layout_marginStart="8dp"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_search_again"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_marginEnd="5dp"
android:contentDescription="@null"
android:src="@mipmap/ic_launcher" />
<TextView
android:id="@+id/tv_search_again"
style="@style/LoginDesignText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/bl_device_search_again"
android:textColor="@color/device_home_orange"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_devices"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:clipChildren="false"
android:clipToPadding="false"
android:paddingStart="26dp"
android:paddingEnd="29dp"
android:paddingTop="1dp"
android:paddingBottom="12dp"
android:scrollbars="none"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:itemCount="3"
tools:listitem="@layout/bl_device_list_item" />
</LinearLayout>

View File

@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/cv_device"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="14dp"
android:clickable="true"
android:focusable="true"
android:foreground="?attr/selectableItemBackground"
app:cardBackgroundColor="@android:color/white"
app:cardCornerRadius="12dp"
app:cardElevation="1dp"
app:cardPreventCornerOverlap="false"
tools:locale="zh">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="66dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingHorizontal="16dp"
android:paddingVertical="14dp">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginEnd="8dp"
android:orientation="vertical">
<TextView
android:id="@+id/tv_device_name"
style="@style/LoginDesignText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="19dp"
android:ellipsize="end"
android:maxLines="1"
android:textColor="#252529"
android:textSize="14sp"
android:textStyle="bold"
tools:text="智能电饼铛" />
<TextView
android:id="@+id/tv_device_sn"
style="@style/LoginDesignText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="15dp"
android:layout_marginTop="4dp"
android:ellipsize="end"
android:maxLines="1"
android:textColor="#9AA0A6"
android:textSize="11sp"
tools:text="SN-20260110001" />
</LinearLayout>
<!-- Bind the signal text, background and text color together in the adapter. -->
<TextView
android:id="@+id/tv_device_signal"
style="@style/BlDeviceSignalStrong"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minHeight="24dp"
android:gravity="center"
android:paddingHorizontal="12dp"
android:paddingVertical="4dp"
android:text="@string/bl_device_signal_strong" />
</LinearLayout>
</androidx.cardview.widget.CardView>

View File

@@ -1,192 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<RelativeLayout
android:id="@+id/rl_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white">
<include
android:id="@+id/include_title"
layout="@layout/include_activity_back_layout"/>
</RelativeLayout>
<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:layout_marginLeft="@dimen/dp_20"
android:textSize="13sp"
android:textColor="@color/gray_d4"
android:text="当前手机号"/>
<TextView
android:id="@+id/tv_user_phone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_30"
android:layout_marginTop="@dimen/dp_15"
android:textSize="18sp"
android:textColor="@color/color_333333"
android:text=""/>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dp_0_5"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_15"
android:background="@color/color_gray2"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="@dimen/dp_10">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:textSize="13sp"
android:textColor="@color/gray_d4"
android:text="新手机号"/>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_30"
android:layout_marginTop="@dimen/dp_15">
<ImageView
android:id="@+id/img_phone"
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_20"
android:src="@mipmap/icon_setting_phone"
android:layout_centerVertical="true"/>
<EditText
android:id="@+id/ed_Phone_num"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_36"
android:layout_toRightOf="@+id/img_phone"
android:layout_centerVertical="true"
android:background="@null"
android:textColor="@color/color_333333"
android:textSize="15sp"
android:hint="请输入新手机号"
android:layout_marginLeft="@dimen/dp_15"
android:inputType="number"
android:maxLength="11"
android:digits="1234567890"/>
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dp_0_5"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_15"
android:background="@color/color_gray2"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="@dimen/dp_10">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:textSize="13sp"
android:textColor="@color/gray_d4"
android:text="验证码"/>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_30"
android:layout_marginRight="@dimen/dp_30"
android:layout_marginTop="@dimen/dp_15">
<ImageView
android:id="@+id/img_verifi"
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_20"
android:src="@mipmap/icon_verification_code"
android:layout_centerVertical="true"/>
<EditText
android:id="@+id/ed_ver_code"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_36"
android:layout_toRightOf="@+id/img_verifi"
android:layout_toLeftOf="@+id/tv_get_code"
android:layout_centerVertical="true"
android:background="@null"
android:textColor="@color/color_333333"
android:textSize="15sp"
android:hint="请输入验证码"
android:layout_marginLeft="@dimen/dp_15"
android:inputType="number"
android:maxLength="6"
android:digits="1234567890"/>
<TextView
android:id="@+id/tv_get_code"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/dp_15"
android:paddingRight="@dimen/dp_15"
android:paddingTop="@dimen/dp_8"
android:paddingBottom="@dimen/dp_8"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:textSize="13sp"
android:textColor="@color/white"
android:text="发送验证码"
android:background="@drawable/shape_blue_radius8"/>
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dp_0_5"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_15"
android:background="@color/color_gray2"/>
</LinearLayout>
<TextView
android:id="@+id/tv_commit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textColor="@color/white"
android:text="提交"
android:gravity="center"
android:paddingTop="@dimen/dp_12"
android:paddingBottom="@dimen/dp_12"
android:layout_marginTop="@dimen/dp_20"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_20"
android:background="@drawable/shape_blue_radius8"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_20"
android:textSize="13sp"
android:textColor="@color/color_333333"
android:text="说明:"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_10"
android:lineSpacingExtra="@dimen/dp_5"
android:textSize="12sp"
android:textColor="@color/color_666666"
android:text="1.请确保输入的手机号码正确无误\n2.手机号修改成功后,您需要使用新手机号登录"/>
</LinearLayout>

View File

@@ -1,260 +0,0 @@
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<RelativeLayout
android:id="@+id/rl_title"
android:layout_width="match_parent"
android:layout_height="48dp">
<include
android:id="@+id/included_title"
layout="@layout/include_activity_back_layout" />
</RelativeLayout>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center_horizontal">
<ImageView
android:layout_width="@dimen/dp_55"
android:layout_height="@dimen/dp_45"
android:src="@mipmap/icon_combo_hg"
android:layout_marginTop="@dimen/dp_20"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:textColor="@color/color_zhu"
android:text="解锁全部功能"
android:textStyle="bold"
android:layout_marginTop="@dimen/dp_15"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textColor="@color/color_666666"
android:text="专业传统文化分析,无限制使用"
android:layout_marginTop="@dimen/dp_5"/>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/dp_13"
android:layout_marginTop="@dimen/dp_20"
android:layout_marginBottom="@dimen/dp_5"
app:cardBackgroundColor="@android:color/white"
app:cardCornerRadius="10dp"
app:cardElevation="4dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingHorizontal="@dimen/dp_15"
android:paddingBottom="@dimen/dp_15">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:textColor="@color/color_zhu"
android:text="会员特权"
android:textStyle="bold"
android:layout_marginTop="@dimen/dp_15"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:layout_marginTop="@dimen/dp_15">
<ImageView
android:layout_width="@dimen/dp_22"
android:layout_height="@dimen/dp_22"
android:src="@mipmap/icon_combo_wxai"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:textSize="15sp"
android:textColor="@color/color_zhu"
android:text="无限次传统文化咨询"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:layout_marginTop="@dimen/dp_15">
<ImageView
android:layout_width="@dimen/dp_22"
android:layout_height="@dimen/dp_22"
android:src="@mipmap/icon_combo_zsys"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:textSize="15sp"
android:textColor="@color/color_zhu"
android:text="专属精准文化解读"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:layout_marginTop="@dimen/dp_15">
<ImageView
android:layout_width="@dimen/dp_22"
android:layout_height="@dimen/dp_22"
android:src="@mipmap/icon_combo_xxbz"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:textSize="15sp"
android:textColor="@color/color_zhu"
android:text="详细传统文化分析"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:layout_marginTop="@dimen/dp_15">
<ImageView
android:layout_width="@dimen/dp_22"
android:layout_height="@dimen/dp_22"
android:src="@mipmap/icon_combo_gjml"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:textSize="15sp"
android:textColor="@color/color_zhu"
android:text="高级文化学习工具使用"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:layout_marginTop="@dimen/dp_15">
<ImageView
android:layout_width="@dimen/dp_22"
android:layout_height="@dimen/dp_22"
android:src="@mipmap/icon_combo_lssj"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:textSize="15sp"
android:textColor="@color/color_zhu"
android:text="历史数据无限查看"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:layout_marginTop="@dimen/dp_15">
<ImageView
android:layout_width="@dimen/dp_22"
android:layout_height="@dimen/dp_22"
android:src="@mipmap/icon_combo_kf"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:textSize="15sp"
android:textColor="@color/color_zhu"
android:text="专属客服一对一服务"/>
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_datas"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layoutManager="me.rosuh.filepicker.widget.PosLinearLayoutManager"
tools:listitem="@layout/combo_price_item"
tools:itemCount="4"/>
<LinearLayout
android:id="@+id/tv_pay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="@dimen/dp_10"
android:gravity="center_vertical"
android:layout_marginHorizontal="@dimen/dp_15"
android:paddingVertical="@dimen/dp_14"
android:paddingHorizontal="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_20"
android:background="@drawable/shape_mine_be_vip_green">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="立即开通"
android:textColor="@color/white"
android:textStyle="bold"
android:textSize="16sp" />
<View
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<TextView
android:id="@+id/tv_min_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:text="低至¥0.8/天"
android:textColor="@color/white"
android:textSize="14sp" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="@dimen/dp_30">
<RelativeLayout
android:id="@+id/realtive_read_finish"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginHorizontal="@dimen/dp_15"
android:paddingVertical="@dimen/dp_5">
<RadioButton
android:id="@+id/checkbox_read"
android:layout_width="@dimen/dp_14"
android:layout_height="@dimen/dp_14"
android:background="@drawable/select_radio"
android:layout_centerVertical="true"
android:button="@null"
android:clickable="false"
android:visibility="visible" />
<TextView
android:id="@+id/tv_agreement_full"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_12"
android:layout_marginRight="@dimen/dp_12"
android:layout_toRightOf="@+id/checkbox_read"
android:autoLink="none"
android:lineSpacingExtra="4dp"
android:textColor="@color/color_gray_tab"
android:textSize="12sp"
android:text="我已经阅读并同意《会员服务协议》"/>
</RelativeLayout>
</RelativeLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>

View File

@@ -1,102 +0,0 @@
<?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:paddingHorizontal="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_10">
<LinearLayout
android:id="@+id/linear_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingHorizontal="@dimen/dp_20"
android:paddingVertical="@dimen/dp_13"
android:gravity="center_vertical"
android:background="@drawable/shape_combo_selected">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:gravity="center_vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical">
<TextView
android:id="@+id/tv_combo_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:textColor="@color/color_zhu"
android:text="周会员"/>
<TextView
android:id="@+id/tv_combo_recommend"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:paddingHorizontal="@dimen/dp_6"
android:paddingVertical="@dimen/dp_2"
android:textSize="10sp"
android:textColor="@color/white"
android:text="推荐"
android:background="@drawable/shape_jiesheng_lable"
android:visibility="gone"/>
<TextView
android:id="@+id/tv_jiesheng"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_5"
android:paddingHorizontal="@dimen/dp_6"
android:paddingVertical="@dimen/dp_2"
android:textSize="10sp"
android:textColor="@color/white"
android:text="剩"
android:background="@drawable/shape_jiesheng_lable"/>
</LinearLayout>
<TextView
android:id="@+id/tv_price_old"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="12sp"
android:textColor="@color/color_666666"
android:text="¥1.3/天"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center">
<TextView
android:id="@+id/tv_price_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="¥9/周"
android:textColor="@color/color_zhu"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_price_day"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="12sp"
android:textColor="@color/color_666666"
android:text="¥1.3/天"/>
</LinearLayout>
<RadioButton
android:id="@+id/checkbox"
android:layout_width="@dimen/dp_18"
android:layout_height="@dimen/dp_18"
android:background="@drawable/select_combo_radio"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_12"
android:button="@null"
android:clickable="false"
android:checked="true"/>
</LinearLayout>
</LinearLayout>

View File

@@ -1,72 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/rl_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white">
<include
android:id="@+id/include_title"
layout="@layout/include_activity_back_layout"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_login_radius8_huise_bg"
android:layout_marginHorizontal="@dimen/dp_12"
android:layout_marginVertical="@dimen/dp_20">
<EditText
android:id="@+id/ed_commit_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="12sp"
android:textColor="@color/color_333333"
android:background="@drawable/shape_login_radius8_huise_bg"
android:paddingLeft="@dimen/dp_10"
android:paddingTop="@dimen/dp_20"
android:paddingBottom="@dimen/dp_12"/>
<TextView
android:id="@+id/tv_input_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@+id/ed_commit_info"
android:layout_marginRight="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_12"
android:layout_marginBottom="@dimen/dp_8"
android:textSize="@dimen/sp_14"
android:textColor="@color/color_ff999999"
android:text="0/200"/>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginHorizontal="@dimen/dp_12"
android:orientation="vertical">
<include
android:id="@+id/include_car_photo"
layout="@layout/include_car_photo"/>
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:background="@color/color_E0E0E0"/>
</LinearLayout>
<TextView
android:id="@+id/tv_commit"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_45"
android:layout_marginHorizontal="@dimen/dp_12"
android:layout_marginTop="@dimen/dp_12"
android:layout_marginBottom="@dimen/dp_12"
android:textSize="@dimen/sp_14"
android:textColor="@color/white"
android:text="反馈"
android:gravity="center"
android:background="@drawable/shape_blue_radius8"/>
</LinearLayout>

View File

@@ -249,20 +249,114 @@
android:textSize="18sp"
android:textStyle="bold" />
<!-- Two columns. Item margins leave 12dp between cards and room for their shadows. -->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_devices"
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginHorizontal="23dp"
android:layout_marginTop="6dp"
android:layout_weight="1"
android:clipChildren="false"
android:clipToPadding="false">
<!-- Two columns. Item margins leave room for card shadows. -->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_devices"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipChildren="false"
android:clipToPadding="false"
android:paddingBottom="12dp"
android:scrollbars="none"
android:visibility="gone"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:spanCount="2"
tools:itemCount="4"
tools:listitem="@layout/device_index_item" />
<ScrollView
android:id="@+id/sv_empty_devices"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipChildren="false"
android:clipToPadding="false"
android:scrollbars="none">
<androidx.cardview.widget.CardView
android:id="@+id/cv_empty_devices"
android:layout_width="match_parent"
android:layout_height="239dp"
android:layout_marginHorizontal="5dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="12dp"
app:cardBackgroundColor="@android:color/white"
app:cardCornerRadius="16dp"
app:cardElevation="1dp"
app:cardPreventCornerOverlap="false">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical"
android:paddingTop="34dp">
<androidx.cardview.widget.CardView
android:layout_width="64dp"
android:layout_height="64dp"
app:cardBackgroundColor="#FFF3EA"
app:cardCornerRadius="32dp"
app:cardElevation="0dp"
app:cardPreventCornerOverlap="false">
<ImageView
android:id="@+id/iv_empty_devices"
android:layout_width="26dp"
android:layout_height="26dp"
android:layout_gravity="center"
android:contentDescription="@null"
android:src="@mipmap/ic_launcher" />
</androidx.cardview.widget.CardView>
<TextView
android:id="@+id/tv_empty_devices"
style="@style/DeviceHomeText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="21dp"
android:layout_marginHorizontal="12dp"
android:layout_marginTop="14dp"
android:gravity="center"
android:text="@string/device_home_empty_message"
android:textColor="#1F2329"
android:textSize="16sp"
android:textStyle="bold" />
<androidx.cardview.widget.CardView
android:id="@+id/btn_empty_add_device"
android:layout_width="104dp"
android:layout_height="40dp"
android:layout_marginTop="38dp"
android:layout_marginBottom="28dp"
android:clickable="true"
android:contentDescription="@string/device_home_add_device"
android:focusable="true"
android:foreground="?attr/selectableItemBackground"
app:cardBackgroundColor="@color/device_home_orange"
app:cardCornerRadius="20dp"
app:cardElevation="0dp"
app:cardPreventCornerOverlap="false">
<TextView
style="@style/DeviceHomeText"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="@string/device_home_add_device"
android:textColor="@android:color/white"
android:textSize="12sp" />
</androidx.cardview.widget.CardView>
</LinearLayout>
</androidx.cardview.widget.CardView>
</ScrollView>
</FrameLayout>
</LinearLayout>

View File

@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/fl_food_banner"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"
android:focusable="true"
android:foreground="?attr/selectableItemBackground">
<ImageView
android:id="@+id/iv_food_banner"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="@mipmap/ic_launcher"
android:contentDescription="@null" />
<View
android:layout_width="match_parent"
android:layout_height="90dp"
android:layout_gravity="bottom"
android:background="@drawable/food_banner_scrim" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:orientation="vertical"
android:paddingHorizontal="16dp"
android:paddingBottom="14dp">
<!-- The adapter marks the current page; page count is supplied by banner data. -->
<LinearLayout
android:id="@+id/ll_banner_indicators"
android:layout_width="match_parent"
android:layout_height="6dp"
android:layout_marginBottom="4dp"
android:gravity="center">
<View
android:id="@+id/view_banner_indicator_active"
android:layout_width="16dp"
android:layout_height="6dp"
android:background="@drawable/food_banner_indicator_active" />
<View
android:layout_width="6dp"
android:layout_height="6dp"
android:layout_marginStart="6dp"
android:background="@drawable/food_banner_indicator_inactive" />
<View
android:layout_width="6dp"
android:layout_height="6dp"
android:layout_marginStart="6dp"
android:background="@drawable/food_banner_indicator_inactive" />
</LinearLayout>
<TextView
android:id="@+id/tv_food_banner_title"
style="@style/LoginDesignText"
android:layout_width="match_parent"
android:layout_height="27dp"
android:gravity="center"
android:textColor="@android:color/white"
android:textSize="20sp"
android:textStyle="bold"
android:maxLines="1"
android:ellipsize="end"
tools:text="Doro Wat" />
<TextView
android:id="@+id/tv_food_banner_subtitle"
style="@style/LoginDesignText"
android:layout_width="match_parent"
android:layout_height="16dp"
android:layout_marginTop="2dp"
android:textColor="@android:color/white"
android:textSize="12sp"
android:maxLines="1"
android:ellipsize="end"
tools:text="Ethiopia’s National Dish" />
</LinearLayout>
</FrameLayout>

View File

@@ -0,0 +1,37 @@
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/ll_food_breakfast"
android:layout_width="106dp"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:orientation="vertical"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="104dp"
app:cardCornerRadius="12dp"
app:cardElevation="0dp"
app:cardPreventCornerOverlap="false">
<ImageView
android:id="@+id/iv_food_cover"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="@mipmap/ic_launcher"
android:contentDescription="@null" />
</androidx.cardview.widget.CardView>
<TextView
android:id="@+id/tv_food_name"
style="@style/FoodItemName"
android:layout_width="match_parent"
android:layout_height="16dp"
android:layout_marginTop="8dp"
android:maxLines="1"
android:ellipsize="end"
tools:text="Injera Firfir" />
</LinearLayout>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/tv_food_category"
style="@style/LoginDesignText"
android:layout_width="wrap_content"
android:layout_height="32dp"
android:layout_marginEnd="12dp"
android:minWidth="64dp"
android:paddingHorizontal="16dp"
android:gravity="center"
android:background="@drawable/food_category_bg"
android:textColor="@color/food_category_text"
android:textSize="12sp"
android:clickable="true"
android:focusable="true"
tools:text="@string/food_category_breakfast" />

View File

@@ -0,0 +1,124 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/sv_food_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/device_home_background"
android:fillViewport="true"
android:scrollbars="none"
tools:locale="zh">
<!-- Fragment content only; MainActivity owns system insets and the bottom TabBar. -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="16dp"
android:paddingBottom="16dp">
<TextView
android:id="@+id/tv_food_title"
style="@style/FoodTitle"
android:layout_width="match_parent"
android:layout_height="48dp"
android:gravity="center"
android:text="@string/food_title"
android:textSize="18sp" />
<androidx.cardview.widget.CardView
android:id="@+id/cv_food_banner"
android:layout_width="match_parent"
android:layout_height="180dp"
android:layout_marginHorizontal="28dp"
app:cardCornerRadius="16dp"
app:cardElevation="0dp"
app:cardPreventCornerOverlap="false">
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/vp_food_banner"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout="@layout/food_banner_item" />
</androidx.cardview.widget.CardView>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_food_categories"
android:layout_width="match_parent"
android:layout_height="32dp"
android:layout_marginTop="16dp"
android:paddingStart="28dp"
android:paddingEnd="16dp"
android:clipToPadding="false"
android:orientation="horizontal"
android:scrollbars="none"
android:nestedScrollingEnabled="false"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:itemCount="4"
tools:listitem="@layout/food_category_item" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="32dp"
android:layout_marginHorizontal="28dp"
android:layout_marginTop="14dp"
android:gravity="center_vertical">
<TextView
android:id="@+id/tv_food_section_title"
style="@style/FoodTitle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/food_category_breakfast" />
<TextView
android:id="@+id/tv_food_category_see_all"
style="@style/FoodSeeAll"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="@string/food_see_all" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_food_breakfast"
android:layout_width="match_parent"
android:layout_height="128dp"
android:layout_marginTop="4dp"
android:paddingStart="28dp"
android:paddingEnd="18dp"
android:clipToPadding="false"
android:orientation="horizontal"
android:scrollbars="none"
android:nestedScrollingEnabled="false"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:itemCount="3"
tools:listitem="@layout/food_breakfast_item" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="32dp"
android:layout_marginHorizontal="28dp"
android:layout_marginTop="6dp"
android:gravity="center_vertical">
<TextView
android:id="@+id/tv_food_recommend_title"
style="@style/FoodTitle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/food_recommend" />
<TextView
android:id="@+id/tv_food_recommend_see_all"
style="@style/FoodSeeAll"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="@string/food_see_all" />
</LinearLayout>
<!-- Each grid cell includes 6dp on either side, giving a 12dp column gap. -->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_food_recommend"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="22dp"
android:layout_marginTop="4dp"
android:nestedScrollingEnabled="false"
android:scrollbars="none"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:spanCount="2"
tools:itemCount="4"
tools:listitem="@layout/food_recommend_item" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>

View File

@@ -0,0 +1,39 @@
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/ll_food_recommend"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="6dp"
android:layout_marginBottom="12dp"
android:orientation="vertical"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="110dp"
app:cardCornerRadius="12dp"
app:cardElevation="0dp"
app:cardPreventCornerOverlap="false">
<ImageView
android:id="@+id/iv_food_cover"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="@mipmap/ic_launcher"
android:contentDescription="@null" />
</androidx.cardview.widget.CardView>
<TextView
android:id="@+id/tv_food_name"
style="@style/FoodItemName"
android:layout_width="match_parent"
android:layout_height="32dp"
android:layout_marginTop="8dp"
android:maxLines="2"
android:ellipsize="end"
android:gravity="center_vertical"
tools:text="Chechebsa" />
</LinearLayout>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 尚未实现的 Tab 使用空白页,后续替换为新项目页面。 -->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white" />

View File

@@ -1,605 +0,0 @@
<?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">
<RelativeLayout
android:id="@+id/rl_title"
android:layout_width="match_parent"
android:layout_height="48dp">
<include
android:id="@+id/included_title"
layout="@layout/include_activity_back_layout" />
</RelativeLayout>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/dp_13"
android:layout_marginTop="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
app:cardBackgroundColor="@android:color/white"
app:cardCornerRadius="10dp"
app:cardElevation="4dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical"
android:paddingHorizontal="@dimen/dp_15"
android:paddingBottom="@dimen/dp_15">
<LinearLayout
android:layout_width="@dimen/dp_90"
android:layout_height="@dimen/dp_90"
android:layout_marginTop="@dimen/dp_15"
android:background="@drawable/shape_mine_head_circle"
android:gravity="center">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/img_user_head"
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80"
app:riv_corner_radius="@dimen/dp_40"
android:src="@mipmap/icon_mine_user_head_defaul" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:text="点击更换头像"
android:textColor="@color/color_zhu"
android:textSize="12sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_20"
android:text="会员状态"
android:textColor="@color/color_666666"
android:textSize="12sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_6"
android:gravity="center_vertical"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_mine_vip_background"
android:gravity="center_vertical"
android:paddingHorizontal="@dimen/dp_8"
android:paddingVertical="@dimen/dp_4">
<ImageView
android:layout_width="@dimen/dp_12"
android:layout_height="@dimen/dp_12"
android:src="@mipmap/icon_mine_vip_true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_5"
android:text="会员状态"
android:textColor="@color/color_E6BF00"
android:textSize="12sp" />
</LinearLayout>
<View
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_5"
android:background="@drawable/shape_mine_vip_center_bg"
android:paddingHorizontal="@dimen/dp_10"
android:paddingVertical="@dimen/dp_5"
android:text="会员状态"
android:textColor="@color/white"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/dp_13"
android:layout_marginTop="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
app:cardBackgroundColor="@android:color/white"
app:cardCornerRadius="10dp"
app:cardElevation="4dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingHorizontal="@dimen/dp_15"
android:paddingVertical="@dimen/dp_15">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="@dimen/dp_26"
android:layout_height="@dimen/dp_26"
android:src="@mipmap/icon_mine_mlda"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_8"
android:text="我的命理档案"
android:textColor="@color/color_zhu"
android:textStyle="bold"
android:textSize="16sp" />
<View
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<ImageView
android:id="@+id/img_edit"
android:layout_width="@dimen/dp_12"
android:layout_height="@dimen/dp_12"
android:src="@mipmap/icon_mine_edit"/>
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_12"
android:text="出生日期"
android:textColor="@color/color_666666"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_defaul_birthtime"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_12"
android:text="****年**月**日"
android:textColor="@color/color_666666"
android:textSize="12sp"
android:visibility="gone"/>
<TextView
android:id="@+id/tv_user_birth_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_4"
android:textColor="@color/color_zhu"
android:textStyle="bold"
android:textSize="16sp"
android:visibility="gone"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_12"
android:text="星座"
android:textColor="@color/color_666666"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_defaul_star"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_12"
android:text="**座"
android:textColor="@color/color_666666"
android:textSize="12sp"
android:visibility="gone"/>
<TextView
android:id="@+id/tv_user_star"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_4"
android:textColor="@color/color_zhu"
android:textStyle="bold"
android:textSize="16sp"
android:visibility="gone"/>
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginHorizontal="@dimen/dp_8"
android:layout_marginTop="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_8"
app:cardCornerRadius="16dp"
app:cardElevation="4dp">
<!-- 底部按钮区域 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<!-- 邀请记录 -->
<LinearLayout
android:id="@+id/ll_invite_record"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/dp_8"
android:gravity="center"
android:orientation="vertical"
android:paddingVertical="@dimen/dp_15">
<ImageView
android:layout_width="@dimen/dp_24"
android:layout_height="@dimen/dp_24"
android:layout_marginBottom="@dimen/dp_8"
android:src="@mipmap/icon_tj_yqjl" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_2"
android:text="我的钱包"
android:textColor="@color/color_zhu"
android:textSize="14sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/dp_13"
android:layout_marginTop="@dimen/dp_15"
android:layout_marginBottom="@dimen/dp_5"
app:cardBackgroundColor="@android:color/white"
app:cardCornerRadius="10dp"
app:cardElevation="4dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingHorizontal="@dimen/dp_15"
android:paddingVertical="@dimen/dp_15">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="@dimen/dp_26"
android:layout_height="@dimen/dp_26"
android:src="@mipmap/icon_mine_tobe_vip"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_8"
android:text="升级 VIP 会员"
android:textColor="@color/color_zhu"
android:textStyle="bold"
android:textSize="16sp" />
<View
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center">
<TextView
android:id="@+id/tv_detail_vip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="查看特权"
android:textColor="@color/color_F7D73B"
android:textSize="12sp" />
<ImageView
android:layout_width="@dimen/dp_6"
android:layout_height="@dimen/dp_11"
android:layout_marginLeft="@dimen/dp_5"
android:src="@mipmap/icon_mine_point_y"/>
</LinearLayout>
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_12"
android:gravity="center"
android:text="解锁全部深度解析,探索你的无限潜能"
android:textColor="@color/color_666666"
android:textSize="14sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="@dimen/dp_12">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="1"
android:gravity="center">
<ImageView
android:layout_width="@dimen/dp_22"
android:layout_height="@dimen/dp_22"
android:src="@mipmap/icon_mine_wxcs"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_4"
android:text="无限次数咨询"
android:textColor="@color/color_666666"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="1"
android:gravity="center">
<ImageView
android:layout_width="@dimen/dp_22"
android:layout_height="@dimen/dp_22"
android:src="@mipmap/icon_mine_ysfx"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_4"
android:text="专属量能分析"
android:textColor="@color/color_666666"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="1"
android:gravity="center">
<ImageView
android:layout_width="@dimen/dp_22"
android:layout_height="@dimen/dp_22"
android:src="@mipmap/icon_mine_mlgj"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_4"
android:text="潜能解析工具箱"
android:textColor="@color/color_666666"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/linear_tobe_vip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:paddingVertical="@dimen/dp_14"
android:paddingHorizontal="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_20"
android:background="@drawable/shape_mine_be_vip_yellow">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="升级 VIP 会员"
android:textColor="@color/white"
android:textStyle="bold"
android:textSize="16sp" />
<View
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:text="低至¥0.8/天"
android:textColor="@color/white"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/dp_13"
android:layout_marginTop="@dimen/dp_15"
android:layout_marginBottom="@dimen/dp_35"
app:cardBackgroundColor="@android:color/white"
app:cardCornerRadius="10dp"
app:cardElevation="4dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingHorizontal="@dimen/dp_15"
android:paddingVertical="@dimen/dp_15">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="@dimen/dp_26"
android:layout_height="@dimen/dp_26"
android:src="@mipmap/icon_mine_friend"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_8"
android:text="推荐好友"
android:textColor="@color/color_zhu"
android:textStyle="bold"
android:textSize="16sp" />
<View
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_share_be_vip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="立即分享"
android:textColor="@color/color_60B864"
android:textSize="12sp" />
<ImageView
android:layout_width="@dimen/dp_6"
android:layout_height="@dimen/dp_11"
android:layout_marginLeft="@dimen/dp_5"
android:src="@mipmap/icon_mine_green" />
</LinearLayout>
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_12"
android:gravity="center"
android:text="分享给好友注册并开通会员,您可获得7天会"
android:textColor="@color/color_666666"
android:textSize="14sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="@dimen/dp_12">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="1"
android:gravity="center">
<ImageView
android:layout_width="@dimen/dp_22"
android:layout_height="@dimen/dp_22"
android:src="@mipmap/icon_mine_wxyq"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_4"
android:text="无限邀请"
android:textColor="@color/color_666666"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="1"
android:gravity="center">
<ImageView
android:layout_width="@dimen/dp_22"
android:layout_height="@dimen/dp_22"
android:src="@mipmap/icon_mine_jl"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_4"
android:text="7天奖励"
android:textColor="@color/color_666666"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="1"
android:gravity="center">
<ImageView
android:layout_width="@dimen/dp_22"
android:layout_height="@dimen/dp_22"
android:src="@mipmap/icon_mine_jsdz"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_4"
android:text="即时到账"
android:textColor="@color/color_666666"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/lienar_share_be_vip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:paddingVertical="@dimen/dp_14"
android:paddingHorizontal="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_20"
android:background="@drawable/shape_mine_be_vip_green">
<ImageView
android:layout_width="@dimen/dp_12"
android:layout_height="@dimen/dp_16"
android:src="@mipmap/icon_mine_share"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_12"
android:text="升级 VIP 会员"
android:textColor="@color/white"
android:textStyle="bold"
android:textSize="16sp" />
<View
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:text="低至¥0.8/天"
android:textColor="@color/white"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>

View File

@@ -0,0 +1,805 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/device_home_background"
android:clipToPadding="false"
android:fillViewport="true"
android:scrollbars="none"
tools:locale="zh">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="16dp"
android:paddingBottom="28dp"
android:clipChildren="false"
android:clipToPadding="false">
<!-- MainActivity owns system insets and the bottom TabBar. -->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginHorizontal="28dp">
<TextView
android:id="@+id/tv_mine_title"
style="@style/MineText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/mine_title"
android:layout_gravity="center"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_logout_top"
style="@style/MineText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/mine_logout"
android:layout_gravity="end|center_vertical"
android:minHeight="40dp"
android:gravity="center"
android:textSize="12sp"
android:textColor="@color/device_home_orange"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
</FrameLayout>
<androidx.cardview.widget.CardView
android:id="@+id/cv_mine_profile"
style="@style/MineCard"
android:layout_height="119dp"
android:layout_marginTop="10dp"
app:cardBackgroundColor="@color/device_home_orange"
app:cardElevation="10dp"
android:outlineAmbientShadowColor="@color/device_home_orange"
android:outlineSpotShadowColor="@color/device_home_orange">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="23dp"
android:gravity="center_vertical">
<TextView
android:id="@+id/tv_my_profile"
style="@style/MineText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/mine_profile"
android:layout_weight="1"
android:textColor="@android:color/white"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_green_pioneer"
style="@style/MineText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/mine_badge"
android:minWidth="110dp"
android:gravity="center"
android:paddingHorizontal="12dp"
android:paddingVertical="4dp"
android:background="@drawable/mine_badge_bg"
android:textSize="11sp"
android:textColor="@android:color/white" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="52dp"
android:layout_marginTop="12dp"
android:gravity="center_vertical">
<androidx.cardview.widget.CardView
android:layout_width="52dp"
android:layout_height="52dp"
app:cardCornerRadius="26dp"
app:cardElevation="0dp"
app:cardPreventCornerOverlap="false">
<ImageView
android:id="@+id/iv_mine_avatar"
android:layout_width="52dp"
android:layout_height="52dp"
android:src="@mipmap/ic_launcher"
android:contentDescription="@null"
android:scaleType="centerCrop" />
</androidx.cardview.widget.CardView>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginStart="12dp"
android:orientation="vertical">
<TextView
android:id="@+id/tv_mine_name"
style="@style/MineText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/mine_default_name"
android:textSize="20sp"
android:textStyle="bold"
android:textColor="@android:color/white"
android:maxLines="1"
android:ellipsize="end" />
<TextView
android:id="@+id/tv_mine_contact"
style="@style/MineText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/mine_contact_empty"
android:layout_marginTop="4dp"
android:textSize="11sp"
android:textColor="@android:color/white"
android:maxLines="1"
android:ellipsize="end"
tools:text="13234545678 · Tom@qq.com" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="@+id/cv_mine_credits"
style="@style/MineCard"
android:layout_marginTop="10dp"
android:minHeight="178dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingHorizontal="16dp"
android:paddingVertical="4dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:gravity="center_vertical">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/tv_my_credits"
style="@style/MineText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/mine_credits"
android:textColor="#9AA0A6"
android:textSize="11sp" />
<TextView
android:id="@+id/tv_mine_points"
style="@style/MineText"
android:layout_width="match_parent"
android:layout_height="32dp"
android:gravity="center_vertical"
android:textSize="24sp"
android:textStyle="bold"
tools:text="5,000 Points" />
</LinearLayout>
<TextView
android:id="@+id/btn_redeem_now"
style="@style/MineText"
android:layout_width="108dp"
android:layout_height="34dp"
android:text="@string/mine_redeem_now"
android:gravity="center"
android:background="@drawable/mine_pill_bg"
android:textColor="@android:color/white"
android:textSize="12sp"
android:clickable="true"
android:focusable="true" />
</LinearLayout>
<TextView
android:id="@+id/tv_credits_hint"
style="@style/MineText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/mine_credits_hint"
android:textColor="#9AA0A6"
android:textSize="11sp"
android:layout_marginTop="2dp"
android:layout_marginBottom="14dp" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#ECEEF2" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="76dp"
android:gravity="center_vertical">
<LinearLayout
android:id="@+id/ll_credit_history"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:gravity="center"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground">
<androidx.cardview.widget.CardView
android:layout_width="34dp"
android:layout_height="34dp"
app:cardBackgroundColor="#FFF3EA"
app:cardCornerRadius="17dp"
app:cardElevation="0dp"
app:cardPreventCornerOverlap="false">
<ImageView
android:id="@+id/iv_credit_history"
android:layout_width="16dp"
android:layout_height="16dp"
android:src="@mipmap/ic_launcher"
android:contentDescription="@null"
android:layout_gravity="center" />
</androidx.cardview.widget.CardView>
<TextView
android:id="@+id/tv_credit_history"
style="@style/MineText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/mine_credit_history"
android:layout_marginTop="6dp"
android:textSize="10sp"
android:textColor="#6B7280"
android:gravity="center" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_redeem_credits"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:gravity="center"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground">
<androidx.cardview.widget.CardView
android:layout_width="34dp"
android:layout_height="34dp"
app:cardBackgroundColor="#FFF3EA"
app:cardCornerRadius="17dp"
app:cardElevation="0dp"
app:cardPreventCornerOverlap="false">
<ImageView
android:id="@+id/iv_redeem_credits"
android:layout_width="16dp"
android:layout_height="16dp"
android:src="@mipmap/ic_launcher"
android:contentDescription="@null"
android:layout_gravity="center" />
</androidx.cardview.widget.CardView>
<TextView
android:id="@+id/tv_redeem_credits"
style="@style/MineText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/mine_redeem_credits"
android:layout_marginTop="6dp"
android:textSize="10sp"
android:textColor="#6B7280"
android:gravity="center" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_registration_order"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:gravity="center"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground">
<androidx.cardview.widget.CardView
android:layout_width="34dp"
android:layout_height="34dp"
app:cardBackgroundColor="#FFF3EA"
app:cardCornerRadius="17dp"
app:cardElevation="0dp"
app:cardPreventCornerOverlap="false">
<ImageView
android:id="@+id/iv_registration_order"
android:layout_width="16dp"
android:layout_height="16dp"
android:src="@mipmap/ic_launcher"
android:contentDescription="@null"
android:layout_gravity="center" />
</androidx.cardview.widget.CardView>
<TextView
android:id="@+id/tv_registration_order"
style="@style/MineText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/mine_registration_order"
android:layout_marginTop="6dp"
android:textSize="10sp"
android:textColor="#6B7280"
android:gravity="center" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
<TextView
android:id="@+id/tv_section_devices_repair"
style="@style/MineText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/mine_devices_repair"
android:layout_marginStart="22dp"
android:layout_marginTop="14dp"
android:layout_marginBottom="16dp"
android:textColor="#9AA0A6"
android:textSize="11sp" />
<androidx.cardview.widget.CardView
android:id="@+id/cv_mine_devices"
style="@style/MineCard">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingHorizontal="16dp"
android:paddingVertical="4dp">
<LinearLayout
android:id="@+id/ll_mine_devices"
style="@style/MineRow">
<TextView
android:id="@+id/tv_devices"
style="@style/MineText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/mine_devices"
android:layout_weight="1" />
<TextView
android:id="@+id/tv_devices_status"
style="@style/MineMuted"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp" />
<ImageView
android:id="@+id/iv_devices_arrow"
android:layout_width="12dp"
android:layout_height="12dp"
android:src="@mipmap/ic_launcher"
android:contentDescription="@null"
android:layout_marginStart="12dp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#ECEEF2" />
<LinearLayout
android:id="@+id/ll_mine_repairs"
style="@style/MineRow">
<TextView
android:id="@+id/tv_repairs"
style="@style/MineText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/mine_repairs"
android:layout_weight="1" />
<TextView
android:id="@+id/tv_repairs_status"
style="@style/MineMuted"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp" />
<ImageView
android:id="@+id/iv_repairs_arrow"
android:layout_width="12dp"
android:layout_height="12dp"
android:src="@mipmap/ic_launcher"
android:contentDescription="@null"
android:layout_marginStart="12dp" />
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
<TextView
android:id="@+id/tv_section_community"
style="@style/MineText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/mine_community"
android:layout_marginStart="22dp"
android:layout_marginTop="14dp"
android:layout_marginBottom="16dp"
android:textColor="#9AA0A6"
android:textSize="11sp" />
<androidx.cardview.widget.CardView
android:id="@+id/cv_mine_community"
style="@style/MineCard">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingHorizontal="16dp"
android:paddingVertical="4dp">
<LinearLayout
android:id="@+id/ll_mine_shares"
style="@style/MineRow">
<TextView
android:id="@+id/tv_shares"
style="@style/MineText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/mine_shares"
android:layout_weight="1" />
<ImageView
android:id="@+id/iv_shares_arrow"
android:layout_width="12dp"
android:layout_height="12dp"
android:src="@mipmap/ic_launcher"
android:contentDescription="@null"
android:layout_marginStart="12dp" />
</LinearLayout>
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="42dp"
android:scrollbars="none">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="42dp"
android:gravity="center_vertical">
<TextView
android:id="@+id/btn_shared_devices"
style="@style/MineText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/mine_shared_devices"
android:layout_marginEnd="8dp"
android:paddingHorizontal="10dp"
android:paddingVertical="6dp"
android:background="@drawable/mine_soft_pill_bg"
android:textColor="@color/device_home_orange"
android:textSize="11sp"
android:clickable="true"
android:focusable="true" />
<TextView
android:id="@+id/btn_team"
style="@style/MineText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/mine_team"
android:layout_marginEnd="8dp"
android:paddingHorizontal="10dp"
android:paddingVertical="6dp"
android:background="@drawable/mine_soft_pill_bg"
android:textColor="@color/device_home_orange"
android:textSize="11sp"
android:clickable="true"
android:focusable="true" />
<TextView
android:id="@+id/btn_promo"
style="@style/MineText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/mine_promo"
android:layout_marginEnd="8dp"
android:paddingHorizontal="10dp"
android:paddingVertical="6dp"
android:background="@drawable/mine_soft_pill_bg"
android:textColor="@color/device_home_orange"
android:textSize="11sp"
android:clickable="true"
android:focusable="true" />
</LinearLayout>
</HorizontalScrollView>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#ECEEF2" />
<LinearLayout
android:id="@+id/ll_mine_recipes"
style="@style/MineRow">
<TextView
android:id="@+id/tv_recipes"
style="@style/MineText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/mine_recipes"
android:layout_weight="1" />
<ImageView
android:id="@+id/iv_recipes_arrow"
android:layout_width="12dp"
android:layout_height="12dp"
android:src="@mipmap/ic_launcher"
android:contentDescription="@null"
android:layout_marginStart="12dp" />
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
<TextView
android:id="@+id/tv_section_mall"
style="@style/MineText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/mine_mall"
android:layout_marginStart="22dp"
android:layout_marginTop="14dp"
android:layout_marginBottom="16dp"
android:textColor="#9AA0A6"
android:textSize="11sp" />
<androidx.cardview.widget.CardView
android:id="@+id/cv_mine_mall"
style="@style/MineCard">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingHorizontal="16dp"
android:paddingVertical="4dp">
<LinearLayout
android:id="@+id/ll_mine_cart"
style="@style/MineRow">
<TextView
android:id="@+id/tv_cart"
style="@style/MineText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/mine_cart"
android:layout_weight="1" />
<ImageView
android:id="@+id/iv_cart_arrow"
android:layout_width="12dp"
android:layout_height="12dp"
android:src="@mipmap/ic_launcher"
android:contentDescription="@null"
android:layout_marginStart="12dp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#ECEEF2" />
<LinearLayout
android:id="@+id/ll_mine_orders"
style="@style/MineRow">
<TextView
android:id="@+id/tv_orders"
style="@style/MineText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/mine_orders"
android:layout_weight="1" />
<ImageView
android:id="@+id/iv_orders_arrow"
android:layout_width="12dp"
android:layout_height="12dp"
android:src="@mipmap/ic_launcher"
android:contentDescription="@null"
android:layout_marginStart="12dp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#ECEEF2" />
<LinearLayout
android:id="@+id/ll_mine_reviews"
style="@style/MineRow">
<TextView
android:id="@+id/tv_reviews"
style="@style/MineText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/mine_reviews"
android:layout_weight="1" />
<ImageView
android:id="@+id/iv_reviews_arrow"
android:layout_width="12dp"
android:layout_height="12dp"
android:src="@mipmap/ic_launcher"
android:contentDescription="@null"
android:layout_marginStart="12dp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#ECEEF2" />
<LinearLayout
android:id="@+id/ll_mine_refunds"
style="@style/MineRow">
<TextView
android:id="@+id/tv_refunds"
style="@style/MineText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/mine_refunds"
android:layout_weight="1" />
<ImageView
android:id="@+id/iv_refunds_arrow"
android:layout_width="12dp"
android:layout_height="12dp"
android:src="@mipmap/ic_launcher"
android:contentDescription="@null"
android:layout_marginStart="12dp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#ECEEF2" />
<LinearLayout
android:id="@+id/ll_mine_addresses"
style="@style/MineRow">
<TextView
android:id="@+id/tv_addresses"
style="@style/MineText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/mine_addresses"
android:layout_weight="1" />
<ImageView
android:id="@+id/iv_addresses_arrow"
android:layout_width="12dp"
android:layout_height="12dp"
android:src="@mipmap/ic_launcher"
android:contentDescription="@null"
android:layout_marginStart="12dp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#ECEEF2" />
<LinearLayout
android:id="@+id/ll_mine_coupons"
style="@style/MineRow">
<TextView
android:id="@+id/tv_coupons"
style="@style/MineText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/mine_coupons"
android:layout_weight="1" />
<ImageView
android:id="@+id/iv_coupons_arrow"
android:layout_width="12dp"
android:layout_height="12dp"
android:src="@mipmap/ic_launcher"
android:contentDescription="@null"
android:layout_marginStart="12dp" />
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
<TextView
android:id="@+id/tv_section_help"
style="@style/MineText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/mine_help"
android:layout_marginStart="22dp"
android:layout_marginTop="14dp"
android:layout_marginBottom="16dp"
android:textColor="#9AA0A6"
android:textSize="11sp" />
<androidx.cardview.widget.CardView
android:id="@+id/cv_mine_help"
style="@style/MineCard">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingHorizontal="16dp"
android:paddingVertical="4dp">
<LinearLayout
android:id="@+id/ll_mine_about"
style="@style/MineRow">
<TextView
android:id="@+id/tv_about"
style="@style/MineText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/mine_about"
android:layout_weight="1" />
<ImageView
android:id="@+id/iv_about_arrow"
android:layout_width="12dp"
android:layout_height="12dp"
android:src="@mipmap/ic_launcher"
android:contentDescription="@null"
android:layout_marginStart="12dp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#ECEEF2" />
<LinearLayout
android:id="@+id/ll_mine_service"
style="@style/MineRow">
<TextView
android:id="@+id/tv_service"
style="@style/MineText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/mine_service"
android:layout_weight="1" />
<ImageView
android:id="@+id/iv_service_arrow"
android:layout_width="12dp"
android:layout_height="12dp"
android:src="@mipmap/ic_launcher"
android:contentDescription="@null"
android:layout_marginStart="12dp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#ECEEF2" />
<LinearLayout
android:id="@+id/ll_mine_agreement"
style="@style/MineRow">
<TextView
android:id="@+id/tv_agreement"
style="@style/MineText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/mine_agreement"
android:layout_weight="1" />
<ImageView
android:id="@+id/iv_agreement_arrow"
android:layout_width="12dp"
android:layout_height="12dp"
android:src="@mipmap/ic_launcher"
android:contentDescription="@null"
android:layout_marginStart="12dp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#ECEEF2" />
<LinearLayout
android:id="@+id/ll_mine_privacy"
style="@style/MineRow">
<TextView
android:id="@+id/tv_privacy"
style="@style/MineText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/mine_privacy"
android:layout_weight="1" />
<ImageView
android:id="@+id/iv_privacy_arrow"
android:layout_width="12dp"
android:layout_height="12dp"
android:src="@mipmap/ic_launcher"
android:contentDescription="@null"
android:layout_marginStart="12dp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#ECEEF2" />
<LinearLayout
android:id="@+id/ll_mine_manual"
style="@style/MineRow">
<TextView
android:id="@+id/tv_manual"
style="@style/MineText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/mine_manual"
android:layout_weight="1" />
<ImageView
android:id="@+id/iv_manual_arrow"
android:layout_width="12dp"
android:layout_height="12dp"
android:src="@mipmap/ic_launcher"
android:contentDescription="@null"
android:layout_marginStart="12dp" />
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
<TextView
android:id="@+id/btn_mine_logout"
style="@style/MineText"
android:layout_width="match_parent"
android:layout_height="50dp"
android:text="@string/mine_logout"
android:layout_marginHorizontal="28dp"
android:layout_marginTop="14dp"
android:gravity="center"
android:background="@drawable/mine_logout_bg"
android:textColor="@color/device_home_orange"
android:textSize="16sp"
android:clickable="true"
android:focusable="true" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>

View File

@@ -1,58 +0,0 @@
<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">
<RelativeLayout
android:id="@+id/rl_title"
android:layout_width="match_parent"
android:layout_height="48dp">
<include
android:id="@+id/included_title"
layout="@layout/include_activity_back_layout" />
</RelativeLayout>
<!-- 使用 FrameLayout 来叠加 -->
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="@dimen/dp_42"
android:layout_marginHorizontal="@dimen/dp_13"
android:layout_marginTop="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
app:cardBackgroundColor="@android:color/white"
app:cardCornerRadius="10dp"
app:cardElevation="4dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_paipan"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:background="@drawable/tab_selector_bg"
android:textSize="15sp"
android:textColor="@drawable/tab_selector_text"
android:text="排盘"/>
<TextView
android:id="@+id/tv_jilu"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:background="@drawable/tab_selector_bg"
android:textSize="15sp"
android:textColor="@drawable/tab_selector_text"
android:text="记录"/>
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/viewpage"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
</LinearLayout>

View File

@@ -1,709 +0,0 @@
<?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:background="@color/white"
android:orientation="vertical">
<!-- 标题栏 -->
<RelativeLayout
android:id="@+id/rl_title"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="@color/white">
<include
android:id="@+id/included_title"
layout="@layout/include_activity_back_layout" />
</RelativeLayout>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:paddingTop="@dimen/dp_12">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingHorizontal="@dimen/dp_10">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/dp_5"
android:layout_marginTop="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_8"
app:cardCornerRadius="16dp"
app:cardElevation="4dp">
<!-- 推荐奖励机制卡片 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_15"
android:orientation="vertical"
android:padding="@dimen/dp_15">
<!-- 标题 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_15"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="@dimen/dp_26"
android:layout_height="@dimen/dp_26"
android:src="@mipmap/icon_tj_jlts" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_8"
android:text="推荐奖励机制"
android:textColor="@color/color_zhu"
android:textSize="18sp"
android:textStyle="bold" />
</LinearLayout>
<!-- 步骤1:分享邀请码 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_12"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="@dimen/dp_16"
android:layout_height="@dimen/dp_16"
android:background="@drawable/shape_blue_circle"
android:gravity="center"
android:textStyle="bold"
android:text="1"
android:textColor="@color/white"
android:textSize="12sp" />
<ImageView
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_20"
android:layout_marginLeft="@dimen/dp_10"
android:src="@mipmap/icon_tj_share" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_8"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="分享邀请码"
android:textColor="@color/color_zhu"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="将您的专属邀请码分享给好友"
android:textColor="@color/color_666666"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
<!-- 步骤2:好友注册 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_12"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="@dimen/dp_16"
android:layout_height="@dimen/dp_16"
android:background="@drawable/shape_green_circle"
android:gravity="center"
android:textStyle="bold"
android:text="2"
android:textColor="@color/white"
android:textSize="12sp" />
<ImageView
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_20"
android:layout_marginLeft="@dimen/dp_10"
android:src="@mipmap/icon_tj_register" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_8"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="好友注册"
android:textColor="@color/color_zhu"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="好友使用邀请码注册并下载应用"
android:textColor="@color/color_666666"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
<!-- 步骤3:开通会员 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_15"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="@dimen/dp_16"
android:layout_height="@dimen/dp_16"
android:background="@drawable/shape_yellow_circle"
android:gravity="center"
android:textStyle="bold"
android:text="3"
android:textColor="@color/white"
android:textSize="12sp" />
<ImageView
android:layout_width="@dimen/dp_16"
android:layout_height="@dimen/dp_16"
android:layout_marginLeft="@dimen/dp_10"
android:src="@mipmap/icon_tj_vip" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_8"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="开通会员"
android:textColor="@color/color_zhu"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="好友开通会员,您获得7天会员奖励"
android:textColor="@color/color_666666"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
<!-- 提示信息 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingHorizontal="@dimen/dp_10"
android:paddingVertical="@dimen/dp_8">
<ImageView
android:layout_width="@dimen/dp_14"
android:layout_height="@dimen/dp_14"
android:src="@mipmap/icon_tj_tips" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_8"
android:text="无限制推荐,每成功一人即可获得7天会员"
android:textColor="@color/color_666666"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/dp_5"
android:layout_marginTop="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_8"
app:cardCornerRadius="16dp"
app:cardElevation="4dp">
<!-- 我的邀请码卡片 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_15"
android:orientation="vertical"
android:padding="@dimen/dp_15">
<!-- 标题 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_15"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="@dimen/dp_26"
android:layout_height="@dimen/dp_26"
android:src="@mipmap/icon_tj_yqm" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_8"
android:text="我的邀请码"
android:textColor="@color/color_zhu"
android:textSize="18sp"
android:textStyle="bold" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_10"
android:text="专属邀请码"
android:textColor="@color/color_666666"
android:textSize="12sp" />
<!-- 邀请码和复制按钮 -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_invite_code"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:textColor="@color/color_zhu"
android:textSize="22sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:orientation="horizontal">
<TextView
android:id="@+id/btn_copy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingHorizontal="@dimen/dp_12"
android:paddingVertical="@dimen/dp_8"
android:text="复制"
android:textColor="@color/color_zhu"
android:textSize="12sp"
android:background="@drawable/shape_tj_copy_bg"
android:drawablePadding="@dimen/dp_5"/>
<TextView
android:id="@+id/btn_share"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingHorizontal="@dimen/dp_12"
android:paddingVertical="@dimen/dp_8"
android:layout_marginLeft="@dimen/dp_8"
android:text="生成海报"
android:textColor="@color/color_zhu"
android:textSize="12sp"
android:background="@drawable/shape_tj_copy_bg"
android:drawablePadding="@dimen/dp_5"/>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="@+id/card_input"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/dp_5"
android:layout_marginTop="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_8"
app:cardCornerRadius="16dp"
app:cardElevation="4dp"
android:visibility="gone">
<!-- 绑定邀请码卡片 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_15"
android:orientation="vertical"
android:padding="@dimen/dp_15">
<!-- 标题 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_15"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_20"
android:src="@mipmap/icon_tj_yqm"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_8"
android:text="绑定邀请码"
android:textColor="@color/color_zhu"
android:textSize="16sp"
android:textStyle="bold" />
</LinearLayout>
<!-- 输入框和绑定按钮 -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_40"
android:background="@drawable/shape_tj_input_bg">
<EditText
android:id="@+id/et_bind_code"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/btn_bind"
android:hint="请输入邀请码"
android:paddingHorizontal="@dimen/dp_12"
android:textColor="@color/color_333333"
android:textColorHint="@color/color_CCCCCC"
android:textSize="16sp"
android:textStyle="bold"
android:background="@null"
android:digits="0123456789abcdefghijklmnopqrstuvwxyz"
android:maxLength="10"/>
<TextView
android:id="@+id/btn_bind"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_10"
android:background="@drawable/shape_tj_copy_bg"
android:gravity="center"
android:paddingHorizontal="@dimen/dp_15"
android:text="绑定"
android:textColor="@color/color_zhu"
android:textSize="12sp" />
</RelativeLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/dp_5"
android:layout_marginTop="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_8"
app:cardCornerRadius="16dp"
app:cardElevation="4dp">
<!-- 推荐统计卡片 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_15"
android:orientation="vertical"
android:padding="@dimen/dp_15">
<!-- 标题 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_15"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_20"
android:src="@mipmap/icon_tj_tj" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_8"
android:text="推荐统计"
android:textColor="@color/color_zhu"
android:textSize="16sp"
android:textStyle="bold" />
</LinearLayout>
<!-- 统计数据 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<!-- 累计邀请 -->
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/shape_tj_ljyq_bg"
android:gravity="center"
android:orientation="vertical"
android:paddingVertical="@dimen/dp_15">
<ImageView
android:layout_width="@dimen/dp_24"
android:layout_height="@dimen/dp_24"
android:layout_marginBottom="@dimen/dp_5"
android:src="@mipmap/icon_tj_ljyq" />
<TextView
android:id="@+id/tv_total_invite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_2"
android:textColor="@color/color_zhu"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="累计邀请"
android:textColor="@color/color_666666"
android:textSize="12sp" />
</LinearLayout>
<!-- 成功转化 -->
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:layout_weight="1"
android:background="@drawable/shape_tj_cgzh_bg"
android:gravity="center"
android:orientation="vertical"
android:paddingVertical="@dimen/dp_15">
<ImageView
android:layout_width="@dimen/dp_24"
android:layout_height="@dimen/dp_24"
android:layout_marginBottom="@dimen/dp_5"
android:src="@mipmap/icon_tj_cgzh" />
<TextView
android:id="@+id/tv_success_convert"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_2"
android:textColor="@color/color_zhu"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="成功转化"
android:textColor="@color/color_666666"
android:textSize="12sp" />
</LinearLayout>
<!-- 奖励天数 -->
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:layout_weight="1"
android:background="@drawable/shape_tj_jlts_bg"
android:gravity="center"
android:orientation="vertical"
android:paddingVertical="@dimen/dp_15">
<ImageView
android:layout_width="@dimen/dp_24"
android:layout_height="@dimen/dp_24"
android:layout_marginBottom="@dimen/dp_5"
android:src="@mipmap/icon_tj_jlts" />
<TextView
android:id="@+id/tv_reward_days"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_2"
android:textColor="@color/color_zhu"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="奖励天数"
android:textColor="@color/color_666666"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginBottom="@dimen/dp_30"
android:visibility="visible">
<androidx.cardview.widget.CardView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginHorizontal="@dimen/dp_8"
android:layout_marginTop="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_8"
app:cardCornerRadius="16dp"
app:cardElevation="4dp">
<!-- 底部按钮区域 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<!-- 邀请记录 -->
<LinearLayout
android:id="@+id/ll_invite_record"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/dp_8"
android:gravity="center"
android:orientation="vertical"
android:paddingVertical="@dimen/dp_15">
<ImageView
android:layout_width="@dimen/dp_24"
android:layout_height="@dimen/dp_24"
android:layout_marginBottom="@dimen/dp_8"
android:src="@mipmap/icon_tj_yqjl" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_2"
android:text="邀请记录"
android:textColor="@color/color_zhu"
android:textSize="14sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="查看详情"
android:textColor="@color/color_1D90FF"
android:textSize="12sp" />
<ImageView
android:layout_width="@dimen/dp_6"
android:layout_height="@dimen/dp_11"
android:layout_marginLeft="@dimen/dp_2"
android:src="@mipmap/icon_tj_blue_jt" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginHorizontal="@dimen/dp_8"
android:layout_marginTop="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_8"
app:cardCornerRadius="16dp"
app:cardElevation="4dp">
<!-- 底部按钮区域 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<!-- 奖励记录 -->
<LinearLayout
android:id="@+id/ll_reward_record"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_8"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical"
android:paddingVertical="@dimen/dp_15">
<ImageView
android:layout_width="@dimen/dp_24"
android:layout_height="@dimen/dp_24"
android:layout_marginBottom="@dimen/dp_8"
android:src="@mipmap/icon_tj_jljl" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_2"
android:text="奖励记录"
android:textColor="@color/color_zhu"
android:textSize="14sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="查看详情"
android:textColor="@color/color_E6BF00"
android:textSize="12sp" />
<ImageView
android:layout_width="@dimen/dp_6"
android:layout_height="@dimen/dp_11"
android:layout_marginLeft="@dimen/dp_2"
android:src="@mipmap/icon_tj_yellow_jt" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>

View File

@@ -1,135 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<RelativeLayout
android:id="@+id/rl_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white">
<include
android:id="@+id/include_title"
layout="@layout/include_activity_back_layout"/>
</RelativeLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:textSize="14sp"
android:textColor="@color/gray_d4"
android:text="注销后无法恢复,请谨慎操作"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="@dimen/dp_12">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:textSize="13sp"
android:textColor="@color/gray_d4"
android:text="当前手机号"/>
<TextView
android:id="@+id/tv_user_phone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_30"
android:layout_marginTop="@dimen/dp_15"
android:textSize="18sp"
android:textColor="@color/color_333333"
android:text=""/>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dp_0_5"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_15"
android:background="@color/color_gray2"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="@dimen/dp_10">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:textSize="13sp"
android:textColor="@color/gray_d4"
android:text="验证码"/>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_30"
android:layout_marginRight="@dimen/dp_30"
android:layout_marginTop="@dimen/dp_15">
<ImageView
android:id="@+id/img_verifi"
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_20"
android:src="@mipmap/icon_verification_code"
android:layout_centerVertical="true"/>
<EditText
android:id="@+id/ed_ver_code"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_36"
android:layout_toRightOf="@+id/img_verifi"
android:layout_toLeftOf="@+id/tv_get_code"
android:layout_centerVertical="true"
android:background="@null"
android:textColor="@color/color_333333"
android:textSize="15sp"
android:hint="请输入验证码"
android:layout_marginLeft="@dimen/dp_15"
android:inputType="number"
android:maxLength="6"
android:digits="1234567890"/>
<TextView
android:id="@+id/tv_get_code"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/dp_15"
android:paddingRight="@dimen/dp_15"
android:paddingTop="@dimen/dp_8"
android:paddingBottom="@dimen/dp_8"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:textSize="13sp"
android:textColor="@color/white"
android:text="发送验证码"
android:background="@drawable/shape_blue_radius8"/>
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dp_0_5"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_15"
android:background="@color/color_gray2"/>
</LinearLayout>
<TextView
android:id="@+id/tv_commit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textColor="@color/white"
android:text="提交"
android:gravity="center"
android:paddingTop="@dimen/dp_12"
android:paddingBottom="@dimen/dp_12"
android:layout_marginTop="@dimen/dp_20"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_20"
android:background="@drawable/shape_blue_radius8"/>
</LinearLayout>

View File

@@ -1,677 +0,0 @@
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<!-- 标题栏 -->
<RelativeLayout
android:id="@+id/rl_title"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="@color/white">
<include
android:id="@+id/included_title"
layout="@layout/include_activity_back_layout" />
</RelativeLayout>
<!-- 协议内容区域 -->
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:fillViewport="true"
android:paddingHorizontal="@dimen/dp_16"
android:paddingTop="@dimen/dp_12"
android:paddingBottom="@dimen/dp_16">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
tools:ignore="ExtraText">
<!-- 协议主标题 -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="《星语明灯》会员服务协议"
android:textSize="22sp"
android:textStyle="bold"
android:textColor="@color/black"
android:gravity="center"
android:layout_marginBottom="@dimen/dp_24"
android:lineSpacingExtra="6dp" />
<!-- 重要提示内容 -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="尊敬的用户,欢迎您使用《星语明灯》(以下简称“本平台”或“我们”)提供的会员服务。在您开通或使用会员服务之前,请您务必审慎阅读、充分理解本协议各条款内容,特别是以加粗形式提示的关于免除或限制责任的条款、法律适用和争议解决条款。 除非您已阅读并接受本协议所有条款,否则您无权开通或使用会员服务。您通过页面点击同意、开通、使用等行为,即视为您已充分阅读、理解并接受本协议的全部内容,并同意遵守本协议及相关规则。"
android:textSize="15sp"
android:textColor="#333333"
android:lineSpacingExtra="6dp"
android:layout_marginBottom="@dimen/dp_20"
android:background="#FFF3E0"
android:padding="@dimen/dp_12" />
<!-- 第一条 -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="第一条 协议订立与生效"
android:textSize="17sp"
android:textStyle="bold"
android:textColor="@color/black"
android:layout_marginTop="@dimen/dp_16"
android:layout_marginBottom="@dimen/dp_12"
android:lineSpacingExtra="4dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="1.1 本协议是用户(以下简称“您”或“会员”)与本平台之间关于使用会员服务所订立的协议。"
android:textSize="15sp"
android:textColor="@color/black"
android:lineSpacingExtra="6dp"
android:layout_marginBottom="@dimen/dp_8" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="1.2 本协议内容同时包括本平台的《用户协议》、《隐私政策》以及本平台已经发布或将来可能发布的与会员服务相关的各项规则、通知、公告等(统称会员规则)。所有会员规则为本协议不可分割的组成部分,与本协议具有同等法律效力。"
android:textSize="15sp"
android:textColor="@color/black"
android:lineSpacingExtra="6dp"
android:layout_marginBottom="@dimen/dp_8" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="1.3 您承诺在开通会员服务时已年满18周岁,或已获得法定监护人的同意,并具备完全民事行为能力。"
android:textSize="15sp"
android:textColor="@color/black"
android:lineSpacingExtra="6dp"
android:layout_marginBottom="@dimen/dp_20" />
<!-- 第二条 -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="第二条 会员服务定义"
android:textSize="17sp"
android:textStyle="bold"
android:textColor="@color/black"
android:layout_marginBottom="@dimen/dp_12"
android:lineSpacingExtra="4dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="2.1 本协议所指的“会员服务”(或“VIP服务”),是指您通过支付一定费用后,享有的由本平台提供的增值服务,具体服务内容以本平台实际提供为准。"
android:textSize="15sp"
android:textColor="@color/black"
android:lineSpacingExtra="6dp"
android:layout_marginBottom="@dimen/dp_20" />
<!-- 第三条 -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="第三条 会员服务内容"
android:textSize="17sp"
android:textStyle="bold"
android:textColor="@color/black"
android:layout_marginBottom="@dimen/dp_12"
android:lineSpacingExtra="4dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="本平台为您提供以下会员专属服务:"
android:textSize="15sp"
android:textColor="@color/black"
android:lineSpacingExtra="6dp"
android:layout_marginBottom="@dimen/dp_12" />
<!-- 3.1 无限次国学文化问答服务 -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="3.1 无限次国学文化问答服务"
android:textSize="16sp"
android:textStyle="bold"
android:textColor="#1976D2"
android:layout_marginBottom="@dimen/dp_8"
android:lineSpacingExtra="4dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="• a) 服务范围:会员在服务有效期内,可每天不限次数地向本平台的智能文化系统提出关于国学、传统文化、人生规划等方面的咨询问题,系统将基于传统智慧典籍为您提供多元的视角参考。"
android:textSize="14sp"
android:textColor="@color/black"
android:lineSpacingExtra="5dp"
android:layout_marginBottom="@dimen/dp_6"
android:paddingStart="@dimen/dp_12" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="• b) 服务形式:服务以人工智能生成的文本、图表等形式提供,结果为基于您输入的信息和算法模型对传统文化知识的计算与解读,并非由人工专家一对一提供。"
android:textSize="14sp"
android:textColor="@color/black"
android:lineSpacingExtra="5dp"
android:layout_marginBottom="@dimen/dp_6"
android:paddingStart="@dimen/dp_12" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="• c) 服务限制:本平台有权对恶意、违法、违背公序良俗、或通过自动化脚本等异常方式进行的问题提问进行拦截、限制或封禁,且无需另行通知。"
android:textSize="14sp"
android:textColor="@color/black"
android:lineSpacingExtra="5dp"
android:layout_marginBottom="@dimen/dp_16"
android:paddingStart="@dimen/dp_12" />
<!-- 3.2 每日文化运势解读服务 -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="3.2 每日文化运势解读服务"
android:textSize="16sp"
android:textStyle="bold"
android:textColor="#1976D2"
android:layout_marginBottom="@dimen/dp_8"
android:lineSpacingExtra="4dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="• a) 服务内容:会员可每日生成基于传统文化理论(如节气、星座、生肖等) 的个性化文化运势解读。解读内容可能涵盖综合展望、人际交往、事业规划、财富观念、身心健康等维度的启发式建议。"
android:textSize="14sp"
android:textColor="@color/black"
android:lineSpacingExtra="5dp"
android:layout_marginBottom="@dimen/dp_6"
android:paddingStart="@dimen/dp_12" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="• b) 生成机制:每日运势解读由系统算法根据固定的基础参数(如您提供的个人信息)结合动态变量(如日期、通用文化模型)自动生成,其内容源于传统文化,结果具有通用性和娱乐性。"
android:textSize="14sp"
android:textColor="@color/black"
android:lineSpacingExtra="5dp"
android:layout_marginBottom="@dimen/dp_6"
android:paddingStart="@dimen/dp_12" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="• c) 服务时效:每日运势解读内容仅限当日生成和查看,不支持查看历史日期的内容。"
android:textSize="14sp"
android:textColor="@color/black"
android:lineSpacingExtra="5dp"
android:layout_marginBottom="@dimen/dp_16"
android:paddingStart="@dimen/dp_12" />
<!-- 3.3 其他服务 -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="3.3 其他服务"
android:textSize="16sp"
android:textStyle="bold"
android:textColor="#1976D2"
android:layout_marginBottom="@dimen/dp_8"
android:lineSpacingExtra="4dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="• 本平台可能不定期为会员提供其他专属特权或优惠,具体以App内实际公示为准。"
android:textSize="14sp"
android:textColor="@color/black"
android:lineSpacingExtra="5dp"
android:layout_marginBottom="@dimen/dp_20"
android:paddingStart="@dimen/dp_12" />
<!-- 第四条 -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="第四条 服务性质与免责声明"
android:textSize="17sp"
android:textStyle="bold"
android:textColor="@color/black"
android:layout_marginBottom="@dimen/dp_12"
android:lineSpacingExtra="4dp" />
<!-- 特别重要声明 -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="4.1 【特别重要】服务性质声明"
android:textSize="16sp"
android:textStyle="bold"
android:textColor="#D32F2F"
android:layout_marginBottom="@dimen/dp_8"
android:lineSpacingExtra="4dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="• 本平台提供的所有问答及运势解读服务,均属于文化娱乐和内容参考范畴,是基于国学、传统文化理论和人工智能算法的计算与解读结果,仅供您参考、娱乐和自我启发之用。"
android:textSize="14sp"
android:textColor="#D32F2F"
android:lineSpacingExtra="5dp"
android:layout_marginBottom="@dimen/dp_8"
android:paddingStart="@dimen/dp_12"
android:background="#FFEBEE"
android:padding="@dimen/dp_8" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="• 您完全知晓并同意,上述服务内容并非科学的精准预测,更不构成任何形式的专业建议(如医学、金融、法律建议)。我们明确否认其具有任何程度的确定性、有效性和可靠性。"
android:textSize="14sp"
android:textColor="#D32F2F"
android:lineSpacingExtra="5dp"
android:layout_marginBottom="@dimen/dp_16"
android:paddingStart="@dimen/dp_12"
android:background="#FFEBEE"
android:padding="@dimen/dp_8" />
<!-- 免责条款 -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="4.2 免责条款"
android:textSize="16sp"
android:textStyle="bold"
android:textColor="#D32F2F"
android:layout_marginBottom="@dimen/dp_8"
android:lineSpacingExtra="4dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="• 您应理性对待服务内容,将其视为一种文化娱乐和休闲方式,不得将其作为做出任何涉及人身、财产、重大决策的唯一或主要依据。 因依赖本服务内容而做出的任何决定或采取的任何行动所导致的任何性质的直接、间接、附带或后果性损失或损害,本平台不承担任何责任。"
android:textSize="14sp"
android:textColor="@color/black"
android:lineSpacingExtra="5dp"
android:layout_marginBottom="@dimen/dp_8"
android:paddingStart="@dimen/dp_12" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="• 本平台的服务结果不应被视为对未来事件的承诺或保证。\n• 您应保持积极健康的生活心态,独立思考。"
android:textSize="14sp"
android:textColor="@color/black"
android:lineSpacingExtra="5dp"
android:layout_marginBottom="@dimen/dp_20"
android:paddingStart="@dimen/dp_12" />
<!-- 第五条 -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="第五条 会员账号与使用规范"
android:textSize="17sp"
android:textStyle="bold"
android:textColor="@color/black"
android:layout_marginBottom="@dimen/dp_12"
android:lineSpacingExtra="4dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="5.1 会员服务仅限您本人使用,不得以转让、出租、出借、分享等任何形式提供给任何第三方使用。"
android:textSize="15sp"
android:textColor="@color/black"
android:lineSpacingExtra="6dp"
android:layout_marginBottom="@dimen/dp_8" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="5.2 您应妥善保管账号及密码,并对使用该账号进行的所有活动承担责任。如发现账号被盗用或异常,应立即通知本平台。"
android:textSize="15sp"
android:textColor="@color/black"
android:lineSpacingExtra="6dp"
android:layout_marginBottom="@dimen/dp_8" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="5.3 您在使用会员服务时,必须遵守法律法规,不得利用服务从事违法违规活动,包括但不限于:"
android:textSize="15sp"
android:textColor="@color/black"
android:lineSpacingExtra="6dp"
android:layout_marginBottom="@dimen/dp_8" />
<!-- 违法行为列表 -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="• a) 违反宪法或法律法规规定的;\n• b) 危害国家安全,泄露国家秘密,颠覆国家政权,破坏国家统一的;\n• c) 损害国家荣誉和利益的;\n• d) 煽动民族仇恨、民族歧视,破坏民族团结的;\n• e) 破坏国家宗教政策,宣扬邪教和封建迷信的;\n• f) 散布谣言,扰乱社会秩序,破坏社会稳定的;\n• g) 散布淫秽、色情、赌博、暴力、凶杀、恐怖或者教唆犯罪的;\n• h) 侮辱或者诽谤他人,侵害他人合法权益的;\n• i) 含有法律、行政法规禁止的其他内容的行为。"
android:textSize="14sp"
android:textColor="#666666"
android:lineSpacingExtra="5dp"
android:layout_marginBottom="@dimen/dp_20"
android:paddingStart="@dimen/dp_12" />
<!-- 第六条 -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="第六条 费用与支付"
android:textSize="17sp"
android:textStyle="bold"
android:textColor="@color/black"
android:layout_marginBottom="@dimen/dp_12"
android:lineSpacingExtra="4dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="6.1 您需要按照本平台公示的收费标准支付相应费用后,方可享受会员服务。我们可能会根据运营需要调整收费标准,调整后的费用将在App内公示,但不影响您已购买的会员服务。"
android:textSize="15sp"
android:textColor="@color/black"
android:lineSpacingExtra="6dp"
android:layout_marginBottom="@dimen/dp_8" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="6.2 支付方式通过您选择的第三方支付平台(如Apple App Store, Google Play, 支付宝、微信支付等)完成,支付过程受该第三方平台的条款约束。"
android:textSize="15sp"
android:textColor="@color/black"
android:lineSpacingExtra="6dp"
android:layout_marginBottom="@dimen/dp_8" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="6.3 本平台目前提供多种订阅周期(如周会员、月度、季度、年度等),请您在支付前仔细确认所选周期和金额。"
android:textSize="15sp"
android:textColor="@color/black"
android:lineSpacingExtra="6dp"
android:layout_marginBottom="@dimen/dp_20" />
<!-- 第七条 -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="第七条 服务的变更、中断或终止"
android:textSize="17sp"
android:textStyle="bold"
android:textColor="@color/black"
android:layout_marginBottom="@dimen/dp_12"
android:lineSpacingExtra="4dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="7.1 鉴于网络服务的特殊性,本平台有权根据需要不时地对服务内容、服务功能、提供服务所需的技术等进行变更、中断或终止,并将尽可能事先进行通知。"
android:textSize="15sp"
android:textColor="@color/black"
android:lineSpacingExtra="6dp"
android:layout_marginBottom="@dimen/dp_8" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="7.2 如因不可抗力(如病毒、黑客攻击、系统不稳定、政府行为等)导致会员服务中断,本平台不承担责任,但将尽力减少因此而给您带来的损失和影响。"
android:textSize="15sp"
android:textColor="@color/black"
android:lineSpacingExtra="6dp"
android:layout_marginBottom="@dimen/dp_20" />
<!-- 第八条 -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="第八条 有效期与终止"
android:textSize="17sp"
android:textStyle="bold"
android:textColor="@color/black"
android:layout_marginBottom="@dimen/dp_12"
android:lineSpacingExtra="4dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="8.1 会员服务有效期自您支付成功之日起计算,至您选择的订阅周期届满之日止。服务期满后,会员身份及相应特权将自动终止。"
android:textSize="15sp"
android:textColor="@color/black"
android:lineSpacingExtra="6dp"
android:layout_marginBottom="@dimen/dp_8" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="8.2 您需要手动进行续费订购以继续享受会员服务。"
android:textSize="15sp"
android:textColor="@color/black"
android:lineSpacingExtra="6dp"
android:layout_marginBottom="@dimen/dp_20" />
<!-- 第九条 -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="第九条 退订与退款政策"
android:textSize="17sp"
android:textStyle="bold"
android:textColor="@color/black"
android:layout_marginBottom="@dimen/dp_12"
android:lineSpacingExtra="4dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="9.1 【适用法规】 本平台的虚拟数字商品和服务,一经购买成功,原则上不予退款。请您在购买前慎重考虑。"
android:textSize="15sp"
android:textColor="#D32F2F"
android:textStyle="bold"
android:lineSpacingExtra="6dp"
android:layout_marginBottom="@dimen/dp_8" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="9.2 除非相关法律法规另有强制性规定,出现以下情况,我们无法为您办理退款:"
android:textSize="15sp"
android:textColor="@color/black"
android:lineSpacingExtra="6dp"
android:layout_marginBottom="@dimen/dp_8" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="• a) 您已成功使用部分会员服务(如已进行问答或生成运势解读);\n• b) 您因个人原因(如感觉内容不符合预期、不再需要该服务、误购等)要求退款;\n• c) 因可归责于您的原因(如违反使用规范)导致账号被封禁,剩余会员时长将不予退还。"
android:textSize="14sp"
android:textColor="@color/black"
android:lineSpacingExtra="5dp"
android:layout_marginBottom="@dimen/dp_8"
android:paddingStart="@dimen/dp_12" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="9.3 如因本平台的原因(如技术故障导致服务完全不可用且无法修复),导致您无法正常使用会员服务的,您可以联系客服,我们将根据情况为您延长服务有效期或办理退款。"
android:textSize="15sp"
android:textColor="@color/black"
android:lineSpacingExtra="6dp"
android:layout_marginBottom="@dimen/dp_20" />
<!-- 第十条 -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="第十条 个人信息保护"
android:textSize="17sp"
android:textStyle="bold"
android:textColor="@color/black"
android:layout_marginBottom="@dimen/dp_12"
android:lineSpacingExtra="4dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="我们非常重视您的个人信息保护。关于我们如何收集、使用、存储和共享您的个人信息,请您详细阅读并同意我们单独的《隐私政策》。"
android:textSize="15sp"
android:textColor="@color/black"
android:lineSpacingExtra="6dp"
android:layout_marginBottom="@dimen/dp_20" />
<!-- 第十一条 -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="第十一条 协议修改"
android:textSize="17sp"
android:textStyle="bold"
android:textColor="@color/black"
android:layout_marginBottom="@dimen/dp_12"
android:lineSpacingExtra="4dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="本平台有权在必要时修改本协议条款。修改后的协议将在本平台上公布,并自公布之日起生效。若您不同意修改后的协议,您有权停止使用会员服务;如果您继续使用,则视为您已接受修改后的协议。"
android:textSize="15sp"
android:textColor="@color/black"
android:lineSpacingExtra="6dp"
android:layout_marginBottom="@dimen/dp_20" />
<!-- 第十二条 -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="第十二条 法律适用与争议解决"
android:textSize="17sp"
android:textStyle="bold"
android:textColor="@color/black"
android:layout_marginBottom="@dimen/dp_12"
android:lineSpacingExtra="4dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="12.1 本协议的订立、执行和解释及争议的解决均应适用中华人民共和国大陆地区法律。"
android:textSize="15sp"
android:textColor="@color/black"
android:lineSpacingExtra="6dp"
android:layout_marginBottom="@dimen/dp_8" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="12.2 因本协议引起的或与本协议有关的任何争议,双方应首先通过友好协商解决;协商不成的,任何一方均有权将争议提交至本平台运营主体所在地有管辖权的人民法院提起诉讼。"
android:textSize="15sp"
android:textColor="@color/black"
android:lineSpacingExtra="6dp"
android:layout_marginBottom="@dimen/dp_20" />
<!-- 第十三条 -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="第十三条 附则"
android:textSize="17sp"
android:textStyle="bold"
android:textColor="@color/black"
android:layout_marginBottom="@dimen/dp_12"
android:lineSpacingExtra="4dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="13.1 本协议所有条款的标题仅为阅读方便,本身并无实际含义,不能作为本协议含义解释的依据。"
android:textSize="15sp"
android:textColor="@color/black"
android:lineSpacingExtra="6dp"
android:layout_marginBottom="@dimen/dp_8" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="13.2 本协议未尽事宜,您需遵守本平台在App内或网站上公布的相关规则。"
android:textSize="15sp"
android:textColor="@color/black"
android:lineSpacingExtra="6dp"
android:layout_marginBottom="@dimen/dp_20" />
<!-- 再次提示 -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="再次提示:"
android:textSize="18sp"
android:textStyle="bold"
android:textColor="#D32F2F"
android:layout_marginTop="@dimen/dp_16"
android:layout_marginBottom="@dimen/dp_8"
android:lineSpacingExtra="4dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="本协议最终解释权归《星语明灯》运营方所有。请在开通前仔细阅读。"
android:textSize="15sp"
android:textColor="#D32F2F"
android:textStyle="bold"
android:lineSpacingExtra="6dp"
android:layout_marginBottom="@dimen/dp_20"
android:background="#FFEBEE"
android:padding="@dimen/dp_12" />
<!-- 公司信息 -->
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#E0E0E0"
android:layout_marginVertical="@dimen/dp_16" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="公司名称:济宁坤焱智垚信息技术服务有限公司"
android:textSize="14sp"
android:textColor="#666666"
android:lineSpacingExtra="4dp"
android:layout_marginBottom="@dimen/dp_6" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="联系邮箱:kunyanzhiyao@outlook.com"
android:textSize="14sp"
android:textColor="#666666"
android:lineSpacingExtra="4dp"
android:layout_marginBottom="@dimen/dp_6" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="最后更新日期:2025年9月1日"
android:textSize="14sp"
android:textColor="#666666"
android:lineSpacingExtra="4dp"
android:layout_marginBottom="@dimen/dp_32" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/navigation_plate"
<item android:id="@+id/navigation_device"
android:icon="@drawable/bottom_study_select"
android:title="排盘"/>
android:title="@string/device_tab_title"/>
<item
android:id="@+id/navigation_index"

View File

@@ -33,6 +33,8 @@
<string name="register_design_submit">Sign up</string>
<string name="register_design_has_account">Already have an account?</string>
<!-- Device home. Values are supplied by the device/account data. -->
<string name="device_tab_title">Devices</string>
<string name="device_home_empty_message">No devices added yet</string>
<string name="device_home_title">Chaselight\'s Home</string>
<string name="device_home_notifications">Notifications</string>
<string name="device_home_add_device">Add device</string>
@@ -45,4 +47,55 @@
<string name="device_home_online">Online</string>
<string name="device_home_offline">Offline</string>
<string name="device_home_sample_name">Kitchen Electric Pancake Maker</string>
<string name="mine_title">Personal Center</string>
<string name="mine_logout">Log Out</string>
<string name="mine_profile">My Profile</string>
<string name="mine_badge">Green Pioneer</string>
<string name="mine_default_name">User</string>
<string name="mine_contact_empty">No contact information</string>
<string name="mine_contact">%1$s · %2$s</string>
<string name="mine_credits">My Credits</string>
<string name="mine_points">%1$s Points</string>
<string name="mine_credits_hint">Total Credits Redemption Available</string>
<string name="mine_redeem_now">Redeem Now</string>
<string name="mine_credit_history">Credit History</string>
<string name="mine_redeem_credits">Redeem Credits</string>
<string name="mine_registration_order">Registration Order</string>
<string name="mine_devices_repair">Devices &amp; Repair</string>
<string name="mine_devices">My Devices</string>
<string name="mine_device_count">%1$d online</string>
<string name="mine_repairs">My Repair Requests</string>
<string name="mine_repair_count">%1$d in progress</string>
<string name="mine_community">Community &amp; Sharing</string>
<string name="mine_shares">My Shares</string>
<string name="mine_shared_devices">Shared Device(s)</string>
<string name="mine_team">My Team</string>
<string name="mine_promo">My Promo Code</string>
<string name="mine_recipes">My Recipes</string>
<string name="mine_mall">Mall Center</string>
<string name="mine_cart">Shopping Cart</string>
<string name="mine_orders">My Orders</string>
<string name="mine_reviews">My Reviews</string>
<string name="mine_refunds">Refunds/After-sales</string>
<string name="mine_addresses">Shipping Addresses</string>
<string name="mine_coupons">Coupons</string>
<string name="mine_help">Settings &amp; Help</string>
<string name="mine_about">About Us</string>
<string name="mine_service">Customer Service</string>
<string name="mine_agreement">User Agreement</string>
<string name="mine_privacy">Privacy Policy</string>
<string name="mine_manual">User Manual</string>
<string name="bl_device_title">Add Device</string>
<string name="bl_device_nearby">Nearby Devices</string>
<string name="bl_device_search_again">Search Again</string>
<string name="bl_device_signal_strong">Strong Signal</string>
<string name="bl_device_signal_medium">Medium Signal</string>
<string name="bl_device_signal_weak">Weak Signal</string>
<string name="food_title">Food</string>
<string name="food_category_breakfast">Breakfast</string>
<string name="food_category_main_dishes">Main Dishes</string>
<string name="food_category_drinks">Drinks</string>
<string name="food_category_snack">Snack</string>
<string name="food_recommend">Recommend</string>
<string name="food_see_all">See all ›</string>
</resources>

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="bl_device_signal_strong">#22A45D</color>
<color name="bl_device_signal_weak">#E5484D</color>
<style name="BlDeviceSignalStrong" parent="LoginDesignText">
<item name="android:textSize">11sp</item>
<item name="android:textColor">@color/bl_device_signal_strong</item>
<item name="android:background">@drawable/bl_device_signal_strong_bg</item>
</style>
<style name="BlDeviceSignalMedium" parent="BlDeviceSignalStrong">
<item name="android:textColor">@color/device_home_orange</item>
<item name="android:background">@drawable/mine_soft_pill_bg</item>
</style>
<style name="BlDeviceSignalWeak" parent="BlDeviceSignalStrong">
<item name="android:textColor">@color/bl_device_signal_weak</item>
<item name="android:background">@drawable/bl_device_signal_weak_bg</item>
</style>
</resources>

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style
name="FoodTitle"
parent="LoginDesignText">
<item
name="android:textColor">#252529</item>
<item
name="android:textSize">17sp</item>
<item
name="android:textStyle">bold</item>
</style>
<style
name="FoodItemName"
parent="LoginDesignText">
<item
name="android:textColor">#292929</item>
<item
name="android:textSize">12sp</item>
</style>
<style
name="FoodSeeAll"
parent="LoginDesignText">
<item
name="android:textColor">@color/device_home_orange</item>
<item
name="android:textSize">12sp</item>
<item
name="android:gravity">center</item>
<item
name="android:clickable">true</item>
<item
name="android:focusable">true</item>
<item
name="android:background">?attr/selectableItemBackground</item>
</style>
</resources>

View File

@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style
name="MineText"
parent="LoginDesignText">
<item
name="android:textColor">#1F2329</item>
<item
name="android:textSize">14sp</item>
</style>
<style
name="MineMuted"
parent="MineText">
<item
name="android:textColor">#9AA0A6</item>
<item
name="android:textSize">12sp</item>
</style>
<style
name="MineCard">
<item
name="android:layout_width">match_parent</item>
<item
name="android:layout_height">wrap_content</item>
<item
name="android:layout_marginHorizontal">28dp</item>
<item
name="cardBackgroundColor">@android:color/white</item>
<item
name="cardCornerRadius">16dp</item>
<item
name="cardElevation">1dp</item>
<item
name="cardPreventCornerOverlap">false</item>
</style>
<style
name="MineRow">
<item
name="android:layout_width">match_parent</item>
<item
name="android:layout_height">46dp</item>
<item
name="android:orientation">horizontal</item>
<item
name="android:gravity">center_vertical</item>
<item
name="android:clickable">true</item>
<item
name="android:focusable">true</item>
<item
name="android:background">?attr/selectableItemBackground</item>
</style>
</resources>

View File

@@ -290,6 +290,8 @@
<string name="register_design_has_account">已有账号?</string>
<!-- 设备首页:统计值和设备数据由后续业务代码绑定。 -->
<string name="device_tab_title">设备</string>
<string name="device_home_empty_message">暂无设备</string>
<string name="device_home_title">我的家</string>
<string name="device_home_notifications">消息通知</string>
<string name="device_home_add_device">添加设备</string>
@@ -305,4 +307,55 @@
<string name="device_home_zero" translatable="false">0</string>
<string name="device_home_zero_charcoal" translatable="false">0 kg</string>
<string name="mine_title">个人中心</string>
<string name="mine_logout">退出登录</string>
<string name="mine_profile">我的资料</string>
<string name="mine_badge">绿色先锋</string>
<string name="mine_default_name">用户</string>
<string name="mine_contact_empty">暂无联系方式</string>
<string name="mine_contact">%1$s · %2$s</string>
<string name="mine_credits">我的积分</string>
<string name="mine_points">%1$s 积分</string>
<string name="mine_credits_hint">可用于积分兑换</string>
<string name="mine_redeem_now">立即兑换</string>
<string name="mine_credit_history">积分记录</string>
<string name="mine_redeem_credits">积分兑换</string>
<string name="mine_registration_order">积分订单</string>
<string name="mine_devices_repair">设备与维修</string>
<string name="mine_devices">我的设备</string>
<string name="mine_device_count">%1$d 台在线</string>
<string name="mine_repairs">我的报修</string>
<string name="mine_repair_count">%1$d 项处理中</string>
<string name="mine_community">社区与分享</string>
<string name="mine_shares">我的分享</string>
<string name="mine_shared_devices">共享设备</string>
<string name="mine_team">我的团队</string>
<string name="mine_promo">我的推广码</string>
<string name="mine_recipes">我的食谱</string>
<string name="mine_mall">商城中心</string>
<string name="mine_cart">购物车</string>
<string name="mine_orders">我的订单</string>
<string name="mine_reviews">我的评价</string>
<string name="mine_refunds">退款/售后</string>
<string name="mine_addresses">收货地址</string>
<string name="mine_coupons">优惠券</string>
<string name="mine_help">设置与帮助</string>
<string name="mine_about">关于我们</string>
<string name="mine_service">客服服务</string>
<string name="mine_agreement">用户协议</string>
<string name="mine_privacy">隐私政策</string>
<string name="mine_manual">用户手册</string>
<string name="bl_device_title">添加设备</string>
<string name="bl_device_nearby">附近的设备</string>
<string name="bl_device_search_again">重新搜索</string>
<string name="bl_device_signal_strong">信号强</string>
<string name="bl_device_signal_medium">信号中等</string>
<string name="bl_device_signal_weak">信号弱</string>
<string name="food_title">美食</string>
<string name="food_category_breakfast">早餐</string>
<string name="food_category_main_dishes">主食</string>
<string name="food_category_drinks">饮品</string>
<string name="food_category_snack">小吃</string>
<string name="food_recommend">推荐</string>
<string name="food_see_all">查看全部 ›</string>
</resources>