版本优化:一些细节处理

This commit is contained in:
huangjian
2022-10-27 15:38:16 +08:00
parent 9e7bf66b31
commit 0449935377
5 changed files with 87 additions and 105 deletions

View File

@@ -745,7 +745,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
if (firstCharmRankUser.getUid() == 0) return;
EventBus.getDefault().post(new ShowUserInfoDialogEvent(String.valueOf(firstCharmRankUser.getUid())));
});
tvNickCharm.setText(StringExtensionKt.subAndReplaceDot(firstCharmRankUser.getNick(), 7));
tvNickCharm.setText(StringExtensionKt.subAndReplaceDot(firstCharmRankUser.getNick(), 6));
} else {
ivAvatarCharm.setOnClickListener(null);
ivAvatarCharm.setImageResource(R.drawable.default_avatar);
@@ -759,7 +759,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
if (firstLevelRankUser.getUid() == 0) return;
EventBus.getDefault().post(new ShowUserInfoDialogEvent(String.valueOf(firstLevelRankUser.getUid())));
});
tvNickLevel.setText(StringExtensionKt.subAndReplaceDot(firstLevelRankUser.getNick(), 7));
tvNickLevel.setText(StringExtensionKt.subAndReplaceDot(firstLevelRankUser.getNick(), 6));
} else {
ivAvatarLevel.setOnClickListener(null);
ivAvatarLevel.setImageResource(R.drawable.default_avatar);

View File

@@ -1,6 +1,7 @@
package com.mango.moshen.ui.widget.drawgift;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.Canvas;
@@ -15,21 +16,16 @@ import java.util.List;
public class DrawGiftPlayView extends View {
private static final int DRAW_ONE_GIFT = 0;
//需要被画上的全部的礼物采用链表的方式每次取第0个
private final LinkedList<List<DrawGiftModel>> allDrawGiftsLinkedList;
//为了体现最后的消失动画效果才引入了这个Paint
private final Paint mPaint = new Paint();
private final Handler mHandler;
;
//当前这幅画播放到第几个礼物
private int currentGiftShowIndex;
private DrawAnimationListener onDrawAnimationListener;
//为了体现最后的消失动画效果才引入了这个Paint
private final Paint mPaint = new Paint();;
private static final int DRAW_ONE_GIFT = 0;
private final Handler mHandler;
private final Handler.Callback mCallback = new Handler.Callback() {
@Override
public boolean handleMessage(Message msg) {
@@ -40,13 +36,12 @@ public class DrawGiftPlayView extends View {
invalidate();
if (currentGiftShowIndex == allDrawGiftsLinkedList.getFirst().size()) {
postDelayed(() -> {
//进入这里,说明已经播放完最后一个礼物了
//播放扩大动画,然后消失
ValueAnimator valueAnimator = ValueAnimator.ofFloat(1, 2);
valueAnimator.setDuration(500);
valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
valueAnimator.addUpdateListener(animation -> {
float p = (float) animation.getAnimatedValue();
//透明效果(所有礼物都做这个动作)
mPaint.setAlpha((int) ((2.0F - p) * 255));
@@ -59,14 +54,8 @@ public class DrawGiftPlayView extends View {
}
invalidate();
}
});
valueAnimator.addListener(new Animator.AnimatorListener(){
@Override
public void onAnimationStart(Animator animation) {
}
valueAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
@@ -95,18 +84,9 @@ public class DrawGiftPlayView extends View {
}
}
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
});
valueAnimator.start();
}, 1000);
} else {
//继续画下一个礼物
Message message = Message.obtain();
@@ -210,6 +190,7 @@ public class DrawGiftPlayView extends View {
public interface DrawAnimationListener {
//礼物动画全部结束
public void onAnimationNodeEnd(DrawGiftPlayView drawGiftPlayView);
//礼物动画当前的这一幅画结束
public void onAnimationAllOver(DrawGiftPlayView drawGiftPlayView);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -95,7 +95,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:gravity="center"
android:text="本周该礼物冠名者"
android:text="该礼物冠名者"
android:textColor="@color/color_333333"
android:textSize="10sp" />
@@ -155,7 +155,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:gravity="center"
android:text="本周该礼物周星神豪"
android:text="该礼物周星神豪"
android:textColor="@color/color_333333"
android:textSize="10sp" />

View File

@@ -84,38 +84,6 @@
</LinearLayout>
<LinearLayout
android:id="@+id/ll_room_pk_order"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_below="@id/contribute_list"
android:layout_alignParentEnd="true"
android:layout_marginTop="5dp"
android:background="@drawable/bg_room_pk_order"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="17dp"
android:includeFontPadding="false"
android:text="下一场PK"
android:textColor="@color/white"
android:textSize="10sp" />
<TextView
android:id="@+id/tv_room_pk_order_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:includeFontPadding="false"
android:textColor="#fffff333"
android:textSize="10sp"
tools:text="04:55" />
</LinearLayout>
<com.mango.moshen.ui.widget.rollviewpager.RollPagerView
android:id="@+id/pager_view_wish_list"
@@ -155,6 +123,39 @@
android:src="@drawable/icon_music_flag"
android:visibility="gone" />
<LinearLayout
android:id="@+id/ll_room_pk_order"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_below="@id/tv_hour_rank"
android:layout_marginTop="5dp"
android:background="@drawable/bg_room_pk_order"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="17dp"
android:includeFontPadding="false"
android:text="下一场PK"
android:textColor="@color/white"
android:textSize="10sp" />
<TextView
android:id="@+id/tv_room_pk_order_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:includeFontPadding="false"
android:textColor="#fffff333"
android:textSize="10sp"
tools:text="04:55" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_dating_step"
android:layout_width="wrap_content"