Merge remote-tracking branch 'origin/dev_6.5.5_语聊' into dev_6.5.5_语聊
# Conflicts: # OneToOne/src/main/java/com/shayu/onetoone/manager/RouteManager.java
This commit is contained in:
commit
0ea00b2b64
@ -144,6 +144,7 @@
|
|||||||
<activity android:name=".activity.HomeScreenActivity" android:windowSoftInputMode="stateHidden|adjustResize" />
|
<activity android:name=".activity.HomeScreenActivity" android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||||
<activity android:name=".activity.HomeSearchActivity" android:windowSoftInputMode="stateHidden|adjustResize" />
|
<activity android:name=".activity.HomeSearchActivity" 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"
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package com.shayu.onetoone.activity;
|
package com.shayu.onetoone.activity;
|
||||||
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
@ -19,6 +18,7 @@ import com.shayu.onetoone.activity.fragments.DynamicFragment;
|
|||||||
import com.shayu.onetoone.activity.fragments.FriendsFragment;
|
import com.shayu.onetoone.activity.fragments.FriendsFragment;
|
||||||
import com.shayu.onetoone.activity.fragments.MessageFragment;
|
import com.shayu.onetoone.activity.fragments.MessageFragment;
|
||||||
import com.shayu.onetoone.activity.fragments.MyFragment;
|
import com.shayu.onetoone.activity.fragments.MyFragment;
|
||||||
|
import com.shayu.onetoone.bean.JoinAnchorBean;
|
||||||
import com.shayu.onetoone.bean.OfficialNoticeBean;
|
import com.shayu.onetoone.bean.OfficialNoticeBean;
|
||||||
import com.shayu.onetoone.event.MessageMsgBusEvent;
|
import com.shayu.onetoone.event.MessageMsgBusEvent;
|
||||||
import com.shayu.onetoone.manager.OTONetManager;
|
import com.shayu.onetoone.manager.OTONetManager;
|
||||||
@ -27,8 +27,10 @@ import com.yunbao.common.CommonAppConfig;
|
|||||||
import com.yunbao.common.bean.IMLoginModel;
|
import com.yunbao.common.bean.IMLoginModel;
|
||||||
import com.yunbao.common.http.base.HttpCallback;
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
import com.yunbao.common.manager.IMLoginManager;
|
import com.yunbao.common.manager.IMLoginManager;
|
||||||
|
import com.yunbao.common.manager.NoviceInstructorManager;
|
||||||
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
||||||
import com.yunbao.common.utils.Bus;
|
import com.yunbao.common.utils.Bus;
|
||||||
|
import com.yunbao.common.utils.StringUtil;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.Subscribe;
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
@ -114,39 +116,63 @@ public class MainActivity extends AbsOTOActivity {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
checkUserInfoIsSet();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检测用户是否设置个人信息
|
||||||
|
*/
|
||||||
|
private void checkUserInfoIsSet() {
|
||||||
|
OTONetManager.getInstance(mContext).getBaseInfos(true, new com.yunbao.common.http.base.HttpCallback<com.shayu.onetoone.bean.UserBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(com.shayu.onetoone.bean.UserBean data) {
|
||||||
|
if (data.getStatus() == 0) {
|
||||||
|
RouteManager.forwardCompleteActivity();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private void showRedPoint(int count) {
|
private void showRedPoint(int count) {
|
||||||
OTONetManager.getInstance(mContext)
|
OTONetManager.getInstance(mContext).getMessageSystemLists(new HttpCallback<List<OfficialNoticeBean>>() {
|
||||||
.getMessageSystemLists(new HttpCallback<List<OfficialNoticeBean>>() {
|
int point = 0;
|
||||||
int point = 0;
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(List<OfficialNoticeBean> data) {
|
||||||
|
for (OfficialNoticeBean datum : data) {
|
||||||
|
point += datum.getNum();
|
||||||
|
}
|
||||||
|
//大于0则是通过会话未读监听器获取到的数,则不用再调用获取未读数接口了
|
||||||
|
if (count >= 0) {
|
||||||
|
updateUnreadCount(point + count);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
RongIMClient.getInstance().getTotalUnreadCount(new RongIMClient.ResultCallback<Integer>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(List<OfficialNoticeBean> data) {
|
public void onSuccess(Integer integer) {
|
||||||
for (OfficialNoticeBean datum : data) {
|
updateUnreadCount(point + integer);
|
||||||
point += datum.getNum();
|
|
||||||
}
|
|
||||||
//大于0则是通过会话未读监听器获取到的数,则不用再调用获取未读数接口了
|
|
||||||
if (count >= 0) {
|
|
||||||
updateUnreadCount(point + count);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
RongIMClient.getInstance().getTotalUnreadCount(new RongIMClient.ResultCallback<Integer>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(Integer integer) {
|
|
||||||
updateUnreadCount(point + integer);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(RongIMClient.ErrorCode e) {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(String error) {
|
public void onError(RongIMClient.ErrorCode e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateUnreadCount(int count) {
|
private void updateUnreadCount(int count) {
|
||||||
|
@ -34,6 +34,7 @@ import com.opensource.svgaplayer.SVGAVideoEntity;
|
|||||||
import com.shayu.onetoone.R;
|
import com.shayu.onetoone.R;
|
||||||
import com.shayu.onetoone.adapter.MainMeAdapter;
|
import com.shayu.onetoone.adapter.MainMeAdapter;
|
||||||
import com.shayu.onetoone.bean.SlideBean;
|
import com.shayu.onetoone.bean.SlideBean;
|
||||||
|
import com.shayu.onetoone.manager.RouteManager;
|
||||||
import com.shayu.onetoone.utils.MainHttpConsts;
|
import com.shayu.onetoone.utils.MainHttpConsts;
|
||||||
import com.shayu.onetoone.utils.MainHttpUtil;
|
import com.shayu.onetoone.utils.MainHttpUtil;
|
||||||
import com.shayu.onetoone.view.CustomMyViewHolder;
|
import com.shayu.onetoone.view.CustomMyViewHolder;
|
||||||
@ -114,7 +115,6 @@ public class MyFragment extends BaseFragment implements OnItemClickListener<User
|
|||||||
private LinearLayout lt_advertisement;
|
private LinearLayout lt_advertisement;
|
||||||
private View redPoint;
|
private View redPoint;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View createView(LayoutInflater inflater, ViewGroup container, Bundle
|
public View createView(LayoutInflater inflater, ViewGroup container, Bundle
|
||||||
savedInstanceState) {
|
savedInstanceState) {
|
||||||
@ -129,7 +129,8 @@ public class MyFragment extends BaseFragment implements OnItemClickListener<User
|
|||||||
ViewClicksAntiShake.clicksAntiShake(mAvatar, new ViewClicksAntiShake.ViewClicksCallBack() {
|
ViewClicksAntiShake.clicksAntiShake(mAvatar, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||||
@Override
|
@Override
|
||||||
public void onViewClicks() {
|
public void onViewClicks() {
|
||||||
RouteUtil.forwardUserHome(mContext, CommonAppConfig.getInstance().getUid(), 2);
|
//RouteUtil.forwardUserHome(mContext, CommonAppConfig.getInstance().getUid(), 2);
|
||||||
|
RouteManager.forwardEditProfileActivity();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -139,7 +140,8 @@ public class MyFragment extends BaseFragment implements OnItemClickListener<User
|
|||||||
ViewClicksAntiShake.clicksAntiShake(gift_svga, new ViewClicksAntiShake.ViewClicksCallBack() {
|
ViewClicksAntiShake.clicksAntiShake(gift_svga, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||||
@Override
|
@Override
|
||||||
public void onViewClicks() {
|
public void onViewClicks() {
|
||||||
RouteUtil.forwardUserHome(mContext, CommonAppConfig.getInstance().getUid(), 2);
|
//RouteUtil.forwardUserHome(mContext, CommonAppConfig.getInstance().getUid(), 2);
|
||||||
|
RouteManager.forwardEditProfileActivity();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
user_noble_ico = (ImageView) itemView.findViewById(R.id.user_noble_ico);
|
user_noble_ico = (ImageView) itemView.findViewById(R.id.user_noble_ico);
|
||||||
|
@ -0,0 +1,251 @@
|
|||||||
|
package com.shayu.onetoone.activity.login;
|
||||||
|
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.RelativeLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||||
|
import com.bigkoo.pickerview.builder.TimePickerBuilder;
|
||||||
|
import com.bigkoo.pickerview.listener.OnTimeSelectListener;
|
||||||
|
import com.bigkoo.pickerview.view.TimePickerView;
|
||||||
|
import com.blankj.utilcode.util.StringUtils;
|
||||||
|
import com.lxj.xpopup.XPopup;
|
||||||
|
import com.shayu.onetoone.R;
|
||||||
|
import com.shayu.onetoone.activity.AbsOTOActivity;
|
||||||
|
import com.shayu.onetoone.activity.MainActivity;
|
||||||
|
import com.shayu.onetoone.bean.AvatarBean;
|
||||||
|
import com.shayu.onetoone.manager.OTONetManager;
|
||||||
|
import com.shayu.onetoone.manager.RouteManager;
|
||||||
|
import com.shayu.onetoone.view.UserAvatarPopup;
|
||||||
|
import com.yunbao.common.CommonAppConfig;
|
||||||
|
import com.yunbao.common.Constants;
|
||||||
|
import com.yunbao.common.bean.HttpCallbackModel;
|
||||||
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
|
import com.yunbao.common.interfaces.ImageResultCallback;
|
||||||
|
import com.yunbao.common.utils.L;
|
||||||
|
import com.yunbao.common.utils.ProcessImageUtil;
|
||||||
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完善个人资料
|
||||||
|
*/
|
||||||
|
@Route(path = RouteManager.ACTIVITY_COMPLETE)
|
||||||
|
public class ChooseLabelActivity extends AbsOTOActivity {
|
||||||
|
|
||||||
|
private RelativeLayout editHead; //头像点击事件
|
||||||
|
private ImageView userAvatar; //头像
|
||||||
|
private TextView txtChoose;
|
||||||
|
private EditText userNickName; //昵称
|
||||||
|
private TextView userSex1; //性别
|
||||||
|
private TextView userSex2; //性别
|
||||||
|
private TextView userBirthday; //年龄
|
||||||
|
private Button btnRegister; //提交资料
|
||||||
|
|
||||||
|
private int sex = -1;
|
||||||
|
|
||||||
|
ProcessImageUtil cameraUtil;
|
||||||
|
|
||||||
|
private File mAvatarFile;
|
||||||
|
|
||||||
|
int year;
|
||||||
|
int month;
|
||||||
|
int day;
|
||||||
|
|
||||||
|
private String avatarUrl;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int getLayoutId() {
|
||||||
|
return R.layout.activity_complete;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void main(Bundle savedInstanceState) {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
year = calendar.get(Calendar.YEAR) - 18;
|
||||||
|
month = calendar.get(Calendar.MONTH);
|
||||||
|
day = calendar.get(Calendar.DAY_OF_MONTH);
|
||||||
|
|
||||||
|
initView();
|
||||||
|
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) {
|
||||||
|
mAvatarFile = file;
|
||||||
|
OTONetManager.getInstance(ChooseLabelActivity.this).updateFile(mAvatarFile, new HttpCallback<AvatarBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(AvatarBean data) {
|
||||||
|
ImgLoader.display(mContext, file, userAvatar);
|
||||||
|
//txtChoose.setVisibility(View.GONE);
|
||||||
|
avatarUrl = data.getAvatar();
|
||||||
|
ToastUtil.show("上传成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
ToastUtil.show("上传失败");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("SetTextI18n")
|
||||||
|
private void initView() {
|
||||||
|
editHead = findViewById(R.id.editHead);
|
||||||
|
userAvatar = findViewById(R.id.userAvatar);
|
||||||
|
txtChoose = findViewById(R.id.text_choose);
|
||||||
|
userNickName = findViewById(R.id.userNickName);
|
||||||
|
userSex1 = findViewById(R.id.user_sex_1);
|
||||||
|
userSex2 = findViewById(R.id.user_sex_2);
|
||||||
|
userBirthday = findViewById(R.id.userBirthday);
|
||||||
|
btnRegister = findViewById(R.id.btn_register);
|
||||||
|
avatarUrl = CommonAppConfig.getInstance().getUserBean().getAvatar();
|
||||||
|
if (!StringUtils.isEmpty(avatarUrl)) {
|
||||||
|
ImgLoader.display(ChooseLabelActivity.this, avatarUrl, userAvatar);
|
||||||
|
}
|
||||||
|
if (!StringUtils.isEmpty(CommonAppConfig.getInstance().getUserBean().getUserNiceName())) {
|
||||||
|
userNickName.setText(CommonAppConfig.getInstance().getUserBean().getUserNiceName());
|
||||||
|
}
|
||||||
|
editHead.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
chooseImage();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
userBirthday.setText(year + " 年 " + (month + 1) + " 月 " + day + " 日 ");
|
||||||
|
|
||||||
|
userSex1.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
changeSex(0);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
userSex2.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
changeSex(1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
userBirthday.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
//时间选择器
|
||||||
|
Calendar selectedDate = Calendar.getInstance();
|
||||||
|
selectedDate.set(year, month, day);
|
||||||
|
TimePickerView pvTime = new TimePickerBuilder(ChooseLabelActivity.this, new OnTimeSelectListener() {
|
||||||
|
@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);
|
||||||
|
|
||||||
|
userBirthday.setText(year + " 年 " + (month + 1) + " 月 " + day + " 日 ");
|
||||||
|
}
|
||||||
|
}).setCancelText("生日").setSubmitColor(getResources().getColor(R.color.blue01)).setSubmitText("完成").setContentTextSize(20).setDate(selectedDate).build();
|
||||||
|
pvTime.show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
btnRegister.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if (StringUtils.isEmpty(userNickName.getText().toString())) {
|
||||||
|
Toast.makeText(mContext, "请填写昵称", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (sex == -1) {
|
||||||
|
Toast.makeText(mContext, "请选择性别", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
OTONetManager.getInstance(mContext).setInfo(avatarUrl, userNickName.getText().toString(), sex, year + "-" + month + "-" + day, new HttpCallback<HttpCallbackModel>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(HttpCallbackModel data) {
|
||||||
|
Toast.makeText(mContext, data.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
|
if (data.getCode() == 0) {
|
||||||
|
Intent intent = new Intent(ChooseLabelActivity.this, MainActivity.class);
|
||||||
|
intent.putExtra(Constants.SHOW_INVITE, false);
|
||||||
|
startActivity(intent);
|
||||||
|
|
||||||
|
RouteManager.forwardMainActivity();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 选择图片
|
||||||
|
*/
|
||||||
|
private void chooseImage() {
|
||||||
|
UserAvatarPopup userAvatarPopup = new UserAvatarPopup(this, userAvatar1 -> {
|
||||||
|
avatarUrl = userAvatar1;
|
||||||
|
ImgLoader.display(ChooseLabelActivity.this, avatarUrl, userAvatar);
|
||||||
|
//txtChoose.setVisibility(View.GONE);
|
||||||
|
}, isCamera -> {
|
||||||
|
if (isCamera) {
|
||||||
|
cameraUtil.getImageByCamera();
|
||||||
|
} else {
|
||||||
|
cameraUtil.getImageByAlumb();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
new XPopup.Builder(mContext).asCustom(userAvatarPopup).show();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void changeSex(int i) {
|
||||||
|
sex = i;
|
||||||
|
if (sex == 0) {
|
||||||
|
userSex1.setTextColor(getResources().getColor(R.color.white));
|
||||||
|
userSex2.setTextColor(getResources().getColor(R.color.text_gray));
|
||||||
|
userSex1.setBackgroundResource(R.mipmap.icon_user_sex_02);
|
||||||
|
userSex2.setBackgroundResource(R.mipmap.icon_user_sex_00);
|
||||||
|
} else {
|
||||||
|
userSex1.setTextColor(getResources().getColor(R.color.text_gray));
|
||||||
|
userSex2.setTextColor(getResources().getColor(R.color.white));
|
||||||
|
userSex1.setBackgroundResource(R.mipmap.icon_user_sex_00);
|
||||||
|
userSex2.setBackgroundResource(R.mipmap.icon_user_sex_01);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,17 +1,71 @@
|
|||||||
package com.shayu.onetoone.activity.login;
|
package com.shayu.onetoone.activity.login;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.RelativeLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||||
|
import com.bigkoo.pickerview.builder.TimePickerBuilder;
|
||||||
|
import com.bigkoo.pickerview.listener.OnTimeSelectListener;
|
||||||
|
import com.bigkoo.pickerview.view.TimePickerView;
|
||||||
|
import com.blankj.utilcode.util.StringUtils;
|
||||||
|
import com.lxj.xpopup.XPopup;
|
||||||
import com.shayu.onetoone.R;
|
import com.shayu.onetoone.R;
|
||||||
import com.shayu.onetoone.activity.AbsOTOActivity;
|
import com.shayu.onetoone.activity.AbsOTOActivity;
|
||||||
|
import com.shayu.onetoone.activity.MainActivity;
|
||||||
|
import com.shayu.onetoone.bean.AvatarBean;
|
||||||
|
import com.shayu.onetoone.manager.OTONetManager;
|
||||||
|
import com.shayu.onetoone.manager.RouteManager;
|
||||||
|
import com.shayu.onetoone.view.UserAvatarPopup;
|
||||||
|
import com.yunbao.common.CommonAppConfig;
|
||||||
|
import com.yunbao.common.Constants;
|
||||||
|
import com.yunbao.common.bean.HttpCallbackModel;
|
||||||
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
|
import com.yunbao.common.interfaces.ImageResultCallback;
|
||||||
|
import com.yunbao.common.utils.L;
|
||||||
|
import com.yunbao.common.utils.ProcessImageUtil;
|
||||||
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 完善个人资料
|
* 完善个人资料
|
||||||
*/
|
*/
|
||||||
|
@Route(path = RouteManager.ACTIVITY_COMPLETE)
|
||||||
public class CompleteActivity extends AbsOTOActivity {
|
public class CompleteActivity extends AbsOTOActivity {
|
||||||
|
|
||||||
|
private RelativeLayout editHead; //头像点击事件
|
||||||
|
private ImageView userAvatar; //头像
|
||||||
|
private TextView txtChoose;
|
||||||
|
private EditText userNickName; //昵称
|
||||||
|
private TextView userSex1; //性别
|
||||||
|
private TextView userSex2; //性别
|
||||||
|
private TextView userBirthday; //年龄
|
||||||
|
private Button btnRegister; //提交资料
|
||||||
|
|
||||||
|
private int sex = -1;
|
||||||
|
|
||||||
|
ProcessImageUtil cameraUtil;
|
||||||
|
|
||||||
|
private File mAvatarFile;
|
||||||
|
|
||||||
|
int year;
|
||||||
|
int month;
|
||||||
|
int day;
|
||||||
|
|
||||||
|
private String avatarUrl;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getLayoutId() {
|
protected int getLayoutId() {
|
||||||
@ -20,6 +74,178 @@ public class CompleteActivity extends AbsOTOActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void main(Bundle savedInstanceState) {
|
protected void main(Bundle savedInstanceState) {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
year = calendar.get(Calendar.YEAR) - 18;
|
||||||
|
month = calendar.get(Calendar.MONTH);
|
||||||
|
day = calendar.get(Calendar.DAY_OF_MONTH);
|
||||||
|
|
||||||
|
initView();
|
||||||
|
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) {
|
||||||
|
mAvatarFile = file;
|
||||||
|
OTONetManager.getInstance(CompleteActivity.this).updateFile(mAvatarFile, new HttpCallback<AvatarBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(AvatarBean data) {
|
||||||
|
ImgLoader.display(mContext, file, userAvatar);
|
||||||
|
//txtChoose.setVisibility(View.GONE);
|
||||||
|
avatarUrl = data.getAvatar();
|
||||||
|
ToastUtil.show("上传成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
ToastUtil.show("上传失败");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("SetTextI18n")
|
||||||
|
private void initView() {
|
||||||
|
editHead = findViewById(R.id.editHead);
|
||||||
|
userAvatar = findViewById(R.id.userAvatar);
|
||||||
|
txtChoose = findViewById(R.id.text_choose);
|
||||||
|
userNickName = findViewById(R.id.userNickName);
|
||||||
|
userSex1 = findViewById(R.id.user_sex_1);
|
||||||
|
userSex2 = findViewById(R.id.user_sex_2);
|
||||||
|
userBirthday = findViewById(R.id.userBirthday);
|
||||||
|
btnRegister = findViewById(R.id.btn_register);
|
||||||
|
avatarUrl = CommonAppConfig.getInstance().getUserBean().getAvatar();
|
||||||
|
if (!StringUtils.isEmpty(avatarUrl)) {
|
||||||
|
ImgLoader.display(CompleteActivity.this, avatarUrl, userAvatar);
|
||||||
|
}
|
||||||
|
if (!StringUtils.isEmpty(CommonAppConfig.getInstance().getUserBean().getUserNiceName())) {
|
||||||
|
userNickName.setText(CommonAppConfig.getInstance().getUserBean().getUserNiceName());
|
||||||
|
}
|
||||||
|
editHead.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
chooseImage();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
userBirthday.setText(year + " 年 " + (month + 1) + " 月 " + day + " 日 ");
|
||||||
|
|
||||||
|
userSex1.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
changeSex(0);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
userSex2.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
changeSex(1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
userBirthday.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
//时间选择器
|
||||||
|
Calendar selectedDate = Calendar.getInstance();
|
||||||
|
selectedDate.set(year, month, day);
|
||||||
|
TimePickerView pvTime = new TimePickerBuilder(CompleteActivity.this, new OnTimeSelectListener() {
|
||||||
|
@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);
|
||||||
|
|
||||||
|
userBirthday.setText(year + " 年 " + (month + 1) + " 月 " + day + " 日 ");
|
||||||
|
}
|
||||||
|
}).setCancelText("生日").setSubmitColor(getResources().getColor(R.color.blue01)).setSubmitText("完成").setContentTextSize(20).setDate(selectedDate).build();
|
||||||
|
pvTime.show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
btnRegister.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if (StringUtils.isEmpty(userNickName.getText().toString())) {
|
||||||
|
Toast.makeText(mContext, "请填写昵称", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (sex == -1) {
|
||||||
|
Toast.makeText(mContext, "请选择性别", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
OTONetManager.getInstance(mContext).setInfo(avatarUrl, userNickName.getText().toString(), sex, year + "-" + month + "-" + day, new HttpCallback<HttpCallbackModel>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(HttpCallbackModel data) {
|
||||||
|
Toast.makeText(mContext, data.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
|
if (data.getCode() == 0) {
|
||||||
|
Intent intent = new Intent(CompleteActivity.this, MainActivity.class);
|
||||||
|
intent.putExtra(Constants.SHOW_INVITE, false);
|
||||||
|
startActivity(intent);
|
||||||
|
|
||||||
|
RouteManager.forwardMainActivity();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 选择图片
|
||||||
|
*/
|
||||||
|
private void chooseImage() {
|
||||||
|
UserAvatarPopup userAvatarPopup = new UserAvatarPopup(this, userAvatar1 -> {
|
||||||
|
avatarUrl = userAvatar1;
|
||||||
|
ImgLoader.display(CompleteActivity.this, avatarUrl, userAvatar);
|
||||||
|
//txtChoose.setVisibility(View.GONE);
|
||||||
|
}, isCamera -> {
|
||||||
|
if (isCamera) {
|
||||||
|
cameraUtil.getImageByCamera();
|
||||||
|
} else {
|
||||||
|
cameraUtil.getImageByAlumb();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
new XPopup.Builder(mContext).asCustom(userAvatarPopup).show();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void changeSex(int i) {
|
||||||
|
sex = i;
|
||||||
|
if (sex == 0) {
|
||||||
|
userSex1.setTextColor(getResources().getColor(R.color.white));
|
||||||
|
userSex2.setTextColor(getResources().getColor(R.color.text_gray));
|
||||||
|
userSex1.setBackgroundResource(R.mipmap.icon_user_sex_02);
|
||||||
|
userSex2.setBackgroundResource(R.mipmap.icon_user_sex_00);
|
||||||
|
} else {
|
||||||
|
userSex1.setTextColor(getResources().getColor(R.color.text_gray));
|
||||||
|
userSex2.setTextColor(getResources().getColor(R.color.white));
|
||||||
|
userSex1.setBackgroundResource(R.mipmap.icon_user_sex_00);
|
||||||
|
userSex2.setBackgroundResource(R.mipmap.icon_user_sex_01);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -201,12 +201,12 @@ public class LoginActivity extends AbsOTOActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//注册
|
//注册
|
||||||
private void register() {
|
private void register() {
|
||||||
startActivity(new Intent(mContext, RegisterActivity.class));
|
startActivity(new Intent(mContext, RegisterActivity.class));
|
||||||
|
//RouteManager.forwardCompleteActivity();
|
||||||
}
|
}
|
||||||
|
|
||||||
//忘记密码
|
//忘记密码
|
||||||
@ -235,19 +235,18 @@ public class LoginActivity extends AbsOTOActivity {
|
|||||||
loadingDialog = new LoadingDialog();
|
loadingDialog = new LoadingDialog();
|
||||||
loadingDialog.show(getSupportFragmentManager(), "LoadingDialog");
|
loadingDialog.show(getSupportFragmentManager(), "LoadingDialog");
|
||||||
loadingDialog.setShowText(getString(R.string.login_ing));
|
loadingDialog.setShowText(getString(R.string.login_ing));
|
||||||
OTONetManager.getInstance(mContext)
|
OTONetManager.getInstance(mContext).login(phoneNum, pwd, uuid, new com.yunbao.common.http.base.HttpCallback<IMLoginModel>() {
|
||||||
.login(phoneNum, pwd, uuid, new com.yunbao.common.http.base.HttpCallback<IMLoginModel>() {
|
@Override
|
||||||
@Override
|
public void onSuccess(IMLoginModel data) {
|
||||||
public void onSuccess(IMLoginModel data) {
|
onLoginSuccess(data);
|
||||||
onLoginSuccess(data);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(String error) {
|
public void onError(String error) {
|
||||||
ToastUtil.show(error);
|
ToastUtil.show(error);
|
||||||
loadingDialog.dismiss();
|
loadingDialog.dismiss();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
hideKeyboard(mEditPwd);
|
hideKeyboard(mEditPwd);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -283,46 +282,44 @@ public class LoginActivity extends AbsOTOActivity {
|
|||||||
* 获取用户信息
|
* 获取用户信息
|
||||||
*/
|
*/
|
||||||
private void getBaseUserInfo() {
|
private void getBaseUserInfo() {
|
||||||
OTONetManager.getInstance(mContext)
|
OTONetManager.getInstance(mContext).getBaseInfos(true, new com.yunbao.common.http.base.HttpCallback<com.shayu.onetoone.bean.UserBean>() {
|
||||||
.getBaseInfos(true, new com.yunbao.common.http.base.HttpCallback<com.shayu.onetoone.bean.UserBean>() {
|
@Override
|
||||||
|
public void onSuccess(com.shayu.onetoone.bean.UserBean data) {
|
||||||
|
RongcloudIMManager.connectIM(mContext);
|
||||||
|
OTONetManager.getInstance(mContext).getRandJoinAnchor(new com.yunbao.common.http.base.HttpCallback<JoinAnchorBean>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(com.shayu.onetoone.bean.UserBean data) {
|
public void onSuccess(JoinAnchorBean data) {
|
||||||
RongcloudIMManager.connectIM(mContext);
|
if (mFirstLogin) {
|
||||||
OTONetManager.getInstance(mContext)
|
IMLoginManager.get(mContext).setNewUserGif(true);
|
||||||
.getRandJoinAnchor(new com.yunbao.common.http.base.HttpCallback<JoinAnchorBean>() {
|
IMLoginManager.get(mContext).setisNewUserOne(true);
|
||||||
@Override
|
|
||||||
public void onSuccess(JoinAnchorBean data) {
|
|
||||||
if (mFirstLogin) {
|
|
||||||
IMLoginManager.get(mContext).setNewUserGif(true);
|
|
||||||
IMLoginManager.get(mContext).setisNewUserOne(true);
|
|
||||||
// MainActivity.forward(EntryActivity.this, false);
|
// MainActivity.forward(EntryActivity.this, false);
|
||||||
if (!StringUtil.isEmpty(data.getHome_zdy_img_us())) {
|
if (!StringUtil.isEmpty(data.getHome_zdy_img_us())) {
|
||||||
home_zdy_img_us = data.getHome_zdy_img_us();
|
home_zdy_img_us = data.getHome_zdy_img_us();
|
||||||
home_zdy_img_cn = data.getHome_zdy_img_cn();
|
home_zdy_img_cn = data.getHome_zdy_img_cn();
|
||||||
}
|
}
|
||||||
if (!StringUtil.isEmpty(data.getHome_zdy_pop())) {
|
if (!StringUtil.isEmpty(data.getHome_zdy_pop())) {
|
||||||
NoviceInstructorManager.get(mContext).setHomeZdyPop(data.getHome_zdy_pop());
|
NoviceInstructorManager.get(mContext).setHomeZdyPop(data.getHome_zdy_pop());
|
||||||
}
|
}
|
||||||
IMLoginManager.get(mContext).setisNewUserOne(true);
|
IMLoginManager.get(mContext).setisNewUserOne(true);
|
||||||
IMLoginManager.get(mContext).setNewUserGif(true);
|
IMLoginManager.get(mContext).setNewUserGif(true);
|
||||||
}
|
}
|
||||||
loadingDialog.dismiss();
|
loadingDialog.dismiss();
|
||||||
RouteManager.forwardMainActivity();
|
RouteManager.forwardMainActivity();
|
||||||
finish();
|
finish();
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(String error) {
|
|
||||||
ToastUtil.show(error);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(String error) {
|
public void onError(String error) {
|
||||||
|
ToastUtil.show(error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@ import com.alibaba.fastjson.JSON;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.blankj.utilcode.util.DeviceUtils;
|
import com.blankj.utilcode.util.DeviceUtils;
|
||||||
import com.blankj.utilcode.util.GsonUtils;
|
import com.blankj.utilcode.util.GsonUtils;
|
||||||
|
import com.blankj.utilcode.util.StringUtils;
|
||||||
import com.fm.openinstall.OpenInstall;
|
import com.fm.openinstall.OpenInstall;
|
||||||
import com.fm.openinstall.listener.AppInstallAdapter;
|
import com.fm.openinstall.listener.AppInstallAdapter;
|
||||||
import com.fm.openinstall.model.AppData;
|
import com.fm.openinstall.model.AppData;
|
||||||
@ -33,6 +34,7 @@ import com.sahooz.library.CountryPicker;
|
|||||||
import com.sahooz.library.OnPick;
|
import com.sahooz.library.OnPick;
|
||||||
import com.shayu.onetoone.R;
|
import com.shayu.onetoone.R;
|
||||||
import com.shayu.onetoone.activity.MainActivity;
|
import com.shayu.onetoone.activity.MainActivity;
|
||||||
|
import com.shayu.onetoone.manager.RouteManager;
|
||||||
import com.shayu.onetoone.utils.MainHttpUtil;
|
import com.shayu.onetoone.utils.MainHttpUtil;
|
||||||
import com.yunbao.common.CommonAppConfig;
|
import com.yunbao.common.CommonAppConfig;
|
||||||
import com.yunbao.common.Constants;
|
import com.yunbao.common.Constants;
|
||||||
@ -52,6 +54,7 @@ import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
|||||||
import com.yunbao.common.utils.DialogUitl;
|
import com.yunbao.common.utils.DialogUitl;
|
||||||
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
|
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
|
||||||
import com.yunbao.common.utils.RouteUtil;
|
import com.yunbao.common.utils.RouteUtil;
|
||||||
|
import com.yunbao.common.utils.SpUtil;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
@ -121,8 +124,8 @@ public class RegisterActivity extends AbsActivity {
|
|||||||
getUuidDevice();
|
getUuidDevice();
|
||||||
getPromoCode();
|
getPromoCode();
|
||||||
|
|
||||||
mGetCode =mContext.getString(R.string.reg_get_code);
|
mGetCode = mContext.getString(R.string.reg_get_code);
|
||||||
mGetCodeAgain =mContext.getString(R.string.reg_get_code_again);
|
mGetCodeAgain = mContext.getString(R.string.reg_get_code_again);
|
||||||
mTvCountryCodeClick();
|
mTvCountryCodeClick();
|
||||||
mEditPhone.addTextChangedListener(new TextWatcher() {
|
mEditPhone.addTextChangedListener(new TextWatcher() {
|
||||||
@Override
|
@Override
|
||||||
@ -280,9 +283,9 @@ public class RegisterActivity extends AbsActivity {
|
|||||||
} else if (i == R.id.btn_register) {
|
} else if (i == R.id.btn_register) {
|
||||||
register();
|
register();
|
||||||
} else if (i == R.id.btn_tip2) {
|
} else if (i == R.id.btn_tip2) {
|
||||||
WebViewActivity.forward(mContext, HtmlConfig.REG_PRIVCAY1,false);
|
WebViewActivity.forward(mContext, HtmlConfig.REG_PRIVCAY1, false);
|
||||||
} else if (i == R.id.btn_tip3) {
|
} else if (i == R.id.btn_tip3) {
|
||||||
WebViewActivity.forward(mContext, HtmlConfig.REG_PRIVCAY2,false);
|
WebViewActivity.forward(mContext, HtmlConfig.REG_PRIVCAY2, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -362,12 +365,12 @@ public class RegisterActivity extends AbsActivity {
|
|||||||
mDialog.show();
|
mDialog.show();
|
||||||
}
|
}
|
||||||
String ti = "";
|
String ti = "";
|
||||||
if (edit_invitecode_2.getText().toString().trim().equals("此設備已註冊")){
|
if (edit_invitecode_2.getText().toString().trim().equals("此設備已註冊")) {
|
||||||
ti = "";
|
ti = "";
|
||||||
}else{
|
} else {
|
||||||
ti = edit_invitecode_2.getText().toString().trim();
|
ti = edit_invitecode_2.getText().toString().trim();
|
||||||
}
|
}
|
||||||
MainHttpUtil.register(UserID,ti, phoneNum, mPromoCode, mUuidDevice, mCountryCode, pwd, pwd2, code, new HttpCallback() {
|
MainHttpUtil.register(UserID, ti, phoneNum, mPromoCode, mUuidDevice, mCountryCode, pwd, pwd2, code, new HttpCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
@ -402,25 +405,25 @@ public class RegisterActivity extends AbsActivity {
|
|||||||
//获取自定义数据
|
//获取自定义数据
|
||||||
if (appData.getData() != null && !appData.getData().equals("")) {
|
if (appData.getData() != null && !appData.getData().equals("")) {
|
||||||
JSONObject data = JSON.parseObject(appData.getData());
|
JSONObject data = JSON.parseObject(appData.getData());
|
||||||
if (CommonAppConfig.IS_GOOGLE_PLAY == true) {
|
if (CommonAppConfig.IS_GOOGLE_PLAY == true) {
|
||||||
yqm_view.setVisibility(View.VISIBLE);
|
yqm_view.setVisibility(View.VISIBLE);
|
||||||
MainHttpUtil.getDeviceLoginType(new HttpCallback() {
|
MainHttpUtil.getDeviceLoginType(new HttpCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
if(code == 201){
|
if (code == 201) {
|
||||||
edit_invitecode_2.setText("此設備已註冊");
|
edit_invitecode_2.setText("此設備已註冊");
|
||||||
edit_invitecode_2.setEnabled(false);
|
edit_invitecode_2.setEnabled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}else{
|
} else {
|
||||||
yqm_view.setVisibility(View.GONE);
|
yqm_view.setVisibility(View.GONE);
|
||||||
//推广的码
|
//推广的码
|
||||||
mPromoCode = data.getString("admin_id") + "";
|
mPromoCode = data.getString("admin_id") + "";
|
||||||
//用户的码
|
//用户的码
|
||||||
UserID = data.getString("user_id") + "";
|
UserID = data.getString("user_id") + "";
|
||||||
}
|
}
|
||||||
Log.d("OpenInstall", UserID+"appData.getData()1111= " + mPromoCode);
|
Log.d("OpenInstall", UserID + "appData.getData()1111= " + mPromoCode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -483,41 +486,35 @@ public class RegisterActivity extends AbsActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
IMLoginModel userInfo = IMLoginManager.get(activity).getUserInfo();
|
IMLoginModel userInfo = IMLoginManager.get(activity).getUserInfo();
|
||||||
HttpClient.getInstance().post("Home.getRandJoinAnchor", "Home.getRandJoinAnchor")
|
HttpClient.getInstance().post("Home.getRandJoinAnchor", "Home.getRandJoinAnchor").params("uid", userInfo.getId()).params("token", userInfo.getToken()).execute(new HttpCallback() {
|
||||||
.params("uid", userInfo.getId())
|
@Override
|
||||||
.params("token", userInfo.getToken())
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
.execute(new HttpCallback() {
|
if (info[0] != null) {
|
||||||
@Override
|
JSONObject obj = JSON.parseObject(info[0]);
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
IMLoginManager.get(activity).setisNewUserOne(true);
|
||||||
if (info[0] != null) {
|
IMLoginManager.get(activity).setNewUserGif(true);
|
||||||
JSONObject obj = JSON.parseObject(info[0]);
|
if (obj.containsKey("home_zdy_img_us")) {
|
||||||
IMLoginManager.get(activity).setisNewUserOne(true);
|
home_zdy_img_us = obj.getString("home_zdy_img_us");
|
||||||
IMLoginManager.get(activity).setNewUserGif(true);
|
home_zdy_img_cn = obj.getString("home_zdy_img_cn");
|
||||||
if (obj.containsKey("home_zdy_img_us")) {
|
|
||||||
home_zdy_img_us = obj.getString("home_zdy_img_us");
|
|
||||||
home_zdy_img_cn = obj.getString("home_zdy_img_cn");
|
|
||||||
}
|
|
||||||
gotoLive(obj.getString("anchor_id"));
|
|
||||||
if (obj.containsKey("home_zdy_pop")) {
|
|
||||||
NoviceInstructorManager.get(mContext).setHomeZdyPop(obj.getString("home_zdy_pop"));
|
|
||||||
}
|
|
||||||
jumpMain(false);
|
|
||||||
} else {
|
|
||||||
jumpMain(false);
|
|
||||||
}
|
|
||||||
// EventBus.getDefault().post(new RegSuccessEvent());
|
|
||||||
}
|
}
|
||||||
});
|
gotoLive(obj.getString("anchor_id"));
|
||||||
|
if (obj.containsKey("home_zdy_pop")) {
|
||||||
|
NoviceInstructorManager.get(mContext).setHomeZdyPop(obj.getString("home_zdy_pop"));
|
||||||
|
}
|
||||||
|
jumpMain(false);
|
||||||
|
} else {
|
||||||
|
jumpMain(false);
|
||||||
|
}
|
||||||
|
// EventBus.getDefault().post(new RegSuccessEvent());
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private void jumpMain(boolean showInvite) {
|
private void jumpMain(boolean showInvite) {
|
||||||
Intent intent = new Intent(activity, MainActivity.class);
|
RouteManager.forwardCompleteActivity();
|
||||||
intent.putExtra(Constants.SHOW_INVITE, showInvite);
|
|
||||||
startActivity(intent);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void gotoLive(final String live_id) {
|
private void gotoLive(final String live_id) {
|
||||||
LiveHttpUtil.getLiveInfo(live_id, new HttpCallback() {
|
LiveHttpUtil.getLiveInfo(live_id, new HttpCallback() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -0,0 +1,109 @@
|
|||||||
|
package com.shayu.onetoone.adapter;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.shayu.onetoone.R;
|
||||||
|
import com.yunbao.common.bean.UserAvatarSelectBean;
|
||||||
|
import com.yunbao.common.custom.RatioRoundImageView;
|
||||||
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
|
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class UserAvatarSelectAdapter extends RecyclerView.Adapter<UserAvatarSelectAdapter.AvatarSelectViewHolder> {
|
||||||
|
private Context mContext;
|
||||||
|
private List<UserAvatarSelectBean> list = new ArrayList<>();
|
||||||
|
private OnItemClickListener<UserAvatarSelectBean> onClickListener;
|
||||||
|
private int selectId = -1;
|
||||||
|
private int defId = -1;
|
||||||
|
private UserAvatarSelectBean selectInfo;
|
||||||
|
|
||||||
|
public void setList(List<UserAvatarSelectBean> list) {
|
||||||
|
this.list = list;
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSelect() {
|
||||||
|
if (selectId == -1 && getItemCount() > 0) {
|
||||||
|
return list.get(0).getId();
|
||||||
|
}
|
||||||
|
return selectId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOnClickListener(OnItemClickListener<UserAvatarSelectBean> onClickListener) {
|
||||||
|
this.onClickListener = onClickListener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getDefId() {
|
||||||
|
return defId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UserAvatarSelectAdapter(Context mContext) {
|
||||||
|
this.mContext = mContext;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public AvatarSelectViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
return new AvatarSelectViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_user_avatar_select, parent, false));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull AvatarSelectViewHolder holder, int position) {
|
||||||
|
holder.setData(list.get(position), position);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return list.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDef(int id) {
|
||||||
|
this.defId = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class AvatarSelectViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
private View hide;
|
||||||
|
private View show;
|
||||||
|
private RatioRoundImageView avatar;
|
||||||
|
|
||||||
|
public AvatarSelectViewHolder(@NonNull View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
hide = itemView.findViewById(R.id.hideCover);
|
||||||
|
show = itemView.findViewById(R.id.showCover);
|
||||||
|
avatar = itemView.findViewById(R.id.avatar);
|
||||||
|
itemView.setOnClickListener(v -> {
|
||||||
|
selectInfo = (UserAvatarSelectBean) v.getTag();
|
||||||
|
selectId = selectInfo.getId();
|
||||||
|
notifyDataSetChanged();
|
||||||
|
onClickListener.onItemClick(selectInfo, defId);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setData(UserAvatarSelectBean bean, int position) {
|
||||||
|
ImgLoader.display(itemView.getContext(), bean.getPath(), avatar);
|
||||||
|
if (selectId == -1 && bean.getChecked() == 1) {
|
||||||
|
selectId = bean.getId();
|
||||||
|
defId = bean.getId();
|
||||||
|
selectInfo = bean;
|
||||||
|
}
|
||||||
|
hide.setVisibility(View.GONE);
|
||||||
|
/*if (select == bean.getId()) {
|
||||||
|
show.setVisibility(View.VISIBLE);
|
||||||
|
hide.setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
show.setVisibility(View.INVISIBLE);
|
||||||
|
hide.setVisibility(View.VISIBLE);
|
||||||
|
}*/
|
||||||
|
itemView.setTag(bean);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,37 @@
|
|||||||
|
package com.shayu.onetoone.bean;
|
||||||
|
|
||||||
|
|
||||||
|
import com.yunbao.common.bean.BaseModel;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class CustomBean extends BaseModel {
|
||||||
|
|
||||||
|
public int code;
|
||||||
|
public String msg;
|
||||||
|
public List<String> info;
|
||||||
|
|
||||||
|
public void setCode(int code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMsg(String msg) {
|
||||||
|
this.msg = msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMsg() {
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInfo(List<String> info) {
|
||||||
|
this.info = info;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getInfo() {
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
}
|
@ -9,6 +9,16 @@ public class UserBean extends BaseModel {
|
|||||||
UserInfo info;
|
UserInfo info;
|
||||||
UserLevel level;
|
UserLevel level;
|
||||||
|
|
||||||
|
int status; //0 需要跳转到 编辑资料页面
|
||||||
|
|
||||||
|
public int getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(int status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
public UserBean() {
|
public UserBean() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -36,7 +46,7 @@ public class UserBean extends BaseModel {
|
|||||||
this.level = level;
|
this.level = level;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class UserInfo{
|
public static class UserInfo {
|
||||||
private int id;
|
private int id;
|
||||||
private String label_id;
|
private String label_id;
|
||||||
private String cn_label;
|
private String cn_label;
|
||||||
@ -267,7 +277,7 @@ public class UserBean extends BaseModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class UserLevel{
|
public static class UserLevel {
|
||||||
private int id;
|
private int id;
|
||||||
private int wealth;
|
private int wealth;
|
||||||
private int wealth_level;
|
private int wealth_level;
|
||||||
|
@ -6,6 +6,7 @@ import android.util.Log;
|
|||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.shayu.onetoone.bean.AvatarBean;
|
import com.shayu.onetoone.bean.AvatarBean;
|
||||||
|
import com.shayu.onetoone.bean.CustomBean;
|
||||||
import com.shayu.onetoone.bean.FollowBean;
|
import com.shayu.onetoone.bean.FollowBean;
|
||||||
import com.shayu.onetoone.bean.GiftBean;
|
import com.shayu.onetoone.bean.GiftBean;
|
||||||
import com.shayu.onetoone.bean.GreetBean;
|
import com.shayu.onetoone.bean.GreetBean;
|
||||||
@ -23,6 +24,7 @@ import com.yunbao.common.CommonAppConfig;
|
|||||||
import com.yunbao.common.bean.BaseModel;
|
import com.yunbao.common.bean.BaseModel;
|
||||||
import com.yunbao.common.bean.HttpCallbackModel;
|
import com.yunbao.common.bean.HttpCallbackModel;
|
||||||
import com.yunbao.common.bean.IMLoginModel;
|
import com.yunbao.common.bean.IMLoginModel;
|
||||||
|
import com.yunbao.common.bean.UserAvatarSelectBean;
|
||||||
import com.yunbao.common.http.ResponseModel;
|
import com.yunbao.common.http.ResponseModel;
|
||||||
import com.yunbao.common.http.base.HttpCallback;
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
import com.yunbao.common.manager.IMLoginManager;
|
import com.yunbao.common.manager.IMLoginManager;
|
||||||
@ -725,4 +727,64 @@ public class OTONetManager {
|
|||||||
RequestBody requestBody = RequestBody.create(MediaType.parse("multipart/form-data"), file);
|
RequestBody requestBody = RequestBody.create(MediaType.parse("multipart/form-data"), file);
|
||||||
return MultipartBody.Part.createFormData("file", file.getName(), requestBody);
|
return MultipartBody.Part.createFormData("file", file.getName(), requestBody);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取系统头像
|
||||||
|
*
|
||||||
|
* @param callback
|
||||||
|
*/
|
||||||
|
public void getSystemUserAvatar(HttpCallback<List<UserAvatarSelectBean>> callback) {
|
||||||
|
API.get().otoApi(mContext)
|
||||||
|
.getSystemUserAvatar(CommonAppConfig.getInstance().getUid())
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Consumer<ResponseModel<List<UserAvatarSelectBean>>>() {
|
||||||
|
@Override
|
||||||
|
public void accept(ResponseModel<List<UserAvatarSelectBean>> objectResponseModel) throws Exception {
|
||||||
|
if (objectResponseModel.getData().getCode() == 0) {
|
||||||
|
callback.onSuccess(objectResponseModel.getData().getInfo());
|
||||||
|
} else {
|
||||||
|
callback.onError(objectResponseModel.getData().getMsg());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(mContext.getString(com.yunbao.common.R.string.net_error));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置基本资料
|
||||||
|
*/
|
||||||
|
public void setInfo(
|
||||||
|
String avatar,
|
||||||
|
String user_nicename,
|
||||||
|
int sex,
|
||||||
|
String birthday,
|
||||||
|
HttpCallback<HttpCallbackModel> callback) {
|
||||||
|
|
||||||
|
API.get().otoApi(mContext).setInfo(avatar, user_nicename, sex, birthday)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Consumer<ResponseModel<List<BaseModel>>>() {
|
||||||
|
@Override
|
||||||
|
public void accept(ResponseModel<List<BaseModel>> listResponseModel) throws Exception {
|
||||||
|
if (listResponseModel.getData().getCode() == 0) {
|
||||||
|
callback.onSuccess(new HttpCallbackModel(listResponseModel.getData().getCode(), listResponseModel.getData().getMsg()));
|
||||||
|
} else {
|
||||||
|
callback.onError(listResponseModel.getData().getMsg());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,36 @@ public class RouteManager {
|
|||||||
public static final String ACTIVITY_HOME_SEARCH = "/activity/HomeSearchActivity";
|
public static final String ACTIVITY_HOME_SEARCH = "/activity/HomeSearchActivity";
|
||||||
public static final String ACTIVITY_HOME_SCREEN = "/activity/HomeScreenActivity";
|
public static final String ACTIVITY_HOME_SCREEN = "/activity/HomeScreenActivity";
|
||||||
public static final String ACTIVITY_CALL_VIDEO="/activity/CallVideoActivity";
|
public static final String ACTIVITY_CALL_VIDEO="/activity/CallVideoActivity";
|
||||||
|
public static final String PATH_EDITPROFILE = "/main/EditProfileActivity";
|
||||||
|
|
||||||
|
//设置基本资料
|
||||||
|
public static final String ACTIVITY_COMPLETE = "/activity/CompleteActivity";
|
||||||
|
|
||||||
|
//选择标签
|
||||||
|
public static final String ACTIVITY_CHOOSE_LABEL = "/activity/ChooseLabelActivity";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 选择标签
|
||||||
|
*/
|
||||||
|
public static void forwardChooseActivity() {
|
||||||
|
ARouter.getInstance().build(ACTIVITY_CHOOSE_LABEL).navigation();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改个人资料
|
||||||
|
*/
|
||||||
|
public static void forwardEditProfileActivity() {
|
||||||
|
ARouter.getInstance().build(PATH_EDITPROFILE).navigation();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 填写基础资料
|
||||||
|
*/
|
||||||
|
public static void forwardCompleteActivity() {
|
||||||
|
ARouter.getInstance().build(ACTIVITY_COMPLETE).navigation();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void forwardMainActivity() {
|
public static void forwardMainActivity() {
|
||||||
ARouter.getInstance().build(ACTIVITY_MAIN)
|
ARouter.getInstance().build(ACTIVITY_MAIN)
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.shayu.onetoone.network;
|
package com.shayu.onetoone.network;
|
||||||
|
|
||||||
import com.shayu.onetoone.bean.AvatarBean;
|
import com.shayu.onetoone.bean.AvatarBean;
|
||||||
|
import com.shayu.onetoone.bean.CustomBean;
|
||||||
import com.shayu.onetoone.bean.FollowBean;
|
import com.shayu.onetoone.bean.FollowBean;
|
||||||
import com.shayu.onetoone.bean.GiftBean;
|
import com.shayu.onetoone.bean.GiftBean;
|
||||||
import com.shayu.onetoone.bean.GreetBean;
|
import com.shayu.onetoone.bean.GreetBean;
|
||||||
@ -14,7 +15,9 @@ import com.shayu.onetoone.bean.SystemMessageBean;
|
|||||||
import com.shayu.onetoone.bean.TargetUserInfoBean;
|
import com.shayu.onetoone.bean.TargetUserInfoBean;
|
||||||
import com.shayu.onetoone.bean.UserBean;
|
import com.shayu.onetoone.bean.UserBean;
|
||||||
import com.yunbao.common.bean.BaseModel;
|
import com.yunbao.common.bean.BaseModel;
|
||||||
|
import com.yunbao.common.bean.HttpCallbackModel;
|
||||||
import com.yunbao.common.bean.IMLoginModel;
|
import com.yunbao.common.bean.IMLoginModel;
|
||||||
|
import com.yunbao.common.bean.UserAvatarSelectBean;
|
||||||
import com.yunbao.common.http.ResponseModel;
|
import com.yunbao.common.http.ResponseModel;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -115,9 +118,11 @@ public interface OneToOneApi {
|
|||||||
@GET("/api/public/?service=Friendappuser.hot")
|
@GET("/api/public/?service=Friendappuser.hot")
|
||||||
Observable<ResponseModel<List<HomeItemBean>>> getHomeHot(@Query("p") String p);
|
Observable<ResponseModel<List<HomeItemBean>>> getHomeHot(@Query("p") String p);
|
||||||
|
|
||||||
|
|
||||||
@GET("/api/public/?service=Friendappuser.recommend")
|
@GET("/api/public/?service=Friendappuser.recommend")
|
||||||
Observable<ResponseModel<List<HomeItemBean>>> getHomeRecommend(@Query("p") String p);
|
Observable<ResponseModel<List<HomeItemBean>>> getHomeRecommend(@Query("p") String p);
|
||||||
|
|
||||||
|
|
||||||
@GET("/api/public/?service=Message.getListInfo")
|
@GET("/api/public/?service=Message.getListInfo")
|
||||||
Observable<ResponseModel<List<SystemMessageBean>>> getSystemMessageList(@Query("type") int type);
|
Observable<ResponseModel<List<SystemMessageBean>>> getSystemMessageList(@Query("type") int type);
|
||||||
|
|
||||||
@ -154,6 +159,7 @@ public interface OneToOneApi {
|
|||||||
@Query("date") String date
|
@Query("date") String date
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@GET("/api/public/?service=Friendappuser.list")
|
@GET("/api/public/?service=Friendappuser.list")
|
||||||
Observable<ResponseModel<List<HomeItemBean>>> search(
|
Observable<ResponseModel<List<HomeItemBean>>> search(
|
||||||
@Query("keyword") String keyword,
|
@Query("keyword") String keyword,
|
||||||
@ -167,6 +173,36 @@ public interface OneToOneApi {
|
|||||||
|
|
||||||
@GET("/api/public/?service=Friendappuser.like")
|
@GET("/api/public/?service=Friendappuser.like")
|
||||||
Observable<ResponseModel<List<HomeItemBean>>> getSearchRecommend();
|
Observable<ResponseModel<List<HomeItemBean>>> getSearchRecommend();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置基本信息
|
||||||
|
*/
|
||||||
|
@FormUrlEncoded
|
||||||
|
@POST("/api/public/?service=Friendappinfos.setInfo")
|
||||||
|
Observable<ResponseModel<List<BaseModel>>> setInfo(
|
||||||
|
@Field("avatar") String avatar,
|
||||||
|
@Field("user_nicename") String userNicename,
|
||||||
|
@Field("sex") int sex,
|
||||||
|
@Field("birthday") String birthday
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取系统默认头像列表
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Userhome.getDefaultAvatarList")
|
||||||
|
Observable<ResponseModel<List<UserAvatarSelectBean>>> getSystemUserAvatar(@Query("user_id") String uid);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取系统标签
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Friendapplable.get")
|
||||||
|
Observable<ResponseModel<List<HomeRankBean>>> getSysLabel(
|
||||||
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -0,0 +1,123 @@
|
|||||||
|
package com.shayu.onetoone.view;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.GridLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.lxj.xpopup.core.BottomPopupView;
|
||||||
|
import com.shayu.onetoone.R;
|
||||||
|
import com.shayu.onetoone.adapter.UserAvatarSelectAdapter;
|
||||||
|
import com.shayu.onetoone.manager.OTONetManager;
|
||||||
|
import com.shayu.onetoone.manager.RouteManager;
|
||||||
|
import com.yunbao.common.bean.UserAvatarSelectBean;
|
||||||
|
import com.yunbao.common.custom.ItemDecoration;
|
||||||
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
|
import com.yunbao.common.http.live.LiveNetManager;
|
||||||
|
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class UserAvatarPopup extends BottomPopupView implements View.OnClickListener {
|
||||||
|
|
||||||
|
RecyclerView recyclerView;
|
||||||
|
private ImageView camera;
|
||||||
|
private ImageView album;
|
||||||
|
private Context mContext;
|
||||||
|
|
||||||
|
UserAvatarSelectAdapter adapter;
|
||||||
|
private OnItemClickListener onItemClickListener;
|
||||||
|
|
||||||
|
public interface OnItemClickListener<T> {
|
||||||
|
void onItemClick(String userAvatar);
|
||||||
|
}
|
||||||
|
|
||||||
|
private onIsCameraClickListener onIsCameraClickListener;
|
||||||
|
|
||||||
|
public interface onIsCameraClickListener {
|
||||||
|
void onIsCamera(boolean isCamera);
|
||||||
|
}
|
||||||
|
|
||||||
|
public UserAvatarPopup(@NonNull Context context, OnItemClickListener onItemClickListener, onIsCameraClickListener onIsCameraClickListener) {
|
||||||
|
super(context);
|
||||||
|
this.mContext = context;
|
||||||
|
this.onIsCameraClickListener = onIsCameraClickListener;
|
||||||
|
this.onItemClickListener = onItemClickListener;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 返回自定义弹窗的布局
|
||||||
|
@Override
|
||||||
|
protected int getImplLayoutId() {
|
||||||
|
return R.layout.dialog_user_avatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||||
|
@Override
|
||||||
|
protected void onCreate() {
|
||||||
|
super.onCreate();
|
||||||
|
initView();
|
||||||
|
initDate();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加载系统头像
|
||||||
|
*/
|
||||||
|
private void initDate() {
|
||||||
|
adapter = new UserAvatarSelectAdapter(mContext);
|
||||||
|
recyclerView.setLayoutManager(new GridLayoutManager(mContext, 4));
|
||||||
|
|
||||||
|
ItemDecoration decoration1 = new ItemDecoration(mContext, 0x00000000, 0, 0);
|
||||||
|
decoration1.setOnlySetItemOffsetsButNoDraw(true);
|
||||||
|
recyclerView.addItemDecoration(decoration1);
|
||||||
|
|
||||||
|
recyclerView.setAdapter(adapter);
|
||||||
|
adapter.setOnClickListener(new com.yunbao.common.interfaces.OnItemClickListener<UserAvatarSelectBean>() {
|
||||||
|
@Override
|
||||||
|
public void onItemClick(UserAvatarSelectBean bean, int position) {
|
||||||
|
onItemClickListener.onItemClick(bean.getPath());
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
OTONetManager.getInstance(mContext).getSystemUserAvatar(new HttpCallback<List<UserAvatarSelectBean>>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(List<UserAvatarSelectBean> data) {
|
||||||
|
adapter.setList(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
adapter.setList(new ArrayList<>());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initView() {
|
||||||
|
recyclerView = findViewById(R.id.recyclerView);
|
||||||
|
camera = findViewById(R.id.camera);
|
||||||
|
album = findViewById(R.id.album);
|
||||||
|
camera.setOnClickListener(new OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
onIsCameraClickListener.onIsCamera(true);
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
album.setOnClickListener(new OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
onIsCameraClickListener.onIsCamera(false);
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
7
OneToOne/src/main/res/drawable/bg_user_avatar.xml
Normal file
7
OneToOne/src/main/res/drawable/bg_user_avatar.xml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<corners
|
||||||
|
android:topLeftRadius="8dp"
|
||||||
|
android:topRightRadius="8dp" />
|
||||||
|
<solid android:color="#F4F7FC" />
|
||||||
|
</shape>
|
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="oval">
|
||||||
|
<solid android:color="#FFC300"/>
|
||||||
|
</shape>
|
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="oval">
|
||||||
|
<solid android:color="#99000000"/>
|
||||||
|
</shape>
|
54
OneToOne/src/main/res/layout/activity_choose_label.xml
Normal file
54
OneToOne/src/main/res/layout/activity_choose_label.xml
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="15dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/next"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="right"
|
||||||
|
android:padding="10dp"
|
||||||
|
android:text="跳过"
|
||||||
|
android:textColor="@color/black2"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<ScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<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_marginTop="10dp"
|
||||||
|
android:text="我的标签"
|
||||||
|
android:textColor="@color/black2"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<com.xuexiang.xui.widget.flowlayout.FlowTagLayout
|
||||||
|
android:id="@+id/myLabel"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
|
app:ftl_check_mode="none" />
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
@ -1,7 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@mipmap/bg_login"
|
android:background="@mipmap/bg_login"
|
||||||
@ -10,137 +9,148 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:background="@mipmap/bg_w"
|
||||||
android:background="@mipmap/bg_w">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="80dp"
|
android:layout_marginTop="120dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="完善资料"
|
android:text="完善个人信息"
|
||||||
android:textColor="#FFFFFF"
|
android:textColor="#FFFFFF"
|
||||||
android:textSize="33sp"
|
android:textSize="33sp"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
|
android:id="@+id/editHead"
|
||||||
android:layout_width="90dp"
|
android:layout_width="90dp"
|
||||||
android:layout_height="90dp"
|
android:layout_height="90dp"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:layout_marginTop="10dp">
|
android:layout_marginTop="20dp">
|
||||||
|
|
||||||
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
<ImageView
|
android:id="@+id/userAvatar"
|
||||||
android:layout_width="90dp"
|
android:layout_width="80dp"
|
||||||
android:layout_height="90dp"
|
android:layout_height="80dp"
|
||||||
android:background="@color/red"/>
|
android:layout_centerHorizontal="true"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@mipmap/icon_avatar_placeholder"
|
||||||
|
app:riv_oval="true" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/text_choose"
|
||||||
android:layout_width="70dp"
|
android:layout_width="70dp"
|
||||||
android:layout_height="30dp"
|
android:layout_height="30dp"
|
||||||
android:textSize="12sp"
|
|
||||||
android:textColor="#FFFFFF"
|
|
||||||
android:gravity="center"
|
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:background="@drawable/background_8f7cdf"
|
android:background="@drawable/background_8f7cdf"
|
||||||
android:text="去选择"/>
|
android:gravity="center"
|
||||||
|
android:text="去选择"
|
||||||
|
android:textColor="#FFFFFF"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="15dp"
|
||||||
|
android:layout_marginTop="60dp"
|
||||||
android:text="昵称"
|
android:text="昵称"
|
||||||
android:textColor="#ff333333"
|
android:textColor="#ff333333"
|
||||||
android:layout_marginTop="60dp"
|
android:textSize="16sp" />
|
||||||
android:layout_marginLeft="15dp"
|
|
||||||
android:textSize="16sp"/>
|
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
|
android:id="@+id/userNickName"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="47dp"
|
android:layout_height="47dp"
|
||||||
android:background="@mipmap/ws_ind"
|
|
||||||
android:layout_marginLeft="30dp"
|
android:layout_marginLeft="30dp"
|
||||||
android:layout_marginRight="30dp"
|
android:layout_marginRight="30dp"
|
||||||
android:textColor="#999999"
|
android:background="@mipmap/ws_ind"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
|
android:maxEms="15"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:textColor="#999999"
|
||||||
android:textColorHint="#999999"
|
android:textColorHint="#999999"
|
||||||
android:textSize="14sp"/>
|
android:textSize="14sp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="15dp"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
android:text="性别"
|
android:text="性别"
|
||||||
android:textColor="#ff333333"
|
android:textColor="#ff333333"
|
||||||
android:layout_marginTop="20dp"
|
android:textSize="16sp" />
|
||||||
android:layout_marginLeft="15dp"
|
|
||||||
android:textSize="16sp"/>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/user_sex_1"
|
||||||
android:layout_width="119dp"
|
android:layout_width="119dp"
|
||||||
android:layout_height="45dp"
|
android:layout_height="45dp"
|
||||||
android:layout_weight="1"
|
|
||||||
android:background="@mipmap/wi_c"
|
|
||||||
android:layout_marginLeft="30dp"
|
android:layout_marginLeft="30dp"
|
||||||
android:layout_marginRight="30dp"
|
android:layout_marginRight="30dp"
|
||||||
android:textColor="#999999"
|
android:layout_weight="1"
|
||||||
|
android:background="@mipmap/icon_user_sex_00"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:textColorHint="#999999"
|
|
||||||
android:text="女"
|
android:text="女"
|
||||||
android:textSize="14sp"/>
|
android:textColor="#999999"
|
||||||
|
android:textColorHint="#999999"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/user_sex_2"
|
||||||
android:layout_width="119dp"
|
android:layout_width="119dp"
|
||||||
android:layout_height="45dp"
|
android:layout_height="45dp"
|
||||||
android:layout_weight="1"
|
|
||||||
android:background="@mipmap/wi_c"
|
|
||||||
android:layout_marginLeft="30dp"
|
android:layout_marginLeft="30dp"
|
||||||
android:layout_marginRight="30dp"
|
android:layout_marginRight="30dp"
|
||||||
android:textColor="#999999"
|
android:layout_weight="1"
|
||||||
|
android:background="@mipmap/icon_user_sex_00"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:textColorHint="#999999"
|
|
||||||
android:text="男"
|
android:text="男"
|
||||||
android:textSize="14sp"/>
|
android:textColor="#999999"
|
||||||
|
android:textColorHint="#999999"
|
||||||
|
android:textSize="14sp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="15dp"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
android:text="生日"
|
android:text="生日"
|
||||||
android:textColor="#ff333333"
|
android:textColor="#ff333333"
|
||||||
android:layout_marginTop="20dp"
|
android:textSize="16sp" />
|
||||||
android:layout_marginLeft="15dp"
|
|
||||||
android:textSize="16sp"/>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/userBirthday"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="47dp"
|
android:layout_height="47dp"
|
||||||
android:background="@mipmap/ws_ind"
|
|
||||||
android:layout_marginLeft="30dp"
|
android:layout_marginLeft="30dp"
|
||||||
android:layout_marginRight="30dp"
|
android:layout_marginRight="30dp"
|
||||||
android:textColor="#999999"
|
android:background="@mipmap/ws_ind"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:textColor="#999999"
|
||||||
android:textColorHint="#999999"
|
android:textColorHint="#999999"
|
||||||
android:textSize="14sp"/>
|
android:textSize="14sp" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/btn_register"
|
android:id="@+id/btn_register"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="47dp"
|
android:layout_height="47dp"
|
||||||
android:layout_marginLeft="30dp"
|
android:layout_marginLeft="30dp"
|
||||||
android:layout_marginRight="30dp"
|
|
||||||
android:layout_marginTop="30dp"
|
android:layout_marginTop="30dp"
|
||||||
|
android:layout_marginRight="30dp"
|
||||||
android:background="@drawable/background_8f7cdf"
|
android:background="@drawable/background_8f7cdf"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:onClick="registerClick"
|
|
||||||
android:text="完成"
|
android:text="完成"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp" />
|
||||||
/>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
43
OneToOne/src/main/res/layout/dialog_user_avatar.xml
Normal file
43
OneToOne/src/main/res/layout/dialog_user_avatar.xml
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
<?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="300dp"
|
||||||
|
android:background="@drawable/bg_user_avatar"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recyclerView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||||
|
app:spanCount="4"
|
||||||
|
tools:itemCount="18"
|
||||||
|
tools:listitem="@layout/item_user_avatar_select" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="70dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginBottom="20dp"
|
||||||
|
android:gravity="center">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/camera"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:src="@mipmap/icon_camera" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/album"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:src="@mipmap/icon_album" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
54
OneToOne/src/main/res/layout/item_user_avatar_select.xml
Normal file
54
OneToOne/src/main/res/layout/item_user_avatar_select.xml
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="70dp"
|
||||||
|
android:layout_height="70dp"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginTop="20dp">
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/showCover"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@drawable/bg_user_avatar_select_selected"
|
||||||
|
android:visibility="invisible"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<com.yunbao.common.custom.RatioRoundImageView
|
||||||
|
android:id="@+id/avatar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_marginStart="2dp"
|
||||||
|
android:layout_marginTop="2dp"
|
||||||
|
android:layout_marginEnd="2dp"
|
||||||
|
android:layout_marginBottom="2dp"
|
||||||
|
android:src="@mipmap/icon_green_science"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:ri_ratio="0.5"
|
||||||
|
app:riv_oval="true" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/hideCover"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginStart="2dp"
|
||||||
|
android:layout_marginTop="2dp"
|
||||||
|
android:layout_marginEnd="2dp"
|
||||||
|
android:layout_marginBottom="2dp"
|
||||||
|
android:background="@drawable/bg_user_avatar_select_unselected"
|
||||||
|
android:visibility="visible"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:visibility="invisible" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
BIN
OneToOne/src/main/res/mipmap-xxhdpi/icon_album.png
Normal file
BIN
OneToOne/src/main/res/mipmap-xxhdpi/icon_album.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.1 KiB |
BIN
OneToOne/src/main/res/mipmap-xxhdpi/icon_camera.png
Normal file
BIN
OneToOne/src/main/res/mipmap-xxhdpi/icon_camera.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.6 KiB |
BIN
OneToOne/src/main/res/mipmap-xxhdpi/icon_user_sex_00.png
Normal file
BIN
OneToOne/src/main/res/mipmap-xxhdpi/icon_user_sex_00.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.6 KiB |
BIN
OneToOne/src/main/res/mipmap-xxhdpi/icon_user_sex_01.png
Normal file
BIN
OneToOne/src/main/res/mipmap-xxhdpi/icon_user_sex_01.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
BIN
OneToOne/src/main/res/mipmap-xxhdpi/icon_user_sex_02.png
Normal file
BIN
OneToOne/src/main/res/mipmap-xxhdpi/icon_user_sex_02.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
@ -1,4 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<color name="rc_white_color">#F7F7F7</color>
|
<color name="rc_white_color">#F7F7F7</color>
|
||||||
|
<color name="text_gray">#999999</color>
|
||||||
</resources>
|
</resources>
|
@ -181,7 +181,7 @@ dependencies {
|
|||||||
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
|
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
|
||||||
api 'com.jakewharton.rxbinding3:rxbinding:3.1.0'
|
api 'com.jakewharton.rxbinding3:rxbinding:3.1.0'
|
||||||
//loading样式库
|
//loading样式库
|
||||||
api 'com.wang.avi:library:2.1.3'
|
api 'com.wang.avi:library:2.1.3'
|
||||||
api 'com.google.firebase:firebase-messaging:23.0.6'
|
api 'com.google.firebase:firebase-messaging:23.0.6'
|
||||||
api 'com.google.firebase:firebase-analytics:21.1.0'
|
api 'com.google.firebase:firebase-analytics:21.1.0'
|
||||||
// api 'com.huawei.hms:push:4.0.2.300'
|
// api 'com.huawei.hms:push:4.0.2.300'
|
||||||
@ -201,6 +201,12 @@ dependencies {
|
|||||||
api 'com.google.android.gms:play-services-auth:15.0.0'
|
api 'com.google.android.gms:play-services-auth:15.0.0'
|
||||||
api 'com.google.android.material:material:1.4.0'
|
api 'com.google.android.material:material:1.4.0'
|
||||||
|
|
||||||
|
api 'com.contrarywind:Android-PickerView:4.1.9'
|
||||||
|
|
||||||
|
//UI框架
|
||||||
|
api 'com.github.xuexiangjys:XUI:1.1.6'
|
||||||
|
api 'com.github.xuexiangjys.XUtil:xutil-core:2.0.0'
|
||||||
|
|
||||||
// api files('libs/svgaplayer-release-v1.2.1.aar')
|
// api files('libs/svgaplayer-release-v1.2.1.aar')
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -82,4 +82,5 @@
|
|||||||
|
|
||||||
<color name="gray_f6f7fb">#F6F7FB</color>
|
<color name="gray_f6f7fb">#F6F7FB</color>
|
||||||
<color name="gray_f6f6f6f6">#FFF6F6F6</color>
|
<color name="gray_f6f6f6f6">#FFF6F6F6</color>
|
||||||
|
<color name="blue01">#A279E4</color>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
android:textColor="@color/textColor"
|
android:textColor="@color/textColor"
|
||||||
android:textSize="14sp" />
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
|
||||||
<com.makeramen.roundedimageview.RoundedImageView
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
android:id="@+id/avatar"
|
android:id="@+id/avatar"
|
||||||
android:layout_width="46dp"
|
android:layout_width="46dp"
|
||||||
@ -313,8 +312,8 @@
|
|||||||
android:layout_marginRight="25dp"
|
android:layout_marginRight="25dp"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:gravity="right"
|
android:gravity="right"
|
||||||
android:singleLine="true"
|
|
||||||
android:hint="@string/bind_phone_text"
|
android:hint="@string/bind_phone_text"
|
||||||
|
android:singleLine="true"
|
||||||
android:textColor="#353535"
|
android:textColor="#353535"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="85dp"
|
android:layout_width="70dp"
|
||||||
android:layout_height="85dp"
|
android:layout_height="70dp"
|
||||||
android:layout_marginStart="22dp"
|
android:layout_marginStart="22dp"
|
||||||
android:layout_marginTop="32dp">
|
android:layout_marginTop="32dp">
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user