111
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 39 KiB |
@ -72,8 +72,8 @@ public class CommonAppConfig {
|
||||
public static boolean isGetNewWrap = false;//是否获取到新的包裹礼物
|
||||
public static int alert_time = 1;
|
||||
public static int alert_end_time = 1;
|
||||
//是否是新用户
|
||||
public static boolean isNewUser = true;
|
||||
|
||||
|
||||
|
||||
|
||||
private CommonAppConfig() {
|
||||
|
@ -33,6 +33,15 @@ public class LiveGiftBean {
|
||||
private String swf;
|
||||
private String isweek;
|
||||
private String end_time;
|
||||
private String tag;
|
||||
|
||||
public String getTag() {
|
||||
return tag;
|
||||
}
|
||||
|
||||
public void setTag(String tag) {
|
||||
this.tag = tag;
|
||||
}
|
||||
|
||||
public String getEnd_time() {
|
||||
return end_time;
|
||||
|
@ -25,6 +25,8 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
private final static String KEY_USER_INFO = "keyUserInfo";
|
||||
private static IMLoginManager manager;
|
||||
private IMLoginModel userInfo;
|
||||
|
||||
|
||||
//根据用户信息
|
||||
private Handler netHandler = new Handler();
|
||||
private Context context;
|
||||
@ -33,6 +35,25 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
super(context);
|
||||
this.context = context;
|
||||
}
|
||||
//新用戶是否送了禮物
|
||||
public boolean isNewUserGif(){
|
||||
return getBoolean("isNewUserGif",false);
|
||||
}
|
||||
//新用戶是否送了禮物
|
||||
public void setNewUserGif(boolean t){
|
||||
put("isNewUserGif",t);
|
||||
}
|
||||
|
||||
// 是否新用户第一次進直播間
|
||||
public boolean isisNewUserOne(){
|
||||
return getBoolean("isNewUserOne",false);
|
||||
}
|
||||
//新用戶是否送了禮物
|
||||
public void setisNewUserOne(boolean t){
|
||||
put("isNewUserOne",t);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取单利
|
||||
|
@ -25,6 +25,7 @@ public class RouteUtil {
|
||||
public static final String PATH_MYWEBVIEWACTIVTITY = "/main/MyWebViewActivity";
|
||||
public static final String PATH_ZHUANGBANACTIVITY = "/main/ZhuangBanActivity";
|
||||
public static final String PATH_FACEBOOKACTIVITY = "/baidu/FacebookLoginActivity";
|
||||
public static final String PATH_MAIN= "/main/MainActivity";
|
||||
|
||||
/**
|
||||
* 启动页
|
||||
|
@ -65,6 +65,17 @@
|
||||
<string name="edit_profile_update_sign">Signature modification</string>
|
||||
<string name="edit_profile_sign">autograph</string>
|
||||
<string name="bind_phone">Binding phone</string>
|
||||
<string name="task1">TASK1</string>
|
||||
<string name="task2">TASK2</string>
|
||||
<string name="task3">TASK3</string>
|
||||
<string name="give_a_free_gift">Give a\nfree gift</string>
|
||||
<string name="incomplete">Incomplete</string>
|
||||
<string name="complete">Complete</string>
|
||||
<string name="follow_anchor">Follow\nanchor</string>
|
||||
<string name="light_up_room">light UP\nRoom</string>
|
||||
|
||||
|
||||
|
||||
<string name="apply_for_lianmai">ApplyMic</string>
|
||||
<string name="cancel_application">Cancel Mic</string>
|
||||
<string name="quit_mic">Quit Mic</string>
|
||||
|
@ -55,6 +55,15 @@
|
||||
<string name="edit_profile_update_sign">修改簽名</string>
|
||||
<string name="edit_profile_sign">簽名</string>
|
||||
<string name="bind_phone">綁定手機</string>
|
||||
<string name="task1">任務1</string>
|
||||
<string name="task2">任務2</string>
|
||||
<string name="task3">任務3</string>
|
||||
<string name="give_a_free_gift">赠送一个\n免费礼物</string>
|
||||
<string name="incomplete">未完成</string>
|
||||
<string name="complete">完成</string>
|
||||
<string name="follow_anchor">關注主播</string>
|
||||
<string name="light_up_room">點亮直播間</string>
|
||||
|
||||
<string name="edit_profile_birthday">生日</string>
|
||||
<string name="edit_profile_sex">性別</string>
|
||||
<string name="apply_for_lianmai">申请連麥</string>
|
||||
|
@ -8,11 +8,13 @@ import android.os.Bundle;
|
||||
import android.os.CountDownTimer;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
|
||||
import androidx.annotation.IdRes;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.viewpager.widget.PagerAdapter;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
@ -24,6 +26,7 @@ import android.widget.ImageView;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.adjust.sdk.AdjustEvent;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
@ -41,6 +44,7 @@ import com.yunbao.common.http.CommonHttpConsts;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.HttpClient;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.pay.PayCallback;
|
||||
import com.yunbao.common.pay.PayPresenter;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
@ -102,9 +106,11 @@ 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.common.utils.RouteUtil.PATH_GOOGLE;
|
||||
import static com.yunbao.common.utils.RouteUtil.PATH_MAIN;
|
||||
import static com.yunbao.live.presenter.LiveLinkMicPresenter.mBannerList2;
|
||||
import static com.yunbao.live.views.LivePlayKsyViewHolder.setViewUP;
|
||||
import static com.yunbao.live.views.LivePlayRyViewHolder.Micing;
|
||||
@ -122,6 +128,7 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
public static JSONObject pkInfo;
|
||||
public static LiveAudienceActivity liveAudienceActivity;
|
||||
|
||||
|
||||
public static void forward(Context context, LiveBean liveBean, int liveType, int liveTypeVal, String key, int position, int liveSdk) {
|
||||
Intent intent = new Intent(context, LiveAudienceActivity.class);
|
||||
intent.putExtra(Constants.LIVE_BEAN, liveBean);
|
||||
@ -184,7 +191,6 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
|
||||
@Override
|
||||
protected void main() {
|
||||
|
||||
liveImDeletUtil = new LiveImDeletUtil();
|
||||
if (getIntent().getIntExtra("isry", 0) == 1) {
|
||||
isRy = true;
|
||||
@ -326,7 +332,7 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
@Override
|
||||
public void onTick(long millisUntilFinished) {
|
||||
|
||||
if (isNewUser == true && timeIndex == 5 ){
|
||||
if (IMLoginManager.get(mContext).isisNewUserOne() == true && timeIndex == 5) {
|
||||
NewUserDialog fragment1 = new NewUserDialog();
|
||||
fragment1.show(((LiveActivity) mContext).getSupportFragmentManager(), "NewUserDialog");
|
||||
}
|
||||
@ -473,6 +479,7 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
mChatLevel = obj.getIntValue("speak_limit");
|
||||
mDanMuLevel = obj.getIntValue("barrage_limit");
|
||||
|
||||
|
||||
//进入直播间
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("hiepcu");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
@ -958,6 +965,7 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
}
|
||||
|
||||
public void end() {
|
||||
IMLoginManager.get(this).setisNewUserOne(false);
|
||||
if (!mEnd && !canBackPressed()) {
|
||||
return;
|
||||
}
|
||||
@ -1204,5 +1212,4 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ import com.yunbao.common.bean.LiveGiftBean;
|
||||
import com.yunbao.common.bean.LiveGiftBean2;
|
||||
import com.yunbao.common.custom.MyRadioButton;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.custom.GiftMarkView;
|
||||
|
||||
@ -171,6 +172,11 @@ public class LiveGiftAdapter extends RecyclerView.Adapter<LiveGiftAdapter.Vh> {
|
||||
}
|
||||
|
||||
void setData(LiveGiftBean bean, int position, Object payload) {
|
||||
if( IMLoginManager.get(mContext).isNewUserGif()== false) {
|
||||
if (position == 0 && bean.getTag()!=null) {
|
||||
mRadioButton.setBackgroundResource(R.mipmap.live_gift_light_bg);
|
||||
}
|
||||
}
|
||||
if (payload == null) {
|
||||
ImgLoader.display(mContext,bean.getIcon(), mIcon);
|
||||
bean.setView(mIcon);
|
||||
|
@ -36,6 +36,7 @@ import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.dialog.AbsDialogFragment;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
@ -50,6 +51,8 @@ import com.yunbao.live.http.LiveHttpConsts;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
import com.yunbao.live.utils.ToolsButton;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -57,6 +60,7 @@ import static com.yunbao.common.CommonAppConfig.isGetNewWrap;
|
||||
import static com.yunbao.common.CommonAppContext.logger;
|
||||
import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics;
|
||||
import static com.yunbao.common.utils.RouteUtil.PATH_COIN;
|
||||
import static com.yunbao.live.presenter.LiveLinkMicPresenter.bean1;
|
||||
|
||||
//import cn.jmessage.support.qiniu.android.utils.Json;
|
||||
|
||||
@ -418,6 +422,10 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
|
||||
}
|
||||
|
||||
private void showGiftList(List<LiveGiftBean> list) {
|
||||
ToastUtil.show( IMLoginManager.get(mContext).isNewUserGif()+"");
|
||||
if( IMLoginManager.get(mContext).isNewUserGif() == false) {
|
||||
list.add(0,bean1);
|
||||
}
|
||||
mGiftList = list;
|
||||
mLiveGiftPagerAdapter = new LiveGiftPagerAdapter(mContext, list);
|
||||
mLiveGiftPagerAdapter.setActionListener(this);
|
||||
@ -665,6 +673,17 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
|
||||
* 赠送礼物
|
||||
*/
|
||||
public void sendGift() {
|
||||
if(mLiveGiftBean.getTag()!=null){
|
||||
LiveHttpUtil.setFrontTask("sendgift", mLiveUid,new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if(code == 0){
|
||||
EventBus.getDefault().post("stop_new_user_gif");
|
||||
}
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
}else {
|
||||
if (TextUtils.isEmpty(mLiveUid) || TextUtils.isEmpty(mStream) || mLiveGiftBean == null) {
|
||||
return;
|
||||
}
|
||||
@ -681,6 +700,7 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
|
||||
LiveHttpUtil.sendGift("0", mLiveUid, mStream, mLiveGiftBean.getId(), mCount, callback);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 隐藏连送按钮
|
||||
|
@ -98,17 +98,11 @@ public class NewUserDialog extends AbsDialogFragment {
|
||||
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);
|
||||
// }
|
||||
// });
|
||||
|
||||
EventBus.getDefault().post("showBanner");
|
||||
EventBus.getDefault().post("svga_new_user_gif");
|
||||
|
||||
// countDownTimer.cancel();
|
||||
countDownTimer.cancel();
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
|
@ -609,6 +609,41 @@ public class LiveHttpUtil {
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 獲取新手任務
|
||||
* @param callback
|
||||
*/
|
||||
public static void getFrontTask(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("User.getFrontTask", "User.getFrontTask")
|
||||
.params("token", CommonAppConfig.getInstance().getToken())
|
||||
.params("uid", CommonAppConfig.getInstance().getUid())
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 完成新手任務
|
||||
*/
|
||||
public static void setFrontTask(String type , HttpCallback callback) {
|
||||
HttpClient.getInstance().get("User.setFrontTask", "User.setFrontTask")
|
||||
.params("token", CommonAppConfig.getInstance().getToken())
|
||||
.params("uid", CommonAppConfig.getInstance().getUid())
|
||||
.params("type", type)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成新手任務
|
||||
*/
|
||||
public static void setFrontTask(String type ,String liveuid , HttpCallback callback) {
|
||||
HttpClient.getInstance().get("User.setFrontTask", "User.setFrontTask")
|
||||
.params("token", CommonAppConfig.getInstance().getToken())
|
||||
.params("uid", CommonAppConfig.getInstance().getUid())
|
||||
.params("type", type)
|
||||
.params("liveuid", liveuid)
|
||||
.execute(callback);
|
||||
}
|
||||
/**
|
||||
* 修改心愿单列表
|
||||
*/
|
||||
|
@ -4,6 +4,7 @@ import android.Manifest;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Outline;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
@ -20,20 +21,26 @@ import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.PopupWindow;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.cardview.widget.CardView;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ms.banner.Banner;
|
||||
import com.ms.banner.BannerConfig;
|
||||
import com.ms.banner.holder.BannerViewHolder;
|
||||
import com.ms.banner.listener.OnBannerClickListener;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.BannerBean;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.bean.LiveGiftBean;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.HttpClient;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.ClickUtil;
|
||||
import com.yunbao.common.utils.CommonIconUtil;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
@ -123,14 +130,89 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
|
||||
|
||||
public static String link = "";
|
||||
LinearLayout btn_event2;
|
||||
public static LiveGiftBean bean1 = new LiveGiftBean();
|
||||
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onUpdata(String str) {
|
||||
if ("showBanner".equals(str)) {
|
||||
showBanner3();
|
||||
} else if ("stop_svga_new_user_double".equals(str)) {
|
||||
mBannerList3.get(2).setLink("1");
|
||||
mBanner3.update(mBannerList3);
|
||||
} else if ("stop_svga_new_user_follow".equals(str)) {
|
||||
mBannerList3.get(1).setLink("1");
|
||||
mBanner3.update(mBannerList3);
|
||||
} else if ("stop_new_user_gif".equals(str)) {
|
||||
mBannerList3.get(0).setLink("1");
|
||||
mBanner3.update(mBannerList3);
|
||||
}
|
||||
}
|
||||
|
||||
public void publicToast(Context content){
|
||||
// 定义Toast对象
|
||||
Toast toast = new Toast(content);
|
||||
// 1、加载布局
|
||||
View view = LayoutInflater.from(content).inflate(R.layout.diy_toast_view,null);
|
||||
// 2、获取组件
|
||||
// TextView tv_toast = view.findViewById(R.id.textView13);
|
||||
//// 3、设置组件内容
|
||||
// tv_toast.setText(content);
|
||||
// 4、将获取的view视图设置进Toast对象中
|
||||
toast.setView(view);
|
||||
// 5、设置toast位置
|
||||
// 5-1、Gravity.CENTER | Gravity.TOP是设置toast在中间上方显示
|
||||
// 5-2、300 表示距离左边300dp
|
||||
// 5-3、250 表示距离上方250dp
|
||||
toast.setGravity(Gravity.CENTER | Gravity.TOP,300,250);
|
||||
// 6、显示toast
|
||||
toast.show();
|
||||
}
|
||||
|
||||
class MyCustomViewHolder implements BannerViewHolder<BannerBean> {
|
||||
|
||||
private TextView task, status;
|
||||
private TextView task_name;
|
||||
private ImageView indicator1, indicator2, indicator3;
|
||||
|
||||
@Override
|
||||
public View createView(Context context, int position, BannerBean data) {
|
||||
View view = LayoutInflater.from(context).inflate(R.layout.banner_new_user, null);
|
||||
task = (TextView) view.findViewById(R.id.task);
|
||||
task_name = (TextView) view.findViewById(R.id.task_name);
|
||||
status = (TextView) view.findViewById(R.id.status);
|
||||
indicator1 = (ImageView) view.findViewById(R.id.indicator1);
|
||||
indicator2 = (ImageView) view.findViewById(R.id.indicator2);
|
||||
indicator3 = (ImageView) view.findViewById(R.id.indicator3);
|
||||
if (data.getLink().equals("0")) {
|
||||
status.setText(R.string.incomplete);
|
||||
} else {
|
||||
status.setText(R.string.complete);
|
||||
}
|
||||
if (position == 0) {
|
||||
task.setText(R.string.task1);
|
||||
task_name.setText(R.string.give_a_free_gift);
|
||||
indicator1.setImageResource(R.drawable.bg_home_indicator_selected);
|
||||
indicator2.setImageResource(R.drawable.bg_home_indicator_unselected);
|
||||
indicator3.setImageResource(R.drawable.bg_home_indicator_unselected);
|
||||
} else if (position == 1) {
|
||||
task.setText(R.string.task2);
|
||||
task_name.setText(R.string.follow_anchor);
|
||||
indicator1.setImageResource(R.drawable.bg_home_indicator_unselected);
|
||||
indicator2.setImageResource(R.drawable.bg_home_indicator_selected);
|
||||
indicator3.setImageResource(R.drawable.bg_home_indicator_unselected);
|
||||
} else if (position == 2) {
|
||||
task.setText(R.string.task3);
|
||||
task_name.setText(R.string.light_up_room);
|
||||
indicator1.setImageResource(R.drawable.bg_home_indicator_unselected);
|
||||
indicator2.setImageResource(R.drawable.bg_home_indicator_unselected);
|
||||
indicator3.setImageResource(R.drawable.bg_home_indicator_selected);
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
||||
}
|
||||
|
||||
public LiveLinkMicPresenter(Context context, ILiveLinkMicViewHolder linkMicViewHolder, boolean isAnchor, int liveSdk, View root) {
|
||||
mContext = context;
|
||||
EventBus.getDefault().register(this);
|
||||
@ -138,6 +220,7 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
|
||||
mIsAnchor = isAnchor;
|
||||
mLiveSdk = liveSdk;
|
||||
Log.e("ry", "画面来了");
|
||||
publicToast(mContext);
|
||||
mSmallContainer = linkMicViewHolder.getSmallContainer();
|
||||
if (!isAnchor && root != null) {
|
||||
View btnLinkMic = root.findViewById(R.id.btn_link_mic);
|
||||
@ -178,20 +261,54 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
|
||||
bannerBean.setLink("zxb");
|
||||
mBannerList1.add(bannerBean);
|
||||
|
||||
|
||||
LiveHttpUtil.getFrontTask(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
JSONObject old_obj = JSON.parseObject(info[0]);
|
||||
|
||||
JSONObject obj = old_obj.getJSONObject("task");
|
||||
JSONObject obj1 = old_obj.getJSONObject("gift");
|
||||
|
||||
bean1.setSwf(obj1.getString("swf"));
|
||||
bean1.setChecked(false);
|
||||
bean1.setIcon(obj1.getString("gifticon"));
|
||||
bean1.setId(obj1.getIntValue("id"));
|
||||
bean1.setName(obj1.getString("giftname"));
|
||||
bean1.setTag("1");
|
||||
|
||||
|
||||
BannerBean banner3Bean = new BannerBean();
|
||||
banner3Bean.setImageUrl("https://qny.shayucm.com/live_Mission_box.png");
|
||||
banner3Bean.setLink("lw");
|
||||
banner3Bean.setLink(obj.getString("sendgift"));
|
||||
mBannerList3.add(banner3Bean);
|
||||
|
||||
if(obj.getString("sendgift").equals("0")){
|
||||
EventBus.getDefault().post("svga_new_user_gif");
|
||||
}
|
||||
|
||||
BannerBean banner3Bean1 = new BannerBean();
|
||||
banner3Bean1.setImageUrl("https://qny.shayucm.com/live_Mission_box.png");
|
||||
banner3Bean1.setLink("gz");
|
||||
banner3Bean1.setLink(obj.getString("attent"));
|
||||
mBannerList3.add(banner3Bean1);
|
||||
|
||||
BannerBean banner3Bean2 = new BannerBean();
|
||||
banner3Bean2.setImageUrl("https://qny.shayucm.com/live_Mission_box.png");
|
||||
banner3Bean2.setLink("dl");
|
||||
banner3Bean2.setLink(obj.getString("illumine"));
|
||||
mBannerList3.add(banner3Bean2);
|
||||
|
||||
if(obj.getString("sendgift").equals("0")&& IMLoginManager.get(context).isisNewUserOne() == false) {
|
||||
showBanner3();
|
||||
}else if(obj.getString("attent").equals("0")&& IMLoginManager.get(context).isisNewUserOne() == false){
|
||||
showBanner3();
|
||||
}else if(obj.getString("illumine").equals("0")&& IMLoginManager.get(context).isisNewUserOne()== false){
|
||||
showBanner3();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
btn_onecz_event = root.findViewById(R.id.btn_onecz_event);
|
||||
btn_onecz_event.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@ -783,19 +900,22 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
|
||||
if (mBannerList3 == null || mBannerList3.size() == 0 || mBanner3 == null) {
|
||||
return;
|
||||
}
|
||||
mBanner1.setAutoPlay(true)
|
||||
.setPages(mBannerList3, new CustomViewHolder())
|
||||
mBanner3.setAutoPlay(true)
|
||||
.setPages(mBannerList3, new MyCustomViewHolder())
|
||||
.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();
|
||||
|
||||
if (mBannerList3.get(p).getLink().equals("0")) {
|
||||
if (p == 0) {
|
||||
((LiveAudienceActivity) mContext).openGiftWindow("1530", "1");
|
||||
EventBus.getDefault().post("svga_new_user_gif");
|
||||
} else if (p == 1) {
|
||||
EventBus.getDefault().post("svga_new_user_follow");
|
||||
} else if (p == 2) {
|
||||
EventBus.getDefault().post("svga_new_user_double");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +13,8 @@ import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import io.rong.imlib.IRongCallback;
|
||||
import io.rong.imlib.RongIMClient;
|
||||
import io.rong.imlib.model.Conversation;
|
||||
@ -186,6 +188,13 @@ public class SocketRyChatUtil {
|
||||
public void onSuccess(Message message) {
|
||||
Log.i("tx", "发送成功");
|
||||
LiveHttpUtil.sendZAN(mLiveUid + "", new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
EventBus.getDefault().post("stop_svga_new_user_double");
|
||||
}
|
||||
});
|
||||
|
||||
LiveHttpUtil.setFrontTask("illumine", new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
|
||||
|
@ -71,9 +71,23 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
|
||||
svga_new_user_double();
|
||||
}else if ("svga_new_user_follow".equals(str)) {
|
||||
svga_new_user_follow();
|
||||
}else if("stop_svga_new_user_double".equals(str)){
|
||||
svga_new_user_double.setVisibility(View.GONE);
|
||||
svga_new_user_double.stopAnimation();
|
||||
svga_new_user_double.clear();
|
||||
} else if("stop_svga_new_user_follow".equals(str)) {
|
||||
svga_new_user_follow.setVisibility(View.GONE);
|
||||
svga_new_user_follow.stopAnimation();
|
||||
svga_new_user_follow.clear();
|
||||
}else if("stop_svga_new_user_follow".equals(str)) {
|
||||
svga_new_user_follow.setVisibility(View.GONE);
|
||||
svga_new_user_follow.stopAnimation();
|
||||
svga_new_user_follow.clear();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void svga_new_user_gif(){
|
||||
new SVGAParser(mContext).decodeFromAssets("free_gift_tip.svga", new SVGAParser.ParseCompletion() {
|
||||
@Override
|
||||
@ -95,6 +109,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
|
||||
public void onComplete(SVGAVideoEntity videoItem) {
|
||||
SVGADrawable drawable = new SVGADrawable(videoItem);
|
||||
svga_new_user_double.setImageDrawable(drawable);
|
||||
svga_new_user_double.setBackgroundResource(R.mipmap.black_bg);
|
||||
svga_new_user_double.startAnimation();
|
||||
}
|
||||
|
||||
@ -180,7 +195,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
|
||||
|
||||
v_msg_redpoint = (View) findViewById(R.id.v_msg_redpoint);
|
||||
//获取系统未读消息
|
||||
MessageIMManager.get(context).getSystemMessages();
|
||||
MessageIMManager.get(mContext).getSystemMessages();
|
||||
}
|
||||
|
||||
public static Handler handler = new Handler();
|
||||
|
@ -85,6 +85,8 @@ import com.yunbao.live.presenter.LiveGiftAnimPresenter;
|
||||
import com.yunbao.live.presenter.LiveLightAnimPresenter;
|
||||
import com.yunbao.live.socket.SocketChatUtil;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
@ -1190,6 +1192,15 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
* 关注主播
|
||||
*/
|
||||
public static void follow() {
|
||||
EventBus.getDefault().post("stop_svga_new_user_follow");
|
||||
|
||||
LiveHttpUtil.setFrontTask("attent", new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
if (TextUtils.isEmpty(mLiveUid)) {
|
||||
return;
|
||||
}
|
||||
|
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="@color/white"/>
|
||||
</shape>
|
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="#66ffffff"/>
|
||||
</shape>
|
4
live/src/main/res/drawable/drawable_toast.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
</selector>
|
75
live/src/main/res/layout/banner_new_user.xml
Normal file
@ -0,0 +1,75 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="67dp"
|
||||
android:layout_height="90dp"
|
||||
android:background="@mipmap/live_mission_box"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/task"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Task 1"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="8sp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/task_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Give a
|
||||
free gift"
|
||||
android:textColor="#fffff69f"
|
||||
android:textSize="10sp"
|
||||
/>
|
||||
|
||||
<TextView android:id="@+id/status"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Incomplete"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="8sp"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView android:id="@+id/indicator1"
|
||||
android:layout_width="4dp"
|
||||
android:layout_height="4dp"
|
||||
android:layout_marginRight="7dp"
|
||||
android:src="@drawable/bg_home_indicator_selected"/>
|
||||
|
||||
<ImageView android:id="@+id/indicator2"
|
||||
android:layout_width="4dp"
|
||||
android:layout_height="4dp"
|
||||
android:layout_marginRight="7dp"
|
||||
android:src="@drawable/bg_home_indicator_unselected"/>
|
||||
|
||||
<ImageView android:id="@+id/indicator3"
|
||||
android:layout_width="4dp"
|
||||
android:layout_height="4dp"
|
||||
android:src="@drawable/bg_home_indicator_unselected"/>
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
52
live/src/main/res/layout/diy_toast_view.xml
Normal file
@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="184dp"
|
||||
android:layout_height="55dp"
|
||||
android:background="@mipmap/black_tip_bg"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="completing mission 1!"
|
||||
android:textColor="#fffff69f"
|
||||
android:textSize="12sp"
|
||||
/>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="GET"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="12sp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="10"
|
||||
android:textColor="#ffffffff"
|
||||
android:drawableLeft="@mipmap/icon_live_beans"
|
||||
android:textSize="12sp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="100"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="12sp"
|
||||
android:drawableLeft="@mipmap/icon_live_exp"
|
||||
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
@ -70,10 +70,12 @@
|
||||
|
||||
<com.ms.banner.Banner
|
||||
android:id="@+id/banner3"
|
||||
android:layout_width="68dp"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="68dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
app:delay_time="5000"
|
||||
app:indicator_drawable_selected="@drawable/bg_home_indicator_selected"
|
||||
app:indicator_drawable_unselected="@drawable/bg_home_indicator_unselected"
|
||||
app:indicator_height="8dp"
|
||||
app:indicator_width="8dp" />
|
||||
|
||||
@ -453,7 +455,6 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="40dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@mipmap/black_bg"
|
||||
app:autoPlay="true"/>
|
||||
|
||||
|
||||
|
BIN
live/src/main/res/mipmap-xhdpi/black_tip_bg.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
live/src/main/res/mipmap-xhdpi/icon_live_beans.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
live/src/main/res/mipmap-xhdpi/icon_live_exp.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
live/src/main/res/mipmap-xhdpi/live_gift_light_bg.png
Normal file
After Width: | Height: | Size: 4.1 KiB |
BIN
live/src/main/res/mipmap-xhdpi/live_mission_box.png
Normal file
After Width: | Height: | Size: 29 KiB |
@ -26,6 +26,7 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.android.billingclient.api.Purchase;
|
||||
@ -65,6 +66,7 @@ import com.yunbao.common.utils.GoogleBillingUtil;
|
||||
import com.yunbao.common.utils.LocationUtil;
|
||||
import com.yunbao.common.utils.OnGoogleBillingListener;
|
||||
import com.yunbao.common.utils.ProcessResultUtil;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.VersionUtil;
|
||||
@ -112,6 +114,7 @@ import io.rong.imlib.RongIMClient;
|
||||
|
||||
import static com.yunbao.common.CommonAppContext.isReady;
|
||||
|
||||
@Route(path = RouteUtil.PATH_MAIN)
|
||||
public class MainActivity extends AbsActivity implements MainAppBarLayoutListener {
|
||||
|
||||
public static RelativeLayout rt_main_tab;
|
||||
@ -576,7 +579,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
super.onResume();
|
||||
if (mFristLoad) {
|
||||
mFristLoad = false;
|
||||
getLocation();
|
||||
// getLocation();
|
||||
loadPageData(0, false);
|
||||
if (mHomeLiveViewHolder != null) {
|
||||
mHomeLiveViewHolder.setShowed(true);
|
||||
|
@ -39,7 +39,7 @@ public class OneLoginActivity extends AbsActivity {
|
||||
EditText edit_user,edit_code;
|
||||
Button btn_enter;
|
||||
|
||||
|
||||
public static OneLoginActivity act;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
@ -65,6 +65,7 @@ public class OneLoginActivity extends AbsActivity {
|
||||
@Override
|
||||
protected void main() {
|
||||
super.main();
|
||||
act = this;
|
||||
avatar = (RoundedImageView)findViewById(R.id.avatar);
|
||||
edit_user = (EditText)findViewById(R.id.edit_user);
|
||||
edit_code = (EditText)findViewById(R.id.edit_code);
|
||||
|
@ -22,6 +22,7 @@ import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.HttpClient;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.activity.LiveAudienceActivity;
|
||||
@ -31,6 +32,7 @@ import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.activity.EntryActivity;
|
||||
import com.yunbao.main.activity.MainActivity;
|
||||
import com.yunbao.main.activity.OneLoginActivity;
|
||||
|
||||
import static com.yunbao.common.CommonAppContext.logger;
|
||||
import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics;
|
||||
@ -118,12 +120,16 @@ public class OneLoginDialog extends AbsDialogFragment {
|
||||
.execute(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
dismiss();
|
||||
if (info[0]!=null) {
|
||||
JSONObject obj = JSON.parseObject(info[0]);
|
||||
CommonAppConfig.isNewUser = true;
|
||||
MainActivity.forward(getContext(), false);
|
||||
gotoLive(obj.getString("anchor_id"));
|
||||
IMLoginManager.get(mContext).setisNewUserOne(true);
|
||||
// OneLoginActivity.act.finish();
|
||||
}else{
|
||||
MainActivity.forward(getContext(), false);
|
||||
// OneLoginActivity.act.finish();
|
||||
}
|
||||
}
|
||||
});
|
||||
|