update 排行榜 筛选 搜索
This commit is contained in:
parent
0c5533ffb3
commit
6211756744
@ -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
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
@ -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) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -292,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("");
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -465,10 +465,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>>>() {
|
||||
@ -489,10 +489,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>>>() {
|
||||
@ -651,10 +651,11 @@ public class OTONetManager {
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
public void getHomeRank(String type,String date, HttpCallback<List<HomeRankBean>> callback) {
|
||||
|
||||
public void getHomeRank(String type, String date, HttpCallback<List<HomeRankBean>> callback) {
|
||||
|
||||
API.get().otoApi(mContext)
|
||||
.getHomeRank(type,date)
|
||||
.getHomeRank(type, date)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(model -> {
|
||||
@ -672,6 +673,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);
|
||||
|
@ -16,11 +16,17 @@ public class RouteManager {
|
||||
public static final String ACTIVITY_WEB_VIEW = "/activity/WebViewActivity";
|
||||
public static final String ACTIVITY_HOME_RANK = "/activity/HomepageRankingActivity";
|
||||
public static final String ACTIVITY_HOME_SEARCH = "/activity/HomeSearchActivity";
|
||||
public static final String ACTIVITY_HOME_SCREEN = "/activity/HomeScreenActivity";
|
||||
|
||||
public static void forwardMainActivity() {
|
||||
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)
|
||||
@ -52,6 +58,11 @@ public class RouteManager {
|
||||
ARouter.getInstance().build(path)
|
||||
.navigation();
|
||||
}
|
||||
public static void forwardActivity(String path,Bundle bundle) {
|
||||
ARouter.getInstance().build(path)
|
||||
.withBundle("bundle",bundle)
|
||||
.navigation();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -113,10 +113,10 @@ public interface OneToOneApi {
|
||||
Observable<ResponseModel<List<TargetUserInfoBean>>> getTargetUserInfoList(@Query("ids") String ids);
|
||||
|
||||
@GET("/api/public/?service=Friendappuser.hot")
|
||||
Observable<ResponseModel<List<HomeItemBean>>> getHomeHot();
|
||||
Observable<ResponseModel<List<HomeItemBean>>> getHomeHot(@Query("p") String p);
|
||||
|
||||
@GET("/api/public/?service=Friendappuser.recommend")
|
||||
Observable<ResponseModel<List<HomeItemBean>>> getHomeRecommend();
|
||||
Observable<ResponseModel<List<HomeItemBean>>> getHomeRecommend(@Query("p") String p);
|
||||
|
||||
@GET("/api/public/?service=Message.getListInfo")
|
||||
Observable<ResponseModel<List<SystemMessageBean>>> getSystemMessageList(@Query("type") int type);
|
||||
@ -137,24 +137,36 @@ 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
|
||||
@Query("type") String type,
|
||||
@Query("date") String date
|
||||
);
|
||||
|
||||
@GET("/api/public/?service=Friendappuser.list")
|
||||
Observable<ResponseModel<List<HomeItemBean>>> search(
|
||||
@Query("keyword") String keyword,
|
||||
@Query("age") String age,
|
||||
@Query("name_auth") String name_auth,
|
||||
@Query("sex") String sex,
|
||||
@Query("star") String star,
|
||||
@Query("p") String p
|
||||
);
|
||||
|
||||
|
||||
|
||||
@GET("/api/public/?service=Friendappuser.like")
|
||||
Observable<ResponseModel<List<HomeItemBean>>> getSearchRecommend();
|
||||
}
|
||||
|
||||
|
||||
|
@ -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>
|
@ -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>
|
307
OneToOne/src/main/res/layout/activity_screen.xml
Normal file
307
OneToOne/src/main/res/layout/activity_screen.xml
Normal 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>
|
@ -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>
|
@ -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>
|
26
OneToOne/src/main/res/layout/view_empty_list.xml
Normal file
26
OneToOne/src/main/res/layout/view_empty_list.xml
Normal 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>
|
BIN
OneToOne/src/main/res/mipmap-xxhdpi/ic_empty_list.png
Normal file
BIN
OneToOne/src/main/res/mipmap-xxhdpi/ic_empty_list.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 73 KiB |
BIN
OneToOne/src/main/res/mipmap-xxhdpi/ic_refresh.png
Normal file
BIN
OneToOne/src/main/res/mipmap-xxhdpi/ic_refresh.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.8 KiB |
@ -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>
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user