From 2b5d3b51f4b587d3d56bd78ac3fee6c8ce327714 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Wed, 10 Aug 2022 13:07:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B5=8B=E8=AF=95=E9=97=AE?= =?UTF-8?q?=E9=A2=98,shouye=20ytuijian?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../res/layout/view_home_float_banner.xml | 10 ++-- .../adapter/SystemChatMessageAdapter.java | 15 +++--- .../res/layout/rc_conversationlist_item.xml | 16 +++--- .../yunbao/main/activity/MainActivity.java | 6 +++ .../main/adapter/SystemMessageAdapter.java | 12 ++--- .../yunbao/main/views/FloatBannerView.java | 50 +++++++++++-------- .../views/SearchRecommendHeardViewHolder.java | 2 +- main/src/main/res/layout/view_homemain.xml | 42 ++++++++-------- .../res/layout/view_search_recommend_body.xml | 8 +-- .../layout/view_search_recommend_heard.xml | 5 +- 10 files changed, 90 insertions(+), 76 deletions(-) diff --git a/common/src/main/res/layout/view_home_float_banner.xml b/common/src/main/res/layout/view_home_float_banner.xml index 66923fd4d..21e04c5e3 100644 --- a/common/src/main/res/layout/view_home_float_banner.xml +++ b/common/src/main/res/layout/view_home_float_banner.xml @@ -52,8 +52,8 @@ @@ -77,5 +77,5 @@ android:layout_marginEnd="15dp" android:text="@string/wonderful_live" android:textColor="@color/white" - android:textSize="9sp" /> + android:textSize="13sp" /> \ No newline at end of file diff --git a/live/src/main/java/com/yunbao/live/adapter/SystemChatMessageAdapter.java b/live/src/main/java/com/yunbao/live/adapter/SystemChatMessageAdapter.java index 1251f6471..f1d68d54a 100644 --- a/live/src/main/java/com/yunbao/live/adapter/SystemChatMessageAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/SystemChatMessageAdapter.java @@ -37,6 +37,7 @@ public class SystemChatMessageAdapter extends RecyclerView.Adapter { private List listUserBean = new ArrayList<>(); protected Activity mContext; protected LayoutInflater mInflater; + private String type = ""; public SystemChatMessageAdapter(Activity mContext) { this.mContext = mContext; @@ -76,6 +77,7 @@ public class SystemChatMessageAdapter extends RecyclerView.Adapter { } //系统消息的跳转 messageViewHolder.setViewHolderOnClickListener((view, model1) -> { + type = model1.getType(); //获取一下系统通知 MessageIMManager.get(mContext).getSystemMessages(new MessageIMManager.SystemMessagesHttpCallback() { @Override @@ -91,11 +93,6 @@ public class SystemChatMessageAdapter extends RecyclerView.Adapter { AppEventsLogger.newLogger(mContext).logEvent("FB_customer_service"); AdjustEvent adjustEvent1 = new AdjustEvent("ww5z2p"); 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())) { mContext.startActivity(new Intent(mContext, WebViewActivity.class).putExtra("url", model1.getLink())); @@ -146,11 +143,13 @@ public class SystemChatMessageAdapter extends RecyclerView.Adapter { listUserBean.clear(); listUserBean.addAll(mlistUserBean); notifyDataSetChanged(); - int systemNumber = 0; for (ImUserBean bean : listUserBean) { //未读消息数 String number = bean.getNum(); + if (TextUtils.equals(type, bean.getType())) { + number = null; + } //未读消息不为空并且大于0 try { if (!TextUtils.isEmpty(number) && Integer.parseInt(number) > 0) { @@ -160,7 +159,7 @@ public class SystemChatMessageAdapter extends RecyclerView.Adapter { systemNumber = systemNumber + 0; } } + type = null; MessageIMManager.get(mContext).setSystemNumber(systemNumber); - } -} +} \ No newline at end of file diff --git a/live/src/main/res/layout/rc_conversationlist_item.xml b/live/src/main/res/layout/rc_conversationlist_item.xml index f4fee666b..9b88732e9 100644 --- a/live/src/main/res/layout/rc_conversationlist_item.xml +++ b/live/src/main/res/layout/rc_conversationlist_item.xml @@ -25,7 +25,12 @@ android:layout_height="match_parent" android:scaleType="centerCrop" /> - + - + diff --git a/main/src/main/java/com/yunbao/main/activity/MainActivity.java b/main/src/main/java/com/yunbao/main/activity/MainActivity.java index 49c2a287f..8fa871a42 100644 --- a/main/src/main/java/com/yunbao/main/activity/MainActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MainActivity.java @@ -405,8 +405,10 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene mTabButtonGroup.addTabButtonGroupChangeListener((view, index) -> { if (index==0){ floatBanner.setVisibility(View.VISIBLE); + findViewById(R.id.banner_click).setVisibility(View.VISIBLE); }else { 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) { if (data.getListShow() == 1) { floatBanner.setVisibility(View.VISIBLE); + findViewById(R.id.banner_click).setVisibility(View.VISIBLE); floatBanner.showBanner(data.getList()); } else { floatBanner.setVisibility(View.GONE); + findViewById(R.id.banner_click).setVisibility(View.GONE); } fragment.dismiss(); @@ -1058,8 +1062,10 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene mTabButtonGroup.setCurPosition(event.getPage()); if (event.getPage()==0){ floatBanner.setVisibility(View.VISIBLE); + findViewById(R.id.banner_click).setVisibility(View.VISIBLE); }else { floatBanner.setVisibility(View.GONE); + findViewById(R.id.banner_click).setVisibility(View.GONE); } } diff --git a/main/src/main/java/com/yunbao/main/adapter/SystemMessageAdapter.java b/main/src/main/java/com/yunbao/main/adapter/SystemMessageAdapter.java index edead0f16..2f16fd288 100644 --- a/main/src/main/java/com/yunbao/main/adapter/SystemMessageAdapter.java +++ b/main/src/main/java/com/yunbao/main/adapter/SystemMessageAdapter.java @@ -21,7 +21,6 @@ import com.yunbao.common.activity.WebViewActivity; import com.yunbao.common.bean.ImUserInfoModel; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.manager.imrongcloud.MessageIMManager; -import com.yunbao.common.utils.ToastUtil; import com.yunbao.live.activity.SystemMessageActivity; import com.yunbao.live.bean.ImUserBean; import com.yunbao.main.R; @@ -41,6 +40,7 @@ public class SystemMessageAdapter extends RecyclerView.Adapter { protected LayoutInflater mInflater; private Handler netHandler = new Handler(); private int mPosition = -1; + private String type = ""; public SystemMessageAdapter(Activity mContext) { this.mContext = mContext; @@ -87,6 +87,7 @@ public class SystemMessageAdapter extends RecyclerView.Adapter { } //系统消息的跳转 messageViewHolder.setViewHolderOnClickListener((view, model1) -> { + type = model1.getType(); mPosition = position; netHandler.post(updataRunable); if (model1.getTitle().equals("在線客服")) { @@ -94,11 +95,6 @@ public class SystemMessageAdapter extends RecyclerView.Adapter { AppEventsLogger.newLogger(mContext).logEvent("FB_customer_service"); AdjustEvent adjustEvent1 = new AdjustEvent("ww5z2p"); 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())) { 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) { //未读消息数 String number = bean.getNum(); + if (TextUtils.equals(type, bean.getType())) { + number = null; + } //未读消息不为空并且大于0 try { if (!TextUtils.isEmpty(number) && Integer.parseInt(number) > 0) { @@ -166,6 +165,7 @@ public class SystemMessageAdapter extends RecyclerView.Adapter { systemNumber = systemNumber + 0; } } + type = null; MessageIMManager.get(mContext).setSystemNumber(systemNumber); } diff --git a/main/src/main/java/com/yunbao/main/views/FloatBannerView.java b/main/src/main/java/com/yunbao/main/views/FloatBannerView.java index 96b913924..b7c15abb8 100644 --- a/main/src/main/java/com/yunbao/main/views/FloatBannerView.java +++ b/main/src/main/java/com/yunbao/main/views/FloatBannerView.java @@ -8,7 +8,6 @@ import android.view.View; import android.view.animation.AlphaAnimation; import android.view.animation.Animation; import android.view.animation.AnimationSet; -import android.view.animation.AnimationUtils; import android.view.animation.ScaleAnimation; import android.view.animation.TranslateAnimation; import android.widget.FrameLayout; @@ -20,6 +19,7 @@ import com.yunbao.common.bean.AnchorRecommendItemModel; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.views.weight.ClipPathCircleImage; +import java.util.ArrayList; import java.util.List; /** @@ -31,9 +31,9 @@ public class FloatBannerView extends FrameLayout { private ViewFlipper homeBanner; private FrameLayout bannerLayout1, bannerLayout2, bannerLayout3; private ClipPathCircleImage clipImage1, clipImage2, clipImage3; - private List list; + private List list = new ArrayList<>(); //默认定时器时间 - private int delayMillis = 800; + private int delayMillis = 1500; //Handler定时加载下一张的数据 private Handler bannerHandler = new Handler(); private int index = 0; @@ -68,11 +68,10 @@ public class FloatBannerView extends FrameLayout { /** * 设置轮播数据 - * - * @param list */ - public void showBanner(List list) { - this.list = list; + public void showBanner(List mList) { + list.clear(); + list.addAll(mList); bannerHandler.post(mFlipRunnable); } @@ -93,19 +92,28 @@ public class FloatBannerView extends FrameLayout { int next = index + 1; next = (next == list.size() ? 0 : next); 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(index).getAvatar(), clipImage1); - Animation animation = new TranslateAnimation(0, -40, 0, 0); - animation.setFillAfter(true); - animation.setDuration(800); + if (index == 0) { + ImgLoader.displayAvatar(getContext(), list.get(index).getAvatar(), clipImage1); + } + TranslateAnimation animationTranslate = new TranslateAnimation(0, -35, 0, 0); + 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); - - Animation animation2 = new AlphaAnimation(1, 0); - animation2.setFillAfter(true); - animation2.setDuration(900); - - animation.setAnimationListener(new Animation.AnimationListener() { + AlphaAnimation animationAlpha = new AlphaAnimation(1, 0); + AnimationSet animationSet2 = new AnimationSet(true); + animationSet2.setFillAfter(true); + animationSet2.setDuration(750); + animationSet2.addAnimation(animationAlpha); + animationSet2.addAnimation(animationTranslate); + bannerLayout1.startAnimation(animationSet2); + int finalNext = next; + animationSet1.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { @@ -114,7 +122,7 @@ public class FloatBannerView extends FrameLayout { @Override public void onAnimationEnd(Animation animation) { bannerLayout3.clearAnimation(); - bannerLayout1.startAnimation(animation2); + ImgLoader.displayAvatar(getContext(), list.get(finalNext).getAvatar(), clipImage1); } @Override @@ -123,7 +131,7 @@ public class FloatBannerView extends FrameLayout { } }); - animation2.setAnimationListener(new Animation.AnimationListener() { + animationSet2.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { @@ -139,7 +147,7 @@ public class FloatBannerView extends FrameLayout { } }); - bannerLayout3.startAnimation(animation); + bannerLayout3.startAnimation(animationSet1); index = index + 1; bannerHandler.postDelayed(mFlipRunnable, delayMillis); } diff --git a/main/src/main/java/com/yunbao/main/views/SearchRecommendHeardViewHolder.java b/main/src/main/java/com/yunbao/main/views/SearchRecommendHeardViewHolder.java index 3a1c21114..875b7ae6e 100644 --- a/main/src/main/java/com/yunbao/main/views/SearchRecommendHeardViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/SearchRecommendHeardViewHolder.java @@ -37,7 +37,7 @@ public class SearchRecommendHeardViewHolder extends RecyclerView.ViewHolder { searchHistory.removeAllViews(); LinearLayout.LayoutParams layoutParams = 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; for (String key : historyMap.keySet()) { i = i + 1; diff --git a/main/src/main/res/layout/view_homemain.xml b/main/src/main/res/layout/view_homemain.xml index 0ffb076c8..d327824f8 100644 --- a/main/src/main/res/layout/view_homemain.xml +++ b/main/src/main/res/layout/view_homemain.xml @@ -144,6 +144,28 @@ android:src="@mipmap/icon_main_start" /> + + + + + - - - - - diff --git a/main/src/main/res/layout/view_search_recommend_body.xml b/main/src/main/res/layout/view_search_recommend_body.xml index d58072c44..a685ae7d5 100644 --- a/main/src/main/res/layout/view_search_recommend_body.xml +++ b/main/src/main/res/layout/view_search_recommend_body.xml @@ -2,14 +2,16 @@ + android:paddingStart="11dp" + android:paddingEnd="11dp"> diff --git a/main/src/main/res/layout/view_search_recommend_heard.xml b/main/src/main/res/layout/view_search_recommend_heard.xml index d61969ced..4b737b602 100644 --- a/main/src/main/res/layout/view_search_recommend_heard.xml +++ b/main/src/main/res/layout/view_search_recommend_heard.xml @@ -35,9 +35,6 @@ + android:layout_height="wrap_content" /> \ No newline at end of file