修改测试问题,shouye ytuijian

This commit is contained in:
18401019693 2022-08-10 20:51:33 +08:00
parent 89e725a73f
commit 2016d43cb1
3 changed files with 26 additions and 20 deletions

View File

@ -22,7 +22,7 @@
android:layout_width="25dp" android:layout_width="25dp"
android:layout_height="25dp" android:layout_height="25dp"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginStart="25dp" android:layout_marginStart="23dp"
android:gravity="center" android:gravity="center"
android:padding="1dp" android:padding="1dp"
android:background="@drawable/bg_white_clip" android:background="@drawable/bg_white_clip"
@ -43,7 +43,7 @@
android:gravity="center" android:gravity="center"
android:padding="1dp" android:padding="1dp"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginStart="25dp" android:layout_marginStart="23dp"
android:background="@drawable/bg_white_clip"> android:background="@drawable/bg_white_clip">
<com.yunbao.common.views.weight.ClipPathCircleImage <com.yunbao.common.views.weight.ClipPathCircleImage
@ -61,7 +61,7 @@
android:layout_height="25dp" android:layout_height="25dp"
android:gravity="center" android:gravity="center"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginStart="7dp" android:layout_marginStart="10dp"
android:padding="1dp" android:padding="1dp"
android:background="@drawable/bg_white_clip" android:background="@drawable/bg_white_clip"
android:visibility="visible"> android:visibility="visible">

View File

@ -163,6 +163,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
private ImageView waitingTip; private ImageView waitingTip;
private FloatBannerView floatBanner; private FloatBannerView floatBanner;
private boolean isClickfloatBanner = false; private boolean isClickfloatBanner = false;
private boolean isfloatBannernet = true;
@Override @Override
@ -365,7 +366,6 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
mViewPager.setCurrentItem(0); mViewPager.setCurrentItem(0);
mTabButtonGroup.setCurPosition(0); mTabButtonGroup.setCurPosition(0);
isInstructor(); isInstructor();
initAnchorRecommendBanner();
findViewById(R.id.banner_click).setOnClickListener(new View.OnClickListener() { findViewById(R.id.banner_click).setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
@ -391,10 +391,11 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
}); });
mCheckLivePresenter.checkLive(liveBean); mCheckLivePresenter.checkLive(liveBean);
isClickfloatBanner = false;
} else { } else {
RouteUtil.forwardUserHome(mContext,Uid, 0); RouteUtil.forwardUserHome(mContext, Uid, 0);
isClickfloatBanner = false;
} }
} }
}); });
@ -408,9 +409,12 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
if (index == 0) { if (index == 0) {
floatBanner.setVisibility(View.VISIBLE); floatBanner.setVisibility(View.VISIBLE);
findViewById(R.id.banner_click).setVisibility(View.VISIBLE); findViewById(R.id.banner_click).setVisibility(View.VISIBLE);
isfloatBannernet = true;
} else { } else {
floatBanner.setVisibility(View.GONE); floatBanner.setVisibility(View.GONE);
findViewById(R.id.banner_click).setVisibility(View.GONE); findViewById(R.id.banner_click).setVisibility(View.GONE);
isfloatBannernet = false;
isClickfloatBanner = false;
} }
}); });
} }
@ -418,7 +422,8 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
/** /**
* 首页推荐位 * 首页推荐位
*/ */
private void initAnchorRecommendBanner() { private synchronized void initAnchorRecommendBanner() {
if (!isfloatBannernet) return;
MainNetManager.get(mContext) MainNetManager.get(mContext)
.anchorRecommend("10", new com.yunbao.common.http.base.HttpCallback<AnchorRecommendModel>() { .anchorRecommend("10", new com.yunbao.common.http.base.HttpCallback<AnchorRecommendModel>() {
@Override @Override
@ -1181,6 +1186,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
@Subscribe(threadMode = ThreadMode.MAIN) @Subscribe(threadMode = ThreadMode.MAIN)
public void onAnchorRecommendModel(AnchorRecommendModel event) { public void onAnchorRecommendModel(AnchorRecommendModel event) {
initAnchorRecommendBanner(); initAnchorRecommendBanner();
findViewById(R.id.banner_click).setVisibility(View.VISIBLE);
} }
} }

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.ScaleAnimation;
import android.view.animation.TranslateAnimation; import android.view.animation.TranslateAnimation;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import android.widget.LinearLayout; import android.widget.LinearLayout;
@ -34,7 +33,7 @@ public class FloatBannerView extends FrameLayout {
private ClipPathCircleImage clipImage1, clipImage2, clipImage3; private ClipPathCircleImage clipImage1, clipImage2, clipImage3;
private List<AnchorRecommendItemModel> list = new ArrayList<>(); private List<AnchorRecommendItemModel> list = new ArrayList<>();
//默认定时器时间 //默认定时器时间
private int delayMillis = 1400; private int delayMillis = 1500;
//Handler定时加载下一张的数据 //Handler定时加载下一张的数据
private Handler bannerHandler = new Handler(); private Handler bannerHandler = new Handler();
private int index = 0; private int index = 0;
@ -72,7 +71,8 @@ public class FloatBannerView extends FrameLayout {
*/ */
public void showBanner(List<AnchorRecommendItemModel> mList) { public void showBanner(List<AnchorRecommendItemModel> mList) {
list.clear(); list.clear();
list.addAll(mList);release(); list.addAll(mList);
release();
bannerHandler.post(mFlipRunnable); bannerHandler.post(mFlipRunnable);
} }
@ -95,21 +95,16 @@ public class FloatBannerView extends FrameLayout {
Uid = String.valueOf(list.get(next).getUid()); Uid = String.valueOf(list.get(next).getUid());
ImgLoader.displayAvatar(getContext(), list.get(next).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);
} TranslateAnimation animationTranslate = new TranslateAnimation(0, -30, 0, 0.2f);
TranslateAnimation animationTranslate = new TranslateAnimation(0, -27, 0, 0.2f);
// ScaleAnimation scaleAnim = new ScaleAnimation(1f, 1.16f, 1f, 1.16f);
AnimationSet animationSet1 = new AnimationSet(true); AnimationSet animationSet1 = new AnimationSet(true);
animationSet1.setFillAfter(true); animationSet1.setFillAfter(true);
animationSet1.setDuration(700); animationSet1.setDuration(650);
animationSet1.addAnimation(animationTranslate); animationSet1.addAnimation(animationTranslate);
// animationSet1.addAnimation(scaleAnim);
AlphaAnimation animationAlpha = new AlphaAnimation(1, 0); AlphaAnimation animationAlpha = new AlphaAnimation(1, 0);
AnimationSet animationSet2 = new AnimationSet(true); AnimationSet animationSet2 = new AnimationSet(true);
animationSet2.setFillAfter(true); animationSet2.setFillAfter(true);
animationSet2.setDuration(800); animationSet2.setDuration(850);
animationSet2.addAnimation(animationAlpha); animationSet2.addAnimation(animationAlpha);
animationSet2.addAnimation(animationTranslate); animationSet2.addAnimation(animationTranslate);
bannerLayout1.startAnimation(animationSet2); bannerLayout1.startAnimation(animationSet2);
@ -117,13 +112,18 @@ public class FloatBannerView extends FrameLayout {
animationSet1.setAnimationListener(new Animation.AnimationListener() { animationSet1.setAnimationListener(new Animation.AnimationListener() {
@Override @Override
public void onAnimationStart(Animation animation) { public void onAnimationStart(Animation animation) {
int page3 = finalNext + 1;
page3 = (page3 == list.size() ? 0 : page3);
ImgLoader.displayAvatar(getContext(), list.get(page3).getAvatar(), clipImage2);
} }
@Override @Override
public void onAnimationEnd(Animation animation) { public void onAnimationEnd(Animation animation) {
bannerLayout3.clearAnimation(); bannerLayout3.clearAnimation();
ImgLoader.displayAvatar(getContext(), list.get(finalNext).getAvatar(), clipImage1); ImgLoader.displayAvatar(getContext(), list.get(finalNext).getAvatar(), clipImage1);
int page3 = finalNext + 1;
page3 = (page3 == list.size() ? 0 : page3);
ImgLoader.displayAvatar(getContext(), list.get(page3).getAvatar(), clipImage3);
} }
@Override @Override