发现萌新新增筛选功能&UI优化
This commit is contained in:
7
app/src/main/res/drawable/shape_white_top_12dp.xml
Normal file
7
app/src/main/res/drawable/shape_white_top_12dp.xml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<solid android:color="@color/white"/>
|
||||||
|
<corners android:topLeftRadius="@dimen/dp_12"
|
||||||
|
android:topRightRadius="@dimen/dp_12"/>
|
||||||
|
</shape>
|
@@ -49,7 +49,7 @@
|
|||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="@id/tv_nickname"
|
app:layout_constraintStart_toStartOf="@id/tv_nickname"
|
||||||
app:layout_constraintTop_toBottomOf="@id/tv_nickname"
|
app:layout_constraintTop_toBottomOf="@id/tv_nickname"
|
||||||
tools:text="66号:1234567" />
|
tools:text="大鹅号:1234567" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_gender"
|
android:id="@+id/iv_gender"
|
||||||
|
@@ -1,135 +1,100 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:layout_marginTop="11dp"
|
||||||
|
android:layout_marginBottom="11dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<LinearLayout
|
<com.yizhuan.erban.common.widget.CircleImageView
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/iv_avatar"
|
||||||
android:layout_height="60dp"
|
android:layout_width="45dp"
|
||||||
android:orientation="horizontal"
|
android:layout_height="45dp"
|
||||||
>
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginStart="15dp" />
|
||||||
|
|
||||||
<com.yizhuan.erban.ui.widget.NobleAvatarView
|
|
||||||
android:id="@+id/noble_avatar_view"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_marginStart="10dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<com.google.android.flexbox.FlexboxLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:flexDirection="row"
|
|
||||||
app:flexWrap="nowrap">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_userName"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginEnd="2dp"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:lines="1"
|
|
||||||
android:textColor="@color/text_title_white"
|
|
||||||
android:textSize="15sp"
|
|
||||||
tools:text="我的我的我的我的我的我的"
|
|
||||||
app:layout_flexShrink="1"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
|
||||||
android:id="@+id/iv_gender"
|
|
||||||
android:layout_width="13dp"
|
|
||||||
android:layout_height="13dp"
|
|
||||||
android:layout_marginEnd="2dp"
|
|
||||||
tools:src="@drawable/ic_gender_female"
|
|
||||||
tools:visibility="visible"
|
|
||||||
app:layout_flexShrink="0"
|
|
||||||
/>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</com.google.android.flexbox.FlexboxLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:gravity="center_vertical">
|
android:layout_marginStart="10dp"
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
android:layout_weight="1"
|
||||||
android:id="@+id/iv_user_level"
|
android:gravity="center_vertical"
|
||||||
android:layout_width="@dimen/dp_19"
|
android:orientation="vertical">
|
||||||
android:layout_height="@dimen/dp_19"
|
|
||||||
android:layout_marginEnd="2dp"
|
|
||||||
android:scaleType="fitCenter"
|
|
||||||
android:visibility="gone"
|
|
||||||
tools:src="@mipmap/ic_user_level"
|
|
||||||
tools:visibility="visible"
|
|
||||||
app:layout_flexShrink="0"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
<LinearLayout
|
||||||
android:id="@+id/iv_charm_level"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="@dimen/dp_19"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="@dimen/dp_19"
|
android:gravity="center_vertical"
|
||||||
android:layout_marginEnd="2dp"
|
android:orientation="horizontal">
|
||||||
android:scaleType="fitCenter"
|
|
||||||
android:visibility="gone"
|
<TextView
|
||||||
tools:src="@mipmap/ic_user_level"
|
android:id="@+id/tv_userName"
|
||||||
tools:visibility="visible"
|
android:layout_width="wrap_content"
|
||||||
app:layout_flexShrink="0"
|
android:layout_height="wrap_content"
|
||||||
/>
|
android:layout_marginEnd="2dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:lines="1"
|
||||||
|
android:textColor="@color/color_333333"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="我的我的我的我的我的我的" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/iv_gender"
|
||||||
|
android:layout_width="21dp"
|
||||||
|
android:layout_height="14dp"
|
||||||
|
tools:src="@drawable/ic_gender_female"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/iv_user_level"
|
||||||
|
android:layout_width="@dimen/dp_21"
|
||||||
|
android:layout_height="@dimen/dp_19"
|
||||||
|
android:layout_marginEnd="2dp"
|
||||||
|
android:scaleType="fitCenter"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_marginStart="2dp"
|
||||||
|
tools:src="@mipmap/ic_user_level"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/iv_charm_level"
|
||||||
|
android:layout_width="@dimen/dp_21"
|
||||||
|
android:layout_height="@dimen/dp_19"
|
||||||
|
android:layout_marginEnd="2dp"
|
||||||
|
android:scaleType="fitCenter"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:src="@mipmap/ic_user_level"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_constellation"
|
android:id="@+id/tv_erban_id"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="17dp"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/shape_58559d"
|
android:textColor="@color/color_666666"
|
||||||
android:gravity="center"
|
android:textSize="14sp"
|
||||||
android:paddingLeft="5dp"
|
android:fontFamily="sans-serif"
|
||||||
android:paddingRight="5dp"
|
tools:text="大鹅号:666666" />
|
||||||
android:visibility="gone"
|
|
||||||
tools:visibility="visible"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:textSize="10dp"
|
|
||||||
tools:text="金牛座" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/attention_img"
|
android:id="@+id/attention_img"
|
||||||
android:layout_width="60dp"
|
android:layout_width="64dp"
|
||||||
android:layout_height="25dp"
|
android:layout_height="25dp"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="15dp"
|
android:layout_marginEnd="15dp"
|
||||||
android:background="@drawable/bg_common_confirm"
|
android:background="@drawable/shape_bg_add_attention"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:text="@string/say_hello"
|
android:text="@string/say_hello"
|
||||||
android:textColor="@color/color_FFFFFF"
|
android:textColor="@color/color_FFFFFF"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
android:visibility="visible" />
|
android:visibility="visible" />
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:id="@+id/view_line"
|
|
||||||
android:background="@color/line_353548"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="1px"
|
|
||||||
android:layout_marginStart="90dp"
|
|
||||||
android:layout_marginEnd="@dimen/dp_15"
|
|
||||||
android:visibility="gone"
|
|
||||||
/>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
@@ -14,7 +14,9 @@ import com.netease.nim.uikit.StatusBarUtil;
|
|||||||
import com.yizhuan.erban.R;
|
import com.yizhuan.erban.R;
|
||||||
import com.yizhuan.erban.base.BaseActivity;
|
import com.yizhuan.erban.base.BaseActivity;
|
||||||
import com.yizhuan.tutu.room_chat.event.ClickRootViewEvent;
|
import com.yizhuan.tutu.room_chat.event.ClickRootViewEvent;
|
||||||
|
import com.yizhuan.tutu.room_chat.fragment.NewbieFilterDialog;
|
||||||
import com.yizhuan.tutu.room_chat.fragment.RoomNewbieListFragment;
|
import com.yizhuan.tutu.room_chat.fragment.RoomNewbieListFragment;
|
||||||
|
import com.yizhuan.xchat_android_library.utils.CommonUtils;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
import org.greenrobot.eventbus.Subscribe;
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
@@ -22,12 +24,16 @@ import org.greenrobot.eventbus.ThreadMode;
|
|||||||
|
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
import butterknife.OnClick;
|
import butterknife.OnClick;
|
||||||
|
import kotlin.Unit;
|
||||||
|
import kotlin.jvm.functions.Function2;
|
||||||
|
|
||||||
public class RoomNewbieActivity extends BaseActivity {
|
public class RoomNewbieActivity extends BaseActivity {
|
||||||
private RoomNewbieListFragment newbieListFragment;
|
private RoomNewbieListFragment newbieListFragment;
|
||||||
private boolean mIsInRoom;
|
private boolean mIsInRoom;
|
||||||
private ImageView ivBack;
|
private ImageView ivBack;
|
||||||
|
|
||||||
|
private NewbieFilterDialog newbieFilterDialog;
|
||||||
|
|
||||||
public static void start(Context context, boolean isInRoom) {
|
public static void start(Context context, boolean isInRoom) {
|
||||||
Intent starter = new Intent(context, RoomNewbieActivity.class);
|
Intent starter = new Intent(context, RoomNewbieActivity.class);
|
||||||
starter.putExtra("isInRoom", isInRoom);
|
starter.putExtra("isInRoom", isInRoom);
|
||||||
@@ -41,12 +47,20 @@ public class RoomNewbieActivity extends BaseActivity {
|
|||||||
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
|
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
|
||||||
fragmentTransaction.replace(R.id.recent_container, newbieListFragment).commitAllowingStateLoss();
|
fragmentTransaction.replace(R.id.recent_container, newbieListFragment).commitAllowingStateLoss();
|
||||||
ivBack = findViewById(R.id.iv_back);
|
ivBack = findViewById(R.id.iv_back);
|
||||||
ivBack.setOnClickListener(new View.OnClickListener() {
|
ivBack.setOnClickListener(v -> finish());
|
||||||
@Override
|
findViewById(R.id.iv_filter).setOnClickListener(v -> {
|
||||||
public void onClick(View v) {
|
if (CommonUtils.isFastDoubleClick(1000)) return;
|
||||||
finish();
|
if (newbieFilterDialog == null) {
|
||||||
|
newbieFilterDialog = NewbieFilterDialog.newInstance()
|
||||||
|
.setOnFilterListener((gender, hello) -> {
|
||||||
|
newbieListFragment.filter(gender, hello);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
newbieFilterDialog.show(this);
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -10,12 +10,9 @@ import androidx.appcompat.widget.AppCompatImageView;
|
|||||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||||
import com.chad.library.adapter.base.BaseViewHolder;
|
import com.chad.library.adapter.base.BaseViewHolder;
|
||||||
import com.yizhuan.erban.R;
|
import com.yizhuan.erban.R;
|
||||||
import com.yizhuan.xchat_android_core.bean.RoomNewbieInfo;
|
import com.yizhuan.erban.ui.user.UserInfoActivity;
|
||||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils;
|
import com.yizhuan.erban.ui.utils.ImageLoadUtils;
|
||||||
import com.yizhuan.erban.ui.widget.NobleAvatarView;
|
import com.yizhuan.xchat_android_core.bean.RoomNewbieInfo;
|
||||||
import com.yizhuan.xchat_android_core.utils.StarUtils;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author jack
|
* @author jack
|
||||||
@@ -27,29 +24,34 @@ public class RoomNewbieListAdapter extends BaseQuickAdapter<RoomNewbieInfo, Base
|
|||||||
|
|
||||||
private RoomNewbieListAdapter.OnItemClickListener onItemClickListener;
|
private RoomNewbieListAdapter.OnItemClickListener onItemClickListener;
|
||||||
|
|
||||||
public interface OnItemClickListener {
|
public RoomNewbieListAdapter() {
|
||||||
void onAttentionBtnClick(RoomNewbieInfo fansInfo);
|
super(R.layout.newbie_list_item);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRylListener(RoomNewbieListAdapter.OnItemClickListener onClickListener) {
|
public void setRylListener(RoomNewbieListAdapter.OnItemClickListener onClickListener) {
|
||||||
onItemClickListener = onClickListener;
|
onItemClickListener = onClickListener;
|
||||||
}
|
}
|
||||||
|
|
||||||
public RoomNewbieListAdapter() {
|
|
||||||
super(R.layout.newbie_list_item);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void convert(BaseViewHolder baseViewHolder, final RoomNewbieInfo newbieInfo) {
|
protected void convert(BaseViewHolder baseViewHolder, final RoomNewbieInfo newbieInfo) {
|
||||||
if (newbieInfo == null) return;
|
if (newbieInfo == null) return;
|
||||||
|
|
||||||
baseViewHolder.setGone(R.id.view_line,false);
|
TextView tvAttention = baseViewHolder.getView(R.id.attention_img);
|
||||||
|
GradientDrawable attentionBg = (GradientDrawable) tvAttention.getBackground();
|
||||||
|
if (!newbieInfo.isHello()) {
|
||||||
|
attentionBg.setColor(mContext.getResources().getColor(R.color.color_CCCCCC));
|
||||||
|
} else {
|
||||||
|
attentionBg.setColor(mContext.getResources().getColor(R.color.appColor));
|
||||||
|
}
|
||||||
baseViewHolder.setText(R.id.tv_userName, newbieInfo.getNick())
|
baseViewHolder.setText(R.id.tv_userName, newbieInfo.getNick())
|
||||||
.setVisible(R.id.view_line, baseViewHolder.getLayoutPosition() != getItemCount() - 1)
|
.setText(R.id.tv_erban_id, "大鹅号:" + newbieInfo.getErbanNo())
|
||||||
.setOnClickListener(R.id.attention_img, v -> {
|
.setOnClickListener(R.id.attention_img, v -> {
|
||||||
if (onItemClickListener != null) {
|
if (onItemClickListener != null) {
|
||||||
onItemClickListener.onAttentionBtnClick(newbieInfo);
|
onItemClickListener.onAttentionBtnClick(newbieInfo);
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
.setOnClickListener(R.id.iv_avatar, v -> {
|
||||||
|
UserInfoActivity.Companion.start(mContext, newbieInfo.getUid());
|
||||||
});
|
});
|
||||||
AppCompatImageView ivGender = baseViewHolder.getView(R.id.iv_gender);
|
AppCompatImageView ivGender = baseViewHolder.getView(R.id.iv_gender);
|
||||||
if (newbieInfo.getGender() == 1) {
|
if (newbieInfo.getGender() == 1) {
|
||||||
@@ -58,9 +60,7 @@ public class RoomNewbieListAdapter extends BaseQuickAdapter<RoomNewbieInfo, Base
|
|||||||
ivGender.setImageResource(R.drawable.ic_gender_female);
|
ivGender.setImageResource(R.drawable.ic_gender_female);
|
||||||
}
|
}
|
||||||
|
|
||||||
NobleAvatarView nobleAvatarView = baseViewHolder.getView(R.id.noble_avatar_view);
|
ImageLoadUtils.loadImage(mContext, newbieInfo.getAvatar(), baseViewHolder.getView(R.id.iv_avatar));
|
||||||
nobleAvatarView.setSize(55, 75, 15);
|
|
||||||
nobleAvatarView.setData(newbieInfo.getAvatar(),null);
|
|
||||||
|
|
||||||
AppCompatImageView ivUserLevel = baseViewHolder.getView(R.id.iv_user_level);
|
AppCompatImageView ivUserLevel = baseViewHolder.getView(R.id.iv_user_level);
|
||||||
ivUserLevel.setVisibility(View.GONE);
|
ivUserLevel.setVisibility(View.GONE);
|
||||||
@@ -76,14 +76,9 @@ public class RoomNewbieListAdapter extends BaseQuickAdapter<RoomNewbieInfo, Base
|
|||||||
ImageLoadUtils.loadImage(mContext, newbieInfo.getCharmUrl(), ivCharmLevel);
|
ImageLoadUtils.loadImage(mContext, newbieInfo.getCharmUrl(), ivCharmLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
TextView tvConstellation = baseViewHolder.getView(R.id.tv_constellation);
|
public interface OnItemClickListener {
|
||||||
tvConstellation.setVisibility(View.GONE);
|
void onAttentionBtnClick(RoomNewbieInfo fansInfo);
|
||||||
String star = StarUtils.getConstellation(new Date(newbieInfo.getBirth()));
|
|
||||||
if (null != star) {
|
|
||||||
tvConstellation.setText(star);
|
|
||||||
tvConstellation.setVisibility(View.VISIBLE);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,46 @@
|
|||||||
|
package com.yizhuan.tutu.room_chat.fragment
|
||||||
|
|
||||||
|
import android.view.Gravity
|
||||||
|
import android.view.WindowManager
|
||||||
|
import com.yizhuan.erban.R
|
||||||
|
import com.yizhuan.erban.base.BaseDialog
|
||||||
|
import com.yizhuan.erban.databinding.DialogNewbieFilterBinding
|
||||||
|
|
||||||
|
class NewbieFilterDialog : BaseDialog<DialogNewbieFilterBinding>() {
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
@JvmStatic
|
||||||
|
fun newInstance(): NewbieFilterDialog {
|
||||||
|
return NewbieFilterDialog()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override var gravity: Int = Gravity.BOTTOM
|
||||||
|
override var width: Int = WindowManager.LayoutParams.MATCH_PARENT
|
||||||
|
|
||||||
|
private var onFilterListener: ((gender: Int, hello: Int) -> Unit)? = null
|
||||||
|
|
||||||
|
fun setOnFilterListener(onFilterListener: (gender: Int, hello: Int) -> Unit): NewbieFilterDialog {
|
||||||
|
this.onFilterListener = onFilterListener
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun init() {
|
||||||
|
binding.ivClose.setOnClickListener { dismissAllowingStateLoss() }
|
||||||
|
binding.tvConfirm.setOnClickListener {
|
||||||
|
onFilterListener?.invoke(
|
||||||
|
when (binding.rgGender.checkedRadioButtonId) {
|
||||||
|
R.id.rb_gender_male -> 1
|
||||||
|
R.id.rb_gender_female -> 2
|
||||||
|
else -> 0
|
||||||
|
},
|
||||||
|
when (binding.rgHello.checkedRadioButtonId) {
|
||||||
|
R.id.rb_hello_already -> 1
|
||||||
|
R.id.rb_hello_no -> 2
|
||||||
|
else -> 0
|
||||||
|
}
|
||||||
|
)
|
||||||
|
dismissAllowingStateLoss()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -25,6 +25,7 @@ import org.greenrobot.eventbus.EventBus;
|
|||||||
import org.greenrobot.eventbus.Subscribe;
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
import org.greenrobot.eventbus.ThreadMode;
|
import org.greenrobot.eventbus.ThreadMode;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,10 +39,11 @@ public class RoomNewbieListFragment extends BaseMvpFragment<IRoomNewbieView, Roo
|
|||||||
private SwipeRefreshLayout swipeRefresh;
|
private SwipeRefreshLayout swipeRefresh;
|
||||||
private RoomNewbieListAdapter mNewbieListAdapter;
|
private RoomNewbieListAdapter mNewbieListAdapter;
|
||||||
private boolean isInRoom;
|
private boolean isInRoom;
|
||||||
|
private List<RoomNewbieInfo> mData;
|
||||||
|
|
||||||
public static RoomNewbieListFragment newInstance(boolean isInRoom) {
|
public static RoomNewbieListFragment newInstance(boolean isInRoom) {
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
args.putBoolean("isInRoom",isInRoom);
|
args.putBoolean("isInRoom", isInRoom);
|
||||||
RoomNewbieListFragment fragment = new RoomNewbieListFragment();
|
RoomNewbieListFragment fragment = new RoomNewbieListFragment();
|
||||||
fragment.setArguments(args);
|
fragment.setArguments(args);
|
||||||
return fragment;
|
return fragment;
|
||||||
@@ -100,16 +102,16 @@ public class RoomNewbieListFragment extends BaseMvpFragment<IRoomNewbieView, Roo
|
|||||||
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||||
recyclerView.setItemAnimator(null);
|
recyclerView.setItemAnimator(null);
|
||||||
mNewbieListAdapter = new RoomNewbieListAdapter();
|
mNewbieListAdapter = new RoomNewbieListAdapter();
|
||||||
mNewbieListAdapter.setOnLoadMoreListener(this, recyclerView);
|
// mNewbieListAdapter.setOnLoadMoreListener(this, recyclerView);
|
||||||
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext());
|
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext());
|
||||||
recyclerView.setLayoutManager(linearLayoutManager);
|
recyclerView.setLayoutManager(linearLayoutManager);
|
||||||
recyclerView.setAdapter(mNewbieListAdapter);
|
recyclerView.setAdapter(mNewbieListAdapter);
|
||||||
mNewbieListAdapter.setRylListener(new RoomNewbieListAdapter.OnItemClickListener() {
|
mNewbieListAdapter.setRylListener(new RoomNewbieListAdapter.OnItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onAttentionBtnClick(RoomNewbieInfo fansInfo) {
|
public void onAttentionBtnClick(RoomNewbieInfo fansInfo) {
|
||||||
if (fansInfo.isHello()){
|
if (fansInfo.isHello()) {
|
||||||
RoomNewbieMessageActivity.start(mContext,fansInfo.getUid(),isInRoom);
|
RoomNewbieMessageActivity.start(mContext, fansInfo.getUid(), isInRoom);
|
||||||
}else {
|
} else {
|
||||||
SingleToastUtil.showToastShort("该用户被打招呼次数太多了,换一个吧~");
|
SingleToastUtil.showToastShort("该用户被打招呼次数太多了,换一个吧~");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -119,6 +121,7 @@ public class RoomNewbieListFragment extends BaseMvpFragment<IRoomNewbieView, Roo
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getRoomNewbieSuccess(List<RoomNewbieInfo> list) {
|
public void getRoomNewbieSuccess(List<RoomNewbieInfo> list) {
|
||||||
|
mData = list;
|
||||||
hideStatus();
|
hideStatus();
|
||||||
if (mNewbieListAdapter != null) {
|
if (mNewbieListAdapter != null) {
|
||||||
int page = getMvpPresenter().getPage();
|
int page = getMvpPresenter().getPage();
|
||||||
@@ -146,12 +149,13 @@ public class RoomNewbieListFragment extends BaseMvpFragment<IRoomNewbieView, Roo
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getRoomNewbieLoadMoreSuccess(List<RoomNewbieInfo> list) {
|
public void getRoomNewbieLoadMoreSuccess(List<RoomNewbieInfo> list) {
|
||||||
if (ListUtils.isListEmpty(list)){
|
if (ListUtils.isListEmpty(list)) {
|
||||||
mNewbieListAdapter.loadMoreEnd();
|
mNewbieListAdapter.loadMoreEnd();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mNewbieListAdapter.addData(list);
|
mNewbieListAdapter.addData(list);
|
||||||
mNewbieListAdapter.loadMoreComplete();
|
mNewbieListAdapter.loadMoreComplete();
|
||||||
|
mData = mNewbieListAdapter.getData();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -171,7 +175,7 @@ public class RoomNewbieListFragment extends BaseMvpFragment<IRoomNewbieView, Roo
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLoadMoreRequested() {
|
public void onLoadMoreRequested() {
|
||||||
loadData(false);
|
//loadData(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -184,4 +188,27 @@ public class RoomNewbieListFragment extends BaseMvpFragment<IRoomNewbieView, Roo
|
|||||||
public void onSendHelloSuccess(SendHelloSuccessEvent event) {
|
public void onSendHelloSuccess(SendHelloSuccessEvent event) {
|
||||||
loadData(true);
|
loadData(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void filter(int gender, int hello) {
|
||||||
|
if (ListUtils.isListEmpty(mData)) return;
|
||||||
|
if (gender == 0 && hello == 0) {
|
||||||
|
hideStatus();
|
||||||
|
mNewbieListAdapter.setNewData(mData);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
List<RoomNewbieInfo> filterData = new ArrayList<>();
|
||||||
|
for (RoomNewbieInfo newbieInfo : mData) {
|
||||||
|
if ((newbieInfo.getGender() == gender || gender == 0) &&
|
||||||
|
(hello == 0 || newbieInfo.isHello() == (hello == 2))) {
|
||||||
|
filterData.add(newbieInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (filterData.size() == 0) {
|
||||||
|
mNewbieListAdapter.setNewData(null);
|
||||||
|
showNoData(getString(R.string.empty_newbie_list));
|
||||||
|
} else {
|
||||||
|
hideStatus();
|
||||||
|
mNewbieListAdapter.setNewData(filterData);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -152,7 +152,7 @@ public class RoomNewbieMessageFragment extends BaseMvpFragment<IRoomNewbieMessag
|
|||||||
showNoData();
|
showNoData();
|
||||||
} else {
|
} else {
|
||||||
for (int i = 0; i < info.getList().size(); i++) {
|
for (int i = 0; i < info.getList().size(); i++) {
|
||||||
info.getList().get(i).setCheck(i==0?true:false);
|
info.getList().get(i).setCheck(i == 0);
|
||||||
}
|
}
|
||||||
mNewbieMessageAdapter.setNewData(info.getList());
|
mNewbieMessageAdapter.setNewData(info.getList());
|
||||||
infoList = info;
|
infoList = info;
|
||||||
|
BIN
app/src/module_room_chat/res/drawable-xhdpi/ic_close_filter.png
Normal file
BIN
app/src/module_room_chat/res/drawable-xhdpi/ic_close_filter.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 926 B |
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
@@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<item android:state_checked="true">
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="#FFEAE5FC" />
|
||||||
|
<stroke android:width="1px" android:color="#FF7154EE" />
|
||||||
|
<corners android:radius="100dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
<item android:state_checked="false">
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="#FFF1F2F4" />
|
||||||
|
<corners android:radius="100dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
</selector>
|
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<item android:color="#FF7154EE" android:state_checked="true" />
|
||||||
|
|
||||||
|
<item android:color="#FF666666" android:state_pressed="false" />
|
||||||
|
|
||||||
|
</selector>
|
@@ -15,43 +15,55 @@
|
|||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:paddingTop="@dimen/dp_5"
|
|
||||||
android:paddingBottom="@dimen/dp_5"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:orientation="horizontal"
|
||||||
>
|
>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:orientation="vertical"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="vertical">
|
android:layout_gravity="center_horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/find_new"
|
android:text="@string/find_new"
|
||||||
android:textColor="@color/text_normal_c6c6e9"
|
android:textColor="@color/color_333333"
|
||||||
android:textSize="@dimen/dp_18" />
|
android:textSize="@dimen/dp_18"
|
||||||
|
android:layout_marginTop="@dimen/dp_15"
|
||||||
|
/>
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="每日更新推荐"
|
android:text="每日更新推荐"
|
||||||
android:textColor="@color/text_secondary_4f516a"
|
android:textColor="@color/color_999999"
|
||||||
android:textSize="@dimen/dp_13" />
|
android:textSize="@dimen/dp_13"
|
||||||
|
/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_back"
|
android:id="@+id/iv_back"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_marginStart="@dimen/dp_15"
|
|
||||||
android:padding="@dimen/dp_8"
|
android:padding="@dimen/dp_8"
|
||||||
android:src="@drawable/arrow_left" />
|
android:src="@drawable/arrow_left"
|
||||||
|
android:layout_marginStart="@dimen/dp_8"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_filter"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="@dimen/dp_8"
|
||||||
|
android:src="@drawable/ic_find_new_filter"
|
||||||
|
android:layout_marginEnd="@dimen/dp_8"
|
||||||
|
android:layout_gravity="center_vertical|end"
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
|
@@ -54,6 +54,15 @@
|
|||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_filter"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="@dimen/dp_8"
|
||||||
|
android:src="@drawable/ic_find_new_filter"
|
||||||
|
android:layout_marginEnd="@dimen/dp_8"
|
||||||
|
android:layout_gravity="center_vertical|end"
|
||||||
|
/>
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
|
160
app/src/module_room_chat/res/layout/dialog_newbie_filter.xml
Normal file
160
app/src/module_room_chat/res/layout/dialog_newbie_filter.xml
Normal file
@@ -0,0 +1,160 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="bottom"
|
||||||
|
android:background="@drawable/shape_white_top_12dp"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="15dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:text="筛选"
|
||||||
|
android:textColor="#ff333333"
|
||||||
|
android:textSize="15sp" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_close"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical|end"
|
||||||
|
android:layout_marginEnd="15dp"
|
||||||
|
android:src="@drawable/ic_close_filter" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="15dp"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:text="用户性别"
|
||||||
|
android:textColor="#ff333333"
|
||||||
|
android:textSize="15sp" />
|
||||||
|
|
||||||
|
<RadioGroup
|
||||||
|
android:id="@+id/rg_gender"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/rb_gender_all"
|
||||||
|
android:layout_width="72dp"
|
||||||
|
android:layout_height="26dp"
|
||||||
|
android:layout_marginStart="15dp"
|
||||||
|
android:background="@drawable/bg_newbie_filter_rb"
|
||||||
|
android:button="@null"
|
||||||
|
android:checked="true"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="全部"
|
||||||
|
android:textColor="@drawable/color_newbie_rb"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/rb_gender_male"
|
||||||
|
android:layout_width="72dp"
|
||||||
|
android:layout_height="26dp"
|
||||||
|
android:layout_marginStart="20dp"
|
||||||
|
android:background="@drawable/bg_newbie_filter_rb"
|
||||||
|
android:button="@null"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="男"
|
||||||
|
android:textColor="@drawable/color_newbie_rb"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/rb_gender_female"
|
||||||
|
android:layout_width="72dp"
|
||||||
|
android:layout_height="26dp"
|
||||||
|
android:layout_marginStart="20dp"
|
||||||
|
android:background="@drawable/bg_newbie_filter_rb"
|
||||||
|
android:button="@null"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="女"
|
||||||
|
android:textColor="@drawable/color_newbie_rb"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
</RadioGroup>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="15dp"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
android:text="是否打招呼"
|
||||||
|
android:textColor="#ff333333"
|
||||||
|
android:textSize="15sp" />
|
||||||
|
|
||||||
|
<RadioGroup
|
||||||
|
android:id="@+id/rg_hello"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/rb_hello_all"
|
||||||
|
android:layout_width="72dp"
|
||||||
|
android:layout_height="26dp"
|
||||||
|
android:layout_marginStart="15dp"
|
||||||
|
android:background="@drawable/bg_newbie_filter_rb"
|
||||||
|
android:button="@null"
|
||||||
|
android:checked="true"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="全部"
|
||||||
|
android:textColor="@drawable/color_newbie_rb"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/rb_hello_already"
|
||||||
|
android:layout_width="72dp"
|
||||||
|
android:layout_height="26dp"
|
||||||
|
android:layout_marginStart="20dp"
|
||||||
|
android:background="@drawable/bg_newbie_filter_rb"
|
||||||
|
android:button="@null"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="已打招呼"
|
||||||
|
android:textColor="@drawable/color_newbie_rb"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/rb_hello_no"
|
||||||
|
android:layout_width="72dp"
|
||||||
|
android:layout_height="26dp"
|
||||||
|
android:layout_marginStart="20dp"
|
||||||
|
android:background="@drawable/bg_newbie_filter_rb"
|
||||||
|
android:button="@null"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="未打招呼"
|
||||||
|
android:textColor="@drawable/color_newbie_rb"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
</RadioGroup>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_confirm"
|
||||||
|
android:layout_width="250dp"
|
||||||
|
android:layout_height="38dp"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_marginTop="40dp"
|
||||||
|
android:layout_marginBottom="45dp"
|
||||||
|
android:background="@drawable/bg_common_confirm"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="确认修改"
|
||||||
|
android:textColor="#ffffffff"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</layout>
|
Reference in New Issue
Block a user