修改测试问题,shouye ytuijian

This commit is contained in:
18401019693 2022-08-10 13:07:35 +08:00
parent 28a1169a89
commit 2b5d3b51f4
10 changed files with 90 additions and 76 deletions

View File

@ -52,8 +52,8 @@
<FrameLayout <FrameLayout
android:id="@+id/banner_layout1" android:id="@+id/banner_layout1"
android:layout_width="28dp" android:layout_width="29dp"
android:layout_height="28dp" android:layout_height="29dp"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginStart="7dp" android:layout_marginStart="7dp"
android:background="@drawable/bg_white_clip" android:background="@drawable/bg_white_clip"
@ -61,8 +61,8 @@
<com.yunbao.common.views.weight.ClipPathCircleImage <com.yunbao.common.views.weight.ClipPathCircleImage
android:id="@+id/clip_image1" android:id="@+id/clip_image1"
android:layout_width="26.5dp" android:layout_width="27.5dp"
android:layout_height="26.5dp" android:layout_height="27.5dp"
android:layout_gravity="center" /> android:layout_gravity="center" />
</FrameLayout> </FrameLayout>
@ -77,5 +77,5 @@
android:layout_marginEnd="15dp" android:layout_marginEnd="15dp"
android:text="@string/wonderful_live" android:text="@string/wonderful_live"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="9sp" /> android:textSize="13sp" />
</RelativeLayout> </RelativeLayout>

View File

@ -37,6 +37,7 @@ public class SystemChatMessageAdapter extends RecyclerView.Adapter {
private List<ImUserBean> listUserBean = new ArrayList<>(); private List<ImUserBean> listUserBean = new ArrayList<>();
protected Activity mContext; protected Activity mContext;
protected LayoutInflater mInflater; protected LayoutInflater mInflater;
private String type = "";
public SystemChatMessageAdapter(Activity mContext) { public SystemChatMessageAdapter(Activity mContext) {
this.mContext = mContext; this.mContext = mContext;
@ -76,6 +77,7 @@ public class SystemChatMessageAdapter extends RecyclerView.Adapter {
} }
//系统消息的跳转 //系统消息的跳转
messageViewHolder.setViewHolderOnClickListener((view, model1) -> { messageViewHolder.setViewHolderOnClickListener((view, model1) -> {
type = model1.getType();
//获取一下系统通知 //获取一下系统通知
MessageIMManager.get(mContext).getSystemMessages(new MessageIMManager.SystemMessagesHttpCallback() { MessageIMManager.get(mContext).getSystemMessages(new MessageIMManager.SystemMessagesHttpCallback() {
@Override @Override
@ -91,11 +93,6 @@ public class SystemChatMessageAdapter extends RecyclerView.Adapter {
AppEventsLogger.newLogger(mContext).logEvent("FB_customer_service"); AppEventsLogger.newLogger(mContext).logEvent("FB_customer_service");
AdjustEvent adjustEvent1 = new AdjustEvent("ww5z2p"); AdjustEvent adjustEvent1 = new AdjustEvent("ww5z2p");
Adjust.trackEvent(adjustEvent1); Adjust.trackEvent(adjustEvent1);
} else if (model1.getContent().equals("新手指導員")) {
FirebaseAnalytics.getInstance(mContext).logEvent("FS_guide", null);
AppEventsLogger.newLogger(mContext).logEvent("FB_guide", null);
AdjustEvent adjustEvent1 = new AdjustEvent("m0nfpn");
Adjust.trackEvent(adjustEvent1);
} }
if (!TextUtils.isEmpty(model1.getLink())) { if (!TextUtils.isEmpty(model1.getLink())) {
mContext.startActivity(new Intent(mContext, WebViewActivity.class).putExtra("url", model1.getLink())); mContext.startActivity(new Intent(mContext, WebViewActivity.class).putExtra("url", model1.getLink()));
@ -146,11 +143,13 @@ public class SystemChatMessageAdapter extends RecyclerView.Adapter {
listUserBean.clear(); listUserBean.clear();
listUserBean.addAll(mlistUserBean); listUserBean.addAll(mlistUserBean);
notifyDataSetChanged(); notifyDataSetChanged();
int systemNumber = 0; int systemNumber = 0;
for (ImUserBean bean : listUserBean) { for (ImUserBean bean : listUserBean) {
//未读消息数 //未读消息数
String number = bean.getNum(); String number = bean.getNum();
if (TextUtils.equals(type, bean.getType())) {
number = null;
}
//未读消息不为空并且大于0 //未读消息不为空并且大于0
try { try {
if (!TextUtils.isEmpty(number) && Integer.parseInt(number) > 0) { if (!TextUtils.isEmpty(number) && Integer.parseInt(number) > 0) {
@ -160,7 +159,7 @@ public class SystemChatMessageAdapter extends RecyclerView.Adapter {
systemNumber = systemNumber + 0; systemNumber = systemNumber + 0;
} }
} }
type = null;
MessageIMManager.get(mContext).setSystemNumber(systemNumber); MessageIMManager.get(mContext).setSystemNumber(systemNumber);
} }
} }

View File

@ -25,7 +25,12 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:scaleType="centerCrop" /> android:scaleType="centerCrop" />
<ImageView
android:id="@+id/img_new"
android:layout_width="wrap_content"
android:layout_height="22dp"
android:layout_alignParentBottom="true"
android:visibility="visible" />
</RelativeLayout> </RelativeLayout>
<LinearLayout <LinearLayout
@ -35,9 +40,9 @@
android:layout_marginStart="15dp" android:layout_marginStart="15dp"
android:layout_marginTop="@dimen/rc_margin_size_16" android:layout_marginTop="@dimen/rc_margin_size_16"
android:layout_marginEnd="@dimen/rc_margin_size_12" android:layout_marginEnd="@dimen/rc_margin_size_12"
android:gravity="center_vertical"
app:layout_constraintEnd_toStartOf="@+id/rc_conversation_date" app:layout_constraintEnd_toStartOf="@+id/rc_conversation_date"
app:layout_constraintStart_toEndOf="@+id/rc_conversation_portrait_rl" app:layout_constraintStart_toEndOf="@+id/rc_conversation_portrait_rl"
android:gravity="center_vertical"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent">
<TextView <TextView
@ -51,12 +56,7 @@
android:textColor="@color/rc_text_main_color" android:textColor="@color/rc_text_main_color"
android:textSize="16sp" /> android:textSize="16sp" />
<ImageView
android:id="@+id/img_new"
android:layout_width="wrap_content"
android:layout_height="18dp"
android:layout_marginStart="3dp"
android:visibility="visible" />
</LinearLayout> </LinearLayout>

View File

@ -405,8 +405,10 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
mTabButtonGroup.addTabButtonGroupChangeListener((view, index) -> { mTabButtonGroup.addTabButtonGroupChangeListener((view, index) -> {
if (index==0){ if (index==0){
floatBanner.setVisibility(View.VISIBLE); floatBanner.setVisibility(View.VISIBLE);
findViewById(R.id.banner_click).setVisibility(View.VISIBLE);
}else { }else {
floatBanner.setVisibility(View.GONE); floatBanner.setVisibility(View.GONE);
findViewById(R.id.banner_click).setVisibility(View.GONE);
} }
}); });
} }
@ -424,9 +426,11 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
public void onSuccess(AnchorRecommendModel data) { public void onSuccess(AnchorRecommendModel data) {
if (data.getListShow() == 1) { if (data.getListShow() == 1) {
floatBanner.setVisibility(View.VISIBLE); floatBanner.setVisibility(View.VISIBLE);
findViewById(R.id.banner_click).setVisibility(View.VISIBLE);
floatBanner.showBanner(data.getList()); floatBanner.showBanner(data.getList());
} else { } else {
floatBanner.setVisibility(View.GONE); floatBanner.setVisibility(View.GONE);
findViewById(R.id.banner_click).setVisibility(View.GONE);
} }
fragment.dismiss(); fragment.dismiss();
@ -1058,8 +1062,10 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
mTabButtonGroup.setCurPosition(event.getPage()); mTabButtonGroup.setCurPosition(event.getPage());
if (event.getPage()==0){ if (event.getPage()==0){
floatBanner.setVisibility(View.VISIBLE); floatBanner.setVisibility(View.VISIBLE);
findViewById(R.id.banner_click).setVisibility(View.VISIBLE);
}else { }else {
floatBanner.setVisibility(View.GONE); floatBanner.setVisibility(View.GONE);
findViewById(R.id.banner_click).setVisibility(View.GONE);
} }
} }

View File

@ -21,7 +21,6 @@ import com.yunbao.common.activity.WebViewActivity;
import com.yunbao.common.bean.ImUserInfoModel; import com.yunbao.common.bean.ImUserInfoModel;
import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.manager.imrongcloud.MessageIMManager; import com.yunbao.common.manager.imrongcloud.MessageIMManager;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.live.activity.SystemMessageActivity; import com.yunbao.live.activity.SystemMessageActivity;
import com.yunbao.live.bean.ImUserBean; import com.yunbao.live.bean.ImUserBean;
import com.yunbao.main.R; import com.yunbao.main.R;
@ -41,6 +40,7 @@ public class SystemMessageAdapter extends RecyclerView.Adapter {
protected LayoutInflater mInflater; protected LayoutInflater mInflater;
private Handler netHandler = new Handler(); private Handler netHandler = new Handler();
private int mPosition = -1; private int mPosition = -1;
private String type = "";
public SystemMessageAdapter(Activity mContext) { public SystemMessageAdapter(Activity mContext) {
this.mContext = mContext; this.mContext = mContext;
@ -87,6 +87,7 @@ public class SystemMessageAdapter extends RecyclerView.Adapter {
} }
//系统消息的跳转 //系统消息的跳转
messageViewHolder.setViewHolderOnClickListener((view, model1) -> { messageViewHolder.setViewHolderOnClickListener((view, model1) -> {
type = model1.getType();
mPosition = position; mPosition = position;
netHandler.post(updataRunable); netHandler.post(updataRunable);
if (model1.getTitle().equals("在線客服")) { if (model1.getTitle().equals("在線客服")) {
@ -94,11 +95,6 @@ public class SystemMessageAdapter extends RecyclerView.Adapter {
AppEventsLogger.newLogger(mContext).logEvent("FB_customer_service"); AppEventsLogger.newLogger(mContext).logEvent("FB_customer_service");
AdjustEvent adjustEvent1 = new AdjustEvent("ww5z2p"); AdjustEvent adjustEvent1 = new AdjustEvent("ww5z2p");
Adjust.trackEvent(adjustEvent1); Adjust.trackEvent(adjustEvent1);
} else if (model1.getTitle().equals("新手指導員")) {
FirebaseAnalytics.getInstance(mContext).logEvent("FS_guide", null);
AppEventsLogger.newLogger(mContext).logEvent("FB_guide", null);
AdjustEvent adjustEvent1 = new AdjustEvent("m0nfpn");
Adjust.trackEvent(adjustEvent1);
} }
if (!TextUtils.isEmpty(model1.getLink())) { if (!TextUtils.isEmpty(model1.getLink())) {
mContext.startActivity(new Intent(mContext, WebViewActivity.class).putExtra("url", model1.getLink())); mContext.startActivity(new Intent(mContext, WebViewActivity.class).putExtra("url", model1.getLink()));
@ -157,6 +153,9 @@ public class SystemMessageAdapter extends RecyclerView.Adapter {
for (ImUserBean bean : listUserBean) { for (ImUserBean bean : listUserBean) {
//未读消息数 //未读消息数
String number = bean.getNum(); String number = bean.getNum();
if (TextUtils.equals(type, bean.getType())) {
number = null;
}
//未读消息不为空并且大于0 //未读消息不为空并且大于0
try { try {
if (!TextUtils.isEmpty(number) && Integer.parseInt(number) > 0) { if (!TextUtils.isEmpty(number) && Integer.parseInt(number) > 0) {
@ -166,6 +165,7 @@ public class SystemMessageAdapter extends RecyclerView.Adapter {
systemNumber = systemNumber + 0; systemNumber = systemNumber + 0;
} }
} }
type = null;
MessageIMManager.get(mContext).setSystemNumber(systemNumber); MessageIMManager.get(mContext).setSystemNumber(systemNumber);
} }

View File

@ -8,7 +8,6 @@ import android.view.View;
import android.view.animation.AlphaAnimation; import android.view.animation.AlphaAnimation;
import android.view.animation.Animation; import android.view.animation.Animation;
import android.view.animation.AnimationSet; import android.view.animation.AnimationSet;
import android.view.animation.AnimationUtils;
import android.view.animation.ScaleAnimation; import android.view.animation.ScaleAnimation;
import android.view.animation.TranslateAnimation; import android.view.animation.TranslateAnimation;
import android.widget.FrameLayout; import android.widget.FrameLayout;
@ -20,6 +19,7 @@ import com.yunbao.common.bean.AnchorRecommendItemModel;
import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.views.weight.ClipPathCircleImage; import com.yunbao.common.views.weight.ClipPathCircleImage;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
@ -31,9 +31,9 @@ public class FloatBannerView extends FrameLayout {
private ViewFlipper homeBanner; private ViewFlipper homeBanner;
private FrameLayout bannerLayout1, bannerLayout2, bannerLayout3; private FrameLayout bannerLayout1, bannerLayout2, bannerLayout3;
private ClipPathCircleImage clipImage1, clipImage2, clipImage3; private ClipPathCircleImage clipImage1, clipImage2, clipImage3;
private List<AnchorRecommendItemModel> list; private List<AnchorRecommendItemModel> list = new ArrayList<>();
//默认定时器时间 //默认定时器时间
private int delayMillis = 800; private int delayMillis = 1500;
//Handler定时加载下一张的数据 //Handler定时加载下一张的数据
private Handler bannerHandler = new Handler(); private Handler bannerHandler = new Handler();
private int index = 0; private int index = 0;
@ -68,11 +68,10 @@ public class FloatBannerView extends FrameLayout {
/** /**
* 设置轮播数据 * 设置轮播数据
*
* @param list
*/ */
public void showBanner(List<AnchorRecommendItemModel> list) { public void showBanner(List<AnchorRecommendItemModel> mList) {
this.list = list; list.clear();
list.addAll(mList);
bannerHandler.post(mFlipRunnable); bannerHandler.post(mFlipRunnable);
} }
@ -93,19 +92,28 @@ public class FloatBannerView extends FrameLayout {
int next = index + 1; int next = index + 1;
next = (next == list.size() ? 0 : next); next = (next == list.size() ? 0 : next);
Uid = String.valueOf(list.get(next).getUid()); Uid = String.valueOf(list.get(next).getUid());
ImgLoader.displayAvatar(getContext(), list.get(index).getAvatar(), clipImage3); ImgLoader.displayAvatar(getContext(), list.get(next).getAvatar(), clipImage3);
ImgLoader.displayAvatar(getContext(), list.get(next).getAvatar(), clipImage2); ImgLoader.displayAvatar(getContext(), list.get(next).getAvatar(), clipImage2);
if (index == 0) {
ImgLoader.displayAvatar(getContext(), list.get(index).getAvatar(), clipImage1); ImgLoader.displayAvatar(getContext(), list.get(index).getAvatar(), clipImage1);
Animation animation = new TranslateAnimation(0, -40, 0, 0); }
animation.setFillAfter(true); TranslateAnimation animationTranslate = new TranslateAnimation(0, -35, 0, 0);
animation.setDuration(800); ScaleAnimation scaleAnim = new ScaleAnimation(1f, 1.15f, 1f, 1.15f, bannerLayout3.getWidth() / 1.1f, bannerLayout3.getHeight() / 1.1f);
AnimationSet animationSet1 = new AnimationSet(true);
animationSet1.setFillAfter(true);
animationSet1.setDuration(750);
animationSet1.addAnimation(animationTranslate);
animationSet1.addAnimation(scaleAnim);
AlphaAnimation animationAlpha = new AlphaAnimation(1, 0);
Animation animation2 = new AlphaAnimation(1, 0); AnimationSet animationSet2 = new AnimationSet(true);
animation2.setFillAfter(true); animationSet2.setFillAfter(true);
animation2.setDuration(900); animationSet2.setDuration(750);
animationSet2.addAnimation(animationAlpha);
animation.setAnimationListener(new Animation.AnimationListener() { animationSet2.addAnimation(animationTranslate);
bannerLayout1.startAnimation(animationSet2);
int finalNext = next;
animationSet1.setAnimationListener(new Animation.AnimationListener() {
@Override @Override
public void onAnimationStart(Animation animation) { public void onAnimationStart(Animation animation) {
@ -114,7 +122,7 @@ public class FloatBannerView extends FrameLayout {
@Override @Override
public void onAnimationEnd(Animation animation) { public void onAnimationEnd(Animation animation) {
bannerLayout3.clearAnimation(); bannerLayout3.clearAnimation();
bannerLayout1.startAnimation(animation2); ImgLoader.displayAvatar(getContext(), list.get(finalNext).getAvatar(), clipImage1);
} }
@Override @Override
@ -123,7 +131,7 @@ public class FloatBannerView extends FrameLayout {
} }
}); });
animation2.setAnimationListener(new Animation.AnimationListener() { animationSet2.setAnimationListener(new Animation.AnimationListener() {
@Override @Override
public void onAnimationStart(Animation animation) { public void onAnimationStart(Animation animation) {
@ -139,7 +147,7 @@ public class FloatBannerView extends FrameLayout {
} }
}); });
bannerLayout3.startAnimation(animation); bannerLayout3.startAnimation(animationSet1);
index = index + 1; index = index + 1;
bannerHandler.postDelayed(mFlipRunnable, delayMillis); bannerHandler.postDelayed(mFlipRunnable, delayMillis);
} }

View File

@ -37,7 +37,7 @@ public class SearchRecommendHeardViewHolder extends RecyclerView.ViewHolder {
searchHistory.removeAllViews(); searchHistory.removeAllViews();
LinearLayout.LayoutParams layoutParams = LinearLayout.LayoutParams layoutParams =
new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
layoutParams.setMargins(17, 10, 0, 10); layoutParams.setMargins(17, 10, 0, 7);
int i = 0; int i = 0;
for (String key : historyMap.keySet()) { for (String key : historyMap.keySet()) {
i = i + 1; i = i + 1;

View File

@ -144,6 +144,28 @@
android:src="@mipmap/icon_main_start" /> android:src="@mipmap/icon_main_start" />
</RelativeLayout> </RelativeLayout>
<com.yunbao.main.views.FloatBannerView
android:id="@+id/float_banner_home"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@id/rt_main_tab"
android:layout_alignParentRight="true"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:visibility="visible" />
<View
android:id="@+id/banner_click"
android:layout_width="123dp"
android:layout_height="35.33dp"
android:clickable="true"
android:focusable="true"
android:layout_marginRight="10dp"
android:layout_above="@id/rt_main_tab"
android:layout_alignParentRight="true"
android:layout_marginBottom="10dp" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -172,24 +194,4 @@
android:layout_height="1dp" android:layout_height="1dp"
android:layout_weight="1" /> android:layout_weight="1" />
</LinearLayout> </LinearLayout>
<com.yunbao.main.views.FloatBannerView
android:id="@+id/float_banner_home"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@id/rt_main_tab"
android:layout_alignParentRight="true"
android:layout_marginBottom="10dp"
android:visibility="visible" />
<View
android:id="@+id/banner_click"
android:layout_width="123dp"
android:layout_height="35.33dp"
android:clickable="true"
android:focusable="true"
android:layout_above="@id/rt_main_tab"
android:layout_alignParentRight="true"
android:layout_marginBottom="10dp" />
</RelativeLayout> </RelativeLayout>

View File

@ -2,14 +2,16 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:orientation="vertical" android:orientation="vertical"
android:padding="11dp"> android:paddingStart="11dp"
android:paddingEnd="11dp">
<FrameLayout <FrameLayout
android:id="@+id/type_title" android:id="@+id/type_title"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">

View File

@ -35,9 +35,6 @@
<com.yunbao.main.views.FlowLayout <com.yunbao.main.views.FlowLayout
android:id="@+id/search_history" android:id="@+id/search_history"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content" />
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:padding="5dp" />
</LinearLayout> </LinearLayout>