编辑资料
This commit is contained in:
parent
4f5085fc85
commit
1a36077fba
@ -158,6 +158,21 @@
|
|||||||
android:label="設定"
|
android:label="設定"
|
||||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".activity.user.EditProfileActivity"
|
||||||
|
android:label="编辑资料"
|
||||||
|
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".activity.user.EditNameActivity"
|
||||||
|
android:label="编辑名称"
|
||||||
|
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".activity.user.EditSignActivity"
|
||||||
|
android:label="编辑签名"
|
||||||
|
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||||
|
|
||||||
<provider
|
<provider
|
||||||
android:name="androidx.core.content.FileProvider"
|
android:name="androidx.core.content.FileProvider"
|
||||||
android:authorities="com.shayu.onetoone.fileprovider"
|
android:authorities="com.shayu.onetoone.fileprovider"
|
||||||
|
@ -0,0 +1,151 @@
|
|||||||
|
package com.shayu.onetoone.activity.setting;
|
||||||
|
|
||||||
|
import android.app.Dialog;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Handler;
|
||||||
|
|
||||||
|
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||||
|
import com.shayu.onetoone.R;
|
||||||
|
import com.shayu.onetoone.activity.login.EntryActivity;
|
||||||
|
import com.yunbao.common.CommonAppConfig;
|
||||||
|
import com.yunbao.common.Constants;
|
||||||
|
import com.yunbao.common.activity.AbsActivity;
|
||||||
|
import com.yunbao.common.bean.IMLoginModel;
|
||||||
|
import com.yunbao.common.http.CommonHttpConsts;
|
||||||
|
import com.yunbao.common.http.CommonHttpUtil;
|
||||||
|
import com.yunbao.common.manager.IMLoginManager;
|
||||||
|
import com.yunbao.common.utils.DialogUitl;
|
||||||
|
import com.yunbao.common.utils.GlideCatchUtil;
|
||||||
|
import com.yunbao.common.utils.RouteUtil;
|
||||||
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
import cn.rongcloud.rtc.api.RCRTCEngine;
|
||||||
|
import io.rong.imlib.RongIMClient;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by cxf on 2018/9/30.
|
||||||
|
*/
|
||||||
|
@Route(path = RouteUtil.PATH_SETTING)
|
||||||
|
public class SettingActivity extends AbsActivity {
|
||||||
|
|
||||||
|
private Handler mHandler;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int getLayoutId() {
|
||||||
|
return R.layout.activity_setting;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void main() {
|
||||||
|
setTitle(mContext.getString(R.string.set_up));
|
||||||
|
IMLoginModel model = IMLoginManager.get(mContext).getUserInfo();
|
||||||
|
|
||||||
|
//跳转自己
|
||||||
|
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.personSet), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||||
|
@Override
|
||||||
|
public void onViewClicks() {
|
||||||
|
RouteUtil.forwardEditProfileActivity();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//黑名单
|
||||||
|
//修改密码
|
||||||
|
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.change_the_password), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||||
|
@Override
|
||||||
|
public void onViewClicks() {
|
||||||
|
//forwardModifyPwd();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.logout), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||||
|
@Override
|
||||||
|
public void onViewClicks() {
|
||||||
|
logout();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查更新
|
||||||
|
*/
|
||||||
|
private void checkVersion() {
|
||||||
|
// CommonAppConfig.getInstance().getConfig(new CommonCallback<ConfigBean>() {
|
||||||
|
// @Override
|
||||||
|
// public void callback(ConfigBean configBean) {
|
||||||
|
// if (configBean != null) {
|
||||||
|
// if (VersionUtil.isLatest(configBean.getVersion())) {
|
||||||
|
// ToastUtil.show(R.string.version_latest);
|
||||||
|
// } else {
|
||||||
|
// VersionUtil.showDialog(mContext, configBean, configBean.getDownloadApkUrl());
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退出登录
|
||||||
|
*/
|
||||||
|
private void logout() {
|
||||||
|
IMLoginManager.get(this).logout(this);
|
||||||
|
CommonAppConfig.getInstance().clearLoginInfo();
|
||||||
|
RCRTCEngine.getInstance().unInit();
|
||||||
|
RongIMClient.getInstance().logout();
|
||||||
|
Intent intent = new Intent(SettingActivity.this, EntryActivity.class).setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
startActivity(intent);
|
||||||
|
Constants.firstInto = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改密码
|
||||||
|
*/
|
||||||
|
private void forwardModifyPwd() {
|
||||||
|
//startActivity(new Intent(mContext, ModifyPwdActivity.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取缓存
|
||||||
|
*/
|
||||||
|
private String getCacheSize() {
|
||||||
|
return GlideCatchUtil.getInstance().getCacheSize();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清除缓存
|
||||||
|
*/
|
||||||
|
private void clearCache(final int position) {
|
||||||
|
final Dialog dialog = DialogUitl.loadingDialog(mContext, getString(R.string.setting_clear_cache_ing));
|
||||||
|
dialog.show();
|
||||||
|
GlideCatchUtil.getInstance().clearImageAllCache();
|
||||||
|
File gifGiftDir = new File(CommonAppConfig.GIF_PATH);
|
||||||
|
if (gifGiftDir.exists() && gifGiftDir.length() > 0) {
|
||||||
|
gifGiftDir.delete();
|
||||||
|
}
|
||||||
|
if (mHandler == null) {
|
||||||
|
mHandler = new Handler();
|
||||||
|
}
|
||||||
|
mHandler.postDelayed(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (dialog != null) {
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
ToastUtil.show(R.string.setting_clear_cache);
|
||||||
|
}
|
||||||
|
}, 2000);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
if (mHandler != null) {
|
||||||
|
mHandler.removeCallbacksAndMessages(null);
|
||||||
|
mHandler = null;
|
||||||
|
}
|
||||||
|
//MainHttpUtil.cancel(MainHttpConsts.GET_SETTING_LIST);
|
||||||
|
CommonHttpUtil.cancel(CommonHttpConsts.GET_CONFIG);
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,113 @@
|
|||||||
|
package com.shayu.onetoone.activity.user;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.text.InputFilter;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.EditText;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.shayu.onetoone.R;
|
||||||
|
import com.shayu.onetoone.utils.MainHttpConsts;
|
||||||
|
import com.shayu.onetoone.utils.MainHttpUtil;
|
||||||
|
import com.tencent.imsdk.v2.V2TIMCallback;
|
||||||
|
import com.tencent.imsdk.v2.V2TIMManager;
|
||||||
|
import com.tencent.imsdk.v2.V2TIMUserFullInfo;
|
||||||
|
import com.yunbao.common.CommonAppConfig;
|
||||||
|
import com.yunbao.common.Constants;
|
||||||
|
import com.yunbao.common.activity.AbsActivity;
|
||||||
|
import com.yunbao.common.bean.UserBean;
|
||||||
|
import com.yunbao.common.http.HttpCallback;
|
||||||
|
import com.yunbao.common.utils.RouteUtil;
|
||||||
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by cxf on 2018/9/29.
|
||||||
|
* 设置昵称
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class EditNameActivity extends AbsActivity {
|
||||||
|
|
||||||
|
private EditText mEditText;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int getLayoutId() {
|
||||||
|
return R.layout.activity_edit_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void main() {
|
||||||
|
setTitle(mContext.getString(R.string.edit_profile_update_nickname));
|
||||||
|
mEditText = (EditText) findViewById(R.id.edit);
|
||||||
|
mEditText.setFilters(new InputFilter[]{new InputFilter.LengthFilter(8)});
|
||||||
|
findViewById(R.id.btSave).setVisibility(View.VISIBLE);
|
||||||
|
findViewById(R.id.btSave).setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
editName();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
String content = getIntent().getStringExtra(Constants.NICK_NAME);
|
||||||
|
if (!TextUtils.isEmpty(content)) {
|
||||||
|
if (content.length() > 8) {
|
||||||
|
content = content.substring(0, 8);
|
||||||
|
}
|
||||||
|
mEditText.setText(content);
|
||||||
|
mEditText.setSelection(content.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void editName() {
|
||||||
|
if (!canClick()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
final String content = mEditText.getText().toString().trim();
|
||||||
|
if (TextUtils.isEmpty(content)) {
|
||||||
|
ToastUtil.show(R.string.edit_profile_name_empty);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
MainHttpUtil.updateFields("{\"user_nicename\":\"" + content + "\"}", new HttpCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
|
if (code == 0) {
|
||||||
|
if (info.length > 0) {
|
||||||
|
JSONObject obj = JSON.parseObject(info[0]);
|
||||||
|
ToastUtil.show(obj.getString("msg"));
|
||||||
|
UserBean u = CommonAppConfig.getInstance().getUserBean();
|
||||||
|
if (u != null) {
|
||||||
|
u.setUserNiceName(content);
|
||||||
|
V2TIMUserFullInfo v2TIMUserFullInfo = new V2TIMUserFullInfo();
|
||||||
|
v2TIMUserFullInfo.setNickname(content);
|
||||||
|
V2TIMManager.getInstance().setSelfInfo(v2TIMUserFullInfo, new V2TIMCallback() {
|
||||||
|
@Override
|
||||||
|
public void onError(int code, String desc) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
Intent intent = getIntent();
|
||||||
|
intent.putExtra(Constants.NICK_NAME, content);
|
||||||
|
setResult(RESULT_OK, intent);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
} else if (code == 2001) {
|
||||||
|
//余额不足,跳转支付页面
|
||||||
|
RouteUtil.forwardMyCoin(mContext);
|
||||||
|
ToastUtil.show(msg);
|
||||||
|
} else {
|
||||||
|
ToastUtil.show(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
MainHttpUtil.cancel(MainHttpConsts.UPDATE_FIELDS);
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,761 @@
|
|||||||
|
package com.shayu.onetoone.activity.user;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.app.Dialog;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.bigkoo.pickerview.builder.TimePickerBuilder;
|
||||||
|
import com.bigkoo.pickerview.listener.OnTimeSelectListener;
|
||||||
|
import com.bigkoo.pickerview.view.TimePickerView;
|
||||||
|
import com.lxj.xpopup.XPopup;
|
||||||
|
import com.sahooz.library.Country;
|
||||||
|
import com.sahooz.library.CountryPicker;
|
||||||
|
import com.sahooz.library.OnPick;
|
||||||
|
import com.shayu.onetoone.R;
|
||||||
|
import com.shayu.onetoone.activity.login.CompleteActivity;
|
||||||
|
import com.shayu.onetoone.bean.AvatarBean;
|
||||||
|
import com.shayu.onetoone.manager.OTONetManager;
|
||||||
|
import com.shayu.onetoone.manager.RouteManager;
|
||||||
|
import com.shayu.onetoone.utils.MainHttpUtil;
|
||||||
|
import com.shayu.onetoone.view.UserAvatarPopup;
|
||||||
|
import com.tencent.imsdk.v2.V2TIMCallback;
|
||||||
|
import com.tencent.imsdk.v2.V2TIMManager;
|
||||||
|
import com.tencent.imsdk.v2.V2TIMUserFullInfo;
|
||||||
|
import com.yunbao.common.CommonAppConfig;
|
||||||
|
import com.yunbao.common.Constants;
|
||||||
|
import com.yunbao.common.activity.AbsActivity;
|
||||||
|
import com.yunbao.common.activity.WebViewActivity;
|
||||||
|
import com.yunbao.common.bean.HttpCallbackModel;
|
||||||
|
import com.yunbao.common.bean.UserBean;
|
||||||
|
import com.yunbao.common.event.UpdateFieldEvent;
|
||||||
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
|
import com.yunbao.common.http.HttpCallback;
|
||||||
|
import com.yunbao.common.interfaces.ActivityResultCallback;
|
||||||
|
import com.yunbao.common.interfaces.CommonCallback;
|
||||||
|
import com.yunbao.common.interfaces.ImageResultCallback;
|
||||||
|
import com.yunbao.common.utils.Bus;
|
||||||
|
import com.yunbao.common.utils.CityUtil;
|
||||||
|
import com.yunbao.common.utils.DialogUitl;
|
||||||
|
import com.yunbao.common.utils.L;
|
||||||
|
import com.yunbao.common.utils.ProcessImageUtil;
|
||||||
|
import com.yunbao.common.utils.StringUtil;
|
||||||
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
import com.yunbao.common.views.CompleteInformationPopup;
|
||||||
|
import com.yunbao.common.views.UpdateSexPopup;
|
||||||
|
|
||||||
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
|
import org.greenrobot.eventbus.ThreadMode;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import cn.qqtheme.framework.entity.City;
|
||||||
|
import cn.qqtheme.framework.entity.County;
|
||||||
|
import cn.qqtheme.framework.entity.Province;
|
||||||
|
import cn.qqtheme.framework.picker.AddressPicker;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 我的 编辑资料
|
||||||
|
*/
|
||||||
|
@Route(path = RouteManager.PATH_EDITPROFILE)
|
||||||
|
public class EditProfileActivity extends AbsActivity {
|
||||||
|
|
||||||
|
private ImageView mAvatar;
|
||||||
|
private TextView mName;
|
||||||
|
private TextView mSign;
|
||||||
|
private TextView mBirthday;
|
||||||
|
private TextView mSex;
|
||||||
|
private TextView mCity;
|
||||||
|
private TextView tv_bind_phone;
|
||||||
|
private ProcessImageUtil cameraUtil;
|
||||||
|
private UserBean mUserBean;
|
||||||
|
private String mProvinceVal;
|
||||||
|
private String mCityVal;
|
||||||
|
private String mZoneVal;
|
||||||
|
private boolean isInto = true;
|
||||||
|
private String isBind = "0", mobile = "";
|
||||||
|
private boolean isName = false;
|
||||||
|
|
||||||
|
private String avatarUrl;
|
||||||
|
|
||||||
|
int userSex;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int getLayoutId() {
|
||||||
|
return R.layout.activity_edit_profile;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void main() {
|
||||||
|
setTitle(mContext.getString(R.string.edit_profile));
|
||||||
|
mAvatar = (ImageView) findViewById(R.id.avatar);
|
||||||
|
mName = (TextView) findViewById(R.id.name);
|
||||||
|
mSign = (TextView) findViewById(R.id.sign);
|
||||||
|
mBirthday = (TextView) findViewById(R.id.birthday);
|
||||||
|
mSex = (TextView) findViewById(R.id.sex);
|
||||||
|
mCity = (TextView) findViewById(R.id.city);
|
||||||
|
tv_bind_phone = (TextView) findViewById(R.id.tv_bind_phone);
|
||||||
|
mUserBean = CommonAppConfig.getInstance().getUserBean();
|
||||||
|
MainHttpUtil.getBaseInfo(new CommonCallback<UserBean>() {
|
||||||
|
@Override
|
||||||
|
public void callback(UserBean u) {
|
||||||
|
mUserBean = u;
|
||||||
|
showData(u);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
/*if (mUserBean != null) {
|
||||||
|
showData(mUserBean);
|
||||||
|
} else {
|
||||||
|
MainHttpUtil.getBaseInfo(new CommonCallback<UserBean>() {
|
||||||
|
@Override
|
||||||
|
public void callback(UserBean u) {
|
||||||
|
mUserBean = u;
|
||||||
|
showData(u);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}*/
|
||||||
|
initCamera();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initCamera() {
|
||||||
|
cameraUtil = new ProcessImageUtil(this, "com.shayu.onetoone.fileprovider");
|
||||||
|
cameraUtil.setImageResultCallback(new ImageResultCallback() {
|
||||||
|
@Override
|
||||||
|
public void beforeCamera() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(File file) {
|
||||||
|
L.e("cameraUtil.setImageResultCallback:");
|
||||||
|
if (file != null) {
|
||||||
|
ImgLoader.display(mContext, file, mAvatar);
|
||||||
|
|
||||||
|
OTONetManager.getInstance(EditProfileActivity.this).updateFile(file, new com.yunbao.common.http.base.HttpCallback<AvatarBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(AvatarBean data) {
|
||||||
|
ImgLoader.display(mContext, file, mAvatar);
|
||||||
|
//txtChoose.setVisibility(View.GONE);
|
||||||
|
avatarUrl = data.getAvatar();
|
||||||
|
ToastUtil.show("上传成功");
|
||||||
|
|
||||||
|
OTONetManager.getInstance(mContext).setInfo(avatarUrl, mName.getText().toString(), userSex, mBirthday.getText().toString(), new com.yunbao.common.http.base.HttpCallback<HttpCallbackModel>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(HttpCallbackModel data) {
|
||||||
|
Toast.makeText(mContext, data.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
|
V2TIMUserFullInfo v2TIMUserFullInfo = new V2TIMUserFullInfo();
|
||||||
|
v2TIMUserFullInfo.setFaceUrl(avatarUrl);
|
||||||
|
V2TIMManager.getInstance().setSelfInfo(v2TIMUserFullInfo, new V2TIMCallback() {
|
||||||
|
@Override
|
||||||
|
public void onError(int code, String desc) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
ToastUtil.show("上传失败");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
if (userModel.getUserInfoComplete() == 1) {
|
||||||
|
finish();
|
||||||
|
} else {
|
||||||
|
new XPopup.Builder(mContext).asCustom(new CompleteInformationPopup(mContext, true, new CompleteInformationPopup.CompleteInformationCallBack() {
|
||||||
|
@Override
|
||||||
|
public void onCancel() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSure() {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
})).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void getTaskType() {
|
||||||
|
MainHttpUtil.getUserFrontTaskType(new HttpCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
|
if (info != null) {
|
||||||
|
if (info.length > 0) {
|
||||||
|
if (info[0].equals("0")) {
|
||||||
|
isInto = false;
|
||||||
|
} else {
|
||||||
|
isInto = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void editProfileClick(View v) {
|
||||||
|
if (!canClick()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
int i = v.getId();
|
||||||
|
if (i == R.id.btn_avatar) {
|
||||||
|
if (isInto) {
|
||||||
|
editAvatar();
|
||||||
|
} else {
|
||||||
|
showTaskDialog();
|
||||||
|
}
|
||||||
|
} else if (i == R.id.btn_name) {
|
||||||
|
if (isInto) {
|
||||||
|
editName();
|
||||||
|
} else {
|
||||||
|
showTaskDialog();
|
||||||
|
}
|
||||||
|
} else if (i == R.id.btn_sign) {
|
||||||
|
if (isInto) {
|
||||||
|
forwardSign();
|
||||||
|
} else {
|
||||||
|
showTaskDialog();
|
||||||
|
}
|
||||||
|
} else if (i == R.id.btn_birthday) {
|
||||||
|
editBirthday();
|
||||||
|
|
||||||
|
} else if (i == R.id.btn_sex) {
|
||||||
|
// forwardSex();
|
||||||
|
new XPopup.Builder(mContext).asCustom(new UpdateSexPopup(mContext, userModel.getSex(), new UpdateSexPopup.UpdateSexCallBack() {
|
||||||
|
@Override
|
||||||
|
public void onSex(int sex) {
|
||||||
|
userSex = sex;
|
||||||
|
MainHttpUtil.updateFields("{\"sex\":\"" + sex + "\"}", new HttpCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
|
if (code == 0 && info.length > 0) {
|
||||||
|
JSONObject obj = JSON.parseObject(info[0]);
|
||||||
|
ToastUtil.show(obj.getString("msg"));
|
||||||
|
userModel.setSex(sex);
|
||||||
|
showData(userModel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})).show();
|
||||||
|
} else if (i == R.id.btn_city) {
|
||||||
|
CountryPicker.newInstance(null, new OnPick() {
|
||||||
|
@Override
|
||||||
|
public void onPick(final Country country) {
|
||||||
|
mCity.setText(country.name);
|
||||||
|
MainHttpUtil.updateFields("{\"location\":\"" + country.name + "\"}", new HttpCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
|
if (code == 0) {
|
||||||
|
JSONObject obj = JSON.parseObject(info[0]);
|
||||||
|
if (info.length > 0) {
|
||||||
|
UserBean u = CommonAppConfig.getInstance().getUserBean();
|
||||||
|
if (u != null) {
|
||||||
|
u.setLocation(country.name);
|
||||||
|
}
|
||||||
|
if (userModel != null) {
|
||||||
|
userModel.setLocation(country.name);
|
||||||
|
}
|
||||||
|
|
||||||
|
showData(userModel);
|
||||||
|
EventBus.getDefault().post(new UpdateFieldEvent());
|
||||||
|
}
|
||||||
|
ToastUtil.show(obj.getString("msg"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).show(getSupportFragmentManager(), "country");
|
||||||
|
} else if (i == R.id.rt_bind_phone) {
|
||||||
|
/*startActivity(new Intent(mContext, BindUserActivity.class)
|
||||||
|
.putExtra("uid", CommonAppConfig.getInstance().getUid())
|
||||||
|
.putExtra("token", CommonAppConfig.getInstance().getToken())
|
||||||
|
.putExtra("isBind", isBind)
|
||||||
|
.putExtra("mobile", mobile));*/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void editName() {
|
||||||
|
Intent intent = new Intent(mContext, EditNameActivity.class);
|
||||||
|
intent.putExtra(Constants.NICK_NAME, mUserBean.getUserNiceName());
|
||||||
|
cameraUtil.startActivityForResult(intent, new ActivityResultCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Intent intent) {
|
||||||
|
if (intent != null) {
|
||||||
|
String nickName = intent.getStringExtra(Constants.NICK_NAME);
|
||||||
|
mUserBean.setSignature(nickName);
|
||||||
|
mName.setText(nickName);
|
||||||
|
EventBus.getDefault().post(new UpdateFieldEvent());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showTaskDialog() {
|
||||||
|
final Dialog dialog = new Dialog(EditProfileActivity.this, R.style.dialog);
|
||||||
|
dialog.setContentView(R.layout.dialog_task);
|
||||||
|
dialog.setCancelable(true);
|
||||||
|
dialog.setCanceledOnTouchOutside(true);
|
||||||
|
|
||||||
|
dialog.findViewById(R.id.tv_cancel).setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
dialog.findViewById(R.id.tv_into).setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
String url = CommonAppConfig.HOST + "/index.php?g=Appapi&m=task&a=index&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&tabIndex=1";
|
||||||
|
WebViewActivity.forward(mContext, url, false);
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
dialog.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void editAvatar() {
|
||||||
|
UserAvatarPopup userAvatarPopup = new UserAvatarPopup(this, userAvatar1 -> {
|
||||||
|
avatarUrl = userAvatar1;
|
||||||
|
ImgLoader.display(EditProfileActivity.this, avatarUrl, mAvatar);
|
||||||
|
|
||||||
|
OTONetManager.getInstance(mContext).setInfo(avatarUrl, mName.getText().toString(), userSex, mBirthday.getText().toString(), new com.yunbao.common.http.base.HttpCallback<HttpCallbackModel>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(HttpCallbackModel data) {
|
||||||
|
Toast.makeText(mContext, data.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
|
V2TIMUserFullInfo v2TIMUserFullInfo = new V2TIMUserFullInfo();
|
||||||
|
v2TIMUserFullInfo.setFaceUrl(avatarUrl);
|
||||||
|
V2TIMManager.getInstance().setSelfInfo(v2TIMUserFullInfo, new V2TIMCallback() {
|
||||||
|
@Override
|
||||||
|
public void onError(int code, String desc) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//txtChoose.setVisibility(View.GONE);
|
||||||
|
}, isCamera -> {
|
||||||
|
if (isCamera) {
|
||||||
|
cameraUtil.getImageByCamera();
|
||||||
|
} else {
|
||||||
|
cameraUtil.getImageByAlumb();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
new XPopup.Builder(mContext).asCustom(userAvatarPopup).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void forwardSign() {
|
||||||
|
if (mUserBean == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Intent intent = new Intent(mContext, EditSignActivity.class);
|
||||||
|
intent.putExtra(Constants.SIGN, mUserBean.getSignature());
|
||||||
|
cameraUtil.startActivityForResult(intent, new ActivityResultCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Intent intent) {
|
||||||
|
if (intent != null) {
|
||||||
|
String sign = intent.getStringExtra(Constants.SIGN);
|
||||||
|
mUserBean.setSignature(sign);
|
||||||
|
mSign.setText(sign);
|
||||||
|
EventBus.getDefault().post(new UpdateFieldEvent());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int year;
|
||||||
|
int month;
|
||||||
|
int day;
|
||||||
|
|
||||||
|
|
||||||
|
private void editBirthday() {
|
||||||
|
if (mUserBean == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String[] times = mUserBean.getBirthday().split("-");
|
||||||
|
year = Integer.parseInt(times[0]);
|
||||||
|
month = Integer.parseInt(times[1]) - 1;
|
||||||
|
day = Integer.parseInt(times[2]);
|
||||||
|
|
||||||
|
//时间选择器
|
||||||
|
Calendar selectedDate = Calendar.getInstance();
|
||||||
|
selectedDate.set(year, month, day);
|
||||||
|
TimePickerView pvTime = new TimePickerBuilder(EditProfileActivity.this, new OnTimeSelectListener() {
|
||||||
|
@SuppressLint("SetTextI18n")
|
||||||
|
@Override
|
||||||
|
public void onTimeSelect(Date date, View v) {
|
||||||
|
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(date);
|
||||||
|
|
||||||
|
year = calendar.get(Calendar.YEAR);
|
||||||
|
month = calendar.get(Calendar.MONTH);
|
||||||
|
day = calendar.get(Calendar.DAY_OF_MONTH);
|
||||||
|
|
||||||
|
String strbri = year + "-" + (month + 1) + "-" + day;
|
||||||
|
|
||||||
|
mBirthday.setText(strbri);
|
||||||
|
|
||||||
|
MainHttpUtil.updateFields("{\"birthday\":\"" + strbri + "\"}", new HttpCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
|
if (code == 0) {
|
||||||
|
if (info.length > 0) {
|
||||||
|
ToastUtil.show(JSON.parseObject(info[0]).getString("msg"));
|
||||||
|
mUserBean.setBirthday(strbri);
|
||||||
|
mBirthday.setText(strbri);
|
||||||
|
|
||||||
|
if (userModel != null) {
|
||||||
|
userModel.setBirthday(strbri);
|
||||||
|
}
|
||||||
|
|
||||||
|
showData(userModel);
|
||||||
|
EventBus.getDefault().post(new UpdateFieldEvent());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ToastUtil.show(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).setCancelText("生日").setSubmitColor(getResources().getColor(R.color.blue01)).setSubmitText("完成").setContentTextSize(20).setDate(selectedDate).build();
|
||||||
|
pvTime.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void forwardSex() {
|
||||||
|
if (mUserBean == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Intent intent = new Intent(mContext, EditSexActivity.class);
|
||||||
|
// intent.putExtra(Constants.SEX, mUserBean.getSex());
|
||||||
|
// mImageUtil.startActivityForResult(intent, new ActivityResultCallback() {
|
||||||
|
// @Override
|
||||||
|
// public void onSuccess(Intent intent) {
|
||||||
|
// if (intent != null) {
|
||||||
|
// int sex = intent.getIntExtra(Constants.SEX, 0);
|
||||||
|
// if (sex == 1) {
|
||||||
|
// mSex.setText(R.string.sex_male);
|
||||||
|
// mUserBean.setSex(sex);
|
||||||
|
// } else if (sex == 2) {
|
||||||
|
// mSex.setText(R.string.sex_female);
|
||||||
|
// mUserBean.setSex(sex);
|
||||||
|
// }
|
||||||
|
// EventBus.getDefault().post(new UpdateFieldEvent());
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
Bus.getOff(this);
|
||||||
|
if (cameraUtil != null) {
|
||||||
|
cameraUtil.release();
|
||||||
|
}
|
||||||
|
//MainHttpUtil.cancel(MainHttpConsts.UPDATE_AVATAR);
|
||||||
|
//MainHttpUtil.cancel(MainHttpConsts.UPDATE_FIELDS);
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
|
public void onEditProfileEvent(/*EditProfileEvent event*/) {
|
||||||
|
MainHttpUtil.getBaseInfo(new CommonCallback<UserBean>() {
|
||||||
|
@Override
|
||||||
|
public void callback(UserBean u) {
|
||||||
|
showData(u);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private UserBean userModel;
|
||||||
|
|
||||||
|
private void showData(UserBean u) {
|
||||||
|
userModel = u;
|
||||||
|
int index = 0;
|
||||||
|
String birthday = u.getBirthday();
|
||||||
|
String location = u.getLocation();
|
||||||
|
String bindPhone = u.getMobile();
|
||||||
|
String sex = "";
|
||||||
|
if (u.getSex() == 1) {
|
||||||
|
sex = mContext.getString(R.string.sex_male);
|
||||||
|
} else if (u.getSex() == 2) {
|
||||||
|
sex = mContext.getString(R.string.sex_female);
|
||||||
|
}
|
||||||
|
if (!TextUtils.isEmpty(bindPhone)) {
|
||||||
|
index = index + 1;
|
||||||
|
}
|
||||||
|
if (!TextUtils.isEmpty(location)) {
|
||||||
|
index = index + 1;
|
||||||
|
}
|
||||||
|
if (!TextUtils.isEmpty(birthday)) {
|
||||||
|
index = index + 1;
|
||||||
|
}
|
||||||
|
if (!TextUtils.isEmpty(sex)) {
|
||||||
|
index = index + 1;
|
||||||
|
}
|
||||||
|
/*if (index == 0) {
|
||||||
|
completeInformation.setBackgroundResource(R.mipmap.bg_complete_information_progress);
|
||||||
|
completeInformation1.setBackgroundResource(R.mipmap.bg_complete_information_progress);
|
||||||
|
completeInformation2.setBackgroundResource(R.mipmap.bg_complete_information_progress);
|
||||||
|
completeInformation3.setBackgroundResource(R.mipmap.bg_complete_information_progress);
|
||||||
|
information.setVisibility(View.VISIBLE);
|
||||||
|
information1.setVisibility(View.VISIBLE);
|
||||||
|
information2.setVisibility(View.VISIBLE);
|
||||||
|
information3.setVisibility(View.VISIBLE);
|
||||||
|
viewProgress1.setBackgroundColor(Color.parseColor("#DEE4F1"));
|
||||||
|
viewProgress2.setBackgroundColor(Color.parseColor("#DEE4F1"));
|
||||||
|
viewProgress3.setBackgroundColor(Color.parseColor("#DEE4F1"));
|
||||||
|
submit.setText(R.string.to_complete);
|
||||||
|
submit.setTextColor(Color.parseColor("#ffffff"));
|
||||||
|
} else if (index == 1) {
|
||||||
|
completeInformation.setBackgroundResource(R.mipmap.bg_complete_information_progress2);
|
||||||
|
completeInformation1.setBackgroundResource(R.mipmap.bg_complete_information_progress);
|
||||||
|
completeInformation2.setBackgroundResource(R.mipmap.bg_complete_information_progress);
|
||||||
|
completeInformation3.setBackgroundResource(R.mipmap.bg_complete_information_progress);
|
||||||
|
information.setVisibility(View.INVISIBLE);
|
||||||
|
information1.setVisibility(View.VISIBLE);
|
||||||
|
information2.setVisibility(View.VISIBLE);
|
||||||
|
information3.setVisibility(View.VISIBLE);
|
||||||
|
viewProgress1.setBackgroundColor(Color.parseColor("#DEE4F1"));
|
||||||
|
viewProgress2.setBackgroundColor(Color.parseColor("#DEE4F1"));
|
||||||
|
viewProgress3.setBackgroundColor(Color.parseColor("#DEE4F1"));
|
||||||
|
submit.setText(R.string.to_complete);
|
||||||
|
submit.setTextColor(Color.parseColor("#ffffff"));
|
||||||
|
} else if (index == 2) {
|
||||||
|
information.setVisibility(View.INVISIBLE);
|
||||||
|
information1.setVisibility(View.INVISIBLE);
|
||||||
|
information2.setVisibility(View.VISIBLE);
|
||||||
|
information3.setVisibility(View.VISIBLE);
|
||||||
|
completeInformation1.setBackgroundResource(R.mipmap.bg_complete_information_progress2);
|
||||||
|
completeInformation.setBackgroundResource(R.mipmap.bg_complete_information_progress2);
|
||||||
|
completeInformation2.setBackgroundResource(R.mipmap.bg_complete_information_progress);
|
||||||
|
completeInformation3.setBackgroundResource(R.mipmap.bg_complete_information_progress);
|
||||||
|
viewProgress1.setBackgroundColor(Color.parseColor("#FFE5D0"));
|
||||||
|
viewProgress2.setBackgroundColor(Color.parseColor("#DEE4F1"));
|
||||||
|
viewProgress3.setBackgroundColor(Color.parseColor("#DEE4F1"));
|
||||||
|
submit.setText(R.string.to_complete);
|
||||||
|
submit.setTextColor(Color.parseColor("#ffffff"));
|
||||||
|
} else if (index == 3) {
|
||||||
|
information.setVisibility(View.INVISIBLE);
|
||||||
|
information1.setVisibility(View.INVISIBLE);
|
||||||
|
information2.setVisibility(View.INVISIBLE);
|
||||||
|
information3.setVisibility(View.VISIBLE);
|
||||||
|
completeInformation.setBackgroundResource(R.mipmap.bg_complete_information_progress2);
|
||||||
|
completeInformation1.setBackgroundResource(R.mipmap.bg_complete_information_progress2);
|
||||||
|
completeInformation2.setBackgroundResource(R.mipmap.bg_complete_information_progress2);
|
||||||
|
completeInformation3.setBackgroundResource(R.mipmap.bg_complete_information_progress);
|
||||||
|
viewProgress1.setBackgroundColor(Color.parseColor("#FFE5D0"));
|
||||||
|
viewProgress2.setBackgroundColor(Color.parseColor("#FFE5D0"));
|
||||||
|
viewProgress3.setBackgroundColor(Color.parseColor("#DEE4F1"));
|
||||||
|
submit.setText(R.string.to_complete);
|
||||||
|
submit.setTextColor(Color.parseColor("#ffffff"));
|
||||||
|
} else if (index == 4) {
|
||||||
|
information.setVisibility(View.INVISIBLE);
|
||||||
|
information1.setVisibility(View.INVISIBLE);
|
||||||
|
information2.setVisibility(View.INVISIBLE);
|
||||||
|
information3.setVisibility(View.INVISIBLE);
|
||||||
|
completeInformation.setBackgroundResource(R.mipmap.bg_complete_information_progress2);
|
||||||
|
completeInformation1.setBackgroundResource(R.mipmap.bg_complete_information_progress2);
|
||||||
|
completeInformation2.setBackgroundResource(R.mipmap.bg_complete_information_progress2);
|
||||||
|
completeInformation3.setBackgroundResource(R.mipmap.bg_complete_information_progress2);
|
||||||
|
viewProgress1.setBackgroundColor(Color.parseColor("#FFE5D0"));
|
||||||
|
viewProgress2.setBackgroundColor(Color.parseColor("#FFE5D0"));
|
||||||
|
viewProgress3.setBackgroundColor(Color.parseColor("#FFE5D0"));
|
||||||
|
submit.setText(R.string.to_receive);
|
||||||
|
submit.setTextColor(Color.parseColor("#935902"));
|
||||||
|
submit.setEnabled(true);
|
||||||
|
}*/
|
||||||
|
ImgLoader.displayAvatar(mContext, u.getAvatar(), mAvatar);
|
||||||
|
mName.setText(u.getUserNiceName());
|
||||||
|
mSign.setText(u.getSignature());
|
||||||
|
mBirthday.setText(u.getBirthday());
|
||||||
|
if (u.getSex() == 0) {
|
||||||
|
mSex.setText("");
|
||||||
|
} else if (u.getSex() == 1) {
|
||||||
|
mSex.setText(R.string.sex_male);
|
||||||
|
} else if (u.getSex() == 2) {
|
||||||
|
mSex.setText(R.string.sex_female);
|
||||||
|
}
|
||||||
|
|
||||||
|
mCity.setText(u.getLocation());
|
||||||
|
if ("1".equals(u.getIs_bind())) {
|
||||||
|
mobile = u.getMobile();
|
||||||
|
tv_bind_phone.setText(mobile);
|
||||||
|
isBind = "1";
|
||||||
|
} else {
|
||||||
|
tv_bind_phone.setHint(getResources().getString(R.string.bind_phone_text));
|
||||||
|
isBind = "0";
|
||||||
|
}
|
||||||
|
/*if (u.getUserInfoComplete() == 1) {
|
||||||
|
submit.setText(R.string.live_task_item_complete_true);
|
||||||
|
submit.setBackgroundResource(R.mipmap.bg_submit_cancel);
|
||||||
|
submit.setTextColor(Color.parseColor("#FFFFFF"));
|
||||||
|
submit.setEnabled(false);
|
||||||
|
} else {
|
||||||
|
if (index < 4) {
|
||||||
|
submit.setText(R.string.to_complete);
|
||||||
|
submit.setBackgroundResource(R.mipmap.bg_submit);
|
||||||
|
submit.setTextColor(Color.parseColor("#FFFFFF"));
|
||||||
|
submit.setEnabled(false);
|
||||||
|
} else {
|
||||||
|
submit.setText(R.string.to_receive);
|
||||||
|
submit.setBackgroundResource(R.mipmap.bg_submit);
|
||||||
|
submit.setTextColor(Color.parseColor("#935902"));
|
||||||
|
}
|
||||||
|
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 选择城市
|
||||||
|
*/
|
||||||
|
private void chooseCity() {
|
||||||
|
ArrayList<Province> list = CityUtil.getInstance().getCityList();
|
||||||
|
if (list == null || list.size() == 0) {
|
||||||
|
final Dialog loading = DialogUitl.loadingDialog(mContext);
|
||||||
|
loading.show();
|
||||||
|
CityUtil.getInstance().getCityListFromAssets(new CommonCallback<ArrayList<Province>>() {
|
||||||
|
@Override
|
||||||
|
public void callback(ArrayList<Province> newList) {
|
||||||
|
loading.dismiss();
|
||||||
|
if (newList != null) {
|
||||||
|
showChooseCityDialog(newList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
showChooseCityDialog(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 选择城市
|
||||||
|
*/
|
||||||
|
private void showChooseCityDialog(ArrayList<Province> list) {
|
||||||
|
String province = mProvinceVal;
|
||||||
|
String city = mCityVal;
|
||||||
|
String district = mZoneVal;
|
||||||
|
if (TextUtils.isEmpty(province)) {
|
||||||
|
province = CommonAppConfig.getInstance().getProvince();
|
||||||
|
}
|
||||||
|
if (TextUtils.isEmpty(city)) {
|
||||||
|
city = CommonAppConfig.getInstance().getCity();
|
||||||
|
}
|
||||||
|
if (TextUtils.isEmpty(district)) {
|
||||||
|
district = CommonAppConfig.getInstance().getDistrict();
|
||||||
|
}
|
||||||
|
DialogUitl.showCityChooseDialog(this, list, province, city, district, new AddressPicker.OnAddressPickListener() {
|
||||||
|
@Override
|
||||||
|
public void onAddressPicked(Province province, final City city, County county) {
|
||||||
|
String provinceName = province.getAreaName();
|
||||||
|
String cityName = city.getAreaName();
|
||||||
|
String zoneName = county.getAreaName();
|
||||||
|
mProvinceVal = provinceName;
|
||||||
|
mCityVal = cityName;
|
||||||
|
mZoneVal = zoneName;
|
||||||
|
final String location = StringUtil.contact(mProvinceVal, mCityVal, mZoneVal);
|
||||||
|
if (mCity != null) {
|
||||||
|
mCity.setText(location);
|
||||||
|
}
|
||||||
|
|
||||||
|
MainHttpUtil.updateFields("{\"location\":\"" + location + "\"}", new HttpCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
|
if (code == 0) {
|
||||||
|
JSONObject obj = JSON.parseObject(info[0]);
|
||||||
|
if (info.length > 0) {
|
||||||
|
UserBean u = CommonAppConfig.getInstance().getUserBean();
|
||||||
|
if (u != null) {
|
||||||
|
u.setLocation(location);
|
||||||
|
}
|
||||||
|
EventBus.getDefault().post(new UpdateFieldEvent());
|
||||||
|
}
|
||||||
|
ToastUtil.show(obj.getString("msg"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
if (Constants.isShowPage != -1) {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
MainHttpUtil.getBaseInfo(new CommonCallback<UserBean>() {
|
||||||
|
@Override
|
||||||
|
public void callback(UserBean u) {
|
||||||
|
if (u != null && "1".equals(u.getIs_bind())) {
|
||||||
|
mobile = u.getMobile();
|
||||||
|
tv_bind_phone.setText(mobile);
|
||||||
|
isBind = "1";
|
||||||
|
} else {
|
||||||
|
tv_bind_phone.setHint(getResources().getString(R.string.bind_phone_text));
|
||||||
|
isBind = "0";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// getTaskType();
|
||||||
|
if (isName) {
|
||||||
|
isName = false;
|
||||||
|
MainHttpUtil.getBaseInfo(CommonAppConfig.getInstance().getUid(), CommonAppConfig.getInstance().getToken(), new CommonCallback<UserBean>() {
|
||||||
|
@Override
|
||||||
|
public void callback(UserBean bean) {
|
||||||
|
if (bean != null) {
|
||||||
|
CommonAppConfig.getInstance().setLoginInfo(CommonAppConfig.getInstance().getUid(), CommonAppConfig.getInstance().getToken(), false);
|
||||||
|
mUserBean = CommonAppConfig.getInstance().getUserBean();
|
||||||
|
mName.setText(mUserBean.getUserNiceName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,95 @@
|
|||||||
|
package com.shayu.onetoone.activity.user;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.text.InputFilter;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.EditText;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.shayu.onetoone.R;
|
||||||
|
import com.shayu.onetoone.utils.MainHttpConsts;
|
||||||
|
import com.shayu.onetoone.utils.MainHttpUtil;
|
||||||
|
import com.yunbao.common.CommonAppConfig;
|
||||||
|
import com.yunbao.common.Constants;
|
||||||
|
import com.yunbao.common.activity.AbsActivity;
|
||||||
|
import com.yunbao.common.bean.UserBean;
|
||||||
|
import com.yunbao.common.http.HttpCallback;
|
||||||
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by cxf on 2018/9/29.
|
||||||
|
* 设置签名
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class EditSignActivity extends AbsActivity {
|
||||||
|
|
||||||
|
private EditText mEditText;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int getLayoutId() {
|
||||||
|
return R.layout.activity_edit_sign;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void main() {
|
||||||
|
setTitle(mContext.getString(R.string.edit_profile_update_sign));
|
||||||
|
mEditText = (EditText) findViewById(R.id.edit);
|
||||||
|
mEditText.setFilters(new InputFilter[]{new InputFilter.LengthFilter(20)});
|
||||||
|
findViewById(R.id.btSave).setVisibility(View.VISIBLE);
|
||||||
|
findViewById(R.id.btSave).setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
ediSign();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
String content = getIntent().getStringExtra(Constants.SIGN);
|
||||||
|
if (!TextUtils.isEmpty(content)) {
|
||||||
|
if (content.length() > 20) {
|
||||||
|
content = content.substring(0, 20);
|
||||||
|
}
|
||||||
|
mEditText.setText(content);
|
||||||
|
mEditText.setSelection(content.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ediSign() {
|
||||||
|
if (!canClick()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
final String content = mEditText.getText().toString().trim();
|
||||||
|
if (TextUtils.isEmpty(content)) {
|
||||||
|
ToastUtil.show(R.string.edit_profile_sign_empty);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
MainHttpUtil.updateFields("{\"signature\":\"" + content + "\"}", new HttpCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
|
if (code == 0) {
|
||||||
|
if (info.length > 0) {
|
||||||
|
JSONObject obj = JSON.parseObject(info[0]);
|
||||||
|
ToastUtil.show(obj.getString("msg"));
|
||||||
|
UserBean u = CommonAppConfig.getInstance().getUserBean();
|
||||||
|
// if (u != null) {
|
||||||
|
// u.setUserNiceName(content);
|
||||||
|
// }
|
||||||
|
Intent intent = getIntent();
|
||||||
|
intent.putExtra(Constants.SIGN, content);
|
||||||
|
setResult(RESULT_OK, intent);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ToastUtil.show(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
MainHttpUtil.cancel(MainHttpConsts.UPDATE_FIELDS);
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
|
}
|
9
OneToOne/src/main/res/drawable/background_ffbe41.xml
Normal file
9
OneToOne/src/main/res/drawable/background_ffbe41.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<corners android:radius="20dp" />
|
||||||
|
<solid android:color="@color/yellow_ffbe41" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
11
OneToOne/src/main/res/drawable/bg_line_ffbe41.xml
Normal file
11
OneToOne/src/main/res/drawable/bg_line_ffbe41.xml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<corners
|
||||||
|
android:bottomLeftRadius="20dp"
|
||||||
|
android:bottomRightRadius="20dp"
|
||||||
|
android:topLeftRadius="20dp"
|
||||||
|
android:topRightRadius="20dp" />
|
||||||
|
<stroke
|
||||||
|
android:width="1dp"
|
||||||
|
android:color="@color/yellow_ffbe41" />
|
||||||
|
</shape>
|
10
OneToOne/src/main/res/drawable/bt_custom_bg.xml
Normal file
10
OneToOne/src/main/res/drawable/bt_custom_bg.xml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="#A279E4" />
|
||||||
|
<corners android:radius="20dp" />
|
||||||
|
<stroke android:width="1dp" android:color="#A279E4" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
51
OneToOne/src/main/res/layout/activity_edit_name.xml
Normal file
51
OneToOne/src/main/res/layout/activity_edit_name.xml
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="#F7F8F9"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<include layout="@layout/view_title_custom" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/edit"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="54dp"
|
||||||
|
android:layout_marginTop="1dp"
|
||||||
|
android:background="@color/white"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:hint="@string/edit_profile_name_hint"
|
||||||
|
android:paddingLeft="15dp"
|
||||||
|
android:paddingRight="15dp"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textColor="@color/textColor"
|
||||||
|
android:textColorHint="@color/gray3"
|
||||||
|
android:textSize="18sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="15dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:text="@string/edit_profile_name_max"
|
||||||
|
android:textColor="@color/gray3"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginTop="50dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv1"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingLeft="15dp"
|
||||||
|
android:paddingRight="15dp"
|
||||||
|
android:text="溫馨提示:可以免費修改昵稱一次,之後修改需要鑽石600一次"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
440
OneToOne/src/main/res/layout/activity_edit_profile.xml
Normal file
440
OneToOne/src/main/res/layout/activity_edit_profile.xml
Normal file
@ -0,0 +1,440 @@
|
|||||||
|
<?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="#F7F8F9"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<include layout="@layout/view_title_custom" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="10dp"
|
||||||
|
android:background="@drawable/setting_item_top"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="10dp">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/btn_avatar"
|
||||||
|
style="@style/edit_profile_group"
|
||||||
|
android:onClick="editProfileClick">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:text="頭像"
|
||||||
|
android:textColor="@color/textColor"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
|
android:id="@+id/avatar"
|
||||||
|
android:layout_width="46dp"
|
||||||
|
android:layout_height="46dp"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginRight="25dp"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
app:riv_oval="true" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="16dp"
|
||||||
|
android:layout_height="18dp"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:src="@mipmap/icon_arrow_right" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
style="@style/line2"
|
||||||
|
android:layout_marginLeft="15dp"
|
||||||
|
android:layout_marginRight="15dp"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/btn_name"
|
||||||
|
style="@style/edit_profile_group"
|
||||||
|
android:onClick="editProfileClick">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:text="暱稱"
|
||||||
|
android:textColor="@color/textColor"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/name"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginLeft="70dp"
|
||||||
|
android:layout_marginRight="25dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:gravity="right"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textColor="#353535"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="16dp"
|
||||||
|
android:layout_height="18dp"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:src="@mipmap/icon_arrow_right" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<View
|
||||||
|
style="@style/line2"
|
||||||
|
android:layout_marginLeft="15dp"
|
||||||
|
android:layout_marginRight="15dp"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/btn_sign"
|
||||||
|
style="@style/edit_profile_group"
|
||||||
|
android:onClick="editProfileClick">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:text="簽名"
|
||||||
|
android:textColor="@color/textColor"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/sign"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginLeft="70dp"
|
||||||
|
android:layout_marginRight="25dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:gravity="right"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textColor="#353535"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="16dp"
|
||||||
|
android:layout_height="18dp"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:src="@mipmap/icon_arrow_right" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
style="@style/line2"
|
||||||
|
android:layout_marginLeft="15dp"
|
||||||
|
android:layout_marginRight="15dp"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/btn_birthday"
|
||||||
|
style="@style/edit_profile_group"
|
||||||
|
android:onClick="editProfileClick">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:text="生日"
|
||||||
|
android:textColor="@color/textColor"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="30dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:text="*"
|
||||||
|
android:textColor="#FF5730"
|
||||||
|
android:textSize="9sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/birthday"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginLeft="70dp"
|
||||||
|
android:layout_marginRight="25dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:gravity="right"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textColor="#353535"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="16dp"
|
||||||
|
android:layout_height="18dp"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:src="@mipmap/icon_arrow_right" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<View
|
||||||
|
style="@style/line2"
|
||||||
|
android:layout_marginLeft="15dp"
|
||||||
|
android:layout_marginRight="15dp"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/btn_sex"
|
||||||
|
style="@style/edit_profile_group"
|
||||||
|
android:onClick="editProfileClick">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:text="性別"
|
||||||
|
android:textColor="@color/textColor"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="30dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:text="*"
|
||||||
|
android:textColor="#FF5730"
|
||||||
|
android:textSize="9sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/sex"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginRight="25dp"
|
||||||
|
android:textColor="#353535"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="16dp"
|
||||||
|
android:layout_height="18dp"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:src="@mipmap/icon_arrow_right" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
style="@style/line2"
|
||||||
|
android:layout_marginLeft="15dp"
|
||||||
|
android:layout_marginRight="15dp"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/btn_city"
|
||||||
|
style="@style/edit_profile_group"
|
||||||
|
android:onClick="editProfileClick">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:text="所在地"
|
||||||
|
android:textColor="@color/textColor"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="44dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:text="*"
|
||||||
|
android:textColor="#FF5730"
|
||||||
|
android:textSize="9sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/city"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginLeft="70dp"
|
||||||
|
android:layout_marginRight="25dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:gravity="right"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textColor="#353535"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="16dp"
|
||||||
|
android:layout_height="18dp"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:src="@mipmap/icon_arrow_right" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
style="@style/line2"
|
||||||
|
android:layout_marginLeft="15dp"
|
||||||
|
android:layout_marginRight="15dp"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/rt_bind_phone"
|
||||||
|
style="@style/edit_profile_group"
|
||||||
|
android:onClick="editProfileClick">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:text="綁定手機"
|
||||||
|
android:textColor="@color/textColor"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="58dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:text="*"
|
||||||
|
android:textColor="#FF5730"
|
||||||
|
android:textSize="9sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_bind_phone"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginLeft="70dp"
|
||||||
|
android:layout_marginRight="25dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:gravity="right"
|
||||||
|
android:hint="@string/bind_phone_text"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textColor="#353535"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="16dp"
|
||||||
|
android:layout_height="18dp"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:src="@mipmap/icon_arrow_right" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/btn_person"
|
||||||
|
style="@style/edit_profile_group"
|
||||||
|
android:onClick="editProfileClick">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:text="真人認證"
|
||||||
|
android:textColor="@color/textColor"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="58dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:text="*"
|
||||||
|
android:textColor="#FF5730"
|
||||||
|
android:textSize="9sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginLeft="70dp"
|
||||||
|
android:layout_marginRight="25dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:gravity="right"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textColor="#353535"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="16dp"
|
||||||
|
android:layout_height="18dp"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:src="@mipmap/icon_arrow_right" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/btn_like"
|
||||||
|
style="@style/edit_profile_group"
|
||||||
|
android:onClick="editProfileClick">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:text="興趣"
|
||||||
|
android:textColor="@color/textColor"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="28dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:text="*"
|
||||||
|
android:textColor="#FF5730"
|
||||||
|
android:textSize="9sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginLeft="70dp"
|
||||||
|
android:layout_marginRight="25dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:gravity="right"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textColor="#353535"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="16dp"
|
||||||
|
android:layout_height="18dp"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:src="@mipmap/icon_arrow_right" />
|
||||||
|
</RelativeLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
style="@style/line2"
|
||||||
|
android:layout_marginLeft="15dp"
|
||||||
|
android:layout_marginRight="15dp"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
style="@style/line2"
|
||||||
|
android:layout_marginLeft="15dp"
|
||||||
|
android:layout_marginRight="15dp"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
35
OneToOne/src/main/res/layout/activity_edit_sign.xml
Normal file
35
OneToOne/src/main/res/layout/activity_edit_sign.xml
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="#F7F8F9"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<include layout="@layout/view_title_custom" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/edit"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="54dp"
|
||||||
|
android:layout_marginTop="1dp"
|
||||||
|
android:background="@color/white"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:hint="@string/edit_profile_sign_hint"
|
||||||
|
android:paddingLeft="15dp"
|
||||||
|
android:paddingRight="15dp"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textColor="@color/textColor"
|
||||||
|
android:textColorHint="@color/gray3"
|
||||||
|
android:textSize="18sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="15dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:text="@string/edit_profile_sign_max"
|
||||||
|
android:textColor="@color/gray3"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
422
OneToOne/src/main/res/layout/activity_setting.xml
Normal file
422
OneToOne/src/main/res/layout/activity_setting.xml
Normal file
@ -0,0 +1,422 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="#F5F6F7"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<include layout="@layout/view_title_custom" />
|
||||||
|
|
||||||
|
<androidx.core.widget.NestedScrollView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:padding="10dp">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@drawable/setting_item_top"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:background="@color/white"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/personSet"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingTop="15.33dp"
|
||||||
|
android:paddingBottom="15dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="25dp"
|
||||||
|
android:text="個人設定"
|
||||||
|
android:textColor="#1E1F20"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/reward"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="13dp"
|
||||||
|
android:paddingStart="14dp"
|
||||||
|
android:paddingTop="5.67dp"
|
||||||
|
android:paddingEnd="13.33dp"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:text="@string/reward"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="17dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginEnd="26.33dp"
|
||||||
|
android:src="@mipmap/icon_arrow_right" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/change_the_password"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingTop="15dp"
|
||||||
|
android:paddingBottom="15dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="25dp"
|
||||||
|
android:text="修改密碼"
|
||||||
|
android:textColor="#1E1F20"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="17dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginEnd="26.33dp"
|
||||||
|
android:src="@mipmap/icon_arrow_right" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingTop="15.33dp"
|
||||||
|
android:paddingBottom="15dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="25dp"
|
||||||
|
android:text="黑名單"
|
||||||
|
android:textColor="#1E1F20"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="17dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginEnd="26.33dp"
|
||||||
|
android:src="@mipmap/icon_arrow_right" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingTop="15.33dp"
|
||||||
|
android:paddingBottom="15dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="25dp"
|
||||||
|
android:text="消息通知"
|
||||||
|
android:textColor="#1E1F20"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="17dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginEnd="26.33dp"
|
||||||
|
android:src="@mipmap/icon_arrow_right" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingTop="15.33dp"
|
||||||
|
android:paddingBottom="15dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="25dp"
|
||||||
|
android:text="語言設定"
|
||||||
|
android:textColor="#1E1F20"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="17dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginEnd="26.33dp"
|
||||||
|
android:src="@mipmap/icon_arrow_right" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingTop="15.33dp"
|
||||||
|
android:paddingBottom="15dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="25dp"
|
||||||
|
android:text="達人認證"
|
||||||
|
android:textColor="#1E1F20"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="17dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginEnd="26.33dp"
|
||||||
|
android:src="@mipmap/icon_arrow_right" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingTop="15.33dp"
|
||||||
|
android:paddingBottom="15dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="25dp"
|
||||||
|
android:text="常見問題"
|
||||||
|
android:textColor="#1E1F20"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="17dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginEnd="26.33dp"
|
||||||
|
android:src="@mipmap/icon_arrow_right" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingTop="15.33dp"
|
||||||
|
android:paddingBottom="15dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="25dp"
|
||||||
|
android:text="服務協議"
|
||||||
|
android:textColor="#1E1F20"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="17dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginEnd="26.33dp"
|
||||||
|
android:src="@mipmap/icon_arrow_right" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingTop="15.33dp"
|
||||||
|
android:paddingBottom="15dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="25dp"
|
||||||
|
android:text="清除緩存"
|
||||||
|
android:textColor="#1E1F20"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="17dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginEnd="26.33dp"
|
||||||
|
android:src="@mipmap/icon_arrow_right" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingTop="15.33dp"
|
||||||
|
android:paddingBottom="15dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="25dp"
|
||||||
|
android:text="刪除用戶"
|
||||||
|
android:textColor="#1E1F20"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="17dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginEnd="26.33dp"
|
||||||
|
android:src="@mipmap/icon_arrow_right" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingTop="15.33dp"
|
||||||
|
android:paddingBottom="15dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="25dp"
|
||||||
|
android:text="關於我們"
|
||||||
|
android:textColor="#1E1F20"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="17dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginEnd="26.33dp"
|
||||||
|
android:src="@mipmap/icon_arrow_right" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingTop="15.33dp"
|
||||||
|
android:paddingBottom="15dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="25dp"
|
||||||
|
android:text="版本號"
|
||||||
|
android:textColor="#1E1F20"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="17dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginEnd="26.33dp"
|
||||||
|
android:src="@mipmap/icon_arrow_right" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingTop="15.33dp"
|
||||||
|
android:paddingBottom="15dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="25dp"
|
||||||
|
android:text="檢查新版本"
|
||||||
|
android:textColor="#1E1F20"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="17dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginEnd="26.33dp"
|
||||||
|
android:src="@mipmap/icon_arrow_right" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/logout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:background="@color/white"
|
||||||
|
android:text="退出"
|
||||||
|
android:textColor="@color/black2"
|
||||||
|
android:textSize="16dp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
77
OneToOne/src/main/res/layout/dialog_task.xml
Normal file
77
OneToOne/src/main/res/layout/dialog_task.xml
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="278dp"
|
||||||
|
android:layout_height="313dp"
|
||||||
|
android:background="@mipmap/img_pop">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginTop="35dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingTop="96dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/user_task_text1"
|
||||||
|
android:textColor="@color/red_853528"
|
||||||
|
android:textSize="17sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_user_task_text2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="3dp"
|
||||||
|
android:text="@string/user_task_text2"
|
||||||
|
android:textColor="@color/red_853528"
|
||||||
|
android:textSize="17sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginBottom="18dp"
|
||||||
|
android:gravity="center">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_cancel"
|
||||||
|
android:layout_width="108dp"
|
||||||
|
android:layout_height="42dp"
|
||||||
|
android:layout_marginRight="6dp"
|
||||||
|
android:background="@drawable/bg_line_ffbe41"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/cancel"
|
||||||
|
android:textColor="@color/yellow_ffbe41"
|
||||||
|
android:textSize="15sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_into"
|
||||||
|
android:layout_width="108dp"
|
||||||
|
android:layout_height="42dp"
|
||||||
|
android:layout_marginLeft="18dp"
|
||||||
|
android:background="@drawable/background_ffbe41"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/user_task_but"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="15sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
@ -41,7 +41,6 @@
|
|||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:tint="@color/textColor" />
|
app:tint="@color/textColor" />
|
||||||
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/redPacketMain"
|
android:id="@+id/redPacketMain"
|
||||||
android:layout_width="20dp"
|
android:layout_width="20dp"
|
||||||
@ -52,5 +51,23 @@
|
|||||||
app:srcCompat="@mipmap/ic_red_packet_record"
|
app:srcCompat="@mipmap/ic_red_packet_record"
|
||||||
tools:visibility="invisible" />
|
tools:visibility="invisible" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/btSave"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="35dp"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
|
android:background="@drawable/bt_custom_bg"
|
||||||
|
android:gravity="center"
|
||||||
|
android:onClick="onClick"
|
||||||
|
android:paddingLeft="20dp"
|
||||||
|
android:paddingRight="20dp"
|
||||||
|
android:text="保存"
|
||||||
|
android:textColor="@color/black2"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:visibility="invisible" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
BIN
OneToOne/src/main/res/mipmap-xxhdpi/img_pop.png
Normal file
BIN
OneToOne/src/main/res/mipmap-xxhdpi/img_pop.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 86 KiB |
Loading…
x
Reference in New Issue
Block a user