补充信箱角标点亮和防抖
This commit is contained in:
parent
4729f93515
commit
1e4b0bb536
@ -4,8 +4,10 @@ import static com.yunbao.common.utils.RouteUtil.PATH_COIN;
|
|||||||
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
import android.text.Html;
|
import android.text.Html;
|
||||||
import android.text.Spanned;
|
import android.text.Spanned;
|
||||||
|
import android.view.View;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
@ -21,6 +23,7 @@ import com.yunbao.common.dialog.AbsDialogPopupWindow;
|
|||||||
import com.yunbao.common.glide.ImgLoader;
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
import com.yunbao.common.http.HttpCallback;
|
import com.yunbao.common.http.HttpCallback;
|
||||||
import com.yunbao.common.utils.DialogUitl;
|
import com.yunbao.common.utils.DialogUitl;
|
||||||
|
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||||
import com.yunbao.live.R;
|
import com.yunbao.live.R;
|
||||||
import com.yunbao.live.http.LiveHttpUtil;
|
import com.yunbao.live.http.LiveHttpUtil;
|
||||||
|
|
||||||
@ -32,12 +35,14 @@ public class LiveContactDetailsSendGiftDialog extends AbsDialogPopupWindow {
|
|||||||
TextView giftName;
|
TextView giftName;
|
||||||
TextView diamond;
|
TextView diamond;
|
||||||
ImageView giftIcon;
|
ImageView giftIcon;
|
||||||
|
View send;
|
||||||
|
|
||||||
int giftId;
|
int giftId;
|
||||||
String anchorName;
|
String anchorName;
|
||||||
private String mLiveUid;
|
private String mLiveUid;
|
||||||
private String mStream;
|
private String mStream;
|
||||||
LiveGiftBean bean;
|
LiveGiftBean bean;
|
||||||
|
DialogInterface.OnDismissListener onDismissListener;
|
||||||
|
|
||||||
public LiveContactDetailsSendGiftDialog(@NonNull Context context) {
|
public LiveContactDetailsSendGiftDialog(@NonNull Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
@ -63,6 +68,11 @@ public class LiveContactDetailsSendGiftDialog extends AbsDialogPopupWindow {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LiveContactDetailsSendGiftDialog setOnDismissListener(DialogInterface.OnDismissListener onDismissListener) {
|
||||||
|
this.onDismissListener = onDismissListener;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void buildDialog(XPopup.Builder builder) {
|
public void buildDialog(XPopup.Builder builder) {
|
||||||
|
|
||||||
@ -77,7 +87,8 @@ public class LiveContactDetailsSendGiftDialog extends AbsDialogPopupWindow {
|
|||||||
protected void onCreate() {
|
protected void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
findViewById(R.id.back).setOnClickListener(v -> dismiss());
|
findViewById(R.id.back).setOnClickListener(v -> dismiss());
|
||||||
findViewById(R.id.send).setOnClickListener(v -> send());
|
send = findViewById(R.id.send);
|
||||||
|
ViewClicksAntiShake.clicksAntiShake(send, this::send);
|
||||||
|
|
||||||
title = findViewById(R.id.title);
|
title = findViewById(R.id.title);
|
||||||
giftIcon = findViewById(R.id.gift_icon);
|
giftIcon = findViewById(R.id.gift_icon);
|
||||||
@ -113,18 +124,25 @@ public class LiveContactDetailsSendGiftDialog extends AbsDialogPopupWindow {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
protected void onDismiss() {
|
||||||
|
super.onDismiss();
|
||||||
|
if (onDismissListener != null) {
|
||||||
|
onDismissListener.onDismiss(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void setData(LiveGiftBean bean) {
|
private void setData(LiveGiftBean bean) {
|
||||||
this.bean=bean;
|
this.bean = bean;
|
||||||
ImgLoader.display(mContext,bean.getIcon(),giftIcon);
|
ImgLoader.display(mContext, bean.getIcon(), giftIcon);
|
||||||
diamond.setText(bean.getPrice());
|
diamond.setText(bean.getPrice());
|
||||||
giftName.setText(bean.getName());
|
giftName.setText(bean.getName());
|
||||||
Spanned spanned = Html.fromHtml(
|
Spanned spanned = Html.fromHtml(
|
||||||
"<font color='#5993FF'>"+mContext.getString(R.string.live_details_sned_gift_text1)+"</font>" +
|
"<font color='#5993FF'>" + mContext.getString(R.string.live_details_sned_gift_text1) + "</font>" +
|
||||||
" <font color='#FFC300'>" + bean.getName() + "</font> " +
|
" <font color='#FFC300'>" + bean.getName() + "</font> " +
|
||||||
"<font color='#5993FF'>"+mContext.getString(R.string.live_details_sned_gift_text2)+"</font>" +
|
"<font color='#5993FF'>" + mContext.getString(R.string.live_details_sned_gift_text2) + "</font>" +
|
||||||
" <font color='#FFC300'>" + anchorName + "</font> " +
|
" <font color='#FFC300'>" + anchorName + "</font> " +
|
||||||
"<font color='#5993FF'>"+mContext.getString(R.string.live_details_sned_gift_text3)+"</font>"
|
"<font color='#5993FF'>" + mContext.getString(R.string.live_details_sned_gift_text3) + "</font>"
|
||||||
);
|
);
|
||||||
title.setText(spanned);
|
title.setText(spanned);
|
||||||
}
|
}
|
||||||
@ -133,7 +151,7 @@ public class LiveContactDetailsSendGiftDialog extends AbsDialogPopupWindow {
|
|||||||
LiveHttpUtil.sendGift("0", mLiveUid, mStream, bean.getId(), "1", 1, new HttpCallback() {
|
LiveHttpUtil.sendGift("0", mLiveUid, mStream, bean.getId(), "1", 1, new HttpCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
if (code == 1001 || code==1005) {
|
if (code == 1001 || code == 1005) {
|
||||||
new DialogUitl.Builder(mContext)
|
new DialogUitl.Builder(mContext)
|
||||||
.setView(R.layout.dialog_live_unfollow)
|
.setView(R.layout.dialog_live_unfollow)
|
||||||
.setConfirmString(mContext.getString(R.string.charge))
|
.setConfirmString(mContext.getString(R.string.charge))
|
||||||
@ -145,10 +163,15 @@ public class LiveContactDetailsSendGiftDialog extends AbsDialogPopupWindow {
|
|||||||
ARouter.getInstance().build(PATH_COIN).withInt("p", 0).navigation();
|
ARouter.getInstance().build(PATH_COIN).withInt("p", 0).navigation();
|
||||||
}
|
}
|
||||||
}).build().show();
|
}).build().show();
|
||||||
}else{
|
} else {
|
||||||
dismiss();
|
dismiss();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError() {
|
||||||
|
super.onError();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5079,6 +5079,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
.setAnchorName(mAnchorName)
|
.setAnchorName(mAnchorName)
|
||||||
.setStream(mStream)
|
.setStream(mStream)
|
||||||
.setLiveUid(mLiveUid)
|
.setLiveUid(mLiveUid)
|
||||||
|
.setOnDismissListener(dialog1 -> {
|
||||||
|
checkNewLetter();
|
||||||
|
})
|
||||||
.showDialog();
|
.showDialog();
|
||||||
loading.dismiss();
|
loading.dismiss();
|
||||||
}
|
}
|
||||||
@ -5153,6 +5156,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
.setAnchorName(mAnchorName)
|
.setAnchorName(mAnchorName)
|
||||||
.setStream(mStream)
|
.setStream(mStream)
|
||||||
.setLiveUid(mLiveUid)
|
.setLiveUid(mLiveUid)
|
||||||
|
.setOnDismissListener(dialog1 -> {
|
||||||
|
checkNewLetter();
|
||||||
|
})
|
||||||
.showDialog();
|
.showDialog();
|
||||||
loading.dismiss();
|
loading.dismiss();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user