修改测试问题,shouye ytuijian
This commit is contained in:
parent
28a1169a89
commit
2b5d3b51f4
@ -52,8 +52,8 @@
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/banner_layout1"
|
||||
android:layout_width="28dp"
|
||||
android:layout_height="28dp"
|
||||
android:layout_width="29dp"
|
||||
android:layout_height="29dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="7dp"
|
||||
android:background="@drawable/bg_white_clip"
|
||||
@ -61,8 +61,8 @@
|
||||
|
||||
<com.yunbao.common.views.weight.ClipPathCircleImage
|
||||
android:id="@+id/clip_image1"
|
||||
android:layout_width="26.5dp"
|
||||
android:layout_height="26.5dp"
|
||||
android:layout_width="27.5dp"
|
||||
android:layout_height="27.5dp"
|
||||
android:layout_gravity="center" />
|
||||
</FrameLayout>
|
||||
|
||||
@ -77,5 +77,5 @@
|
||||
android:layout_marginEnd="15dp"
|
||||
android:text="@string/wonderful_live"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="9sp" />
|
||||
android:textSize="13sp" />
|
||||
</RelativeLayout>
|
@ -37,6 +37,7 @@ public class SystemChatMessageAdapter extends RecyclerView.Adapter {
|
||||
private List<ImUserBean> 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);
|
||||
|
||||
}
|
||||
}
|
@ -25,7 +25,12 @@
|
||||
android:layout_height="match_parent"
|
||||
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>
|
||||
|
||||
<LinearLayout
|
||||
@ -35,9 +40,9 @@
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginTop="@dimen/rc_margin_size_16"
|
||||
android:layout_marginEnd="@dimen/rc_margin_size_12"
|
||||
android:gravity="center_vertical"
|
||||
app:layout_constraintEnd_toStartOf="@+id/rc_conversation_date"
|
||||
app:layout_constraintStart_toEndOf="@+id/rc_conversation_portrait_rl"
|
||||
android:gravity="center_vertical"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
@ -51,12 +56,7 @@
|
||||
android:textColor="@color/rc_text_main_color"
|
||||
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>
|
||||
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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<AnchorRecommendItemModel> list;
|
||||
private List<AnchorRecommendItemModel> 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<AnchorRecommendItemModel> list) {
|
||||
this.list = list;
|
||||
public void showBanner(List<AnchorRecommendItemModel> 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);
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -144,6 +144,28 @@
|
||||
android:src="@mipmap/icon_main_start" />
|
||||
</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
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@ -172,24 +194,4 @@
|
||||
android:layout_height="1dp"
|
||||
android:layout_weight="1" />
|
||||
</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>
|
||||
|
@ -2,14 +2,16 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
|
||||
android:orientation="vertical"
|
||||
android:padding="11dp">
|
||||
android:paddingStart="11dp"
|
||||
android:paddingEnd="11dp">
|
||||
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/type_title"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
|
@ -35,9 +35,6 @@
|
||||
<com.yunbao.main.views.FlowLayout
|
||||
android:id="@+id/search_history"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:padding="5dp" />
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</LinearLayout>
|
Loading…
Reference in New Issue
Block a user