111
This commit is contained in:
@@ -58,6 +58,7 @@ import com.yunbao.live.bean.LivePKUserListBean;
|
||||
import com.yunbao.live.bean.LiveUserGiftBean;
|
||||
import com.yunbao.live.dialog.BlowkissDialog;
|
||||
import com.yunbao.live.dialog.LiveGiftDialogFragment;
|
||||
import com.yunbao.live.dialog.NewUserDialog;
|
||||
import com.yunbao.live.event.LinkMicTxAccEvent;
|
||||
import com.yunbao.live.event.LiveRoomChangeEvent;
|
||||
import com.yunbao.live.http.LiveHttpConsts;
|
||||
@@ -82,6 +83,7 @@ import com.yunbao.live.views.LivePlayTxViewHolder;
|
||||
import com.yunbao.live.views.LiveRoomPlayViewHolder;
|
||||
import com.yunbao.live.views.LiveRoomViewHolder;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
@@ -100,6 +102,7 @@ import io.rong.imlib.model.Conversation;
|
||||
import io.rong.message.TextMessage;
|
||||
import pl.droidsonroids.gif.GifImageView;
|
||||
|
||||
import static com.yunbao.common.CommonAppConfig.isNewUser;
|
||||
import static com.yunbao.common.CommonAppContext.logger;
|
||||
import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics;
|
||||
import static com.yunbao.live.presenter.LiveLinkMicPresenter.mBannerList2;
|
||||
@@ -181,6 +184,7 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
|
||||
@Override
|
||||
protected void main() {
|
||||
|
||||
liveImDeletUtil = new LiveImDeletUtil();
|
||||
if (getIntent().getIntExtra("isry", 0) == 1) {
|
||||
isRy = true;
|
||||
@@ -321,6 +325,11 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
countDownTimer = new CountDownTimer(CommonAppConfig.getInstance().alert_end_time * 1000, 1000) {
|
||||
@Override
|
||||
public void onTick(long millisUntilFinished) {
|
||||
|
||||
if (isNewUser == true && timeIndex == 5 ){
|
||||
NewUserDialog fragment1 = new NewUserDialog();
|
||||
fragment1.show(((LiveActivity) mContext).getSupportFragmentManager(), "NewUserDialog");
|
||||
}
|
||||
if (timeIndex == CommonAppConfig.getInstance().alert_time) {
|
||||
if (mLiveRoomViewHolder.isAttention == 0) {
|
||||
BlowkissDialog fragment1 = new BlowkissDialog();
|
||||
|
||||
@@ -21,6 +21,8 @@ import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.LiveActivity;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
import static com.yunbao.live.activity.LiveAudienceActivity.countDownTimer;
|
||||
@@ -89,61 +91,24 @@ public class NewUserDialog extends AbsDialogFragment {
|
||||
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
ImageView btn_close = (ImageView) mRootView.findViewById(R.id.btn_close);
|
||||
btn_close.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
RelativeLayout btn_rose = (RelativeLayout) mRootView.findViewById(R.id.btn_rose);
|
||||
RelativeLayout btn_roses = (RelativeLayout) mRootView.findViewById(R.id.btn_roses);
|
||||
RelativeLayout btn_lollipop = (RelativeLayout) mRootView.findViewById(R.id.btn_lollipop);
|
||||
|
||||
|
||||
TextView btn_confirm = (TextView) mRootView.findViewById(R.id.btn_confirm);
|
||||
btn_rose.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
gif = 1;
|
||||
gif_id = 210;
|
||||
btn_rose.setBackgroundResource(R.drawable.button_ffb6c4);
|
||||
btn_roses.setBackgroundResource(R.drawable.button_fff8f6f8);
|
||||
btn_lollipop.setBackgroundResource(R.drawable.button_fff8f6f8);
|
||||
}
|
||||
});
|
||||
|
||||
btn_roses.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
gif = 2;
|
||||
gif_id = 224;
|
||||
btn_rose.setBackgroundResource(R.drawable.button_fff8f6f8);
|
||||
btn_roses.setBackgroundResource(R.drawable.button_ffb6c4);
|
||||
btn_lollipop.setBackgroundResource(R.drawable.button_fff8f6f8);
|
||||
}
|
||||
});
|
||||
|
||||
btn_lollipop.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
gif = 0;
|
||||
gif_id = 1093;
|
||||
btn_rose.setBackgroundResource(R.drawable.button_fff8f6f8);
|
||||
btn_roses.setBackgroundResource(R.drawable.button_fff8f6f8);
|
||||
btn_lollipop.setBackgroundResource(R.drawable.button_ffb6c4);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
btn_confirm.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
follow();
|
||||
LiveHttpUtil.sendGift("0", mLiveUid, LiveActivity.mStream, gif_id, "1", new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
ToastUtil.show(msg);
|
||||
}
|
||||
});
|
||||
countDownTimer.cancel();
|
||||
// follow();
|
||||
// LiveHttpUtil.sendGift("0", mLiveUid, LiveActivity.mStream, gif_id, "1", new HttpCallback() {
|
||||
// @Override
|
||||
// public void onSuccess(int code, String msg, String[] info) {
|
||||
// ToastUtil.show(msg);
|
||||
// }
|
||||
// });
|
||||
EventBus.getDefault().post("showBanner");
|
||||
EventBus.getDefault().post("svga_new_user_gif");
|
||||
|
||||
// countDownTimer.cancel();
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -68,6 +68,8 @@ import com.yunbao.live.views.LiveLinkMicPushTxViewHolder;
|
||||
import com.yunbao.live.activity.ZhuangBanActivity;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -112,8 +114,9 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
|
||||
private ImageView imgEvent;
|
||||
private String eventUrl;
|
||||
private Banner mBanner1;
|
||||
public static Banner mBanner2;
|
||||
public static Banner mBanner2,mBanner3;
|
||||
private List<BannerBean> mBannerList1 = new ArrayList<>();
|
||||
private List<BannerBean> mBannerList3 = new ArrayList<>();
|
||||
|
||||
public static List<BannerBean> mBannerList2 = new ArrayList<>();
|
||||
public static CountDownView date;
|
||||
@@ -121,8 +124,16 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
|
||||
public static String link = "";
|
||||
LinearLayout btn_event2;
|
||||
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onUpdata(String str) {
|
||||
if ("showBanner".equals(str)) {
|
||||
showBanner3();
|
||||
}
|
||||
}
|
||||
public LiveLinkMicPresenter(Context context, ILiveLinkMicViewHolder linkMicViewHolder, boolean isAnchor, int liveSdk, View root) {
|
||||
mContext = context;
|
||||
EventBus.getDefault().register(this);
|
||||
mRoot = root;
|
||||
mIsAnchor = isAnchor;
|
||||
mLiveSdk = liveSdk;
|
||||
@@ -139,6 +150,9 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
|
||||
btnEvent = root.findViewById(R.id.btn_event);
|
||||
mBanner1 = (Banner) root.findViewById(R.id.banner1);
|
||||
mBanner2 = (Banner) root.findViewById(R.id.banner2);
|
||||
mBanner3 = (Banner) root.findViewById(R.id.banner3);
|
||||
|
||||
|
||||
btn_event2 = root.findViewById(R.id.btn_event2);
|
||||
mBanner1.setOutlineProvider(new ViewOutlineProvider() {
|
||||
@Override
|
||||
@@ -152,13 +166,32 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
|
||||
outline.setRoundRect(0, 0, view.getWidth(), view.getHeight(), 10);
|
||||
}
|
||||
});
|
||||
|
||||
mBanner3.setOutlineProvider(new ViewOutlineProvider() {
|
||||
@Override
|
||||
public void getOutline(View view, Outline outline) {
|
||||
outline.setRoundRect(0, 0, view.getWidth(), view.getHeight(), 10);
|
||||
}
|
||||
});
|
||||
//周星
|
||||
BannerBean bannerBean = new BannerBean();
|
||||
bannerBean.setImageUrl("https://qny.shayucm.com/img/BTN_WEEKSTAR%20%281%29.png");
|
||||
bannerBean.setLink("zxb");
|
||||
mBannerList1.add(bannerBean);
|
||||
|
||||
BannerBean banner3Bean = new BannerBean();
|
||||
banner3Bean.setImageUrl("https://qny.shayucm.com/live_Mission_box.png");
|
||||
banner3Bean.setLink("lw");
|
||||
mBannerList3.add(banner3Bean);
|
||||
BannerBean banner3Bean1 = new BannerBean();
|
||||
banner3Bean1.setImageUrl("https://qny.shayucm.com/live_Mission_box.png");
|
||||
banner3Bean1.setLink("gz");
|
||||
mBannerList3.add(banner3Bean1);
|
||||
|
||||
BannerBean banner3Bean2 = new BannerBean();
|
||||
banner3Bean2.setImageUrl("https://qny.shayucm.com/live_Mission_box.png");
|
||||
banner3Bean2.setLink("dl");
|
||||
mBannerList3.add(banner3Bean2);
|
||||
|
||||
btn_onecz_event = root.findViewById(R.id.btn_onecz_event);
|
||||
btn_onecz_event.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@@ -746,6 +779,31 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
|
||||
}
|
||||
}
|
||||
|
||||
private void showBanner3() {
|
||||
if (mBannerList3 == null || mBannerList3.size() == 0 || mBanner3 == null) {
|
||||
return;
|
||||
}
|
||||
mBanner1.setAutoPlay(true)
|
||||
.setPages(mBannerList3, new CustomViewHolder())
|
||||
.setDelayTime(3000)
|
||||
.setBannerStyle(BannerConfig.NOT_INDICATOR)
|
||||
.setOnBannerClickListener(new OnBannerClickListener() {
|
||||
@Override
|
||||
public void onBannerClick(List datas, int p) {
|
||||
if (mBannerList3 != null) {
|
||||
if (p >= 0 && p < mBannerList3.size()) {
|
||||
BannerBean bean = mBannerList3.get(p);
|
||||
if (bean != null) {
|
||||
String link = bean.getLink();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
.start();
|
||||
}
|
||||
|
||||
//获取活动
|
||||
private void getEvent() {
|
||||
if (btn_onecz_event != null) {
|
||||
|
||||
@@ -56,31 +56,28 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
|
||||
private TextView tv_trickery_time;
|
||||
private View v_msg_redpoint;
|
||||
private Activity context;
|
||||
private SVGAImageView svga_new_user_gif;
|
||||
private SVGAImageView svga_new_user_gif,svga_new_user_double,svga_new_user_follow;
|
||||
|
||||
public LiveAudienceViewHolder(Context context, ViewGroup parentView) {
|
||||
super(context, parentView);
|
||||
this.context = (Activity) context;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.view_live_audience;
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onUpdata(String str) {
|
||||
if ("svga_new_user_gif".equals(str)) {
|
||||
svga_new_user_gif();
|
||||
}else if ("svga_new_user_double".equals(str)) {
|
||||
svga_new_user_double();
|
||||
}else if ("svga_new_user_follow".equals(str)) {
|
||||
svga_new_user_follow();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
super.init();
|
||||
findViewById(R.id.btn_close).setOnClickListener(this);
|
||||
findViewById(R.id.btn_share).setOnClickListener(this);
|
||||
findViewById(R.id.btn_red_pack).setOnClickListener(this);
|
||||
findViewById(R.id.btn_gift).setOnClickListener(this);
|
||||
findViewById(R.id.btn_zg).setOnClickListener(this);
|
||||
svga_new_user_gif = (SVGAImageView)findViewById(R.id.svga_new_user_gif);
|
||||
private void svga_new_user_gif(){
|
||||
new SVGAParser(mContext).decodeFromAssets("free_gift_tip.svga", new SVGAParser.ParseCompletion() {
|
||||
@Override
|
||||
public void onComplete(SVGAVideoEntity videoItem) {
|
||||
ToastUtil.show("1212");
|
||||
SVGADrawable drawable = new SVGADrawable(videoItem);
|
||||
svga_new_user_gif.setImageDrawable(drawable);
|
||||
svga_new_user_gif.startAnimation();
|
||||
@@ -91,6 +88,55 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
|
||||
Log.e("errqs","errl");
|
||||
}
|
||||
});
|
||||
}
|
||||
private void svga_new_user_double() {
|
||||
new SVGAParser(mContext).decodeFromAssets("double_click_tip.svga", new SVGAParser.ParseCompletion() {
|
||||
@Override
|
||||
public void onComplete(SVGAVideoEntity videoItem) {
|
||||
SVGADrawable drawable = new SVGADrawable(videoItem);
|
||||
svga_new_user_double.setImageDrawable(drawable);
|
||||
svga_new_user_double.startAnimation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError() {
|
||||
Log.e("errqs", "errl");
|
||||
}
|
||||
});
|
||||
}
|
||||
private void svga_new_user_follow() {
|
||||
new SVGAParser(mContext).decodeFromAssets("live_follow_tip.svga", new SVGAParser.ParseCompletion() {
|
||||
@Override
|
||||
public void onComplete(SVGAVideoEntity videoItem) {
|
||||
SVGADrawable drawable = new SVGADrawable(videoItem);
|
||||
svga_new_user_follow.setImageDrawable(drawable);
|
||||
svga_new_user_follow.startAnimation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError() {
|
||||
Log.e("errqs", "errl");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.view_live_audience;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
super.init();
|
||||
EventBus.getDefault().register(this);
|
||||
findViewById(R.id.btn_close).setOnClickListener(this);
|
||||
findViewById(R.id.btn_share).setOnClickListener(this);
|
||||
findViewById(R.id.btn_red_pack).setOnClickListener(this);
|
||||
findViewById(R.id.btn_gift).setOnClickListener(this);
|
||||
findViewById(R.id.btn_zg).setOnClickListener(this);
|
||||
svga_new_user_gif = (SVGAImageView)findViewById(R.id.svga_new_user_gif);
|
||||
svga_new_user_double = (SVGAImageView)findViewById(R.id.svga_new_user_double);
|
||||
svga_new_user_follow = (SVGAImageView)findViewById(R.id.svga_new_user_follow);
|
||||
|
||||
findViewById(R.id.btn_mic).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@@ -135,7 +181,6 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
|
||||
v_msg_redpoint = (View) findViewById(R.id.v_msg_redpoint);
|
||||
//获取系统未读消息
|
||||
MessageIMManager.get(context).getSystemMessages();
|
||||
EventBus.getDefault().register(LiveAudienceViewHolder.this);
|
||||
}
|
||||
|
||||
public static Handler handler = new Handler();
|
||||
|
||||
Reference in New Issue
Block a user