设置标签
This commit is contained in:
parent
d2639ceb6a
commit
1f0cdd86a4
@ -120,6 +120,8 @@ public class MainActivity extends AbsOTOActivity {
|
|||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
checkUserInfoIsSet();
|
checkUserInfoIsSet();
|
||||||
|
//测试
|
||||||
|
//RouteManager.forwardChooseActivity();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package com.shayu.onetoone.activity.fragments;
|
package com.shayu.onetoone.activity.fragments;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import android.content.ClipboardManager;
|
import android.content.ClipboardManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
@ -32,6 +31,7 @@ import com.opensource.svgaplayer.SVGAImageView;
|
|||||||
import com.opensource.svgaplayer.SVGAParser;
|
import com.opensource.svgaplayer.SVGAParser;
|
||||||
import com.opensource.svgaplayer.SVGAVideoEntity;
|
import com.opensource.svgaplayer.SVGAVideoEntity;
|
||||||
import com.shayu.onetoone.R;
|
import com.shayu.onetoone.R;
|
||||||
|
import com.shayu.onetoone.activity.setting.SettingActivity;
|
||||||
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.manager.RouteManager;
|
||||||
@ -442,7 +442,7 @@ public class MyFragment extends BaseFragment implements OnItemClickListener<User
|
|||||||
forwardCoin();
|
forwardCoin();
|
||||||
break;
|
break;
|
||||||
case 13:
|
case 13:
|
||||||
// forwardSetting();
|
forwardSetting();
|
||||||
break;
|
break;
|
||||||
case 19:
|
case 19:
|
||||||
forwardMyVideo();
|
forwardMyVideo();
|
||||||
@ -559,7 +559,7 @@ public class MyFragment extends BaseFragment implements OnItemClickListener<User
|
|||||||
* 设置
|
* 设置
|
||||||
*/
|
*/
|
||||||
private void forwardSetting() {
|
private void forwardSetting() {
|
||||||
// mContext.startActivity(new Intent(mContext, SettingActivity.class));
|
mContext.startActivity(new Intent(mContext, SettingActivity.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,206 +1,139 @@
|
|||||||
package com.shayu.onetoone.activity.login;
|
package com.shayu.onetoone.activity.login;
|
||||||
|
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.EditText;
|
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.RelativeLayout;
|
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
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.adapter.LabelTagAdapter;
|
||||||
import com.shayu.onetoone.bean.AvatarBean;
|
import com.shayu.onetoone.adapter.LableChooseAdapter;
|
||||||
|
import com.shayu.onetoone.bean.LabelBean;
|
||||||
import com.shayu.onetoone.manager.OTONetManager;
|
import com.shayu.onetoone.manager.OTONetManager;
|
||||||
import com.shayu.onetoone.manager.RouteManager;
|
import com.shayu.onetoone.manager.RouteManager;
|
||||||
import com.shayu.onetoone.view.UserAvatarPopup;
|
import com.xuexiang.xui.widget.flowlayout.FlowTagLayout;
|
||||||
import com.yunbao.common.CommonAppConfig;
|
|
||||||
import com.yunbao.common.Constants;
|
|
||||||
import com.yunbao.common.bean.HttpCallbackModel;
|
import com.yunbao.common.bean.HttpCallbackModel;
|
||||||
import com.yunbao.common.glide.ImgLoader;
|
|
||||||
import com.yunbao.common.http.base.HttpCallback;
|
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.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.List;
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 完善个人资料
|
* 设置标签
|
||||||
*/
|
*/
|
||||||
@Route(path = RouteManager.ACTIVITY_COMPLETE)
|
@Route(path = RouteManager.ACTIVITY_CHOOSE_LABEL)
|
||||||
public class ChooseLabelActivity extends AbsOTOActivity {
|
public class ChooseLabelActivity extends AbsOTOActivity {
|
||||||
|
|
||||||
private RelativeLayout editHead; //头像点击事件
|
FlowTagLayout myFlowTag; //我的标签
|
||||||
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;
|
RecyclerView recyclerView; //系统分类标签
|
||||||
|
|
||||||
ProcessImageUtil cameraUtil;
|
TextView next; //跳过
|
||||||
|
|
||||||
private File mAvatarFile;
|
LableChooseAdapter lableChooseAdapter;
|
||||||
|
|
||||||
int year;
|
List<LabelBean.Children> myLabelList = new ArrayList<>();
|
||||||
int month;
|
|
||||||
int day;
|
|
||||||
|
|
||||||
private String avatarUrl;
|
LabelTagAdapter myAdapter;
|
||||||
|
|
||||||
|
Button submit; //提交
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getLayoutId() {
|
protected int getLayoutId() {
|
||||||
return R.layout.activity_complete;
|
return R.layout.activity_choose_label;
|
||||||
}
|
}
|
||||||
|
|
||||||
@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();
|
initView();
|
||||||
initCamera();
|
initDate();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initCamera() {
|
private void initDate() {
|
||||||
cameraUtil = new ProcessImageUtil(this, "com.shayu.onetoone.fileprovider");
|
OTONetManager.getInstance(mContext).getSysLabel(new HttpCallback<List<LabelBean>>() {
|
||||||
cameraUtil.setImageResultCallback(new ImageResultCallback() {
|
|
||||||
@Override
|
@Override
|
||||||
public void beforeCamera() {
|
public void onSuccess(List<LabelBean> data) {
|
||||||
|
lableChooseAdapter.setList(data);
|
||||||
}
|
|
||||||
|
|
||||||
@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
|
@Override
|
||||||
public void onError(String error) {
|
public void onError(String error) {
|
||||||
ToastUtil.show("上传失败");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure() {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("SetTextI18n")
|
@SuppressLint("SetTextI18n")
|
||||||
private void initView() {
|
private void initView() {
|
||||||
editHead = findViewById(R.id.editHead);
|
submit = findViewById(R.id.submit);
|
||||||
userAvatar = findViewById(R.id.userAvatar);
|
myFlowTag = findViewById(R.id.myFlowTag);
|
||||||
txtChoose = findViewById(R.id.text_choose);
|
recyclerView = findViewById(R.id.recyclerView);
|
||||||
userNickName = findViewById(R.id.userNickName);
|
next = findViewById(R.id.next);
|
||||||
userSex1 = findViewById(R.id.user_sex_1);
|
|
||||||
userSex2 = findViewById(R.id.user_sex_2);
|
myLabelList = new ArrayList<>();
|
||||||
userBirthday = findViewById(R.id.userBirthday);
|
|
||||||
btnRegister = findViewById(R.id.btn_register);
|
myAdapter = new LabelTagAdapter(mContext, new LabelTagAdapter.OnSureOnClickListener() {
|
||||||
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
|
@Override
|
||||||
public void onClick(View v) {
|
public void sure(LabelBean.Children labelBean) {
|
||||||
chooseImage();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
myFlowTag.setAdapter(myAdapter);
|
||||||
|
myFlowTag.setTagCheckedMode(FlowTagLayout.FLOW_TAG_CHECKED_NONE);
|
||||||
|
myAdapter.setData(myLabelList);
|
||||||
|
|
||||||
userBirthday.setText(year + " 年 " + (month + 1) + " 月 " + day + " 日 ");
|
recyclerView.setHasFixedSize(true);
|
||||||
|
LinearLayoutManager layoutManager1 = new LinearLayoutManager(ChooseLabelActivity.this);
|
||||||
|
layoutManager1.setOrientation(LinearLayoutManager.VERTICAL);
|
||||||
|
recyclerView.setLayoutManager(layoutManager1);
|
||||||
|
|
||||||
userSex1.setOnClickListener(new View.OnClickListener() {
|
lableChooseAdapter = new LableChooseAdapter(ChooseLabelActivity.this, new LableChooseAdapter.onItemLabelClicklistener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onChoose(LabelBean.Children children) {
|
||||||
changeSex(0);
|
addLabel(children);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
userSex2.setOnClickListener(new View.OnClickListener() {
|
recyclerView.setAdapter(lableChooseAdapter);
|
||||||
|
|
||||||
|
next.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
changeSex(1);
|
finish();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
userBirthday.setOnClickListener(new View.OnClickListener() {
|
submit.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
//时间选择器
|
setLabel();
|
||||||
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;
|
* 设置标签
|
||||||
|
*/
|
||||||
|
private void setLabel() {
|
||||||
|
StringBuffer labels = new StringBuffer();
|
||||||
|
for (int i = 0; i < myLabelList.size(); i++) {
|
||||||
|
if (i == 0) {
|
||||||
|
labels.append(myLabelList.get(i).getId());
|
||||||
|
} else {
|
||||||
|
labels.append("," + myLabelList.get(i).getId());
|
||||||
}
|
}
|
||||||
OTONetManager.getInstance(mContext).setInfo(avatarUrl, userNickName.getText().toString(), sex, year + "-" + month + "-" + day, new HttpCallback<HttpCallbackModel>() {
|
}
|
||||||
|
OTONetManager.getInstance(mContext).setLabels(labels.toString(), new HttpCallback<HttpCallbackModel>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(HttpCallbackModel data) {
|
public void onSuccess(HttpCallbackModel data) {
|
||||||
Toast.makeText(mContext, data.getMsg(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(mContext, data.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
if (data.getCode() == 0) {
|
if (data.getCode() == 0) {
|
||||||
Intent intent = new Intent(ChooseLabelActivity.this, MainActivity.class);
|
|
||||||
intent.putExtra(Constants.SHOW_INVITE, false);
|
|
||||||
startActivity(intent);
|
|
||||||
|
|
||||||
RouteManager.forwardMainActivity();
|
RouteManager.forwardMainActivity();
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
@ -212,40 +145,40 @@ public class ChooseLabelActivity extends AbsOTOActivity {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 选择图片
|
* 处理标签 +-
|
||||||
|
*
|
||||||
|
* @param children
|
||||||
*/
|
*/
|
||||||
private void chooseImage() {
|
private void addLabel(LabelBean.Children children) {
|
||||||
UserAvatarPopup userAvatarPopup = new UserAvatarPopup(this, userAvatar1 -> {
|
if (children.isSelect()) {
|
||||||
avatarUrl = userAvatar1;
|
boolean isAdd = true;
|
||||||
ImgLoader.display(ChooseLabelActivity.this, avatarUrl, userAvatar);
|
for (int i = 0; i < myLabelList.size(); i++) {
|
||||||
//txtChoose.setVisibility(View.GONE);
|
if (myLabelList.get(i).getId() == children.getId()) {
|
||||||
}, isCamera -> {
|
isAdd = false;
|
||||||
if (isCamera) {
|
|
||||||
cameraUtil.getImageByCamera();
|
|
||||||
} else {
|
|
||||||
cameraUtil.getImageByAlumb();
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
new XPopup.Builder(mContext).asCustom(userAvatarPopup).show();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
if (isAdd) {
|
||||||
private void changeSex(int i) {
|
myLabelList.add(children);
|
||||||
sex = i;
|
myAdapter.setData(myLabelList);
|
||||||
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 {
|
} else {
|
||||||
userSex1.setTextColor(getResources().getColor(R.color.text_gray));
|
int index = -1;
|
||||||
userSex2.setTextColor(getResources().getColor(R.color.white));
|
for (int i = 0; i < myLabelList.size(); i++) {
|
||||||
userSex1.setBackgroundResource(R.mipmap.icon_user_sex_00);
|
if (myLabelList.get(i).getId() == children.getId()) {
|
||||||
userSex2.setBackgroundResource(R.mipmap.icon_user_sex_01);
|
index = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (index != -1) {
|
||||||
|
myLabelList.remove(index);
|
||||||
|
myAdapter.setData(myLabelList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (myLabelList.size() > 0) {
|
||||||
|
findViewById(R.id.notitle).setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
findViewById(R.id.notitle).setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -197,11 +197,7 @@ public class CompleteActivity extends AbsOTOActivity {
|
|||||||
public void onSuccess(HttpCallbackModel data) {
|
public void onSuccess(HttpCallbackModel data) {
|
||||||
Toast.makeText(mContext, data.getMsg(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(mContext, data.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
if (data.getCode() == 0) {
|
if (data.getCode() == 0) {
|
||||||
Intent intent = new Intent(CompleteActivity.this, MainActivity.class);
|
RouteManager.forwardChooseActivity();
|
||||||
intent.putExtra(Constants.SHOW_INVITE, false);
|
|
||||||
startActivity(intent);
|
|
||||||
|
|
||||||
RouteManager.forwardMainActivity();
|
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,57 @@
|
|||||||
|
package com.shayu.onetoone.adapter;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.shayu.onetoone.R;
|
||||||
|
import com.shayu.onetoone.bean.LabelBean;
|
||||||
|
import com.xuexiang.xui.widget.flowlayout.BaseTagAdapter;
|
||||||
|
|
||||||
|
public class LabelChooseTagAdapter extends BaseTagAdapter<LabelBean.Children, TextView> {
|
||||||
|
|
||||||
|
OnSureOnClickListener onSureOnClickListener;
|
||||||
|
|
||||||
|
Context mContext;
|
||||||
|
|
||||||
|
public LabelChooseTagAdapter(Context context, OnSureOnClickListener onSureOnClickListener) {
|
||||||
|
super(context);
|
||||||
|
this.onSureOnClickListener = onSureOnClickListener;
|
||||||
|
this.mContext = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LabelChooseTagAdapter(Context context) {
|
||||||
|
super(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected TextView newViewHolder(View convertView) {
|
||||||
|
return (TextView) convertView.findViewById(R.id.tv_tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int getLayoutId() {
|
||||||
|
return R.layout.adapter_item_tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void convert(TextView textView, LabelBean.Children item, int position) {
|
||||||
|
textView.setText(item.getCn_title());
|
||||||
|
if (item.isSelect()) {
|
||||||
|
textView.setBackground(getDrawable(R.drawable.bg_rect_round_tag_btn1));
|
||||||
|
textView.setTextColor(mContext.getResources().getColor(R.color.white));
|
||||||
|
} else {
|
||||||
|
textView.setBackground(getDrawable(R.drawable.bg_rect_round_tag_btn));
|
||||||
|
textView.setTextColor(mContext.getResources().getColor(R.color.black2));
|
||||||
|
}
|
||||||
|
textView.setOnClickListener(v -> {
|
||||||
|
item.setSelect(!item.isSelect());
|
||||||
|
onSureOnClickListener.sure(item);
|
||||||
|
notifyDataSetChanged();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface OnSureOnClickListener {
|
||||||
|
void sure(LabelBean.Children labelBean);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,48 @@
|
|||||||
|
package com.shayu.onetoone.adapter;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.shayu.onetoone.R;
|
||||||
|
import com.shayu.onetoone.bean.LabelBean;
|
||||||
|
import com.xuexiang.xui.widget.flowlayout.BaseTagAdapter;
|
||||||
|
|
||||||
|
public class LabelTagAdapter extends BaseTagAdapter<LabelBean.Children, TextView> {
|
||||||
|
|
||||||
|
OnSureOnClickListener onSureOnClickListener;
|
||||||
|
|
||||||
|
Context mContext;
|
||||||
|
|
||||||
|
public LabelTagAdapter(Context context, OnSureOnClickListener onSureOnClickListener) {
|
||||||
|
super(context);
|
||||||
|
this.onSureOnClickListener = onSureOnClickListener;
|
||||||
|
this.mContext = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LabelTagAdapter(Context context) {
|
||||||
|
super(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected TextView newViewHolder(View convertView) {
|
||||||
|
return (TextView) convertView.findViewById(R.id.tv_tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int getLayoutId() {
|
||||||
|
return R.layout.adapter_item_tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void convert(TextView textView, LabelBean.Children item, int position) {
|
||||||
|
textView.setText(item.getCn_title());
|
||||||
|
textView.setBackground(getDrawable(R.drawable.bg_rect_round_tag_btn));
|
||||||
|
textView.setTextColor(mContext.getResources().getColor(R.color.black2));
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface OnSureOnClickListener {
|
||||||
|
void sure(LabelBean.Children labelBean);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,88 @@
|
|||||||
|
package com.shayu.onetoone.adapter;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.shayu.onetoone.R;
|
||||||
|
import com.shayu.onetoone.bean.LabelBean;
|
||||||
|
import com.xuexiang.xui.widget.flowlayout.FlowTagLayout;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class LableChooseAdapter extends RecyclerView.Adapter<LableChooseAdapter.ViewHolder> {
|
||||||
|
private Context mContext;
|
||||||
|
private List<LabelBean> list;
|
||||||
|
private int selectPosition = 0;
|
||||||
|
|
||||||
|
public onItemLabelClicklistener onItemLabelClicklistener;
|
||||||
|
|
||||||
|
public LableChooseAdapter(Context mContext, onItemLabelClicklistener onItemLabelClicklistener) {
|
||||||
|
this.mContext = mContext;
|
||||||
|
list = new ArrayList<>();
|
||||||
|
this.onItemLabelClicklistener = onItemLabelClicklistener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setList(List<LabelBean> list) {
|
||||||
|
this.list = list;
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
return new ViewHolder(LayoutInflater.from(mContext).inflate(R.layout.adapter_choose_label, parent, false));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||||
|
holder.setData(list.get(position), position);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return list.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
public LabelBean getItem() {
|
||||||
|
return list.get(selectPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
private FlowTagLayout flowTagLayout;
|
||||||
|
private TextView title;
|
||||||
|
|
||||||
|
public ViewHolder(@NonNull View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
flowTagLayout = itemView.findViewById(R.id.myFlowTag);
|
||||||
|
title = itemView.findViewById(R.id.title);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setData(LabelBean labelBean, int position) {
|
||||||
|
LabelChooseTagAdapter tagAdapter1 = new LabelChooseTagAdapter(mContext, new LabelChooseTagAdapter.OnSureOnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void sure(LabelBean.Children labelBean) {
|
||||||
|
if (onItemLabelClicklistener != null) {
|
||||||
|
onItemLabelClicklistener.onChoose(labelBean);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
flowTagLayout.setAdapter(tagAdapter1);
|
||||||
|
flowTagLayout.setTagCheckedMode(FlowTagLayout.FLOW_TAG_CHECKED_NONE);
|
||||||
|
tagAdapter1.setData(labelBean.getChildren());
|
||||||
|
title.setText(labelBean.getCn_title());
|
||||||
|
title.setTag(labelBean);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface onItemLabelClicklistener {
|
||||||
|
void onChoose(LabelBean.Children children);
|
||||||
|
}
|
||||||
|
}
|
124
OneToOne/src/main/java/com/shayu/onetoone/bean/LabelBean.java
Normal file
124
OneToOne/src/main/java/com/shayu/onetoone/bean/LabelBean.java
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
package com.shayu.onetoone.bean;
|
||||||
|
|
||||||
|
import com.yunbao.common.bean.BaseModel;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class LabelBean extends BaseModel {
|
||||||
|
private int id;
|
||||||
|
private int pid;
|
||||||
|
private String cn_title;
|
||||||
|
private String en_title;
|
||||||
|
private List<Children> children;
|
||||||
|
|
||||||
|
public class Children {
|
||||||
|
private int id;
|
||||||
|
private int pid;
|
||||||
|
private String cn_title;
|
||||||
|
private String en_title;
|
||||||
|
private List<Children> children;
|
||||||
|
|
||||||
|
private boolean isSelect;
|
||||||
|
|
||||||
|
public boolean isSelect() {
|
||||||
|
return isSelect;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSelect(boolean select) {
|
||||||
|
isSelect = select;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Children() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPid() {
|
||||||
|
return pid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPid(int pid) {
|
||||||
|
this.pid = pid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCn_title() {
|
||||||
|
return cn_title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCn_title(String cn_title) {
|
||||||
|
this.cn_title = cn_title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEn_title() {
|
||||||
|
return en_title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEn_title(String en_title) {
|
||||||
|
this.en_title = en_title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Children> getChildren() {
|
||||||
|
return children;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChildren(List<Children> children) {
|
||||||
|
this.children = children;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPid() {
|
||||||
|
return pid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPid(int pid) {
|
||||||
|
this.pid = pid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCn_title() {
|
||||||
|
return cn_title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCn_title(String cn_title) {
|
||||||
|
this.cn_title = cn_title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEn_title() {
|
||||||
|
return en_title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEn_title(String en_title) {
|
||||||
|
this.en_title = en_title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Children> getChildren() {
|
||||||
|
return children;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<String> getStringChildren() {
|
||||||
|
List<String> stringList = new ArrayList<>();
|
||||||
|
for (int i = 0; i < children.size(); i++) {
|
||||||
|
stringList.add(children.get(i).getCn_title());
|
||||||
|
}
|
||||||
|
return stringList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChildren(List<Children> children) {
|
||||||
|
this.children = children;
|
||||||
|
}
|
||||||
|
}
|
@ -13,6 +13,7 @@ import com.shayu.onetoone.bean.GreetBean;
|
|||||||
import com.shayu.onetoone.bean.HomeItemBean;
|
import com.shayu.onetoone.bean.HomeItemBean;
|
||||||
import com.shayu.onetoone.bean.HomeRankBean;
|
import com.shayu.onetoone.bean.HomeRankBean;
|
||||||
import com.shayu.onetoone.bean.JoinAnchorBean;
|
import com.shayu.onetoone.bean.JoinAnchorBean;
|
||||||
|
import com.shayu.onetoone.bean.LabelBean;
|
||||||
import com.shayu.onetoone.bean.MessageConsumeConfigBean;
|
import com.shayu.onetoone.bean.MessageConsumeConfigBean;
|
||||||
import com.shayu.onetoone.bean.OfficialNoticeBean;
|
import com.shayu.onetoone.bean.OfficialNoticeBean;
|
||||||
import com.shayu.onetoone.bean.PurseBean;
|
import com.shayu.onetoone.bean.PurseBean;
|
||||||
@ -467,7 +468,7 @@ public class OTONetManager {
|
|||||||
}).isDisposed();
|
}).isDisposed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getHomeHot(String page,HttpCallback<List<HomeItemBean>> callback) {
|
public void getHomeHot(String page, HttpCallback<List<HomeItemBean>> callback) {
|
||||||
|
|
||||||
API.get().otoApi(mContext)
|
API.get().otoApi(mContext)
|
||||||
.getHomeHot(page)
|
.getHomeHot(page)
|
||||||
@ -491,7 +492,7 @@ public class OTONetManager {
|
|||||||
}).isDisposed();
|
}).isDisposed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getHomeRecommend(String page,HttpCallback<List<HomeItemBean>> callback) {
|
public void getHomeRecommend(String page, HttpCallback<List<HomeItemBean>> callback) {
|
||||||
|
|
||||||
API.get().otoApi(mContext)
|
API.get().otoApi(mContext)
|
||||||
.getHomeRecommend(page)
|
.getHomeRecommend(page)
|
||||||
@ -683,7 +684,7 @@ public class OTONetManager {
|
|||||||
HttpCallback<List<HomeItemBean>> callback) {
|
HttpCallback<List<HomeItemBean>> callback) {
|
||||||
|
|
||||||
API.get().otoApi(mContext)
|
API.get().otoApi(mContext)
|
||||||
.search(keyword, age, name_auth, sex, "",page)
|
.search(keyword, age, name_auth, sex, "", page)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(model -> {
|
.subscribe(model -> {
|
||||||
@ -700,6 +701,7 @@ public class OTONetManager {
|
|||||||
}
|
}
|
||||||
}).isDisposed();
|
}).isDisposed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getSearchRecommend(HttpCallback<List<HomeItemBean>> callback) {
|
public void getSearchRecommend(HttpCallback<List<HomeItemBean>> callback) {
|
||||||
|
|
||||||
API.get().otoApi(mContext)
|
API.get().otoApi(mContext)
|
||||||
@ -723,6 +725,7 @@ public class OTONetManager {
|
|||||||
}
|
}
|
||||||
}).isDisposed();
|
}).isDisposed();
|
||||||
}
|
}
|
||||||
|
|
||||||
private MultipartBody.Part createUploadFile(File file) {
|
private MultipartBody.Part createUploadFile(File file) {
|
||||||
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);
|
||||||
@ -785,6 +788,65 @@ public class OTONetManager {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}).isDisposed();
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取系统 Label
|
||||||
|
*
|
||||||
|
* @param callback
|
||||||
|
*/
|
||||||
|
public void getSysLabel(HttpCallback<List<LabelBean>> callback) {
|
||||||
|
API.get().otoApi(mContext)
|
||||||
|
.getSysLabel()
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Consumer<ResponseModel<List<LabelBean>>>() {
|
||||||
|
@Override
|
||||||
|
public void accept(ResponseModel<List<LabelBean>> 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 setLabels(
|
||||||
|
String labels,
|
||||||
|
HttpCallback<HttpCallbackModel> callback) {
|
||||||
|
|
||||||
|
API.get().otoApi(mContext).setLabels(labels)
|
||||||
|
.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();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ public class RouteManager {
|
|||||||
public static final String ACTIVITY_HOME_RANK = "/activity/HomepageRankingActivity";
|
public static final String ACTIVITY_HOME_RANK = "/activity/HomepageRankingActivity";
|
||||||
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 PATH_EDITPROFILE = "/main/EditProfileActivity";
|
||||||
|
|
||||||
//设置基本资料
|
//设置基本资料
|
||||||
@ -26,7 +26,6 @@ public class RouteManager {
|
|||||||
//选择标签
|
//选择标签
|
||||||
public static final String ACTIVITY_CHOOSE_LABEL = "/activity/ChooseLabelActivity";
|
public static final String ACTIVITY_CHOOSE_LABEL = "/activity/ChooseLabelActivity";
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 选择标签
|
* 选择标签
|
||||||
*/
|
*/
|
||||||
@ -48,51 +47,40 @@ public class RouteManager {
|
|||||||
ARouter.getInstance().build(ACTIVITY_COMPLETE).navigation();
|
ARouter.getInstance().build(ACTIVITY_COMPLETE).navigation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void forwardMainActivity() {
|
public static void forwardMainActivity() {
|
||||||
ARouter.getInstance().build(ACTIVITY_MAIN)
|
ARouter.getInstance().build(ACTIVITY_MAIN).navigation();
|
||||||
.navigation();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void forwardMainActivityForScreen(Bundle bundle) {
|
public static void forwardMainActivityForScreen(Bundle bundle) {
|
||||||
ARouter.getInstance().build(ACTIVITY_MAIN)
|
ARouter.getInstance().build(ACTIVITY_MAIN).withBundle("screen", bundle).navigation();
|
||||||
.withBundle("screen",bundle)
|
|
||||||
.navigation();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void forwardMsgMoreConfigActivity() {
|
public static void forwardMsgMoreConfigActivity() {
|
||||||
ARouter.getInstance().build(ACTIVITY_MSG_MORE_CONFIG_ACTIVITY)
|
ARouter.getInstance().build(ACTIVITY_MSG_MORE_CONFIG_ACTIVITY).navigation();
|
||||||
.navigation();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void forwardMsgChatActivity() {
|
public static void forwardMsgChatActivity() {
|
||||||
ARouter.getInstance().build(ACTIVITY_MSG_CHAT)
|
ARouter.getInstance().build(ACTIVITY_MSG_CHAT).navigation();
|
||||||
.navigation();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void forwardEntryActivity() {
|
public static void forwardEntryActivity() {
|
||||||
ARouter.getInstance().build(ACTIVITY_ENTRY)
|
ARouter.getInstance().build(ACTIVITY_ENTRY).navigation();
|
||||||
.navigation();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void forwardLoginActivity() {
|
public static void forwardLoginActivity() {
|
||||||
ARouter.getInstance().build(ACTIVITY_LOGIN)
|
ARouter.getInstance().build(ACTIVITY_LOGIN).navigation();
|
||||||
.navigation();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void forwardWebViewActivity(String title, String url) {
|
public static void forwardWebViewActivity(String title, String url) {
|
||||||
ARouter.getInstance().build(ACTIVITY_WEB_VIEW)
|
ARouter.getInstance().build(ACTIVITY_WEB_VIEW).withString("title", title).withString("url", url).navigation();
|
||||||
.withString("title", title)
|
|
||||||
.withString("url", url)
|
|
||||||
.navigation();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void forwardActivity(String path) {
|
public static void forwardActivity(String path) {
|
||||||
ARouter.getInstance().build(path)
|
ARouter.getInstance().build(path).navigation();
|
||||||
.navigation();
|
|
||||||
}
|
}
|
||||||
public static void forwardActivity(String path,Bundle bundle) {
|
|
||||||
ARouter.getInstance().build(path)
|
public static void forwardActivity(String path, Bundle bundle) {
|
||||||
.withBundle("bundle",bundle)
|
ARouter.getInstance().build(path).withBundle("bundle", bundle).navigation();
|
||||||
.navigation();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ import com.shayu.onetoone.bean.GreetBean;
|
|||||||
import com.shayu.onetoone.bean.HomeItemBean;
|
import com.shayu.onetoone.bean.HomeItemBean;
|
||||||
import com.shayu.onetoone.bean.HomeRankBean;
|
import com.shayu.onetoone.bean.HomeRankBean;
|
||||||
import com.shayu.onetoone.bean.JoinAnchorBean;
|
import com.shayu.onetoone.bean.JoinAnchorBean;
|
||||||
|
import com.shayu.onetoone.bean.LabelBean;
|
||||||
import com.shayu.onetoone.bean.MessageConsumeConfigBean;
|
import com.shayu.onetoone.bean.MessageConsumeConfigBean;
|
||||||
import com.shayu.onetoone.bean.OfficialNoticeBean;
|
import com.shayu.onetoone.bean.OfficialNoticeBean;
|
||||||
import com.shayu.onetoone.bean.PurseBean;
|
import com.shayu.onetoone.bean.PurseBean;
|
||||||
@ -175,7 +176,6 @@ public interface OneToOneApi {
|
|||||||
Observable<ResponseModel<List<HomeItemBean>>> getSearchRecommend();
|
Observable<ResponseModel<List<HomeItemBean>>> getSearchRecommend();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置基本信息
|
* 设置基本信息
|
||||||
*/
|
*/
|
||||||
@ -188,7 +188,6 @@ public interface OneToOneApi {
|
|||||||
@Field("birthday") String birthday
|
@Field("birthday") String birthday
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取系统默认头像列表
|
* 获取系统默认头像列表
|
||||||
*/
|
*/
|
||||||
@ -200,7 +199,17 @@ public interface OneToOneApi {
|
|||||||
* 获取系统标签
|
* 获取系统标签
|
||||||
*/
|
*/
|
||||||
@GET("/api/public/?service=Friendapplable.get")
|
@GET("/api/public/?service=Friendapplable.get")
|
||||||
Observable<ResponseModel<List<HomeRankBean>>> getSysLabel(
|
Observable<ResponseModel<List<LabelBean>>> getSysLabel(
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置基本信息
|
||||||
|
*/
|
||||||
|
@FormUrlEncoded
|
||||||
|
@POST("/api/public/?service=Friendappinfos.setLabel")
|
||||||
|
Observable<ResponseModel<List<BaseModel>>> setLabels(
|
||||||
|
@Field("labels") String avatar
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
25
OneToOne/src/main/res/drawable/bg_rect_round_tag_btn.xml
Normal file
25
OneToOne/src/main/res/drawable/bg_rect_round_tag_btn.xml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<item android:state_pressed="true">
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="#F1F1F1" />
|
||||||
|
<corners android:radius="20dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
<item android:state_selected="true">
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="#F1F1F1" />
|
||||||
|
<corners android:radius="20dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="#F1F1F1" />
|
||||||
|
<corners android:radius="20dp" />
|
||||||
|
<stroke android:width="1dp" android:color="#F1F1F1" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
10
OneToOne/src/main/res/drawable/bg_rect_round_tag_btn1.xml
Normal file
10
OneToOne/src/main/res/drawable/bg_rect_round_tag_btn1.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>
|
@ -3,6 +3,7 @@
|
|||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/white"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="15dp">
|
android:padding="15dp">
|
||||||
|
|
||||||
@ -11,6 +12,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="right"
|
android:layout_gravity="right"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
android:padding="10dp"
|
android:padding="10dp"
|
||||||
android:text="跳过"
|
android:text="跳过"
|
||||||
android:textColor="@color/black2"
|
android:textColor="@color/black2"
|
||||||
@ -18,7 +20,8 @@
|
|||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -31,24 +34,44 @@
|
|||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
android:text="我的标签"
|
android:text="我的标签"
|
||||||
android:textColor="@color/black2"
|
android:textColor="@color/black2"
|
||||||
android:textSize="16sp" />
|
android:textSize="18sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/notitle"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:text="暂无标签"
|
||||||
|
android:textColor="@color/gray1"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
<com.xuexiang.xui.widget.flowlayout.FlowTagLayout
|
<com.xuexiang.xui.widget.flowlayout.FlowTagLayout
|
||||||
android:id="@+id/myLabel"
|
android:id="@+id/myFlowTag"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="15dp"
|
android:layout_marginTop="5dp"
|
||||||
android:layout_marginBottom="10dp"
|
android:layout_marginBottom="10dp"
|
||||||
app:ftl_check_mode="none" />
|
app:ftl_check_mode="none" />
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recyclerView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent" />
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/submit"
|
||||||
|
android:layout_width="150dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center|bottom"
|
||||||
|
android:layout_marginBottom="20dp"
|
||||||
|
android:background="@drawable/bg_rect_round_tag_btn1"
|
||||||
|
android:padding="10dp"
|
||||||
|
android:text="完成"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="18sp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
25
OneToOne/src/main/res/layout/adapter_choose_label.xml
Normal file
25
OneToOne/src/main/res/layout/adapter_choose_label.xml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<?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="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/title"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:text="我的标签"
|
||||||
|
android:textColor="@color/black2"
|
||||||
|
android:textSize="18sp" />
|
||||||
|
|
||||||
|
<com.xuexiang.xui.widget.flowlayout.FlowTagLayout
|
||||||
|
android:id="@+id/myFlowTag"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
|
app:ftl_check_mode="none" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
21
OneToOne/src/main/res/layout/adapter_item_tag.xml
Normal file
21
OneToOne/src/main/res/layout/adapter_item_tag.xml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_tag"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="32dp"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
|
android:background="@drawable/bg_rect_round_tag_btn"
|
||||||
|
android:paddingStart="15dp"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:paddingEnd="15dp"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:text="活泼"
|
||||||
|
android:textColor="@color/black2" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
Loading…
x
Reference in New Issue
Block a user