feat:完成消息页UI改版

This commit is contained in:
Max
2023-11-24 19:04:41 +08:00
parent e1b7a5464d
commit 4f24fed67f
21 changed files with 367 additions and 192 deletions

View File

@@ -41,21 +41,21 @@ class ContactsListFragment : BaseViewBindingFragment<FragmentContactListBinding>
private var pagerAdapter: UserInfoPagerAdapter? = null
override fun init() {
//标记已读消息
binding.ivContactTrash.setOnClickListener {
if (NIMClient.getService(MsgService::class.java).totalUnreadCount > 0) {
dialogManager.showOkCancelDialog(getString(R.string.tips_clear_unread_count),
getString(R.string.text_canle), getString(R.string.tips_ok_label_clear),
object : AbsOkDialogListener() {
override fun onOk() {}
override fun onCancel() {
EventBus.getDefault().post(ContactTrashEvent())
}
})
} else {
toast(ResUtil.getString(R.string.home_fragment_contactslistfragment_01))
}
}
// //标记已读消息
// binding.ivContactTrash.setOnClickListener {
// if (NIMClient.getService(MsgService::class.java).totalUnreadCount > 0) {
// dialogManager.showOkCancelDialog(getString(R.string.tips_clear_unread_count),
// getString(R.string.text_canle), getString(R.string.tips_ok_label_clear),
// object : AbsOkDialogListener() {
// override fun onOk() {}
// override fun onCancel() {
// EventBus.getDefault().post(ContactTrashEvent())
// }
// })
// } else {
// toast(ResUtil.getString(R.string.home_fragment_contactslistfragment_01))
// }
// }
initViewPager()
}
@@ -73,7 +73,7 @@ class ContactsListFragment : BaseViewBindingFragment<FragmentContactListBinding>
tagList.add(getString(R.string.layout_fragment_contact_list_03))
tagList.add(getString(R.string.layout_fragment_contact_list_04))
val commonNavigator = CommonNavigator(context)
commonNavigator.setTitleWrapContent(true)
commonNavigator.setTitleWrapContent(false)
val magicIndicatorAdapter = UserInfoIndicatorAdapter(context, tagList)
magicIndicatorAdapter.setOnItemSelectListener { position: Int, view: TextView? ->
binding.viewPager.currentItem = position

View File

@@ -76,8 +76,6 @@ import io.reactivex.functions.BiConsumer;
*/
public class RecentListFragment extends BaseFragment {
private static final String TAG = "RecentListFragment";
private final String share_pref_is_newbie_clicked = "share_pref_is_newbie_clicked";
private RecyclerView grabApprenticesRecyclerView;
@@ -86,10 +84,10 @@ public class RecentListFragment extends BaseFragment {
private RecentContactsFragment recentContactsFragment;
private boolean isInRoom;
private RecyclerView rvAttentionOnline;
private AttentionInRoomAdapter mAttentionInRoomAdapter;
// private RecyclerView rvAttentionOnline;
// private AttentionInRoomAdapter mAttentionInRoomAdapter;
private FrameLayout flNewbie;
private ImageView ivRedPoint;
// private ImageView ivRedPoint;
private long lastClickTime;
public static RecentListFragment newInstance(boolean isInRoom) {
@@ -115,36 +113,36 @@ public class RecentListFragment extends BaseFragment {
public void onFindViews() {
// 一起玩、关注用户在房间内列表
rvAttentionOnline = mView.findViewById(R.id.rv_attention_online);
mAttentionInRoomAdapter = new AttentionInRoomAdapter();
rvAttentionOnline.setAdapter(mAttentionInRoomAdapter);
rvAttentionOnline.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false));
mAttentionInRoomAdapter.setOnItemChildClickListener((adapter, view, position) -> {
List<AttentionItem> attentionItems = adapter.getData();
if (attentionItems.size() > position) {
AttentionItem attentionItem = attentionItems.get(position);
switch (attentionItem.getItemType()) {
case AttentionItem.TYPE_ATTENTION:
try {
AttentionInfo attentionInfo = (AttentionInfo) attentionItem.getData();
if (attentionInfo != null && attentionInfo.getUserInRoom() != null && mContext != null) {
AVRoomActivity.startForFromType(mContext, attentionInfo.getUserInRoom().getUid(),
AVRoomActivity.FROM_TYPE_USER, attentionInfo.getNick(), String.valueOf(attentionInfo.getUid()));
}
} catch (Exception ex) {
ex.printStackTrace();
}
break;
case AttentionItem.TYPE_ATTENTION_MORE:
if (mContext != null) {
AttentionListActivity.start(mContext);
}
break;
}
}
});
// rvAttentionOnline = mView.findViewById(R.id.rv_attention_online);
// mAttentionInRoomAdapter = new AttentionInRoomAdapter();
// rvAttentionOnline.setAdapter(mAttentionInRoomAdapter);
// rvAttentionOnline.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false));
// mAttentionInRoomAdapter.setOnItemChildClickListener((adapter, view, position) -> {
// List<AttentionItem> attentionItems = adapter.getData();
// if (attentionItems.size() > position) {
// AttentionItem attentionItem = attentionItems.get(position);
// switch (attentionItem.getItemType()) {
// case AttentionItem.TYPE_ATTENTION:
// try {
// AttentionInfo attentionInfo = (AttentionInfo) attentionItem.getData();
// if (attentionInfo != null && attentionInfo.getUserInRoom() != null && mContext != null) {
// AVRoomActivity.startForFromType(mContext, attentionInfo.getUserInRoom().getUid(),
// AVRoomActivity.FROM_TYPE_USER, attentionInfo.getNick(), String.valueOf(attentionInfo.getUid()));
// }
//
// } catch (Exception ex) {
// ex.printStackTrace();
// }
// break;
//
// case AttentionItem.TYPE_ATTENTION_MORE:
// if (mContext != null) {
// AttentionListActivity.start(mContext);
// }
// break;
// }
// }
// });
recentContactsFragment = RecentContactsFragment.newInstance(isInRoom);
FragmentManager fragmentManager = getChildFragmentManager();
@@ -164,10 +162,10 @@ public class RecentListFragment extends BaseFragment {
}
});
boolean isClicked = (boolean) SharedPreferenceUtils.get(share_pref_is_newbie_clicked, false);
// boolean isClicked = (boolean) SharedPreferenceUtils.get(share_pref_is_newbie_clicked, false);
flNewbie = mView.findViewById(R.id.fl_newbie);
ivRedPoint = mView.findViewById(R.id.iv_red_point);
ivRedPoint.setVisibility(isClicked ? View.GONE : View.VISIBLE);
// ivRedPoint = mView.findViewById(R.id.iv_red_point);
// ivRedPoint.setVisibility(isClicked ? View.GONE : View.VISIBLE);
// 等级限制
setFindNewbieView();
}
@@ -223,7 +221,7 @@ public class RecentListFragment extends BaseFragment {
}
lastClickTime = currTime;
SharedPreferenceUtils.put(share_pref_is_newbie_clicked, true);// 是否第一次点击发现萌新
ivRedPoint.setVisibility(View.GONE);
// ivRedPoint.setVisibility(View.GONE);
RoomNewbieActivity.start(getActivity(), false);
});
}
@@ -398,18 +396,18 @@ public class RecentListFragment extends BaseFragment {
// attentionItems.add(attentionItem);
// }
if (rvAttentionOnline != null) {
rvAttentionOnline.setVisibility(View.VISIBLE);
}
if (mAttentionInRoomAdapter != null) {
mAttentionInRoomAdapter.setNewData(attentionItems);
}
// if (rvAttentionOnline != null) {
// rvAttentionOnline.setVisibility(View.VISIBLE);
// }
//
// if (mAttentionInRoomAdapter != null) {
// mAttentionInRoomAdapter.setNewData(attentionItems);
// }
} else {
if (rvAttentionOnline != null) {
rvAttentionOnline.setVisibility(View.GONE);
}
// if (rvAttentionOnline != null) {
// rvAttentionOnline.setVisibility(View.GONE);
// }
}
}

View File

@@ -0,0 +1,177 @@
package com.chwl.app.ui.user.adapter;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.view.View;
import android.view.animation.Interpolator;
import android.view.animation.LinearInterpolator;
import com.chwl.app.ui.widget.magicindicator.FragmentContainerHelper;
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.abs.IPagerIndicator;
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.model.PositionData;
import java.util.List;
public class DrawableIndicator extends View implements IPagerIndicator {
public static final int MODE_MATCH_EDGE = 0; // drawable宽度 == title宽度 - 2 * mXOffset
public static final int MODE_WRAP_CONTENT = 1; // drawable宽度 == title内容宽度 - 2 * mXOffset
public static final int MODE_EXACTLY = 2;
private int mMode; // 默认为MODE_MATCH_EDGE模式
private Drawable mIndicatorDrawable;
// 控制动画
private Interpolator mStartInterpolator = new LinearInterpolator();
private Interpolator mEndInterpolator = new LinearInterpolator();
private float mDrawableHeight;
private float mDrawableWidth;
private float mYOffset;
private float mXOffset;
private List<PositionData> mPositionDataList;
private Rect mDrawableRect = new Rect();
public DrawableIndicator(Context context) {
super(context);
}
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
if (mIndicatorDrawable == null) {
return;
}
if (mPositionDataList == null || mPositionDataList.isEmpty()) {
return;
}
// 计算锚点位置
PositionData current = FragmentContainerHelper.getImitativePositionData(mPositionDataList, position);
PositionData next = FragmentContainerHelper.getImitativePositionData(mPositionDataList, position + 1);
float leftX;
float nextLeftX;
float rightX;
float nextRightX;
if (mMode == MODE_MATCH_EDGE) {
leftX = current.mLeft + mXOffset;
nextLeftX = next.mLeft + mXOffset;
rightX = current.mRight - mXOffset;
nextRightX = next.mRight - mXOffset;
mDrawableRect.top = (int) mYOffset;
mDrawableRect.bottom = (int) (getHeight() - mYOffset);
} else if (mMode == MODE_WRAP_CONTENT) {
leftX = current.mContentLeft + mXOffset;
nextLeftX = next.mContentLeft + mXOffset;
rightX = current.mContentRight - mXOffset;
nextRightX = next.mContentRight - mXOffset;
mDrawableRect.top = (int) (current.mContentTop - mYOffset);
mDrawableRect.bottom = (int) (current.mContentBottom + mYOffset);
} else { // MODE_EXACTLY
leftX = current.mLeft + (current.width() - mDrawableWidth) / 2;
nextLeftX = next.mLeft + (next.width() - mDrawableWidth) / 2;
rightX = current.mLeft + (current.width() + mDrawableWidth) / 2;
nextRightX = next.mLeft + (next.width() + mDrawableWidth) / 2;
mDrawableRect.top = (int) (getHeight() - mDrawableHeight - mYOffset);
mDrawableRect.bottom = (int) (getHeight() - mYOffset);
}
mDrawableRect.left = (int) (leftX + (nextLeftX - leftX) * mStartInterpolator.getInterpolation(positionOffset));
mDrawableRect.right = (int) (rightX + (nextRightX - rightX) * mEndInterpolator.getInterpolation(positionOffset));
mIndicatorDrawable.setBounds(mDrawableRect);
invalidate();
}
@Override
public void onPageSelected(int position) {
}
@Override
public void onPageScrollStateChanged(int state) {
}
@Override
protected void onDraw(Canvas canvas) {
if (mIndicatorDrawable != null) {
mIndicatorDrawable.draw(canvas);
}
}
@Override
public void onPositionDataProvide(List<PositionData> dataList) {
mPositionDataList = dataList;
}
public Drawable getIndicatorDrawable() {
return mIndicatorDrawable;
}
public void setIndicatorDrawable(Drawable indicatorDrawable) {
mIndicatorDrawable = indicatorDrawable;
}
public Interpolator getStartInterpolator() {
return mStartInterpolator;
}
public void setStartInterpolator(Interpolator startInterpolator) {
mStartInterpolator = startInterpolator;
}
public Interpolator getEndInterpolator() {
return mEndInterpolator;
}
public void setEndInterpolator(Interpolator endInterpolator) {
mEndInterpolator = endInterpolator;
}
public int getMode() {
return mMode;
}
public void setMode(int mode) {
if (mode == MODE_EXACTLY || mode == MODE_MATCH_EDGE || mode == MODE_WRAP_CONTENT) {
mMode = mode;
} else {
throw new IllegalArgumentException("mode " + mode + " not supported.");
}
}
public float getDrawableHeight() {
return mDrawableHeight;
}
public void setDrawableHeight(float drawableHeight) {
mDrawableHeight = drawableHeight;
}
public float getDrawableWidth() {
return mDrawableWidth;
}
public void setDrawableWidth(float drawableWidth) {
mDrawableWidth = drawableWidth;
}
public float getYOffset() {
return mYOffset;
}
public void setYOffset(float yOffset) {
mYOffset = yOffset;
}
public float getXOffset() {
return mXOffset;
}
public void setXOffset(float xOffset) {
mXOffset = xOffset;
}
}

View File

@@ -14,22 +14,18 @@ import com.chwl.app.ui.widget.magicindicator.buildins.UIUtil;
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.abs.CommonNavigatorAdapter;
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.abs.IPagerIndicator;
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.abs.IPagerTitleView;
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.indicators.GradientLinePagerIndicator;
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.indicators.LinePagerIndicator;
import java.util.List;
public class UserInfoIndicatorAdapter extends CommonNavigatorAdapter {
private final Context mContext;
private final List<? extends CharSequence> mTitleList;
private int textSize = 18;
private float minScale = 0.75f;
private int textSize = 16;
private float minScale = 1f;
private boolean showIndicator = true;
private OnItemSelectListener mOnItemSelectListener;
public UserInfoIndicatorAdapter(Context context, List<? extends CharSequence> charSequences) {
this.mContext = context;
this.mTitleList = charSequences;
}
@@ -41,18 +37,17 @@ public class UserInfoIndicatorAdapter extends CommonNavigatorAdapter {
@Override
public IPagerTitleView getTitleView(Context context, final int i) {
ScaleTransitionPagerTitleView scaleTransitionPagerTitleView = new ScaleTransitionPagerTitleView(context, true);
scaleTransitionPagerTitleView.setNormalColor(ContextCompat.getColor(context, R.color.color_6D6B89));
scaleTransitionPagerTitleView.setSelectedColor(ContextCompat.getColor(context, R.color.color_1F1A4E));
scaleTransitionPagerTitleView.setNormalColor(ContextCompat.getColor(context, R.color.color_84868A));
scaleTransitionPagerTitleView.setSelectedColor(ContextCompat.getColor(context, R.color.color_1E1E1F));
scaleTransitionPagerTitleView.setMinScale(minScale);
scaleTransitionPagerTitleView.setTextSize(textSize);
int padding = UIUtil.dip2px(context, 12);
int padding = UIUtil.dip2px(context, 16);
scaleTransitionPagerTitleView.setPadding(padding, 0, padding, 0);
scaleTransitionPagerTitleView.setText(mTitleList.get(i));
scaleTransitionPagerTitleView.setOnClickListener(view -> {
if (mOnItemSelectListener != null) {
mOnItemSelectListener.onItemSelect(i, scaleTransitionPagerTitleView);
}
});
return scaleTransitionPagerTitleView;
}
@@ -60,13 +55,13 @@ public class UserInfoIndicatorAdapter extends CommonNavigatorAdapter {
@Override
public IPagerIndicator getIndicator(Context context) {
if (!showIndicator) return null;
GradientLinePagerIndicator indicator = new GradientLinePagerIndicator(context);
indicator.setMode(LinePagerIndicator.MODE_WRAP_CONTENT);
indicator.setLineHeight(UIUtil.dip2px(mContext, 8));
indicator.setRoundRadius(UIUtil.dip2px(mContext, 360));
DrawableIndicator indicator = new DrawableIndicator(context);
indicator.setMode(DrawableIndicator.MODE_EXACTLY);
indicator.setDrawableWidth(UIUtil.dip2px(context, 24));
indicator.setDrawableHeight(UIUtil.dip2px(context, 8));
indicator.setIndicatorDrawable(context.getResources().getDrawable(R.drawable.base_ic_indicator));
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
lp.gravity = Gravity.END;
lp.bottomMargin = UIUtil.dip2px(mContext, 0);
indicator.setLayoutParams(lp);
return indicator;
}

View File

@@ -24,15 +24,15 @@ class GenderAgeTextView @JvmOverloads constructor(
setTextColor(Color.WHITE)
minWidth = resources.getDimensionPixelOffset(R.dimen.dp_26)
minWidth = resources.getDimensionPixelOffset(R.dimen.dp_34)
gravity = Gravity.CENTER_VERTICAL
setPadding(
resources.getDimensionPixelOffset(R.dimen.dp_4),
resources.getDimensionPixelOffset(R.dimen.dp_3),
0,
resources.getDimensionPixelOffset(R.dimen.dp_4),
resources.getDimensionPixelOffset(R.dimen.dp_5),
0
)
compoundDrawablePadding = resources.getDimensionPixelOffset(R.dimen.dp_2)
// compoundDrawablePadding = resources.getDimensionPixelOffset(R.dimen.dp_2)
setGender(gender)
setBirthDay(System.currentTimeMillis())

Binary file not shown.

Before

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -1,7 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/dp_16" />
<corners android:radius="@dimen/dp_8" />
<gradient
android:angle="90"
android:endColor="#FFACD4"
android:startColor="#ffff6ea9"
android:type="linear" />
<solid android:color="@color/color_ff80cc" />
</shape>

View File

@@ -1,7 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/dp_16" />
<corners android:radius="@dimen/dp_8" />
<solid android:color="@color/color_6bb3ff" />
<gradient
android:angle="90"
android:endColor="#ACD1FF"
android:startColor="#6EA9FF"
android:type="linear" />
</shape>

View File

@@ -3,21 +3,22 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/color_white">
android:background="@color/color_F7F7F7">
<View
android:background="@drawable/bg_message_top"
android:layout_width="match_parent"
android:layout_height="169dp"
app:layout_constraintTop_toTopOf="parent"/>
android:layout_height="0dp"
android:background="@drawable/bg_home_top"
app:layout_constraintDimensionRatio="375:178"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/ll_title"
android:orientation="horizontal"
android:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_40"
android:layout_marginTop="@dimen/dp_40"
android:layout_height="@dimen/dp_44"
android:layout_marginTop="@dimen/dp_44"
android:paddingStart="@dimen/dp_15"
android:paddingEnd="@dimen/dp_15"
app:layout_constraintStart_toStartOf="parent"
@@ -26,22 +27,22 @@
<com.chwl.app.ui.widget.magicindicator.MagicIndicator
android:id="@+id/magic_indicator"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_25" />
android:layout_height="match_parent" />
<View
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"/>
<!-- <View-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_weight="1"-->
<!-- android:layout_height="wrap_content"/>-->
<ImageView
android:id="@+id/iv_contact_trash"
android:layout_width="30dp"
android:layout_height="30dp"
android:scaleType="center"
android:src="@mipmap/ic_contact_trash"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/magic_indicator"
app:layout_constraintBottom_toBottomOf="@+id/magic_indicator"/>
<!-- <ImageView-->
<!-- android:id="@+id/iv_contact_trash"-->
<!-- android:layout_width="30dp"-->
<!-- android:layout_height="30dp"-->
<!-- android:scaleType="center"-->
<!-- android:src="@mipmap/ic_contact_trash"-->
<!-- app:layout_constraintEnd_toEndOf="parent"-->
<!-- app:layout_constraintTop_toTopOf="@+id/magic_indicator"-->
<!-- app:layout_constraintBottom_toBottomOf="@+id/magic_indicator"/>-->
</LinearLayout>

View File

@@ -56,7 +56,7 @@
app:layout_constraintTop_toTopOf="@id/layout_menu" />
<ImageView
android:layout_width="@dimen/dp_23"
android:layout_width="@dimen/dp_24"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_2"
android:src="@drawable/base_ic_indicator"

View File

@@ -2,77 +2,70 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/recent_list_container"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:orientation="vertical">
<com.chwl.app.ui.widget.RecyclerViewNoViewpagerScroll
android:id="@+id/rv_attention_online"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
tools:visibility="visible"/>
<!-- <com.chwl.app.ui.widget.RecyclerViewNoViewpagerScroll-->
<!-- android:id="@+id/rv_attention_online"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:visibility="gone"-->
<!-- tools:visibility="visible"/>-->
<FrameLayout
android:id="@+id/fl_newbie"
android:layout_width="match_parent"
android:layout_height="80dp"
android:gravity="center_vertical"
android:layout_height="@dimen/dp_109"
android:visibility="gone"
>
tools:visibility="visible">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical">
android:layout_gravity="center"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:layout_width="55dp"
android:layout_height="55dp"
android:src="@mipmap/ic_find_new"
android:layout_marginStart="@dimen/dp_15"
/>
android:src="@mipmap/ic_find_new" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/text_title_color"
android:textSize="@dimen/dp_15"
android:text="@string/find_new"
android:gravity="center_vertical"
android:layout_marginStart="@dimen/dp_13"
android:drawablePadding="13.5dp"
android:layout_gravity="center_vertical"
/>
android:textColor="@color/color_333333"
android:textSize="@dimen/dp_14" />
</LinearLayout>
<!-- <ImageView-->
<!-- android:id="@+id/iv_red_point"-->
<!-- android:layout_width="8dp"-->
<!-- android:layout_height="8dp"-->
<!-- android:layout_gravity="end|center_vertical"-->
<!-- android:layout_marginEnd="@dimen/dp_32"-->
<!-- android:src="@drawable/shap_red_point"-->
<!-- android:visibility="gone" />-->
<ImageView
android:id="@+id/iv_red_point"
android:layout_width="8dp"
android:layout_height="8dp"
android:src="@drawable/shap_red_point"
android:layout_gravity="end|center_vertical"
android:layout_marginEnd="@dimen/dp_32"
android:visibility="gone"
/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/arrow_right"
android:layout_gravity="end|center_vertical"
android:layout_marginEnd="@dimen/dp_15"
/>
<!-- <ImageView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_gravity="end|center_vertical"-->
<!-- android:layout_marginEnd="@dimen/dp_15"-->
<!-- android:src="@drawable/arrow_right" />-->
</FrameLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_grab_apprentices"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
android:layout_height="wrap_content" />
<FrameLayout
android:paddingTop="8dp"
android:id="@+id/recent_container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent"
android:background="@drawable/base_shape_ffffff_top_12dp" />
</LinearLayout>

View File

@@ -2,7 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="71dp"
android:layout_height="80dp"
android:clickable="true"
android:focusable="true"
android:orientation="vertical"
@@ -10,7 +10,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="71dp"
android:layout_height="80dp"
android:orientation="horizontal">
<RelativeLayout
@@ -18,19 +18,19 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="5dp">
android:layout_marginStart="11dp">
<com.netease.nim.uikit.common.ui.imageview.HeadImageView
android:id="@+id/img_head"
android:layout_width="55dp"
android:layout_height="55dp"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_centerInParent="true"
tools:src="@drawable/default_avatar" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/noble_head_wear"
android:layout_width="75dp"
android:layout_height="75dp"
android:layout_width="65.5dp"
android:layout_height="65.5dp"
android:layout_centerInParent="true"
tools:src="@mipmap/ic_user_avatar_level_king" />
@@ -38,9 +38,8 @@
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:orientation="vertical">
@@ -71,7 +70,7 @@
android:singleLine="true"
android:text=""
android:textColor="@color/text_title_color"
android:textSize="15dp"
android:textSize="14dp"
tools:ignore="SpUsage"
tools:text="@string/layout_nim_recent_contact_list_item_new_01" />
@@ -115,7 +114,7 @@
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginTop="8dp"
android:gravity="center_vertical"
android:orientation="horizontal">
@@ -153,8 +152,8 @@
android:lines="1"
android:scrollHorizontally="true"
android:text=""
android:textColor="@color/text_normal_c6c6e9"
android:textSize="12dp"
android:textColor="#84868A"
android:textSize="13dp"
tools:ignore="SpUsage"
tools:text="@string/layout_nim_recent_contact_list_item_new_03" />
@@ -165,8 +164,7 @@
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginTop="10dp"
android:layout_marginEnd="15dp"
android:layout_marginEnd="20dp"
android:gravity="end"
android:orientation="vertical">
@@ -174,7 +172,8 @@
android:id="@+id/unread_number_tip"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_18"
android:layout_gravity="right"
android:layout_gravity="right|bottom"
android:layout_marginBottom="19dp"
android:singleLine="true"
android:visibility="gone"
tools:text="123"
@@ -193,8 +192,7 @@
android:id="@+id/tv_date_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|right"
android:layout_marginTop="6dp"
android:layout_marginTop="19dp"
android:textColor="@color/text_secondary_4f516a"
android:textSize="11dp"
tools:text="just now" />
@@ -203,11 +201,11 @@
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_marginStart="85dp"
android:layout_marginEnd="15dp"
android:background="@color/line_353548" />
<!-- <View-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="1px"-->
<!-- android:layout_marginStart="85dp"-->
<!-- android:layout_marginEnd="15dp"-->
<!-- android:background="@color/line_353548" />-->
</LinearLayout>

View File

@@ -68,11 +68,11 @@ public abstract class RoomMsgRecentViewHolder extends RecyclerViewHolder<BaseQui
protected void updateBackground(BaseViewHolder holder, RecentContact recent, int position) {
if ((recent.getTag() & RecentContactsFragment.RECENT_TAG_STICKY) == 0) {
holder.getConvertView().setBackgroundResource(R.drawable.bg_common_touch);
} else {
holder.getConvertView().setBackgroundResource(R.drawable.nim_recent_contact_sticky_selecter);
}
// if ((recent.getTag() & RecentContactsFragment.RECENT_TAG_STICKY) == 0) {
// holder.getConvertView().setBackgroundResource(R.drawable.bg_common_touch);
// } else {
// holder.getConvertView().setBackgroundResource(R.drawable.nim_recent_contact_sticky_selecter);
// }
}
protected void loadPortrait(RecentContact recent) {

View File

@@ -48,7 +48,7 @@ import io.reactivex.Single;
public class RoomMsgRecentListFragment extends BaseFragment {
private RoomMsgRecentContactsFragment recentContactsFragment;
private FrameLayout flNewbie;
private ImageView ivRedPoint;
// private ImageView ivRedPoint;
private final String share_pref_is_newbie_clicked = "share_pref_is_newbie_clicked";
private long lastClickTime;
@@ -68,10 +68,10 @@ public class RoomMsgRecentListFragment extends BaseFragment {
FragmentManager fragmentManager = getChildFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.replace(R.id.recent_container, recentContactsFragment).commitAllowingStateLoss();
boolean isClicked = (boolean) SharedPreferenceUtils.get(share_pref_is_newbie_clicked, false);
// boolean isClicked = (boolean) SharedPreferenceUtils.get(share_pref_is_newbie_clicked, false);
flNewbie = mView.findViewById(R.id.fl_newbie);
ivRedPoint = mView.findViewById(R.id.iv_red_point);
ivRedPoint.setVisibility(isClicked ? View.GONE : View.VISIBLE);
// ivRedPoint = mView.findViewById(R.id.iv_red_point);
// ivRedPoint.setVisibility(isClicked ? View.GONE : View.VISIBLE);
// 等级限制
setFindNewbieView();
}
@@ -99,7 +99,7 @@ public class RoomMsgRecentListFragment extends BaseFragment {
}
lastClickTime = currTime;
SharedPreferenceUtils.put(share_pref_is_newbie_clicked, true);// 是否第一次点击发现萌新
ivRedPoint.setVisibility(View.GONE);
// ivRedPoint.setVisibility(View.GONE);
RoomNewbieActivity.start(getActivity(), true);
});
}

View File

@@ -2,8 +2,7 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="75dp"
android:background="@drawable/bg_common_touch">
android:layout_height="75dp">
<com.netease.nim.uikit.common.ui.imageview.HeadImageView
android:id="@+id/img_head"

View File

@@ -3,8 +3,7 @@
android:width="18dp"
android:height="18dp"
android:viewportWidth="18"
android:viewportHeight="18"
tools:ignore="MissingDefaultResource">
android:viewportHeight="18">
<path
android:pathData="M6.97,14.834C6.677,14.541 6.677,14.066 6.97,13.773L11.742,9.001L6.97,4.227C6.677,3.934 6.677,3.459 6.97,3.166C7.263,2.873 7.737,2.873 8.03,3.166L13.334,8.47L13.334,8.47C13.627,8.763 13.627,9.237 13.334,9.53L8.03,14.834C7.737,15.127 7.263,15.127 6.97,14.834Z"
android:strokeWidth="0.2"

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#FFFFFF" />
<corners android:radius="12dp" />
</shape>

View File

@@ -52,7 +52,7 @@ public class BubbleView extends AppCompatTextView {
gradientDrawable.setShape(GradientDrawable.RECTANGLE);
// gradientDrawable.setShape(GradientDrawable.RECTANGLE);
gradientDrawable.setCornerRadius(ScreenUtil.dip2px(20));
gradientDrawable.setColor(Color.parseColor("#FF3B30"));
gradientDrawable.setColor(Color.parseColor("#FC5168"));
setBackground(gradientDrawable);
setPadding(ScreenUtil.dip2px(6), ScreenUtil.dip2px(2), ScreenUtil.dip2px(6), ScreenUtil.dip2px(2));
setGravity(Gravity.CENTER);