Merge remote-tracking branch 'origin/develop_new' into develop_new
This commit is contained in:
@@ -13,6 +13,7 @@ import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.coorchice.library.SuperTextView;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.avroom.activity.AVRoomActivity;
|
||||
import com.yizhuan.erban.friend.action.AbstractSelectFriendAction;
|
||||
import com.yizhuan.erban.ui.user.UserInfoActivity;
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils;
|
||||
@@ -34,41 +35,41 @@ import java.util.List;
|
||||
public class SearchAdapter extends BaseQuickAdapter<SearchRoomInfo,SearchAdapter.ViewHolder> {
|
||||
|
||||
private Context context;
|
||||
private int type;
|
||||
private int mType;
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public SearchAdapter(Context context, List<HomeRoom> homeRoomList) {
|
||||
public SearchAdapter(Context context, int type) {
|
||||
super(R.layout.list_item_search);
|
||||
this.context = context;
|
||||
this.mType = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(ViewHolder holder, SearchRoomInfo item) {
|
||||
holder.userName.setText(item.getNick() != null ? item.getNick().replaceAll(RegexUtil.getNotPrintableStringReg(), "?"):"");
|
||||
holder.ivLive.setVisibility(View.GONE);
|
||||
holder.tvOnlineNum.setVisibility(View.GONE);
|
||||
if (mType == SearchDetailFragment.TYPE_SEARCH_USER){
|
||||
holder.userName.setText(item.getNick() != null ? item.getNick().replaceAll(RegexUtil.getNotPrintableStringReg(), "?"):"");
|
||||
holder.ivLive.setVisibility(View.VISIBLE);
|
||||
holder.container.setOnClickListener(v -> {
|
||||
UserInfoActivity.Companion.start(context, item.getUid());
|
||||
});
|
||||
}else {
|
||||
holder.userName.setText(item.getTitle() != null ? item.getTitle().replaceAll(RegexUtil.getNotPrintableStringReg(), "?"):"");
|
||||
holder.tvOnlineNum.setVisibility(View.VISIBLE);
|
||||
holder.tvOnlineNum.setText(item.getOnlineNum()+"");
|
||||
holder.container.setOnClickListener(v -> {
|
||||
AVRoomActivity.start(mContext, item.getUid());
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
holder.mNobleAvatarView.setSize(40, 58, 15);
|
||||
holder.mNobleAvatarView.setData(item.getAvatar(), item.nobleUsers);
|
||||
|
||||
holder.erbanNo.setText(context.getString(R.string.me_user_id, item.getErbanNo()));
|
||||
holder.mIvGoodNumber.setVisibility(item.hasPrettyErbanNo ? View.VISIBLE : View.GONE);
|
||||
holder.officialView.setVisibility(item.isOfficial() ? View.VISIBLE : View.GONE);
|
||||
|
||||
if (item.nobleUsers != null) {
|
||||
String badgeByLevel = NobleUtil.getBadgeByLevel(item.nobleUsers.getLevel());
|
||||
if (!TextUtils.isEmpty(badgeByLevel))
|
||||
NobleUtil.loadResource(badgeByLevel, holder.mIvNobleLevel);
|
||||
holder.mIvNobleLevel.setVisibility(TextUtils.isEmpty(badgeByLevel) ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
holder.mIvNobleLevel.setVisibility(item.nobleUsers == null ? View.GONE : View.VISIBLE);
|
||||
|
||||
holder.container.setOnClickListener(v -> {
|
||||
if (type == AbstractSelectFriendAction.TYPE_NORMAL) {
|
||||
UserInfoActivity.Companion.start(context, item.getUid());
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
if (item.getGender() == 1) {
|
||||
holder.mIvSex.setVisibility(View.VISIBLE);
|
||||
holder.mIvSex.setImageResource(R.drawable.ic_gender_male);
|
||||
@@ -79,47 +80,7 @@ public class SearchAdapter extends BaseQuickAdapter<SearchRoomInfo,SearchAdapter
|
||||
holder.mIvSex.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
holder.mIvUserLevel.setVisibility(View.GONE);
|
||||
UserLevelVo userLevelVo = item.userLevelVo;
|
||||
if (userLevelVo != null && !TextUtils.isEmpty(userLevelVo.getExperUrl())) {
|
||||
holder.mIvUserLevel.setVisibility(View.VISIBLE);
|
||||
ImageLoadUtils.loadImage(context, userLevelVo.getExperUrl(), holder.mIvUserLevel);
|
||||
}
|
||||
//魅力等级,只在模厅情况下显示,原来逻辑不修改
|
||||
holder.mIvUserCharm.setVisibility(View.GONE);
|
||||
if ((type == AbstractSelectFriendAction.TYPE_CAR || type == AbstractSelectFriendAction.TYPE_WEAR) && AuthModel.get().getCurrentUid()!=item.getUid()){
|
||||
holder.flOpLayout.setVisibility(View.VISIBLE);
|
||||
holder.tvSend.setVisibility(View.VISIBLE);
|
||||
holder.stvOp.setVisibility(View.GONE);
|
||||
} else if (type == AbstractSelectFriendAction.TYPE_MODULE_HALL) {
|
||||
//模厅搜索
|
||||
holder.tvSend.setVisibility(View.GONE);
|
||||
holder.stvOp.setVisibility(View.VISIBLE);
|
||||
holder.stvOp.setText("添加");
|
||||
holder.addOnClickListener(R.id.stv_op);
|
||||
if (!UserModel.get().isMyseft(item.getUid())) {
|
||||
holder.flOpLayout.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
holder.flOpLayout.setVisibility(View.GONE);
|
||||
}
|
||||
if (userLevelVo != null && !TextUtils.isEmpty(userLevelVo.getCharmUrl())) {
|
||||
holder.mIvUserCharm.setVisibility(View.VISIBLE);
|
||||
ImageLoadUtils.loadImage(context, userLevelVo.getCharmUrl(), holder.mIvUserCharm);
|
||||
} else {
|
||||
holder.mIvUserCharm.setVisibility(View.GONE);
|
||||
}
|
||||
//贵族不显示
|
||||
holder.mIvNobleLevel.setVisibility(View.GONE);
|
||||
//靓号不显示
|
||||
holder.mIvGoodNumber.setVisibility(View.GONE);
|
||||
} else {
|
||||
holder.flOpLayout.setVisibility(View.GONE);
|
||||
}
|
||||
holder.addOnClickListener(R.id.tv_send);
|
||||
if (type == AbstractSelectFriendAction.TYPE_SHARE
|
||||
|| type == AbstractSelectFriendAction.TYPE_WORLD_DYNAMIC) {
|
||||
holder.addOnClickListener(R.id.container);
|
||||
}
|
||||
}
|
||||
|
||||
static class ViewHolder extends BaseViewHolder {
|
||||
@@ -127,33 +88,25 @@ public class SearchAdapter extends BaseQuickAdapter<SearchRoomInfo,SearchAdapter
|
||||
TextView tvSend;
|
||||
TextView roomTitle;
|
||||
TextView erbanNo;
|
||||
TextView tvOnlineNum;
|
||||
private ImageView ivLive;
|
||||
RelativeLayout container;
|
||||
ImageView mIvGoodNumber;
|
||||
ImageView officialView;
|
||||
private NobleAvatarView mNobleAvatarView;
|
||||
private AppCompatImageView mIvNobleLevel;
|
||||
private AppCompatImageView mIvUserLevel;
|
||||
private AppCompatImageView mIvUserCharm;
|
||||
private ImageView mIvSex;
|
||||
private FrameLayout flOpLayout;
|
||||
private SuperTextView stvOp;
|
||||
|
||||
|
||||
public ViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
userName = (TextView) itemView.findViewById(R.id.user_name);
|
||||
roomTitle = (TextView) itemView.findViewById(R.id.room_title);
|
||||
tvSend = (TextView) itemView.findViewById(R.id.tv_send);
|
||||
erbanNo = (TextView) itemView.findViewById(R.id.erban_no);
|
||||
container = (RelativeLayout) itemView.findViewById(R.id.container);
|
||||
mIvGoodNumber = itemView.findViewById(R.id.iv_good_number);
|
||||
officialView = itemView.findViewById(R.id.iv_user_official);
|
||||
userName = itemView.findViewById(R.id.user_name);
|
||||
roomTitle = itemView.findViewById(R.id.room_title);
|
||||
tvSend = itemView.findViewById(R.id.tv_send);
|
||||
erbanNo = itemView.findViewById(R.id.erban_no);
|
||||
container = itemView.findViewById(R.id.container);
|
||||
mNobleAvatarView = itemView.findViewById(R.id.noble_avatar_view);
|
||||
mIvNobleLevel = itemView.findViewById(R.id.iv_noble_level);
|
||||
mIvSex = itemView.findViewById(R.id.sex);
|
||||
mIvUserLevel = itemView.findViewById(R.id.iv_user_level);
|
||||
flOpLayout = itemView.findViewById(R.id.fl_op_layout);
|
||||
stvOp = itemView.findViewById(R.id.stv_op);
|
||||
mIvUserCharm = itemView.findViewById(R.id.iv_user_charm);
|
||||
ivLive = itemView.findViewById(R.id.iv_living);
|
||||
tvOnlineNum = itemView.findViewById(R.id.tv_online_num);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -23,9 +23,13 @@ public class SearchDetailFragment extends BaseMvpFragment<ISearchView, SearchPre
|
||||
public static final int TYPE_SEARCH_USER = 2;
|
||||
private RecyclerView recyclerView;
|
||||
private SearchAdapter searchAdapter;
|
||||
private int mType;
|
||||
|
||||
public static SearchDetailFragment newInstance(int type) {
|
||||
Bundle args = new Bundle();
|
||||
args.putInt("type", type);
|
||||
SearchDetailFragment fragment = new SearchDetailFragment();
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@@ -53,12 +57,15 @@ public class SearchDetailFragment extends BaseMvpFragment<ISearchView, SearchPre
|
||||
|
||||
@Override
|
||||
public void initiate() {
|
||||
if (getArguments() != null) {
|
||||
mType = getArguments().getInt("type");
|
||||
}
|
||||
initData();
|
||||
}
|
||||
|
||||
private void initData(){
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(mContext));
|
||||
searchAdapter = new SearchAdapter(mContext, null);
|
||||
searchAdapter = new SearchAdapter(mContext, mType);
|
||||
recyclerView.setAdapter(searchAdapter);
|
||||
}
|
||||
|
||||
|
@@ -5,6 +5,7 @@
|
||||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="75dp"
|
||||
android:paddingEnd="@dimen/dp_15"
|
||||
android:background="@drawable/bg_common_touch_trans">
|
||||
|
||||
<com.yizhuan.erban.ui.widget.NobleAvatarView
|
||||
@@ -13,7 +14,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginStart="@dimen/dp_5"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
tools:layout_width="70dp" />
|
||||
|
||||
<LinearLayout
|
||||
@@ -21,7 +22,6 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toEndOf="@id/noble_avatar_view"
|
||||
android:layout_toStartOf="@id/fl_op_layout"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:gravity="center_vertical"
|
||||
@@ -37,15 +37,6 @@
|
||||
android:textSize="15sp"
|
||||
tools:text="小涩瑶小涩瑶小涩瑶小涩瑶小涩瑶小涩瑶小涩瑶" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_noble_level"
|
||||
android:layout_width="13dp"
|
||||
android:layout_height="13dp"
|
||||
android:layout_marginStart="@dimen/dp_5"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level_king"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/sex"
|
||||
android:layout_width="13dp"
|
||||
@@ -53,32 +44,14 @@
|
||||
android:layout_marginStart="@dimen/dp_5"
|
||||
android:src="@drawable/ic_gender_female" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_user_level"
|
||||
android:layout_width="38dp"
|
||||
android:layout_height="@dimen/dp_15"
|
||||
android:layout_marginStart="@dimen/dp_5"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_user_charm"
|
||||
android:layout_width="39dp"
|
||||
android:layout_height="@dimen/dp_15"
|
||||
android:layout_marginStart="@dimen/dp_5"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/ll_name"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_toEndOf="@id/noble_avatar_view"
|
||||
android:layout_toStartOf="@id/fl_op_layout"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
@@ -96,24 +69,6 @@
|
||||
android:visibility="gone"
|
||||
tools:text="什么鬼" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_user_official"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
android:src="@mipmap/ic_user_official_10dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_good_number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
android:src="@mipmap/ic_pretty_account_10dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/erban_no"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -126,50 +81,38 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_op_layout"
|
||||
android:layout_width="55dp"
|
||||
android:layout_height="25dp"
|
||||
<ImageView
|
||||
android:id="@+id/iv_living"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_send"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_solid_car_send"
|
||||
android:gravity="center"
|
||||
android:text="@string/label_send"
|
||||
android:textColor="@color/appColor"
|
||||
android:textSize="12sp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="gone" />
|
||||
|
||||
<com.coorchice.library.SuperTextView
|
||||
android:id="@+id/stv_op"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/appColor"
|
||||
android:textSize="@dimen/sp_12"
|
||||
android:visibility="gone"
|
||||
app:corner="@dimen/dp_20"
|
||||
app:stroke_color="@color/appColor"
|
||||
app:stroke_width="1px"
|
||||
tools:text="添加"
|
||||
tools:visibility="visible" />
|
||||
</FrameLayout>
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/ic_dy_in_room"
|
||||
>
|
||||
</ImageView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_online_num"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:layout_marginStart="1.5dp"
|
||||
android:gravity="start|center_vertical"
|
||||
android:textColor="@color/appColor"
|
||||
android:textSize="@dimen/dp_10"
|
||||
android:background="@mipmap/ic_search_room_onlinenum"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="@dimen/dp_5"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
tools:text="177" />
|
||||
|
||||
<View
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="1px"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginStart="15dp"
|
||||
android:background="@color/color_F5F5F5" />
|
||||
android:layout_alignStart="@id/ll_name"
|
||||
android:background="@color/color_F4F4F4" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
BIN
app/src/main/res/mipmap-xhdpi/ic_search_room_onlinenum.png
Normal file
BIN
app/src/main/res/mipmap-xhdpi/ic_search_room_onlinenum.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
@@ -64,24 +64,25 @@ public class DynamicNickDetailWidget extends ShapeConstrainLayout {
|
||||
public void setData(BaseUserInfo info) {
|
||||
|
||||
tvNick.setText(RegexUtil.getPrintableString(info.getNick()));
|
||||
if (info.getAge() > 0) {
|
||||
llGenderAge.setVisibility(VISIBLE);
|
||||
tvAge.setVisibility(VISIBLE);
|
||||
tvAge.setText(String.valueOf(info.getAge()));
|
||||
ivGender.setVisibility(GONE);
|
||||
} else {
|
||||
ivGender.setVisibility(VISIBLE);
|
||||
tvAge.setVisibility(GONE);
|
||||
llGenderAge.setVisibility(GONE);
|
||||
tvAge.setText("");
|
||||
}
|
||||
// if (info.getAge() > 0) {
|
||||
// llGenderAge.setVisibility(VISIBLE);
|
||||
// tvAge.setVisibility(VISIBLE);
|
||||
// tvAge.setText(String.valueOf(info.getAge()));
|
||||
// ivGender.setVisibility(GONE);
|
||||
// } else {
|
||||
// ivGender.setVisibility(VISIBLE);
|
||||
// tvAge.setVisibility(GONE);
|
||||
// llGenderAge.setVisibility(GONE);
|
||||
// tvAge.setText("");
|
||||
// }
|
||||
// llGenderAge.setPadding(paddingH, 0, paddingH, 0);
|
||||
|
||||
// llGenderAge.setBackgroundResource(info.getGender() == 1 ?
|
||||
// R.drawable.ic_male_community_notice : R.drawable.ic_female_age_community_notice);
|
||||
tvAge.setVisibility(GONE);
|
||||
llGenderAge.setVisibility(GONE);
|
||||
ivGender.setVisibility(VISIBLE);
|
||||
ivGender.setImageResource(info.getGender() == 1 ?
|
||||
R.drawable.ic_gender_male : R.drawable.ic_gender_female);
|
||||
llGenderAge.setBackgroundResource(info.getGender() == 1 ?
|
||||
R.drawable.ic_male_community_notice : R.drawable.ic_female_age_community_notice);
|
||||
|
||||
//财富等级
|
||||
ImageLoadUtils.loadImage(context, info.getExperLevelPic(), ivUserWealthLevel);
|
||||
//魅力等级
|
||||
|
@@ -30,6 +30,7 @@
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="@dimen/dp_5"
|
||||
android:paddingEnd="@dimen/dp_5"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tv_nick"
|
||||
app:layout_constraintStart_toEndOf="@id/tv_nick"
|
||||
app:layout_constraintTop_toTopOf="@id/tv_nick">
|
||||
@@ -44,6 +45,7 @@
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_10"
|
||||
android:paddingLeft="5dp"
|
||||
android:visibility="gone"
|
||||
tools:text="20" />
|
||||
|
||||
</LinearLayout>
|
||||
|
Reference in New Issue
Block a user