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
#	OneToOne/src/main/java/com/shayu/onetoone/network/OneToOneApi.java
This commit is contained in:
hch 2023-10-16 18:21:11 +08:00
commit 52d565c4ee
27 changed files with 970 additions and 309 deletions

View File

@ -141,7 +141,8 @@
<activity
android:name=".activity.HomepageRankingActivity"
android:windowSoftInputMode="stateHidden|adjustResize" />
<activity android:name=".activity.HomeSearchActivity" />
<activity android:name=".activity.HomeScreenActivity" android:windowSoftInputMode="stateHidden|adjustResize" />
<activity android:name=".activity.HomeSearchActivity" android:windowSoftInputMode="stateHidden|adjustResize" />
<provider

View File

@ -0,0 +1,97 @@
package com.shayu.onetoone.activity;
import android.os.Bundle;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.RadioButton;
import android.widget.TextView;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.shayu.onetoone.R;
import com.shayu.onetoone.manager.RouteManager;
import com.shayu.onetoone.widget.flexboxradiogroup.FlexBoxRadioGroup;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.ToastUtil;
@Route(path = RouteManager.ACTIVITY_HOME_SCREEN)
public class HomeScreenActivity extends AbsOTOActivity {
EditText etSearch;
TextView tvSearch;
LinearLayout ageLayout;
LinearLayout sexLayout;
LinearLayout authLayout;
FlexBoxRadioGroup ageRadioGroup;
FlexBoxRadioGroup sexRadioGroup;
FlexBoxRadioGroup authRadioGroup;
Button apply;
@Override
protected int getLayoutId() {
return R.layout.activity_screen;
}
@Override
protected void main(Bundle savedInstanceState) {
etSearch = findViewById(R.id.edit);
tvSearch = findViewById(R.id.search);
ageLayout = findViewById(R.id.age_layout);
sexLayout = findViewById(R.id.sex_layout);
authLayout = findViewById(R.id.auth_layout);
ageRadioGroup = findViewById(R.id.age_radio_group);
sexRadioGroup = findViewById(R.id.sex_radio_group);
authRadioGroup = findViewById(R.id.auth_radio_group);
apply = findViewById(R.id.apply);
apply.setOnClickListener(v -> {
String age = getRadioButtonValue(ageRadioGroup);
String sex = getRadioButton(sexRadioGroup).getTag().toString();
String auth = getRadioButtonValue(authRadioGroup);
if (isRadioButtonEmpty(ageRadioGroup)) {
age = "";
}
if (isRadioButtonEmpty(authRadioGroup)) {
auth = "";
}
if (sex.equals("all")) {
sex = "";
}
if (StringUtil.isEmptyAll(age, auth, sex)) {
RouteManager.forwardMainActivity();
} else {
Bundle bundle = new Bundle();
bundle.putString("age", age);
bundle.putString("sex", sex);
bundle.putString("auth", auth);
RouteManager.forwardMainActivityForScreen(bundle);
}
});
tvSearch.setOnClickListener(v -> {
String search = etSearch.getText().toString();
if(StringUtil.isEmpty(search)){
ToastUtil.show("空的不能搜索");
return;
}
Bundle bundle=new Bundle();
bundle.putString("search",search);
RouteManager.forwardActivity(RouteManager.ACTIVITY_HOME_SEARCH,bundle);
});
}
String getRadioButtonValue(FlexBoxRadioGroup group) {
return ((RadioButton) findViewById(group.getCheckedRadioButtonId())).getText().toString();
}
boolean isRadioButtonEmpty(FlexBoxRadioGroup group) {
RadioButton button = (RadioButton) findViewById(group.getCheckedRadioButtonId());
if (button.getTag() == null) {
return false;
}
return button.getTag().toString().equals("all");
}
RadioButton getRadioButton(FlexBoxRadioGroup group) {
return findViewById(group.getCheckedRadioButtonId());
}
}

View File

@ -1,13 +1,44 @@
package com.shayu.onetoone.activity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.shayu.onetoone.R;
import com.shayu.onetoone.adapter.HomeHotListAdapter;
import com.shayu.onetoone.adapter.HomeRecommendListAdapter;
import com.shayu.onetoone.bean.HomeItemBean;
import com.shayu.onetoone.manager.OTONetManager;
import com.shayu.onetoone.manager.RouteManager;
import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.ToastUtil;
import java.util.List;
import io.rong.imkit.widget.refresh.SmartRefreshLayout;
import io.rong.imkit.widget.refresh.api.RefreshLayout;
import io.rong.imkit.widget.refresh.listener.OnLoadMoreListener;
import io.rong.imkit.widget.refresh.wrapper.RongRefreshHeader;
@Route(path = RouteManager.ACTIVITY_HOME_SEARCH)
public class HomeSearchActivity extends AbsOTOActivity {
View viewEmpty;
View refresh;
SmartRefreshLayout swipeRefreshLayout;
RecyclerView searchList;
RecyclerView recommendList;
EditText edit;
TextView searchBtn;
int page = 1;
HomeRecommendListAdapter searchListAdapter;
HomeHotListAdapter recommendListAdapter;
@Override
protected int getLayoutId() {
return R.layout.activity_search;
@ -15,6 +46,94 @@ public class HomeSearchActivity extends AbsOTOActivity {
@Override
protected void main(Bundle savedInstanceState) {
viewEmpty = findViewById(R.id.view_empty);
refresh = findViewById(R.id.refresh);
swipeRefreshLayout = findViewById(R.id.swipeRefreshLayout);
searchList = findViewById(R.id.searchList);
recommendList = findViewById(R.id.recommendList);
edit = findViewById(R.id.edit);
searchBtn = findViewById(R.id.search);
searchListAdapter = new HomeRecommendListAdapter(this);
recommendListAdapter = new HomeHotListAdapter(this);
swipeRefreshLayout.autoLoadMore();
swipeRefreshLayout.setEnableRefresh(false);
swipeRefreshLayout.setRefreshFooter(new RongRefreshHeader(this));
swipeRefreshLayout.setOnLoadMoreListener(new OnLoadMoreListener() {
@Override
public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
page++;
search(edit.getText().toString());
}
});
searchList.setAdapter(searchListAdapter);
recommendList.setAdapter(recommendListAdapter);
refresh.setOnClickListener(v -> refresh());
searchBtn.setOnClickListener(v -> search(edit.getText().toString()));
edit.setText(getIntent().getBundleExtra("bundle").getString("search"));
search(edit.getText().toString());
refresh();
}
private void search(String key) {
if (StringUtil.isEmpty(key)) {
ToastUtil.show("不能为空");
return;
}
OTONetManager.getInstance(mContext)
.search(key,
"",
"",
"",
page + "",
new HttpCallback<List<HomeItemBean>>() {
@Override
public void onSuccess(List<HomeItemBean> data) {
if (page == 1 && data.isEmpty()) {
searchList.setVisibility(View.GONE);
viewEmpty.setVisibility(View.VISIBLE);
return;
}
viewEmpty.setVisibility(View.GONE);
searchList.setVisibility(View.VISIBLE);
if (page != 1 && data.isEmpty()) {
page--;
swipeRefreshLayout.finishLoadMore();
return;
}
if (page == 1) {
searchListAdapter.setList(data);
} else {
searchListAdapter.addLst(data);
}
}
@Override
public void onError(String error) {
}
}
);
}
private void refresh() {
OTONetManager.getInstance(this)
.getSearchRecommend(new HttpCallback<List<HomeItemBean>>() {
@Override
public void onSuccess(List<HomeItemBean> data) {
recommendListAdapter.setList(data);
}
@Override
public void onError(String error) {
}
});
}
}

View File

@ -46,10 +46,13 @@ public class FriendsFragment extends BaseFragment {
return fragments.size();
}
});
findViewById(R.id.btn_top).setOnClickListener(v ->{
RouteManager.forwardActivity(RouteManager.ACTIVITY_HOME_RANK);
findViewById(R.id.btn_top).setOnClickListener(v -> RouteManager.forwardActivity(RouteManager.ACTIVITY_HOME_RANK));
findViewById(R.id.btn_filter).setOnClickListener(v -> RouteManager.forwardActivity(RouteManager.ACTIVITY_HOME_SCREEN));
});
Bundle screen = getActivity().getIntent().getBundleExtra("screen");
if(screen!=null){
viewPager2.setCurrentItem(0);
}
}
@Override

View File

@ -27,6 +27,7 @@ public class HotFragment extends BaseFragment {
SmartRefreshLayout mRefreshLayout;
SwipeRecyclerView recyclerView;
HomeHotListAdapter adapter;
private int page = 1;
@Override
public void initView(View itemView) {
@ -47,24 +48,37 @@ public class HotFragment extends BaseFragment {
onConversationListLoadMore();
}
});
page = 1;
initData();
}
private void onConversationListLoadMore() {
page++;
initData();
mRefreshLayout.finishLoadMore();
}
private void onConversationListRefresh(RefreshLayout refreshLayout) {
page = 1;
initData();
refreshLayout.finishRefresh();
}
private void initData() {
OTONetManager.getInstance(mContext)
.getHomeHot(new HttpCallback<List<HomeItemBean>>() {
.getHomeHot(page + "", new HttpCallback<List<HomeItemBean>>() {
@Override
public void onSuccess(List<HomeItemBean> data) {
adapter.setList(data);
if (page != 1 && data.isEmpty()) {
page--;
mRefreshLayout.finishLoadMore();
return;
}
if (page != 1) {
adapter.addList(data);
} else {
adapter.setList(data);
}
}
@Override

View File

@ -1,6 +1,5 @@
package com.shayu.onetoone.activity.fragments.home;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
@ -9,9 +8,7 @@ import android.view.ViewGroup;
import androidx.annotation.NonNull;
import com.shayu.onetoone.R;
import com.shayu.onetoone.activity.HomeSearchActivity;
import com.shayu.onetoone.activity.fragments.BaseFragment;
import com.shayu.onetoone.activity.HomepageRankingActivity;
import com.shayu.onetoone.adapter.HomeRecommendListAdapter;
import com.shayu.onetoone.bean.HomeItemBean;
import com.shayu.onetoone.manager.OTONetManager;
@ -31,6 +28,9 @@ public class RecommendFragment extends BaseFragment {
SwipeRecyclerView recyclerView;
HomeRecommendListAdapter adapter;
View top;
private int page = 1;
private boolean isScreen;
Bundle screen;
@Override
public void initView(View itemView) {
@ -42,8 +42,10 @@ public class RecommendFragment extends BaseFragment {
mRefreshLayout.setNestedScrollingEnabled(false);
mRefreshLayout.setRefreshHeader(new RongRefreshHeader(this.getContext()));
mRefreshLayout.setRefreshFooter(new RongRefreshHeader(this.getContext()));
recyclerView.setEmptyView(itemView.findViewById(R.id.view_empty));
mRefreshLayout.setOnRefreshListener(new OnRefreshListener() {
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
page = 1;
onConversationListRefresh(refreshLayout);
}
});
@ -53,13 +55,63 @@ public class RecommendFragment extends BaseFragment {
}
});
top.setOnClickListener(view -> {
// recyclerView.scrollToPosition(0);
startActivity(new Intent(getContext(), HomeSearchActivity.class));
recyclerView.scrollToPosition(0);
});
initData();
screen = getActivity().getIntent().getBundleExtra("screen");
if (screen != null) {
if (!isScreen) {
page = 1;
}
isScreen = true;
screen(screen);
mRefreshLayout.setEnableRefresh(false);
} else {
if (isScreen) {
page = 1;
}
isScreen = false;
initData();
}
}
private void screen(Bundle screen) {
OTONetManager.getInstance(mContext)
.search("",
screen.getString("age", ""),
screen.getString("auth", ""),
screen.getString("sex", ""),
page + "",
new HttpCallback<List<HomeItemBean>>() {
@Override
public void onSuccess(List<HomeItemBean> data) {
if (page != 1 && data.isEmpty()) {
page--;
mRefreshLayout.finishLoadMore();
return;
}
if (page != 1) {
adapter.addLst(data);
} else {
adapter.setList(data);
}
mRefreshLayout.finishRefresh();
}
@Override
public void onError(String error) {
}
}
);
}
private void onConversationListLoadMore() {
page++;
if (isScreen) {
screen(screen);
} else {
initData();
}
mRefreshLayout.finishLoadMore();
}
@ -69,10 +121,19 @@ public class RecommendFragment extends BaseFragment {
private void initData() {
OTONetManager.getInstance(mContext)
.getHomeRecommend(new HttpCallback<List<HomeItemBean>>() {
.getHomeRecommend(page + "", new HttpCallback<List<HomeItemBean>>() {
@Override
public void onSuccess(List<HomeItemBean> data) {
adapter.setList(data);
if (page != 1 && data.isEmpty()) {
page--;
mRefreshLayout.finishLoadMore();
return;
}
if (page != 1) {
adapter.addLst(data);
} else {
adapter.setList(data);
}
mRefreshLayout.finishRefresh();
}

View File

@ -12,6 +12,7 @@ import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
@ -44,6 +45,7 @@ import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.interfaces.ImageResultCallback;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.ProcessImageUtil;
import com.yunbao.common.utils.SpUtil;
import com.yunbao.common.utils.StringUtil;
@ -54,15 +56,20 @@ import java.io.File;
import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import io.rong.imkit.IMCenter;
import io.rong.imkit.config.RongConfigCenter;
import io.rong.imkit.conversation.MessageListAdapter;
import io.rong.imkit.conversation.extension.component.plugin.IPluginModule;
import io.rong.imkit.conversation.extension.component.plugin.ImagePlugin;
import io.rong.imkit.manager.SendImageManager;
import io.rong.imkit.model.UiMessage;
import io.rong.imkit.picture.PictureSelectionModel;
import io.rong.imkit.picture.PictureSelector;
import io.rong.imkit.picture.config.PictureMimeType;
import io.rong.imkit.picture.entity.LocalMedia;
import io.rong.imlib.IRongCallback;
import io.rong.imlib.RongIMClient;
import io.rong.imlib.model.Conversation;
@ -246,22 +253,22 @@ public class ChatMessageFragment extends AbsConversationFragment {
boolean isCamera = position == 1;
SendMessageManager.sendMessageForText(targetId, "图片信息", new OnSendMessageListener() {
// PictureSelector.create(currentFragment)
// .openGallery(RongConfigCenter.conversationConfig().rc_media_selector_contain_video ? PictureMimeType.ofAll() : PictureMimeType.ofImage())
// .loadImageEngine(RongConfigCenter.featureConfig().getKitImageEngine())
// .setRequestedOrientation(1)
// .videoDurationLimit(RongIMClient.getInstance().getVideoLimitTime())
// .maxSelectNum(9)
// .imageSpanCount(3)
// .isGif(true)
// .forResult(this.mRequestCode);
@Override
public void onSuccess(String token) {
super.onSuccess(token);
ChatMessageFragment.this.token = token;
if (isCamera) {
PictureSelector.create(ChatMessageFragment.this).openCamera(PictureMimeType.ofImage());
cameraUtil.getImageByCamera(false);
} else {
PictureSelector.create(ChatMessageFragment.this).openGallery(PictureMimeType.ofImage());
PictureSelector.create(ChatMessageFragment.this)
.openGallery(PictureMimeType.ofImage())
.loadImageEngine(RongConfigCenter.featureConfig().getKitImageEngine())
.setRequestedOrientation(1)
.videoDurationLimit(RongIMClient.getInstance().getVideoLimitTime())
.maxSelectNum(9)
.imageSpanCount(3)
.isGif(true)
.forResult(110);
}
}
@ -285,7 +292,7 @@ public class ChatMessageFragment extends AbsConversationFragment {
.getTargetUserInfo(Integer.parseInt(targetId), new HttpCallback<UserBean>() {
@Override
public void onSuccess(UserBean data) {
if (data.getInfo().getSage_auth() == 1) {
if (data.getInfo().getName_auth() == 1) {
listener.onError(0, "");
} else {
listener.onSuccess("");
@ -400,6 +407,7 @@ public class ChatMessageFragment extends AbsConversationFragment {
@Override
public void onSuccess(Message message) {
SendMessageManager.onCallSuccess(token, null);
}
@Override
@ -560,6 +568,51 @@ public class ChatMessageFragment extends AbsConversationFragment {
@Override
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
ToastUtil.show("收到回调");
if (requestCode == 110) {
List<LocalMedia> selectList = PictureSelector.obtainMultipleResult(data);
if (selectList != null && selectList.size() > 0) {
boolean sendOrigin = ((LocalMedia) selectList.get(0)).isOriginal();
for (LocalMedia item : selectList) {
String mimeType = item.getMimeType();
if (mimeType.startsWith("image")) {
ImageMessage imageMessage=ImageMessage.obtain(Uri.parse(item.getPath()),sendOrigin);
Message message = Message.obtain(targetId, conversationType, imageMessage);
message.setSenderUserId(CommonAppConfig.getInstance().getUid());
message.setObjectName("RC:ImgMsg");
message.setExtra("");
message.setSentTime(new Date().getTime());
message.setTargetId(targetId);
IMCenter.getInstance().sendMediaMessage(message, null, null, new IRongCallback.ISendMediaMessageCallback() {
@Override
public void onProgress(Message message, int progress) {
}
@Override
public void onCanceled(Message message) {
}
@Override
public void onAttached(Message message) {
}
@Override
public void onSuccess(Message message) {
SendMessageManager.onCallSuccess(token, null);
}
@Override
public void onError(Message message, RongIMClient.ErrorCode errorCode) {
ToastUtil.show(R.string.system_tip_failure);
System.out.println("发送失败:" + errorCode.getMessage());
}
});
}
}
}
}
}
}

View File

@ -42,7 +42,7 @@ public class HomeHotListAdapter extends RecyclerView.Adapter<HomeHotListAdapter.
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
holder.setData(list.get(position),position);
holder.setData(list.get(position), position);
}
@Override
@ -50,6 +50,11 @@ public class HomeHotListAdapter extends RecyclerView.Adapter<HomeHotListAdapter.
return list.size();
}
public void addList(List<HomeItemBean> data) {
list.addAll(data);
notifyDataSetChanged();
}
public class ViewHolder extends RecyclerView.ViewHolder {
private RoundedImageView avatar;
private ImageView status;

View File

@ -52,6 +52,11 @@ public class HomeRecommendListAdapter extends RecyclerView.Adapter<HomeRecommend
notifyDataSetChanged();
}
public void addLst(List<HomeItemBean> data) {
this.list.addAll(data);
notifyDataSetChanged();
}
public class ViewHolder extends RecyclerView.ViewHolder {
private RoundedImageView avatar;
private ImageView chat;
@ -88,7 +93,7 @@ public class HomeRecommendListAdapter extends RecyclerView.Adapter<HomeRecommend
} else {
sex.setImageResource(R.mipmap.ic_message_tab_woman);
}
if (bean.getSage_auth() == 1) {
if (bean.getName_auth() == 1) {
auth.setVisibility(View.VISIBLE);
} else {
auth.setVisibility(View.GONE);

View File

@ -2,6 +2,7 @@ package com.shayu.onetoone.adapter;
import android.text.SpannableString;
import com.shayu.onetoone.bean.MessageChatAuthContent;
import com.shayu.onetoone.bean.MessageChatGiftContent;
import com.yanzhenjie.recyclerview.SwipeRecyclerView;
@ -66,6 +67,8 @@ public class MsgMessageRecyclerViewAdapter extends ConversationListAdapter {
if (datum.mCore.getConversationType() == Conversation.ConversationType.PRIVATE || datum.mCore.getConversationType() == Conversation.ConversationType.SYSTEM) {
if(datum.mCore.getLatestMessage() instanceof MessageChatGiftContent){
datum.mConversationContent=new SpannableString("[禮物]");
}else if(datum.mCore.getLatestMessage() instanceof MessageChatAuthContent){
datum.mConversationContent=new SpannableString("[邀請認證]");
}
if (datum.mCore.isTop()) {
top.add(datum);

View File

@ -1,6 +1,8 @@
package com.shayu.onetoone.dialog;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
@ -15,8 +17,11 @@ import com.yunbao.common.utils.StringUtil;
public class TipsDialog extends AbsDialogCenterPopupWindow {
private String title, content;
private OnDialogClickListener onDialogClickListener;
TextView mTitle,mContent;
Button mCancel,mApply;
TextView mTitle, mContent;
Button mCancel, mApply;
ViewGroup viewGroup;
View contentView;
String cancelText, applyText;
public TipsDialog(@NonNull Context context) {
super(context);
@ -32,6 +37,21 @@ public class TipsDialog extends AbsDialogCenterPopupWindow {
return this;
}
public TipsDialog setContentView(View contentView) {
this.contentView = contentView;
return this;
}
public TipsDialog setCancelText(String cancelText) {
this.cancelText = cancelText;
return this;
}
public TipsDialog setApplyText(String applyText) {
this.applyText = applyText;
return this;
}
public TipsDialog setOnDialogClickListener(OnDialogClickListener onDialogClickListener) {
this.onDialogClickListener = onDialogClickListener;
return this;
@ -50,29 +70,38 @@ public class TipsDialog extends AbsDialogCenterPopupWindow {
@Override
protected void onCreate() {
super.onCreate();
mTitle=findViewById(R.id.title);
mContent=findViewById(R.id.content);
mCancel=findViewById(R.id.cancel);
mApply=findViewById(R.id.apply);
mTitle = findViewById(R.id.title);
mContent = findViewById(R.id.content);
mCancel = findViewById(R.id.cancel);
mApply = findViewById(R.id.apply);
viewGroup = findViewById(R.id.content_layout);
if(StringUtil.isEmpty(title)){
if (StringUtil.isEmpty(title)) {
mTitle.setVisibility(GONE);
}else{
} else {
mTitle.setText(title);
}
if(StringUtil.isEmpty(content)){
if (StringUtil.isEmpty(content)) {
mContent.setVisibility(GONE);
}else{
} else {
mContent.setText(content);
}
if (contentView != null) {
viewGroup.addView(contentView);
if (onDialogClickListener != null) {
onDialogClickListener.onCreateView(contentView);
}
}
mCancel.setText(cancelText);
mApply.setText(applyText);
mCancel.setOnClickListener(v -> {
if(onDialogClickListener!=null){
if (onDialogClickListener != null) {
onDialogClickListener.onCancel(dialog);
}
dismiss();
});
mApply.setOnClickListener(v ->{
if(onDialogClickListener!=null){
mApply.setOnClickListener(v -> {
if (onDialogClickListener != null) {
onDialogClickListener.onApply(dialog);
}
dismiss();

View File

@ -1,6 +1,7 @@
package com.shayu.onetoone.listener;
import android.app.Dialog;
import android.view.View;
public abstract class OnDialogClickListener {
public void onCancel(Dialog dialog){
@ -8,5 +9,8 @@ public abstract class OnDialogClickListener {
}
public void onApply(Dialog dialog){
}
public void onCreateView(View itemView){
}
}

View File

@ -467,10 +467,10 @@ public class OTONetManager {
}).isDisposed();
}
public void getHomeHot(HttpCallback<List<HomeItemBean>> callback) {
public void getHomeHot(String page,HttpCallback<List<HomeItemBean>> callback) {
API.get().otoApi(mContext)
.getHomeHot()
.getHomeHot(page)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel<List<HomeItemBean>>>() {
@ -491,10 +491,10 @@ public class OTONetManager {
}).isDisposed();
}
public void getHomeRecommend(HttpCallback<List<HomeItemBean>> callback) {
public void getHomeRecommend(String page,HttpCallback<List<HomeItemBean>> callback) {
API.get().otoApi(mContext)
.getHomeRecommend()
.getHomeRecommend(page)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel<List<HomeItemBean>>>() {
@ -675,6 +675,54 @@ public class OTONetManager {
}).isDisposed();
}
public void search(String keyword,
String age,
String name_auth,
String sex,
String page,
HttpCallback<List<HomeItemBean>> callback) {
API.get().otoApi(mContext)
.search(keyword, age, name_auth, sex, "",page)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(model -> {
if (callback != null) {
callback.onSuccess(model.getData().getInfo());
}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
Log.e(TAG, "accept: ", throwable);
if (callback != null) {
callback.onError(mContext.getString(com.yunbao.common.R.string.net_error));
}
}
}).isDisposed();
}
public void getSearchRecommend(HttpCallback<List<HomeItemBean>> callback) {
API.get().otoApi(mContext)
.getSearchRecommend()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel<List<HomeItemBean>>>() {
@Override
public void accept(ResponseModel<List<HomeItemBean>> model) throws Exception {
if (callback != null) {
callback.onSuccess(model.getData().getInfo());
}
}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
Log.e(TAG, "accept: ", throwable);
if (callback != null) {
callback.onError(mContext.getString(com.yunbao.common.R.string.net_error));
}
}
}).isDisposed();
}
private MultipartBody.Part createUploadFile(File file) {
RequestBody requestBody = RequestBody.create(MediaType.parse("multipart/form-data"), file);
return MultipartBody.Part.createFormData("file", file.getName(), requestBody);

View File

@ -48,31 +48,44 @@ public class RouteManager {
public static void forwardMainActivity() {
ARouter.getInstance().build(ACTIVITY_MAIN).navigation();
ARouter.getInstance().build(ACTIVITY_MAIN)
.navigation();
}
public static void forwardMainActivityForScreen(Bundle bundle) {
ARouter.getInstance().build(ACTIVITY_MAIN)
.withBundle("screen",bundle)
.navigation();
}
public static void forwardMsgMoreConfigActivity() {
ARouter.getInstance().build(ACTIVITY_MSG_MORE_CONFIG_ACTIVITY).navigation();
ARouter.getInstance().build(ACTIVITY_MSG_MORE_CONFIG_ACTIVITY)
.navigation();
}
public static void forwardMsgChatActivity() {
ARouter.getInstance().build(ACTIVITY_MSG_CHAT).navigation();
ARouter.getInstance().build(ACTIVITY_MSG_CHAT)
.navigation();
}
public static void forwardEntryActivity() {
ARouter.getInstance().build(ACTIVITY_ENTRY).navigation();
ARouter.getInstance().build(ACTIVITY_ENTRY)
.navigation();
}
public static void forwardLoginActivity() {
ARouter.getInstance().build(ACTIVITY_LOGIN).navigation();
ARouter.getInstance().build(ACTIVITY_LOGIN)
.navigation();
}
public static void forwardWebViewActivity(String title, String url) {
ARouter.getInstance().build(ACTIVITY_WEB_VIEW).withString("title", title).withString("url", url).navigation();
ARouter.getInstance().build(ACTIVITY_WEB_VIEW)
.withString("title", title)
.withString("url", url)
.navigation();
}
public static void forwardActivity(String path) {
ARouter.getInstance().build(path).navigation();
ARouter.getInstance().build(path)
.navigation();
}

View File

@ -4,6 +4,7 @@ import com.shayu.onetoone.bean.MessageConsumeConfigBean;
import com.shayu.onetoone.listener.OnSendMessageListener;
import com.yunbao.common.bean.HttpCallbackModel;
import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.utils.ToastUtil;
import java.util.HashMap;
import java.util.Map;
@ -105,17 +106,25 @@ public class SendMessageManager {
@Override
public void onSuccess(HttpCallbackModel sd) {
if (sd.getCode() != 0) {
listener.onSuccess(sd.getMsg());
if(listener!=null) {
listener.onSuccess(sd.getMsg());
}
} else {
cache.remove(token);
listener.onSuccess(null);
if(listener!=null) {
listener.onSuccess(null);
}
}
}
@Override
public void onError(String error) {
listener.onError(OnSendMessageListener.STATUS_ERROR, error);
ToastUtil.show(error);
System.err.println(error);
if(listener!=null) {
listener.onError(OnSendMessageListener.STATUS_ERROR, error);
}
}
}
);

View File

@ -140,41 +140,23 @@ public interface OneToOneApi {
@GET("/api/public/?service=Friendappmsg.giftList")
Observable<ResponseModel<List<GiftBean>>> getGiftList();
@GET("/api/public/?service=Friendappmoney.info")
Observable<ResponseModel<PurseBean>> getPurseInfo();
@GET("/api/public/?service=User.setAttents")
Observable<ResponseModel<List<FollowBean>>> follow(@Query("touid") String toUid);
Observable<ResponseModel<List<FollowBean>>> follow(@Query("touid")String toUid);
/**
*
* @param type 1魅力榜 2财富榜
* @param date 1日榜 2周榜
*/
@GET("/api/public/?service=Friendapprank.list")
Observable<ResponseModel<List<HomeRankBean>>> getHomeRank(
@Query("type") String type,
@Query("date") String date
);
/**
* 设置基本信息
*/
@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
@Query("type")String type,
@Query("date")String date
);
/**
* 获取系统默认头像列表
*/
@GET("/api/public/?service=Userhome.getDefaultAvatarList")
Observable<ResponseModel<List<UserAvatarSelectBean>>> getSystemUserAvatar(@Query("user_id") String uid);
}

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/bg_search_select" android:state_checked="true"/>
<item android:drawable="@drawable/bg_search_unselect" android:state_checked="false"/>
<item android:drawable="@drawable/bg_search_select" android:state_enabled="true"/>
<item android:drawable="@drawable/bg_search_unselect" android:state_enabled="false"/>
</selector>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/bg_search_select" android:state_checked="true"/>
<item android:drawable="@drawable/bg_search_unselect" android:state_checked="false"/>
</selector>

View File

@ -0,0 +1,307 @@
<?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="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<include
android:id="@+id/include3"
layout="@layout/view_search"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/activity_top"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/age_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="18dp"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/include3">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:text="年龄"
android:textColor="#333333"
android:textSize="16sp" />
<com.shayu.onetoone.widget.flexboxradiogroup.FlexBoxRadioGroup
android:id="@+id/age_radio_group"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="16dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="16dp"
android:orientation="horizontal"
app:alignContent="stretch"
app:alignItems="stretch"
app:flexWrap="wrap"
app:justifyContent="flex_start"
app:layout_wrapBefore="true"
app:maxLine="3">
<RadioButton
android:id="@+id/age_all"
android:layout_width="62dp"
android:layout_height="27dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:background="@drawable/bg_home_search_checked"
android:button="@null"
android:checked="true"
android:gravity="center"
android:tag="all"
android:text="全部"
android:textColor="@drawable/bg_home_search_text"
android:textSize="14sp" />
<RadioButton
android:id="@+id/age_type1"
android:layout_width="62dp"
android:layout_height="27dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:background="@drawable/bg_home_search_checked"
android:button="@null"
android:gravity="center"
android:text="18-25"
android:textColor="@drawable/bg_home_search_text"
android:textSize="14sp" />
<RadioButton
android:id="@+id/age_type2"
android:layout_width="62dp"
android:layout_height="27dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:background="@drawable/bg_home_search_checked"
android:button="@null"
android:gravity="center"
android:text="26-30"
android:textColor="@drawable/bg_home_search_text"
android:textSize="14sp" />
<RadioButton
android:id="@+id/age_type3"
android:layout_width="62dp"
android:layout_height="27dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:background="@drawable/bg_home_search_checked"
android:button="@null"
android:gravity="center"
android:text="31-35"
android:textColor="@drawable/bg_home_search_text"
android:textSize="14sp" />
<RadioButton
android:id="@+id/age_type4"
android:layout_width="62dp"
android:layout_height="27dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:background="@drawable/bg_home_search_checked"
android:button="@null"
android:gravity="center"
android:text="36-40"
android:textColor="@drawable/bg_home_search_text"
android:textSize="14sp" />
<RadioButton
android:id="@+id/age_type5"
android:layout_width="62dp"
android:layout_height="27dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:background="@drawable/bg_home_search_checked"
android:button="@null"
android:gravity="center"
android:text="40以上"
android:textColor="@drawable/bg_home_search_text"
android:textSize="14sp" />
</com.shayu.onetoone.widget.flexboxradiogroup.FlexBoxRadioGroup>
</LinearLayout>
<LinearLayout
android:id="@+id/sex_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/age_layout">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:text="性别"
android:textColor="#333333"
android:textSize="16sp" />
<com.shayu.onetoone.widget.flexboxradiogroup.FlexBoxRadioGroup
android:id="@+id/sex_radio_group"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="16dp"
android:layout_marginTop="15dp"
android:layout_marginEnd="16dp"
android:orientation="horizontal"
app:alignContent="stretch"
app:alignItems="stretch"
app:flexWrap="wrap"
app:justifyContent="flex_start"
app:layout_wrapBefore="true"
app:maxLine="3">
<RadioButton
android:id="@+id/sex_all"
android:layout_width="62dp"
android:layout_height="27dp"
android:layout_marginStart="10dp"
android:background="@drawable/bg_home_search_checked"
android:button="@null"
android:checked="true"
android:gravity="center"
android:tag="all"
android:text="全部"
android:textColor="@drawable/bg_home_search_text"
android:textSize="14sp" />
<RadioButton
android:id="@+id/sex_man"
android:layout_width="62dp"
android:layout_height="27dp"
android:layout_marginStart="10dp"
android:background="@drawable/bg_home_search_checked"
android:button="@null"
android:gravity="center"
android:tag="1"
android:text="男"
android:textColor="@drawable/bg_home_search_text"
android:textSize="14sp" />
<RadioButton
android:id="@+id/sex_woman"
android:layout_width="62dp"
android:layout_height="27dp"
android:layout_marginStart="10dp"
android:background="@drawable/bg_home_search_checked"
android:button="@null"
android:gravity="center"
android:tag="2"
android:text="女"
android:textColor="@drawable/bg_home_search_text"
android:textSize="14sp" />
</com.shayu.onetoone.widget.flexboxradiogroup.FlexBoxRadioGroup>
</LinearLayout>
<LinearLayout
android:id="@+id/auth_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/sex_layout">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:text="是否完成真人认证"
android:textColor="#333333"
android:textSize="16sp" />
<com.shayu.onetoone.widget.flexboxradiogroup.FlexBoxRadioGroup
android:id="@+id/auth_radio_group"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="16dp"
android:layout_marginTop="15dp"
android:layout_marginEnd="16dp"
android:orientation="horizontal"
app:alignContent="stretch"
app:alignItems="stretch"
app:flexWrap="wrap"
app:justifyContent="flex_start"
app:layout_wrapBefore="true"
app:maxLine="3">
<RadioButton
android:id="@+id/auth_all"
android:layout_width="62dp"
android:layout_height="27dp"
android:layout_marginStart="10dp"
android:background="@drawable/bg_home_search_checked"
android:button="@null"
android:checked="true"
android:gravity="center"
android:tag="all"
android:text="全部"
android:textColor="@drawable/bg_home_search_text"
android:textSize="14sp" />
<RadioButton
android:id="@+id/auth_true"
android:layout_width="62dp"
android:layout_height="27dp"
android:layout_marginStart="10dp"
android:background="@drawable/bg_home_search_checked"
android:button="@null"
android:gravity="center"
android:text="已完成"
android:textColor="@drawable/bg_home_search_text"
android:textSize="14sp" />
<RadioButton
android:id="@+id/auth_false"
android:layout_width="62dp"
android:layout_height="27dp"
android:layout_marginStart="10dp"
android:background="@drawable/bg_home_search_checked"
android:button="@null"
android:gravity="center"
android:text="未完成"
android:textColor="@drawable/bg_home_search_text"
android:textSize="14sp" />
</com.shayu.onetoone.widget.flexboxradiogroup.FlexBoxRadioGroup>
</LinearLayout>
<Button
android:id="@+id/apply"
android:layout_width="151dp"
android:layout_height="45dp"
android:background="@drawable/bg_home_search_btn"
android:text="确定"
android:textColor="#FFFFFF"
android:textSize="14sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/auth_layout" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,9 +1,9 @@
<?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="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
android:layout_height="match_parent">
<include
android:id="@+id/include3"
@ -15,247 +15,97 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/age_layout"
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="18dp"
android:orientation="vertical"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/include3">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:text="年龄"
android:textColor="#333333"
android:textSize="16sp" />
<com.shayu.onetoone.widget.flexboxradiogroup.FlexBoxRadioGroup
android:id="@+id/age_radio_group"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="16dp"
android:layout_marginTop="15dp"
android:layout_marginEnd="16dp"
android:orientation="horizontal"
app:alignContent="stretch"
app:alignItems="stretch"
app:flexWrap="wrap"
app:justifyContent="flex_start"
app:layout_wrapBefore="true"
app:maxLine="3">
android:gravity="center"
android:orientation="vertical">
<RadioButton
android:layout_width="62dp"
android:layout_height="27dp"
android:layout_marginStart="10dp"
android:background="@drawable/bg_home_search_btn"
android:button="@null"
android:checked="true"
android:gravity="center"
android:text="全部"
android:textColor="@drawable/bg_home_search_text"
android:textSize="14sp" />
<include
android:id="@+id/view_empty"
layout="@layout/view_empty_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/include3"
tools:visibility="visible" />
<io.rong.imkit.widget.refresh.SmartRefreshLayout
android:id="@+id/swipeRefreshLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/searchList"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/include3"
tools:itemCount="3"
tools:listitem="@layout/item_home_recommend"/>
<RadioButton
android:layout_width="62dp"
android:layout_height="27dp"
android:layout_marginStart="10dp"
android:background="@drawable/bg_home_search_btn"
android:button="@null"
android:gravity="center"
android:text="18-25"
android:textColor="@drawable/bg_home_search_text"
android:textSize="14sp" />
</io.rong.imkit.widget.refresh.SmartRefreshLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="36dp"
android:layout_marginEnd="16dp"
android:orientation="horizontal">
<RadioButton
android:layout_width="62dp"
android:layout_height="27dp"
android:layout_marginStart="10dp"
android:background="@drawable/bg_home_search_btn"
android:button="@null"
android:gravity="center"
android:text="26-30"
android:textColor="@drawable/bg_home_search_text"
android:textSize="14sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1.9"
android:text="猜你喜欢"
android:textColor="#333333"
android:textSize="18sp" />
<RadioButton
android:layout_width="62dp"
android:layout_height="27dp"
android:layout_marginStart="10dp"
android:background="@drawable/bg_home_search_btn"
android:button="@null"
android:gravity="center"
android:text="31-35"
android:textColor="@drawable/bg_home_search_text"
android:textSize="14sp" />
<ImageView
android:id="@+id/refresh"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|center"
<RadioButton
android:layout_width="62dp"
android:layout_height="27dp"
android:layout_marginStart="10dp"
android:background="@drawable/bg_home_search_btn"
android:button="@null"
android:gravity="center"
android:text="36-40"
android:textColor="@drawable/bg_home_search_text"
android:textSize="14sp" />
<RadioButton
android:layout_width="62dp"
android:layout_height="27dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:background="@drawable/bg_home_search_btn"
android:button="@null"
android:gravity="center"
android:text="40以上"
android:textColor="@drawable/bg_home_search_text"
android:textSize="14sp" />
android:layout_weight="0.1"
app:srcCompat="@mipmap/ic_refresh" />
</LinearLayout>
</com.shayu.onetoone.widget.flexboxradiogroup.FlexBoxRadioGroup>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recommendList"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/view_empty"
app:spanCount="2"
tools:itemCount="3"
tools:listitem="@layout/item_home_hot">
</LinearLayout>
</androidx.recyclerview.widget.RecyclerView>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
<LinearLayout
android:id="@+id/sex_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/age_layout">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:text="性别"
android:textColor="#333333"
android:textSize="16sp" />
<com.shayu.onetoone.widget.flexboxradiogroup.FlexBoxRadioGroup
android:id="@+id/sex_radio_group"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="16dp"
android:layout_marginTop="15dp"
android:layout_marginEnd="16dp"
android:orientation="horizontal"
app:alignContent="stretch"
app:alignItems="stretch"
app:flexWrap="wrap"
app:justifyContent="flex_start"
app:layout_wrapBefore="true"
app:maxLine="3">
<RadioButton
android:layout_width="62dp"
android:layout_height="27dp"
android:layout_marginStart="10dp"
android:background="@drawable/bg_home_search_btn"
android:button="@null"
android:checked="true"
android:gravity="center"
android:text="全部"
android:textColor="@drawable/bg_home_search_text"
android:textSize="14sp" />
<RadioButton
android:layout_width="62dp"
android:layout_height="27dp"
android:layout_marginStart="10dp"
android:background="@drawable/bg_home_search_btn"
android:button="@null"
android:gravity="center"
android:text="男"
android:textColor="@drawable/bg_home_search_text"
android:textSize="14sp" />
<RadioButton
android:layout_width="62dp"
android:layout_height="27dp"
android:layout_marginStart="10dp"
android:background="@drawable/bg_home_search_btn"
android:button="@null"
android:gravity="center"
android:text="女"
android:textColor="@drawable/bg_home_search_text"
android:textSize="14sp" />
</com.shayu.onetoone.widget.flexboxradiogroup.FlexBoxRadioGroup>
</LinearLayout>
<LinearLayout
android:id="@+id/auth_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/sex_layout">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:text="是否完成真人认证"
android:textColor="#333333"
android:textSize="16sp" />
<com.shayu.onetoone.widget.flexboxradiogroup.FlexBoxRadioGroup
android:id="@+id/auth_radio_group"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="16dp"
android:layout_marginTop="15dp"
android:layout_marginEnd="16dp"
android:orientation="horizontal"
app:alignContent="stretch"
app:alignItems="stretch"
app:flexWrap="wrap"
app:justifyContent="flex_start"
app:layout_wrapBefore="true"
app:maxLine="3">
<RadioButton
android:layout_width="62dp"
android:layout_height="27dp"
android:layout_marginStart="10dp"
android:background="@drawable/bg_home_search_btn"
android:button="@null"
android:checked="true"
android:gravity="center"
android:text="已完成"
android:textColor="@drawable/bg_home_search_text"
android:textSize="14sp" />
<RadioButton
android:layout_width="62dp"
android:layout_height="27dp"
android:layout_marginStart="10dp"
android:background="@drawable/bg_home_search_btn"
android:button="@null"
android:gravity="center"
android:text="未完成"
android:textColor="@drawable/bg_home_search_text"
android:textSize="14sp" />
</com.shayu.onetoone.widget.flexboxradiogroup.FlexBoxRadioGroup>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -17,6 +17,12 @@
android:textColor="#333333"
android:textSize="18sp"
android:textStyle="bold" />
<FrameLayout
android:id="@+id/content_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
</FrameLayout>
<TextView
android:id="@+id/content"
@ -28,6 +34,7 @@
android:gravity="center"
tools:text="與TA視頻聊天每分鐘續消耗299鑽石您可通過充值獲取更多鑽石以便繼續聊天" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"

View File

@ -32,4 +32,15 @@
android:src="@mipmap/ic_recommend_top"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<include
android:id="@+id/view_empty"
layout="@layout/view_empty_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,26 @@
<?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="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/imageView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@mipmap/ic_empty_list" />
<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="没有找到匹配结果~"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView3" />
</androidx.constraintlayout.widget.ConstraintLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="activity_top">22dp</dimen>
<dimen name="activity_top">42dp</dimen>
</resources>

View File

@ -160,4 +160,13 @@ public class StringUtil {
}
return false;
}
public static boolean isEmptyAll(String... str) {
for (String s : str) {
if (!isEmpty(s)) {
return false;
}
}
return true;
}
}