This commit is contained in:
18142669586 2022-07-27 11:21:34 +08:00
parent d4cc6f747b
commit 133e45bc63
18 changed files with 313 additions and 102 deletions

View File

@ -73,6 +73,7 @@
<string name="complete">Complete</string> <string name="complete">Complete</string>
<string name="follow_anchor">Follow\nanchor</string> <string name="follow_anchor">Follow\nanchor</string>
<string name="light_up_room">light UP\nRoom</string> <string name="light_up_room">light UP\nRoom</string>
<string name="completing_mission">completing mission</string>
@ -153,6 +154,7 @@
<string name="fans">Fans</string> <string name="fans">Fans</string>
<string name="no_mic_opn">Opps… The anchor did not open the voice link</string> <string name="no_mic_opn">Opps… The anchor did not open the voice link</string>
<string name="fanss">Fans</string> <string name="fanss">Fans</string>
<string name="free">Free</string>
<string name="fans_my_fans">My fans</string> <string name="fans_my_fans">My fans</string>
<string name="fans_ta_fans">TA fans</string> <string name="fans_ta_fans">TA fans</string>
<string name="fans_no_fans">You don\'t have fans yet</string> <string name="fans_no_fans">You don\'t have fans yet</string>
@ -166,6 +168,8 @@
<string name="guard_buy_2">Open guard</string> <string name="guard_buy_2">Open guard</string>
<string name="guard_buy_3">Renewal Guardian</string> <string name="guard_buy_3">Renewal Guardian</string>
<string name="guard_my">My</string> <string name="guard_my">My</string>
<string name="get">GET</string>
<string name="only_one">Only one can be given away~</string>
<string name="guard_guard">Guard</string> <string name="guard_guard">Guard</string>
<string name="guard_week_con">Contribution this week</string> <string name="guard_week_con">Contribution this week</string>
<string name="guard_no_data">Become the girst Guard of he/she</string> <string name="guard_no_data">Become the girst Guard of he/she</string>

View File

@ -61,9 +61,11 @@
<string name="give_a_free_gift">赠送一个\n免费礼物</string> <string name="give_a_free_gift">赠送一个\n免费礼物</string>
<string name="incomplete">未完成</string> <string name="incomplete">未完成</string>
<string name="complete">完成</string> <string name="complete">完成</string>
<string name="follow_anchor">關注主播</string> <string name="follow_anchor">任意關注\n一名主播</string>
<string name="light_up_room">點亮直播間</string> <string name="light_up_room">雙擊點亮\n 直播間</string>
<string name="completing_mission">恭喜你完成任務</string>
<string name="get">获得</string>
<string name="only_one">這個禮物只能送一個哦~</string>
<string name="edit_profile_birthday">生日</string> <string name="edit_profile_birthday">生日</string>
<string name="edit_profile_sex">性別</string> <string name="edit_profile_sex">性別</string>
<string name="apply_for_lianmai">申请連麥</string> <string name="apply_for_lianmai">申请連麥</string>
@ -102,6 +104,8 @@
<string name="no_mic_opn">Opps… 主播沒有開啟語音連麥</string> <string name="no_mic_opn">Opps… 主播沒有開啟語音連麥</string>
<string name="fanss">粉絲</string> <string name="fanss">粉絲</string>
<string name="noble">貴族</string> <string name="noble">貴族</string>
<string name="free">免費贈送</string>
<string name="fans_my_fans">我的粉絲</string> <string name="fans_my_fans">我的粉絲</string>
<string name="fans_ta_fans">TA的粉絲</string> <string name="fans_ta_fans">TA的粉絲</string>
<string name="fans_no_fans">你還沒有粉絲</string> <string name="fans_no_fans">你還沒有粉絲</string>

View File

@ -332,7 +332,7 @@ public class LiveAudienceActivity extends LiveActivity {
@Override @Override
public void onTick(long millisUntilFinished) { public void onTick(long millisUntilFinished) {
if (IMLoginManager.get(mContext).isisNewUserOne() == true && timeIndex == 5) { if (IMLoginManager.get(mContext).isisNewUserOne() == true && timeIndex == 10) {
NewUserDialog fragment1 = new NewUserDialog(); NewUserDialog fragment1 = new NewUserDialog();
fragment1.show(((LiveActivity) mContext).getSupportFragmentManager(), "NewUserDialog"); fragment1.show(((LiveActivity) mContext).getSupportFragmentManager(), "NewUserDialog");
} }

View File

@ -4,6 +4,8 @@ import android.content.Context;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.graphics.Color;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
@ -190,6 +192,12 @@ public class LiveGiftAdapter extends RecyclerView.Adapter<LiveGiftAdapter.Vh> {
mPayico.setImageResource(R.mipmap.diamond); mPayico.setImageResource(R.mipmap.diamond);
} }
mPrice.setText(bean.getPrice()); mPrice.setText(bean.getPrice());
if (IMLoginManager.get(mContext).isNewUserGif() == false && position == 0 && bean.getTag() != null) {
mPayico.setVisibility(View.GONE);
mPrice.setText(R.string.free);
mPrice.setTextColor(Color.parseColor("#FFF269"));
}
expire.setVisibility(View.GONE); expire.setVisibility(View.GONE);
if(bean.getEnd_time()!=null){ if(bean.getEnd_time()!=null){
expire.setVisibility(View.VISIBLE); expire.setVisibility(View.VISIBLE);

View File

@ -21,6 +21,7 @@ import android.widget.PopupWindow;
import android.widget.RadioButton; import android.widget.RadioButton;
import android.widget.RadioGroup; import android.widget.RadioGroup;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;
import com.adjust.sdk.Adjust; import com.adjust.sdk.Adjust;
import com.adjust.sdk.AdjustEvent; import com.adjust.sdk.AdjustEvent;
@ -187,6 +188,7 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
} }
} else { } else {
//点击包裹展示包裹列表 //点击包裹展示包裹列表
mCurrentId = 1; mCurrentId = 1;
loadWrapListData(); loadWrapListData();
@ -422,8 +424,8 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
} }
private void showGiftList(List<LiveGiftBean> list) { private void showGiftList(List<LiveGiftBean> list) {
ToastUtil.show( IMLoginManager.get(mContext).isNewUserGif()+"");
if( IMLoginManager.get(mContext).isNewUserGif() == false) { if( IMLoginManager.get(mContext).isNewUserGif() == false) {
mWishGiftId = ""+bean1.getId();
list.add(0,bean1); list.add(0,bean1);
} }
mGiftList = list; mGiftList = list;
@ -674,15 +676,21 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
*/ */
public void sendGift() { public void sendGift() {
if(mLiveGiftBean.getTag()!=null){ if(mLiveGiftBean.getTag()!=null){
LiveHttpUtil.setFrontTask("sendgift", mLiveUid,new HttpCallback() { if(mCount.equals("1")) {
LiveHttpUtil.setFrontTask("sendgift", mLiveUid, new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {
if(code == 0){ EventBus.getDefault().post("stop_svga_new_user_gif");
EventBus.getDefault().post("stop_new_user_gif"); EventBus.getDefault().post("stop_new_user_gif");
if (code == 0) {
EventBus.getDefault().post("stop_new_user_gif1");
} }
dismiss(); dismiss();
} }
}); });
}else {
ToastUtil.show(R.string.only_one);
}
}else { }else {
if (TextUtils.isEmpty(mLiveUid) || TextUtils.isEmpty(mStream) || mLiveGiftBean == null) { if (TextUtils.isEmpty(mLiveUid) || TextUtils.isEmpty(mStream) || mLiveGiftBean == null) {
return; return;

View File

@ -14,6 +14,8 @@ import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction; import androidx.fragment.app.FragmentTransaction;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yunbao.common.dialog.AbsDialogFragment; import com.yunbao.common.dialog.AbsDialogFragment;
import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
@ -90,18 +92,25 @@ public class NewUserDialog extends AbsDialogFragment {
@Override @Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) { public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState); super.onActivityCreated(savedInstanceState);
ImageView btn_close = (ImageView) mRootView.findViewById(R.id.btn_close); TextView gold = (TextView) mRootView.findViewById(R.id.gold);
TextView exp = (TextView) mRootView.findViewById(R.id.exp);
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("reward_all");
gold.setText(obj.getString("gold"));
exp.setText(obj.getString("experience"));
}});
TextView btn_confirm = (TextView) mRootView.findViewById(R.id.btn_confirm); TextView btn_confirm = (TextView) mRootView.findViewById(R.id.btn_confirm);
btn_confirm.setOnClickListener(new View.OnClickListener() { btn_confirm.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
EventBus.getDefault().post("showBanner"); EventBus.getDefault().post("showBanner");
EventBus.getDefault().post("svga_new_user_gif"); EventBus.getDefault().post("svga_new_user_gif");
countDownTimer.cancel(); countDownTimer.cancel();
dismiss(); dismiss();
} }

View File

@ -117,6 +117,7 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
private View btnWishList; private View btnWishList;
private View btnTurnTable; private View btnTurnTable;
private View btnEvent; private View btnEvent;
private View btnEvent3;
private View btn_onecz_event; private View btn_onecz_event;
private ImageView imgEvent; private ImageView imgEvent;
private String eventUrl; private String eventUrl;
@ -131,7 +132,7 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
public static String link = ""; public static String link = "";
LinearLayout btn_event2; LinearLayout btn_event2;
public static LiveGiftBean bean1 = new LiveGiftBean(); public static LiveGiftBean bean1 = new LiveGiftBean();
String gold,experience;
@Subscribe(threadMode = ThreadMode.MAIN) @Subscribe(threadMode = ThreadMode.MAIN)
public void onUpdata(String str) { public void onUpdata(String str) {
@ -140,12 +141,40 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
} else if ("stop_svga_new_user_double".equals(str)) { } else if ("stop_svga_new_user_double".equals(str)) {
mBannerList3.get(2).setLink("1"); mBannerList3.get(2).setLink("1");
mBanner3.update(mBannerList3); mBanner3.update(mBannerList3);
if(mBannerList3.get(0).getLink().equals("1")){
if(mBannerList3.get(1).getLink().equals("1")){
if(mBannerList3.get(2).getLink().equals("1")){
btnEvent3.setVisibility(View.GONE);
}
}
}
} else if ("stop_svga_new_user_follow".equals(str)) { } else if ("stop_svga_new_user_follow".equals(str)) {
mBannerList3.get(1).setLink("1"); mBannerList3.get(1).setLink("1");
mBanner3.update(mBannerList3); mBanner3.update(mBannerList3);
if(mBannerList3.get(0).getLink().equals("1")){
if(mBannerList3.get(1).getLink().equals("1")){
if(mBannerList3.get(2).getLink().equals("1")){
btnEvent3.setVisibility(View.GONE);
}
}
}
} else if ("stop_new_user_gif".equals(str)) { } else if ("stop_new_user_gif".equals(str)) {
IMLoginManager.get(mContext).setNewUserGif(true);
mBannerList3.get(0).setLink("1"); mBannerList3.get(0).setLink("1");
mBanner3.update(mBannerList3); mBanner3.update(mBannerList3);
if(mBannerList3.get(0).getLink().equals("1")){
if(mBannerList3.get(1).getLink().equals("1")){
if(mBannerList3.get(2).getLink().equals("1")){
btnEvent3.setVisibility(View.GONE);
}
}
}
}else if("stop_svga_new_user_double1".equals(str)){
publicToast(mContext);
}else if ("stop_svga_new_user_follow1".equals(str)) {
publicToast(mContext);
}else if ("stop_new_user_gif1".equals(str)) {
publicToast(mContext);
} }
} }
@ -155,16 +184,19 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
// 1加载布局 // 1加载布局
View view = LayoutInflater.from(content).inflate(R.layout.diy_toast_view,null); View view = LayoutInflater.from(content).inflate(R.layout.diy_toast_view,null);
// 2获取组件 // 2获取组件
// TextView tv_toast = view.findViewById(R.id.textView13); TextView gold_text = view.findViewById(R.id.gold);
//// 3设置组件内容 // 3设置组件内容
// tv_toast.setText(content); gold_text.setText(gold);
TextView exp_txt = view.findViewById(R.id.exp);
// 3设置组件内容
exp_txt.setText(experience);
// 4将获取的view视图设置进Toast对象中 // 4将获取的view视图设置进Toast对象中
toast.setView(view); toast.setView(view);
// 5设置toast位置 // 5设置toast位置
// 5-1Gravity.CENTER | Gravity.TOP是设置toast在中间上方显示 // 5-1Gravity.CENTER | Gravity.TOP是设置toast在中间上方显示
// 5-2300 表示距离左边300dp // 5-2300 表示距离左边300dp
// 5-3250 表示距离上方250dp // 5-3250 表示距离上方250dp
toast.setGravity(Gravity.CENTER | Gravity.TOP,300,250); toast.setGravity(Gravity.CENTER ,Gravity.CENTER ,Gravity.CENTER );
// 6显示toast // 6显示toast
toast.show(); toast.show();
} }
@ -220,7 +252,6 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
mIsAnchor = isAnchor; mIsAnchor = isAnchor;
mLiveSdk = liveSdk; mLiveSdk = liveSdk;
Log.e("ry", "画面来了"); Log.e("ry", "画面来了");
publicToast(mContext);
mSmallContainer = linkMicViewHolder.getSmallContainer(); mSmallContainer = linkMicViewHolder.getSmallContainer();
if (!isAnchor && root != null) { if (!isAnchor && root != null) {
View btnLinkMic = root.findViewById(R.id.btn_link_mic); View btnLinkMic = root.findViewById(R.id.btn_link_mic);
@ -231,6 +262,7 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
btnWishList.setOnClickListener(this); btnWishList.setOnClickListener(this);
btnTurnTable.setOnClickListener(this); btnTurnTable.setOnClickListener(this);
btnEvent = root.findViewById(R.id.btn_event); btnEvent = root.findViewById(R.id.btn_event);
btnEvent3 = root.findViewById(R.id.btn_event3);
mBanner1 = (Banner) root.findViewById(R.id.banner1); mBanner1 = (Banner) root.findViewById(R.id.banner1);
mBanner2 = (Banner) root.findViewById(R.id.banner2); mBanner2 = (Banner) root.findViewById(R.id.banner2);
mBanner3 = (Banner) root.findViewById(R.id.banner3); mBanner3 = (Banner) root.findViewById(R.id.banner3);
@ -269,23 +301,29 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
JSONObject obj = old_obj.getJSONObject("task"); JSONObject obj = old_obj.getJSONObject("task");
JSONObject obj1 = old_obj.getJSONObject("gift"); JSONObject obj1 = old_obj.getJSONObject("gift");
JSONObject reward_one = old_obj.getJSONObject("reward_one");
bean1.setSwf(obj1.getString("swf")); gold = reward_one.getString("gold");
experience = reward_one.getString("experience");
bean1.setSwf("111");
bean1.setChecked(false); bean1.setChecked(false);
bean1.setIcon(obj1.getString("gifticon")); bean1.setIcon(obj1.getString("gifticon"));
bean1.setId(obj1.getIntValue("id")); bean1.setId(obj1.getIntValue("id"));
bean1.setName(obj1.getString("giftname")); bean1.setName(obj1.getString("giftname"));
bean1.setTag("1"); bean1.setTag("1");
if( IMLoginManager.get(mContext).isisNewUserOne() == false) {
if(obj.getString("sendgift").equals("0")) {
EventBus.getDefault().post("svga_new_user_gif");
}
}
BannerBean banner3Bean = new BannerBean(); BannerBean banner3Bean = new BannerBean();
banner3Bean.setImageUrl("https://qny.shayucm.com/live_Mission_box.png"); banner3Bean.setImageUrl("https://qny.shayucm.com/live_Mission_box.png");
banner3Bean.setLink(obj.getString("sendgift")); banner3Bean.setLink(obj.getString("sendgift"));
mBannerList3.add(banner3Bean); mBannerList3.add(banner3Bean);
if(obj.getString("sendgift").equals("0")){
EventBus.getDefault().post("svga_new_user_gif");
}
BannerBean banner3Bean1 = new BannerBean(); BannerBean banner3Bean1 = new BannerBean();
banner3Bean1.setImageUrl("https://qny.shayucm.com/live_Mission_box.png"); banner3Bean1.setImageUrl("https://qny.shayucm.com/live_Mission_box.png");
@ -897,6 +935,7 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
} }
private void showBanner3() { private void showBanner3() {
btnEvent3.setVisibility(View.VISIBLE);
if (mBannerList3 == null || mBannerList3.size() == 0 || mBanner3 == null) { if (mBannerList3 == null || mBannerList3.size() == 0 || mBanner3 == null) {
return; return;
} }
@ -910,7 +949,7 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
if (mBannerList3 != null) { if (mBannerList3 != null) {
if (mBannerList3.get(p).getLink().equals("0")) { if (mBannerList3.get(p).getLink().equals("0")) {
if (p == 0) { if (p == 0) {
((LiveAudienceActivity) mContext).openGiftWindow("1530", "1"); ((LiveAudienceActivity) mContext).openGiftWindow(""+bean1.getId(), "1");
EventBus.getDefault().post("svga_new_user_gif"); EventBus.getDefault().post("svga_new_user_gif");
} else if (p == 1) { } else if (p == 1) {
EventBus.getDefault().post("svga_new_user_follow"); EventBus.getDefault().post("svga_new_user_follow");

View File

@ -1,6 +1,9 @@
package com.yunbao.live.socket; package com.yunbao.live.socket;
import android.util.Log; import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Toast;
import com.adjust.sdk.Adjust; import com.adjust.sdk.Adjust;
import com.adjust.sdk.AdjustEvent; import com.adjust.sdk.AdjustEvent;
@ -12,6 +15,7 @@ import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.utils.WordUtil; import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R; import com.yunbao.live.R;
import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.live.http.LiveHttpUtil;
import com.yunbao.live.views.LiveRoomViewHolder;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
@ -197,6 +201,9 @@ public class SocketRyChatUtil {
LiveHttpUtil.setFrontTask("illumine", new HttpCallback() { LiveHttpUtil.setFrontTask("illumine", new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {
if(code == 0) {
EventBus.getDefault().post("stop_svga_new_user_double1");
}
} }
}); });

View File

@ -79,10 +79,10 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
svga_new_user_follow.setVisibility(View.GONE); svga_new_user_follow.setVisibility(View.GONE);
svga_new_user_follow.stopAnimation(); svga_new_user_follow.stopAnimation();
svga_new_user_follow.clear(); svga_new_user_follow.clear();
}else if("stop_svga_new_user_follow".equals(str)) { }else if("stop_svga_new_user_gif".equals(str)) {
svga_new_user_follow.setVisibility(View.GONE); svga_new_user_gif.setVisibility(View.GONE);
svga_new_user_follow.stopAnimation(); svga_new_user_gif.stopAnimation();
svga_new_user_follow.clear(); svga_new_user_gif.clear();
} }
} }
@ -152,7 +152,12 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
svga_new_user_gif = (SVGAImageView)findViewById(R.id.svga_new_user_gif); 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_double = (SVGAImageView)findViewById(R.id.svga_new_user_double);
svga_new_user_follow = (SVGAImageView)findViewById(R.id.svga_new_user_follow); svga_new_user_follow = (SVGAImageView)findViewById(R.id.svga_new_user_follow);
svga_new_user_double.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
((LiveAudienceActivity) mContext).light();
}
});
findViewById(R.id.btn_mic).setOnClickListener(new View.OnClickListener() { findViewById(R.id.btn_mic).setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {

View File

@ -8,6 +8,7 @@ import android.os.Message;
import android.os.SystemClock; import android.os.SystemClock;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.WindowManager; import android.view.WindowManager;
@ -16,6 +17,7 @@ import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
@ -105,7 +107,7 @@ import static com.yunbao.live.activity.LiveAudienceActivity.countDownTimer;
*/ */
public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickListener { public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickListener {
private static Context Contexts; public static Context Contexts;
private int mOffsetY; private int mOffsetY;
private ViewGroup mRoot; private ViewGroup mRoot;
LinearLayout gif_view; LinearLayout gif_view;
@ -1197,7 +1199,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
LiveHttpUtil.setFrontTask("attent", new HttpCallback() { LiveHttpUtil.setFrontTask("attent", new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {
if(code == 0){
EventBus.getDefault().post("stop_svga_new_user_follow1");
}
} }
}); });

View File

@ -1,9 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="67dp" android:layout_width="50dp"
android:layout_height="90dp" android:layout_height="70dp"
android:background="@mipmap/live_mission_box"
android:orientation="vertical"> android:orientation="vertical">
<RelativeLayout <RelativeLayout

View File

@ -26,7 +26,7 @@
<TextView <TextView
android:layout_width="190dp" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/newcomer" android:text="@string/newcomer"
android:textColor="#ff1a1a1a" android:textColor="#ff1a1a1a"
@ -35,12 +35,11 @@
android:gravity="center" android:gravity="center"
android:textSize="18sp" android:textSize="18sp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_marginBottom="20dp"
/> />
<RelativeLayout android:id="@+id/btn_rose" <RelativeLayout android:id="@+id/btn_rose"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="60dp" android:layout_height="70dp"
android:layout_marginLeft="22dp" android:layout_marginLeft="22dp"
android:layout_marginRight="22dp" android:layout_marginRight="22dp"
android:background="@mipmap/freegift_box"> android:background="@mipmap/freegift_box">
@ -66,10 +65,10 @@
<RelativeLayout android:id="@+id/aa" <RelativeLayout android:id="@+id/aa"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="40dp" android:layout_height="50dp"
android:layout_weight="1" android:layout_weight="1"
android:layout_marginLeft="22dp" android:layout_marginLeft="22dp"
android:layout_marginRight="22dp" android:layout_marginRight="5dp"
android:background="@mipmap/jindou_box"> android:background="@mipmap/jindou_box">
<LinearLayout <LinearLayout
@ -90,10 +89,10 @@
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
/> />
<TextView <TextView android:id="@+id/gold"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="20" android:text="0"
android:textColor="#fffff69f" android:textColor="#fffff69f"
android:textSize="12sp" android:textSize="12sp"
/> />
@ -103,9 +102,9 @@
<RelativeLayout android:id="@+id/aa1" <RelativeLayout android:id="@+id/aa1"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="40dp" android:layout_height="50dp"
android:layout_weight="1" android:layout_weight="1"
android:layout_marginLeft="22dp" android:layout_marginLeft="5dp"
android:layout_marginRight="22dp" android:layout_marginRight="22dp"
android:background="@mipmap/exp_box"> android:background="@mipmap/exp_box">
@ -127,10 +126,10 @@
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
/> />
<TextView <TextView android:id="@+id/exp"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="20" android:text="0"
android:textColor="#fffff69f" android:textColor="#fffff69f"
android:textSize="12sp" android:textSize="12sp"
/> />

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="184dp" android:layout_width="184dp"
@ -8,42 +7,47 @@
android:background="@mipmap/black_tip_bg" android:background="@mipmap/black_tip_bg"
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="completing mission 1!" android:text="@string/completing_mission"
android:layout_marginTop="3dp"
android:textColor="#fffff69f" android:textColor="#fffff69f"
android:textSize="12sp" android:textSize="12sp" />
/>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:gravity="center" android:gravity="center"
android:layout_marginBottom="5dp"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="GET"
android:textColor="#ffffffff"
android:textSize="12sp"
/>
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/get"
android:textColor="#ffffffff"
android:textSize="12sp" />
<TextView android:id="@+id/gold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:drawableLeft="@mipmap/icon_live_beans"
android:text="10" android:text="10"
android:textColor="#ffffffff" android:textColor="#ffffffff"
android:drawableLeft="@mipmap/icon_live_beans" android:textSize="12sp" />
android:textSize="12sp"
/>
<TextView <TextView android:id="@+id/exp"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:drawableLeft="@mipmap/icon_live_exp"
android:text="100" android:text="100"
android:textColor="#ffffffff" android:textColor="#ffffffff"
android:textSize="12sp" android:textSize="12sp"
android:drawableLeft="@mipmap/icon_live_exp"
/> />
</LinearLayout> </LinearLayout>

View File

@ -60,19 +60,21 @@
<LinearLayout <LinearLayout
android:id="@+id/btn_event3" android:id="@+id/btn_event3"
android:layout_width="68dp" android:layout_width="67dp"
android:layout_height="68dp" android:layout_height="90dp"
android:layout_gravity="right" android:layout_gravity="right"
android:layout_marginRight="10dp" android:layout_marginRight="10dp"
android:layout_marginBottom="18dp" android:layout_marginBottom="18dp"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:background="@mipmap/live_mission_box"
android:visibility="gone"
android:orientation="vertical"> android:orientation="vertical">
<com.ms.banner.Banner <com.ms.banner.Banner
android:id="@+id/banner3" android:id="@+id/banner3"
android:layout_width="65dp" android:layout_width="match_parent"
android:layout_height="68dp" android:layout_height="match_parent"
android:layout_marginBottom="5dp" android:layout_marginTop="5dp"
app:delay_time="5000" app:delay_time="5000"
app:indicator_drawable_selected="@drawable/bg_home_indicator_selected" app:indicator_drawable_selected="@drawable/bg_home_indicator_selected"
app:indicator_drawable_unselected="@drawable/bg_home_indicator_unselected" app:indicator_drawable_unselected="@drawable/bg_home_indicator_unselected"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -72,6 +72,7 @@ import com.yunbao.common.bean.LoginData;
import com.yunbao.common.bean.UserBean; import com.yunbao.common.bean.UserBean;
import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.CommonHttpUtil;
import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.HttpClient;
import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager; import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
@ -235,7 +236,7 @@ public class EntryActivity extends AppCompatActivity {
CommonHttpUtil.setAdvertisingChannels("tyqsyf", new HttpCallback() { CommonHttpUtil.setAdvertisingChannels("tyqsyf", new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {
if(code == 0) { if (code == 0) {
mFirebaseAnalytics.logEvent("FS_registration", null); mFirebaseAnalytics.logEvent("FS_registration", null);
logger.logEvent("FB_registration"); logger.logEvent("FB_registration");
} }
@ -271,7 +272,7 @@ public class EntryActivity extends AppCompatActivity {
CommonHttpUtil.setAdvertisingChannels("umk7ri", new HttpCallback() { CommonHttpUtil.setAdvertisingChannels("umk7ri", new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {
if(code == 0) { if (code == 0) {
mFirebaseAnalytics.logEvent("FS_click_fb", null); mFirebaseAnalytics.logEvent("FS_click_fb", null);
logger.logEvent("FB_click_fb"); logger.logEvent("FB_click_fb");
} }
@ -310,7 +311,7 @@ public class EntryActivity extends AppCompatActivity {
CommonHttpUtil.setAdvertisingChannels("iqd6b7", new HttpCallback() { CommonHttpUtil.setAdvertisingChannels("iqd6b7", new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {
if(code == 0) { if (code == 0) {
mFirebaseAnalytics.logEvent("FS_click_google", null); mFirebaseAnalytics.logEvent("FS_click_google", null);
logger.logEvent("FB_click_google"); logger.logEvent("FB_click_google");
} }
@ -329,7 +330,7 @@ public class EntryActivity extends AppCompatActivity {
CommonHttpUtil.setAdvertisingChannels("le2qca", new HttpCallback() { CommonHttpUtil.setAdvertisingChannels("le2qca", new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {
if(code == 0) { if (code == 0) {
mFirebaseAnalytics.logEvent("FS_click_twitter", null); mFirebaseAnalytics.logEvent("FS_click_twitter", null);
logger.logEvent("FB_click_twitter"); logger.logEvent("FB_click_twitter");
} }
@ -378,7 +379,7 @@ public class EntryActivity extends AppCompatActivity {
CommonHttpUtil.setAdvertisingChannels("gev462", new HttpCallback() { CommonHttpUtil.setAdvertisingChannels("gev462", new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {
if(code == 0) { if (code == 0) {
mFirebaseAnalytics.logEvent("FS_click_line", null); mFirebaseAnalytics.logEvent("FS_click_line", null);
logger.logEvent("FB_click_line"); logger.logEvent("FB_click_line");
} }
@ -591,24 +592,24 @@ public class EntryActivity extends AppCompatActivity {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {
onLoginSuccess(code, msg, info); onLoginSuccess(code, msg, info);
if(code == 0){ if (code == 0) {
//完成第三方登录 //完成第三方登录
if(mLoginType.equals("twitter")){ if (mLoginType.equals("twitter")) {
AdjustEvent adjustEvent1 = new AdjustEvent("winf6e"); AdjustEvent adjustEvent1 = new AdjustEvent("winf6e");
Adjust.trackEvent(adjustEvent1); Adjust.trackEvent(adjustEvent1);
mFirebaseAnalytics.logEvent("FS_log_twitter", null); mFirebaseAnalytics.logEvent("FS_log_twitter", null);
logger.logEvent("FB_log_twitter"); logger.logEvent("FB_log_twitter");
}else if(mLoginType.equals("facebook")){ } else if (mLoginType.equals("facebook")) {
AdjustEvent adjustEvent1 = new AdjustEvent("oywoff"); AdjustEvent adjustEvent1 = new AdjustEvent("oywoff");
Adjust.trackEvent(adjustEvent1); Adjust.trackEvent(adjustEvent1);
mFirebaseAnalytics.logEvent("FS_log_fb", null); mFirebaseAnalytics.logEvent("FS_log_fb", null);
logger.logEvent("FB_log_fb"); logger.logEvent("FB_log_fb");
}else if(mLoginType.equals("google")){ } else if (mLoginType.equals("google")) {
AdjustEvent adjustEvent1 = new AdjustEvent("1cm8gl"); AdjustEvent adjustEvent1 = new AdjustEvent("1cm8gl");
Adjust.trackEvent(adjustEvent1); Adjust.trackEvent(adjustEvent1);
mFirebaseAnalytics.logEvent("FS_log_google", null); mFirebaseAnalytics.logEvent("FS_log_google", null);
logger.logEvent("FB_log_google"); logger.logEvent("FB_log_google");
}else if(mLoginType.equals("line")){ } else if (mLoginType.equals("line")) {
AdjustEvent adjustEvent1 = new AdjustEvent("71p74r"); AdjustEvent adjustEvent1 = new AdjustEvent("71p74r");
Adjust.trackEvent(adjustEvent1); Adjust.trackEvent(adjustEvent1);
mFirebaseAnalytics.logEvent("FS_log_line", null); mFirebaseAnalytics.logEvent("FS_log_line", null);
@ -618,7 +619,7 @@ public class EntryActivity extends AppCompatActivity {
CommonHttpUtil.setAdvertisingChannels("1com4k", new HttpCallback() { CommonHttpUtil.setAdvertisingChannels("1com4k", new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {
if(code == 0) { if (code == 0) {
mFirebaseAnalytics.logEvent("FS_createdRole", null); mFirebaseAnalytics.logEvent("FS_createdRole", null);
logger.logEvent("FB_createdRole"); logger.logEvent("FB_createdRole");
} }
@ -672,53 +673,53 @@ public class EntryActivity extends AppCompatActivity {
Adjust.trackEvent(adjustEvent); Adjust.trackEvent(adjustEvent);
//完成第三方登录 //完成第三方登录
if(mLoginType.equals("twitter")){ if (mLoginType.equals("twitter")) {
AdjustEvent adjustEvent1 = new AdjustEvent("ea6lld"); AdjustEvent adjustEvent1 = new AdjustEvent("ea6lld");
Adjust.trackEvent(adjustEvent1); Adjust.trackEvent(adjustEvent1);
CommonHttpUtil.setAdvertisingChannels("ea6lld", new HttpCallback() { CommonHttpUtil.setAdvertisingChannels("ea6lld", new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {
if(code == 0) { if (code == 0) {
mFirebaseAnalytics.logEvent("FS_reg_twitter", null); mFirebaseAnalytics.logEvent("FS_reg_twitter", null);
logger.logEvent("FB_reg_twitter"); logger.logEvent("FB_reg_twitter");
} }
} }
}); });
}else if(mLoginType.equals("facebook")){ } else if (mLoginType.equals("facebook")) {
AdjustEvent adjustEvent1 = new AdjustEvent("5jbk95"); AdjustEvent adjustEvent1 = new AdjustEvent("5jbk95");
Adjust.trackEvent(adjustEvent1); Adjust.trackEvent(adjustEvent1);
CommonHttpUtil.setAdvertisingChannels("5jbk95", new HttpCallback() { CommonHttpUtil.setAdvertisingChannels("5jbk95", new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {
if(code == 0) { if (code == 0) {
mFirebaseAnalytics.logEvent("FS_reg_fb", null); mFirebaseAnalytics.logEvent("FS_reg_fb", null);
logger.logEvent("FB_reg_fb"); logger.logEvent("FB_reg_fb");
} }
} }
}); });
}else if(mLoginType.equals("google")){ } else if (mLoginType.equals("google")) {
AdjustEvent adjustEvent1 = new AdjustEvent("krap47"); AdjustEvent adjustEvent1 = new AdjustEvent("krap47");
Adjust.trackEvent(adjustEvent1); Adjust.trackEvent(adjustEvent1);
CommonHttpUtil.setAdvertisingChannels("krap47", new HttpCallback() { CommonHttpUtil.setAdvertisingChannels("krap47", new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {
if(code == 0) { if (code == 0) {
mFirebaseAnalytics.logEvent("FS_reg_google", null); mFirebaseAnalytics.logEvent("FS_reg_google", null);
logger.logEvent("FB_reg_google"); logger.logEvent("FB_reg_google");
} }
} }
}); });
}else if(mLoginType.equals("line")){ } else if (mLoginType.equals("line")) {
AdjustEvent adjustEvent1 = new AdjustEvent("uaacbn"); AdjustEvent adjustEvent1 = new AdjustEvent("uaacbn");
Adjust.trackEvent(adjustEvent1); Adjust.trackEvent(adjustEvent1);
CommonHttpUtil.setAdvertisingChannels("uaacbn", new HttpCallback() { CommonHttpUtil.setAdvertisingChannels("uaacbn", new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {
if(code == 0) { if (code == 0) {
mFirebaseAnalytics.logEvent("FS_reg_line", null); mFirebaseAnalytics.logEvent("FS_reg_line", null);
logger.logEvent("FB_reg_line"); logger.logEvent("FB_reg_line");
} }
@ -727,9 +728,23 @@ public class EntryActivity extends AppCompatActivity {
} }
if (CommonAppConfig.IS_GOOGLE_PLAY == true) { if (CommonAppConfig.IS_GOOGLE_PLAY == true) {
EntryActivity.this.startActivity(new Intent(EntryActivity.this, OneLoginActivity.class)); EntryActivity.this.startActivity(new Intent(EntryActivity.this, OneLoginActivity.class));
}else{ } else {
gotoLive("97714"); HttpClient.getInstance().post("Home.getRandJoinAnchor", "Home.getRandJoinAnchor")
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.execute(new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
if (info[0] != null) {
JSONObject obj = JSON.parseObject(info[0]);
MainActivity.forward(EntryActivity.this, false); MainActivity.forward(EntryActivity.this, false);
gotoLive(obj.getString("anchor_id"));
IMLoginManager.get(EntryActivity.this).setisNewUserOne(true);
} else {
MainActivity.forward(EntryActivity.this, false);
}
}
});
} }
} else { } else {
MainActivity.forward(EntryActivity.this, false); MainActivity.forward(EntryActivity.this, false);

View File

@ -38,11 +38,16 @@ import com.yunbao.common.bean.UserBean;
import com.yunbao.common.http.CommonHttpConsts; import com.yunbao.common.http.CommonHttpConsts;
import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.CommonHttpUtil;
import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.HttpClient;
import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager; import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil; import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.activity.LiveAudienceActivity;
import com.yunbao.live.bean.LiveBean;
import com.yunbao.live.http.LiveHttpUtil;
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
import com.yunbao.main.R; import com.yunbao.main.R;
import com.yunbao.main.event.RegSuccessEvent; import com.yunbao.main.event.RegSuccessEvent;
import com.yunbao.main.http.MainHttpConsts; import com.yunbao.main.http.MainHttpConsts;
@ -70,7 +75,7 @@ public class LoginActivity extends AbsActivity {
private View mBtnLogin; private View mBtnLogin;
private RecyclerView mRecyclerView; private RecyclerView mRecyclerView;
// private MobLoginUtil mLoginUtil; // private MobLoginUtil mLoginUtil;
private static boolean mFirstLogin;//是否是第一次登录 private boolean mFirstLogin;//是否是第一次登录
private static boolean mShowInvite;//显示邀请码弹窗 private static boolean mShowInvite;//显示邀请码弹窗
private static String mLoginType = Constants.MOB_PHONE;//登录方式 private static String mLoginType = Constants.MOB_PHONE;//登录方式
private String mPromoCode = "";//推广码 private String mPromoCode = "";//推广码
@ -217,21 +222,53 @@ public class LoginActivity extends AbsActivity {
}); });
hideKeyboard(mEditPwd); hideKeyboard(mEditPwd);
} }
/** /**
* 强隐键盘 * 强隐键盘
*
* @param view * @param view
*/ */
private void hideKeyboard(View view) { private void hideKeyboard(View view) {
InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE); InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(view.getWindowToken(), 0); imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
} }
//登录即代表同意服务和隐私条款 //登录即代表同意服务和隐私条款
private void forwardTip() { private void forwardTip() {
WebViewActivity.forward(mContext, HtmlConfig.LOGIN_PRIVCAY); WebViewActivity.forward(mContext, HtmlConfig.LOGIN_PRIVCAY);
} }
private LiveRoomCheckLivePresenter mCheckLivePresenter;
private void gotoLive(final String live_id) {
LiveHttpUtil.getLiveInfo(live_id, new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
if (code == 0 && info.length > 0) {
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
if (mCheckLivePresenter == null) {
mCheckLivePresenter = new LiveRoomCheckLivePresenter(LoginActivity.this, new LiveRoomCheckLivePresenter.ActionListener() {
@Override
public void onLiveRoomChanged(LiveBean liveBean, int liveType, int liveTypeVal, int liveSdk) {
if (liveBean == null) {
return;
}
LiveAudienceActivity.forward(LoginActivity.this, liveBean, liveType, liveTypeVal, "", 0, liveSdk);
}
});
}
mCheckLivePresenter.checkLive(liveBean);
} else {
MainActivity.forward(LoginActivity.this, false);
}
}
});
}
//登录成功 //登录成功
private static void onLoginSuccess(int code, String msg, String[] info) { private void onLoginSuccess(int code, String msg, String[] info) {
if (code == 0 && info.length > 0) { if (code == 0 && info.length > 0) {
JSONObject obj = JSON.parseObject(info[0]); JSONObject obj = JSON.parseObject(info[0]);
String uid = obj.getString("id"); String uid = obj.getString("id");
@ -258,7 +295,7 @@ public class LoginActivity extends AbsActivity {
/** /**
* 获取用户信息 * 获取用户信息
*/ */
private static void getBaseUserInfo() { private void getBaseUserInfo() {
MainHttpUtil.getBaseInfo(new CommonCallback<UserBean>() { MainHttpUtil.getBaseInfo(new CommonCallback<UserBean>() {
@Override @Override
public void callback(UserBean bean) { public void callback(UserBean bean) {
@ -267,9 +304,28 @@ public class LoginActivity extends AbsActivity {
mFirebaseAnalytics.logEvent("FS_login", null); mFirebaseAnalytics.logEvent("FS_login", null);
logger.logEvent("FB_login"); logger.logEvent("FB_login");
Adjust.trackEvent(adjustEvent1); Adjust.trackEvent(adjustEvent1);
MainActivity.forward(Contexts, mShowInvite); ToastUtil.show(mFirstLogin+"");
HttpClient.getInstance().post("Home.getRandJoinAnchor", "Home.getRandJoinAnchor")
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.execute(new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
if (info[0] != null && mFirstLogin == true) {
JSONObject obj = JSON.parseObject(info[0]);
MainActivity.forward(LoginActivity.this, false);
gotoLive(obj.getString("anchor_id"));
IMLoginManager.get(mContext).setisNewUserOne(true);
EntryActivity.activity.finish(); EntryActivity.activity.finish();
activity.finish(); activity.finish();
} else {
MainActivity.forward(LoginActivity.this, false);
EntryActivity.activity.finish();
activity.finish();
}
}
});
} }
}); });
} }

View File

@ -39,12 +39,17 @@ import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.bean.UserBean; import com.yunbao.common.bean.UserBean;
import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.CommonHttpUtil;
import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.HttpClient;
import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager; import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil; import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.activity.LiveAudienceActivity;
import com.yunbao.live.bean.LiveBean;
import com.yunbao.live.http.LiveHttpUtil;
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
import com.yunbao.main.R; import com.yunbao.main.R;
import com.yunbao.main.event.RegSuccessEvent; import com.yunbao.main.event.RegSuccessEvent;
import com.yunbao.main.http.MainHttpConsts; import com.yunbao.main.http.MainHttpConsts;
@ -490,6 +495,7 @@ public class RegisterActivity extends AbsActivity {
IMLoginManager.get(activity).setupLoginUser(model); IMLoginManager.get(activity).setupLoginUser(model);
//融云连接服务器 //融云连接服务器
RongcloudIMManager.connectIM(activity); RongcloudIMManager.connectIM(activity);
} else { } else {
ToastUtil.show(msg); ToastUtil.show(msg);
} }
@ -516,9 +522,22 @@ public class RegisterActivity extends AbsActivity {
} }
if (bean != null) { if (bean != null) {
if (mFirstLogin) { if (mFirstLogin) {
RecommendActivity.forward(mContext, mShowInvite); HttpClient.getInstance().post("Home.getRandJoinAnchor", "Home.getRandJoinAnchor")
.params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken())
.execute(new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
if (info[0] != null) {
JSONObject obj = JSON.parseObject(info[0]);
MainActivity.forward(RegisterActivity.this, false);
gotoLive(obj.getString("anchor_id"));
IMLoginManager.get(RegisterActivity.this).setisNewUserOne(true);
} else { } else {
MainActivity.forward(mContext, mShowInvite); MainActivity.forward(RegisterActivity.this, false);
}
}
});
} }
EventBus.getDefault().post(new RegSuccessEvent()); EventBus.getDefault().post(new RegSuccessEvent());
} }
@ -526,6 +545,35 @@ public class RegisterActivity extends AbsActivity {
}); });
} }
private LiveRoomCheckLivePresenter mCheckLivePresenter;
private void gotoLive(final String live_id) {
LiveHttpUtil.getLiveInfo(live_id, new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
if (code == 0 && info.length > 0) {
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
if (mCheckLivePresenter == null) {
mCheckLivePresenter = new LiveRoomCheckLivePresenter(RegisterActivity.this, new LiveRoomCheckLivePresenter.ActionListener() {
@Override
public void onLiveRoomChanged(LiveBean liveBean, int liveType, int liveTypeVal, int liveSdk) {
if (liveBean == null) {
return;
}
LiveAudienceActivity.forward(RegisterActivity.this, liveBean, liveType, liveTypeVal, "", 0, liveSdk);
}
});
}
mCheckLivePresenter.checkLive(liveBean);
} else {
MainActivity.forward(RegisterActivity.this, false);
}
}
});
}
@Subscribe(threadMode = ThreadMode.MAIN) @Subscribe(threadMode = ThreadMode.MAIN)
public void onRegSuccessEvent(RegSuccessEvent e) { public void onRegSuccessEvent(RegSuccessEvent e) {
finish(); finish();