6.7.0用户端更新:整蛊图标闪烁

This commit is contained in:
余前卫 2024-06-14 18:15:22 +08:00
parent 45ae3b1624
commit 309d04653e
2 changed files with 44 additions and 6 deletions

View File

@ -221,6 +221,7 @@ import io.rong.imkit.userinfo.RongUserInfoManager;
import io.rong.imlib.RongIMClient; import io.rong.imlib.RongIMClient;
import io.rong.imlib.model.Conversation; import io.rong.imlib.model.Conversation;
import io.rong.imlib.model.UserInfo; import io.rong.imlib.model.UserInfo;
import com.bumptech.glide.load.resource.gif.GifDrawable;
import pl.droidsonroids.gif.GifImageView; import pl.droidsonroids.gif.GifImageView;
/** /**
@ -415,7 +416,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
private View prank_group; private View prank_group;
public TextView prank_group_title,prank_group_turntable; public TextView prank_group_title,prank_group_turntable;
private RecyclerView recycler_prank; private RecyclerView recycler_prank;
private ImageView prank_group_bottom_icon,prank_group_turntable_icon,prank_small_icon; private ImageView prank_group_bottom_icon,prank_group_turntable_icon;
private GifImageView prank_small_icon;
private PrankAdapter prankAdapter; private PrankAdapter prankAdapter;
private List<PrankProgressBean.PrankList> prankAndComboList = new ArrayList<>(); private List<PrankProgressBean.PrankList> prankAndComboList = new ArrayList<>();
private List<PrankProgressBean.PrankList> completedList = new ArrayList<>(); private List<PrankProgressBean.PrankList> completedList = new ArrayList<>();
@ -423,6 +425,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
private boolean prankAnisShow; private boolean prankAnisShow;
private LinearLayout prank_top_layout; private LinearLayout prank_top_layout;
private ImageView prank_group_top_icon; private ImageView prank_group_top_icon;
private pl.droidsonroids.gif.GifDrawable mGifDrawable;
public LiveRoomViewHolder setGuardType(int guardType) { public LiveRoomViewHolder setGuardType(int guardType) {
this.guardType = guardType; this.guardType = guardType;
return this; return this;
@ -1677,7 +1682,21 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
prank_group_turntable = (TextView) findViewById(R.id.prank_group_turntable);//文字转盘整蛊(用户端已删除,主播端为待完成整蛊按钮) prank_group_turntable = (TextView) findViewById(R.id.prank_group_turntable);//文字转盘整蛊(用户端已删除,主播端为待完成整蛊按钮)
prank_group_bottom_icon = (ImageView) findViewById(R.id.prank_group_bottom_icon);//收起icon prank_group_bottom_icon = (ImageView) findViewById(R.id.prank_group_bottom_icon);//收起icon
prank_group_turntable_icon = (ImageView) findViewById(R.id.prank_group_turntable_icon);//转盘图标 prank_group_turntable_icon = (ImageView) findViewById(R.id.prank_group_turntable_icon);//转盘图标
prank_small_icon = (ImageView) findViewById(R.id.prank_small_icon);//收起后图标 prank_small_icon = (GifImageView) findViewById(R.id.prank_small_icon);//收起后图标
try {
if (WordUtil.isNewZh()){
mGifDrawable = new pl.droidsonroids.gif.GifDrawable(mContext.getResources(),R.drawable.pran_zh);
}else {
mGifDrawable = new pl.droidsonroids.gif.GifDrawable(mContext.getResources(),R.drawable.pran_en);
}
prank_small_icon.setImageDrawable(mGifDrawable);
mGifDrawable.stop();
}catch (Exception e){
e.printStackTrace();
}
//点击文字转盘整蛊(跳转转盘整蛊) //点击文字转盘整蛊(跳转转盘整蛊)
prank_group_turntable.setOnClickListener(v->{ prank_group_turntable.setOnClickListener(v->{
prankAnisShow = !prankAnisShow; prankAnisShow = !prankAnisShow;
@ -1699,6 +1718,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
prank_group_bottom_icon.setOnClickListener(v->{ prank_group_bottom_icon.setOnClickListener(v->{
prank_group.setVisibility(View.GONE); prank_group.setVisibility(View.GONE);
prank_small_icon.setVisibility(View.VISIBLE); prank_small_icon.setVisibility(View.VISIBLE);
if (CommonAppConfig.getInstance().getUid().equals(mLiveUid)){
switchGifDrawable(!completedList.isEmpty());
}else {
switchGifDrawable(false);
}
}); });
//点击收起整蛊icon //点击收起整蛊icon
@ -1865,6 +1889,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
public void onClick(View view) { public void onClick(View view) {
prank_group.setVisibility(View.GONE); prank_group.setVisibility(View.GONE);
prank_small_icon.setVisibility(View.VISIBLE); prank_small_icon.setVisibility(View.VISIBLE);
switchGifDrawable(!completedList.isEmpty());
} }
}); });
prank_group_top_icon.setVisibility(View.VISIBLE); prank_group_top_icon.setVisibility(View.VISIBLE);
@ -1875,6 +1900,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
} }
prank_group_bottom_icon.setVisibility(View.GONE); prank_group_bottom_icon.setVisibility(View.GONE);
}else{ }else{
switchGifDrawable(false);
if(mPrankType==1){ if(mPrankType==1){
prank_group_title.setText(R.string.prank_progress); prank_group_title.setText(R.string.prank_progress);
}else{ }else{
@ -1924,6 +1950,18 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
}); });
} }
private void switchGifDrawable(boolean start){
LogUtils.e("yqw=====>判断闪烁:"+(mGifDrawable != null)+","+start);
if (mGifDrawable != null){
if (start){
mGifDrawable.start();
}else {
mGifDrawable.seekTo(0);
mGifDrawable.stop();
}
}
}
int ttttttype = 0; int ttttttype = 0;
private LinearLayout dragonImmediateParticipation, dragonImmediateParticipationTime; private LinearLayout dragonImmediateParticipation, dragonImmediateParticipationTime;
private FrameLayout redPacket; private FrameLayout redPacket;

View File

@ -2403,14 +2403,14 @@
tools:visibility="visible" tools:visibility="visible"
layout="@layout/view_prank_group"/> layout="@layout/view_prank_group"/>
<ImageView <pl.droidsonroids.gif.GifImageView
android:id="@+id/prank_small_icon" android:id="@+id/prank_small_icon"
android:layout_gravity="end" android:layout_gravity="end"
android:visibility="gone" android:visibility="gone"
android:layout_width="wrap_content" android:layout_width="23dp"
android:layout_height="wrap_content" android:layout_height="33dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:src="@mipmap/prank_icon"/> />
<ImageView <ImageView
android:id="@+id/prank_group_turntable_icon" android:id="@+id/prank_group_turntable_icon"