Browse Source

Merge remote-tracking branch 'origin/sheep_develop' into sheep_develop

# Conflicts:
#	app/src/main/java/com/sheep/gamegroup/util/CommonUtil.java
liujiangyao 7 years ago
parent
commit
8198efcb75

+ 0 - 1
app/src/main/java/com/sheep/gamegroup/helper/TaskHelper.java

@@ -160,7 +160,6 @@ public class TaskHelper {
                 public void onClick(View view) {
                     reloadDataType = 1;//回来后将刷新界面数据 taskAcceptedEty
                     Jump2View.getInstance().goGameTaskDetailView(activity, release_task_id, orienteeringDetail.getGame_id(), 1);
-                    UMConfigUtils.IdEvent.TASK.commit(release_task_id);
                 }
             });
             return;

+ 3 - 0
app/src/main/java/com/sheep/gamegroup/util/CommonUtil.java

@@ -104,6 +104,8 @@ import rx.schedulers.Schedulers;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.LINK_SHARE;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.NEWBIE_TASK;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.QR_COPY;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.RECEIVE_AWARD_GAME_TASK;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.RESERVATION_GAME_TASK;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.XIAOMI_GAME_RECEIVE;
 import static com.sheep.gamegroup.view.adapter.TryMakeMoneyAdp.PUBLIC_TAG_PREFIX_TEXTVIEW_LIST;
 import static com.sheep.gamegroup.view.adapter.WelfareAdapter.TO_REFRESH;
@@ -1206,6 +1208,7 @@ public class CommonUtil {
     }
     //对---游戏任务中的领取奖励
     public void receiveAward(final Context context, final GameEntity gameEntity, final Action1<Integer> action1) {
+        RECEIVE_AWARD_GAME_TASK.onEvent();
         if(gameEntity.getAccepted_task_id() < 1){
             acceptedTask(context,gameEntity,action1);
         }else {

+ 36 - 2
app/src/main/java/com/sheep/gamegroup/util/DataUtil.java

@@ -8,11 +8,14 @@ import android.content.Context;
 import android.content.Intent;
 import android.media.projection.MediaProjectionManager;
 import android.os.Build;
+import android.os.Bundle;
 import android.text.TextUtils;
 
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.sheep.gamegroup.model.api.BaseMessageConverter;
 import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.GameEntity;
 import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.model.util.AutoTaskListUtil;
 import com.sheep.jiuyan.samllsheep.BuildConfig;
@@ -259,9 +262,9 @@ public class DataUtil {
         return null;
     }
     //是否使用小绵羊截图方案
-    public static final boolean IS_USE_SCREEN_SHOT = true;
+    public static final boolean IS_USE_SCREEN_SHOT = false;
     //是否监听媒体库图片变化
-    public static final boolean IS_LISTEN_SCREEN_SHOT = true;
+    public static final boolean IS_LISTEN_SCREEN_SHOT = false;
     /**
      * 截图路径
      *
@@ -431,4 +434,35 @@ public class DataUtil {
     }
 
     //-----------------------------------------引导页中用到的是否为新版部分-----------------------------------------------------结束
+    //-----------------------------------------数据转换部分-----------------------------------------------------结束
+
+    /**
+     * 获取bundle中的数据并转换为对应的类
+     * @param bundle
+     * @param tClass
+     * @param <T>
+     * @return
+     */
+    public static <T> T getObject(Bundle bundle, Class<T> tClass) {
+        if(bundle != null) {
+            String data = bundle.getString(tClass.getSimpleName());
+            try {
+                return JSONObject.parseObject(data, tClass);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        return null;
+    }
+
+    /**
+     * 设置数据到bundle中,注意,其key是类名,所以同一个类只支持一条
+     * @param bundle
+     * @param t
+     * @param <T>
+     */
+    public static <T> void putObject(Bundle bundle, T t) {
+        bundle.putString(t.getClass().getSimpleName(), JSONObject.toJSONString(t));
+    }
+    //-----------------------------------------数据转换部分-----------------------------------------------------结束
 }

+ 8 - 5
app/src/main/java/com/sheep/gamegroup/util/Jump2View.java

@@ -122,9 +122,11 @@ import rx.functions.Action1;
 import rx.schedulers.Schedulers;
 
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.GAME_DOWNLOAD_WELFARE_LIST;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.GAME_EVERY_DAY_MORE;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.GAME_GIFT_CENTER;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.GAME_INSTEAD_OF_RECHARGE;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.GAME_MY_WELFARE;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.GAME_PLAY_GAME_DETAIL;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.MI_DONG_VIEW;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.RECHARGE;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.RECHARGE_QQ;
@@ -563,11 +565,10 @@ public class Jump2View {
         context.startActivity(intent);
 
     }
-    public synchronized void goGameTaskDetailView(Context context, Object o, Object b, int type){
+    public synchronized void goGameTaskDetailView(Context context, int task_id, Object b, int type){
         Intent intent = new Intent(context, TaskDetailAct.class);
-        if(o instanceof Integer){
-            intent.putExtra("task_id", (Integer) o);
-        }
+        intent.putExtra("task_id", task_id);
+        UMConfigUtils.IdEvent.TASK.commit(task_id);
         if(b instanceof String){
             intent.putExtra("game_id", (String) b);
         }else
@@ -1538,13 +1539,15 @@ public class Jump2View {
         Intent intent = new Intent(activity, ActEverydayPlayGame.class);
         intent.putExtra("type", type);
         activity.startActivity(intent);
+        GAME_EVERY_DAY_MORE.onEvent("type", type);
     }
     /**
-     * 每日必做、近期最热
+     * 游戏详情
      */
     public void goPlayGameDetail(Activity activity, int id){
         Intent intent = new Intent(activity, ActPlayGameDetail.class);
         intent.putExtra("id", id);
         activity.startActivity(intent);
+        GAME_PLAY_GAME_DETAIL.onEvent();
     }
 }

+ 11 - 2
app/src/main/java/com/sheep/gamegroup/util/UMConfigUtils.java

@@ -54,7 +54,7 @@ public class UMConfigUtils {
         USER_LOGOUT("账号安全 -> 退出登录按钮"),//5021
         GAME_SEARCH("游戏模块 -> 搜索界面-> 搜索按钮"),//5022
         GAME_DOWNLOAD_MANAGER("主界面右上角 -> 下载管理按钮"),//5023
-        TASK_ACCEPT("接取任务"),//5024
+        TASK_ACCEPT("接取任务 新添加参数 device_id,release_task_id"),//5024
         SHEEP_NEWBIE_TASK_LIST("新手任务列表界面,(界面已经修改为对话框了)"),//5025
         SHEEP_NEWBIE_TASK_UNDERSTAND_SHEEP("新手任务 -> 一分钟了解小绵羊界面"),//5026
         SHEEP_NEWBIE_TASK_REGIST_SUCCESS_DIALOG("注册小绵羊成功对话框"),//5027
@@ -135,7 +135,7 @@ public class UMConfigUtils {
         SEARCH_GAME_COMMIT("游戏代充模块 -> 搜索游戏 -> 点击搜索按钮"),//5102
         GAME_INSTEAD_OF_RECHARGE_HELP("游戏代充模块 -> 点击帮助图标"),//5103
         GAME_INSTEAD_OF_RECHARGE_TAB("游戏代充模块 -> 点击上面的平台进行切换 需要传task_type和平台名称到substring中,如:{\"task_type\":1,\"name\":\"平台|小米|腾讯\"}"),//5104
-        GAME_INSTEAD_OF_RECHARGE_PLATFORM("游戏代充模块 -> 点击平台充值按钮 需要传task_type和平台名称到substring中,如:{\"task_type\":1,\"name\":\"平台|小米|腾讯\"}"),//5105
+        GAME_INSTEAD_OF_RECHARGE_PLATFORM("游戏代充模块 -> 点击平台充值按钮 需要传game_id和平台名称到substring中,如:{\"game_id\":1,\"name\":\"平台|小米|腾讯\"}"),//5105
         GAME_INSTEAD_OF_RECHARGE_GAME("游戏代充模块 -> 点击立即充值"),//5106
         GAME_INSTEAD_OF_RECHARGE_PAY("游戏代充模块 -> 点击立即充值 -> 点击立即支付"),//5107
         GAME_INSTEAD_OF_RECHARGE_GET("游戏代充模块 -> 点击领取游戏账号"),//5108
@@ -159,6 +159,15 @@ public class UMConfigUtils {
         GAME_MY_WELFARE("我的福利"),
         BIND_QQ("绑定QQ"),
         BIND_WX("绑定微信"),
+        GAME_EVERY_DAY_MORE("玩转游戏 -> 每日必做(type为0)或者近期最热(type为1)-> 更多  需要传type,如:{\"type\":1 } "),
+        GAME_PLAY_GAME_DETAIL("玩转游戏 -> 游戏详情界面"),
+        RESERVATION_GAME_TASK("点击预约游戏按钮"),
+        RECEIVE_AWARD_GAME_TASK("游戏任务领取奖励"),
+        GIFT_BAG_RECEIVE("礼包中心 -> 领取礼包 参数 gift_bag_id"),
+        GIFT_BAG_COPY_CODE("礼包中心 -> 点击复制按钮 参数 gift_bag_id gift_bag_code"),
+        GIFT_BAG_LOOK_TIP("礼包中心 -> 点击提示图标 参数 gift_bag_id"),
+        GIFT_BAG_DIALOG_COPY_CODE("礼包中心 -> 领取礼包 -> 对话框内复制礼包码 参数 gift_bag_id gift_bag_code"),
+        GIFT_BAG_DIALOG_START_APP("礼包中心 -> 领取礼包 -> 对话框内启动游戏 参数 gift_bag_id package_name"),
         ;
         private String tag;
 

+ 6 - 13
app/src/main/java/com/sheep/gamegroup/util/ViewUtil.java

@@ -10,7 +10,6 @@ import android.content.Context;
 import android.content.DialogInterface;
 import android.content.Intent;
 import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
 import android.graphics.Color;
 import android.graphics.drawable.BitmapDrawable;
 import android.graphics.drawable.Drawable;
@@ -21,8 +20,6 @@ import android.provider.MediaStore;
 import android.support.v4.app.FragmentActivity;
 import android.support.v7.app.AlertDialog;
 import android.support.v7.widget.GridLayoutManager;
-import android.support.v7.widget.LinearLayoutManager;
-import android.support.v7.widget.OrientationHelper;
 import android.support.v7.widget.RecyclerView;
 import android.text.Html;
 import android.text.TextUtils;
@@ -51,11 +48,7 @@ import com.bumptech.glide.request.RequestOptions;
 import com.google.gson.Gson;
 import com.jcodecraeer.xrecyclerview.CustomFooterViewCallBack;
 import com.jcodecraeer.xrecyclerview.XRecyclerView;
-import com.kfzs.duanduan.cardview.BlurBitmapUtils;
-import com.kfzs.duanduan.cardview.CardAdapter;
 import com.kfzs.duanduan.cardview.CardScaleHelper;
-import com.kfzs.duanduan.cardview.SpeedRecyclerView;
-import com.kfzs.duanduan.cardview.ViewSwitchUtils;
 import com.kfzs.duanduan.fragment.FgtPersonalCenter;
 import com.sheep.gamegroup.dateview.DatePickerDialog;
 import com.sheep.gamegroup.dateview.DateUtil;
@@ -64,20 +57,16 @@ import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.Container;
 import com.sheep.gamegroup.model.entity.DialogConfig;
 import com.sheep.gamegroup.model.entity.GameAccountEntity;
-import com.sheep.gamegroup.model.entity.GiftBag;
 import com.sheep.gamegroup.model.entity.GiftBagApp;
 import com.sheep.gamegroup.model.entity.HomeListEntity;
 import com.sheep.gamegroup.model.entity.PayEntity;
-import com.sheep.gamegroup.model.entity.PictureInvitationEntity;
 import com.sheep.gamegroup.model.entity.RobTask;
-import com.sheep.gamegroup.model.entity.TaskReleaseEty;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.glide.RoundedCornersTransformation;
 import com.sheep.gamegroup.view.activity.PersonalInfoAct;
 import com.sheep.gamegroup.view.activity.SplashAct;
 import com.sheep.gamegroup.view.activity.TaskDetailAct;
 import com.sheep.gamegroup.view.adapter.AdbCommonRecycler;
-import com.sheep.gamegroup.view.adapter.InvitationPictureAdapter;
 import com.sheep.gamegroup.view.dialog.DialogAddAccount;
 import com.sheep.gamegroup.view.dialog.DialogModifyAccount;
 import com.sheep.gamegroup.view.dialog.DialogOrienteeringDetails;
@@ -97,18 +86,19 @@ import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
-import java.util.ArrayList;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
 import java.util.Random;
 
-import rx.Scheduler;
 import rx.android.schedulers.AndroidSchedulers;
 import rx.functions.Action1;
 import rx.schedulers.Schedulers;
 
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.AD_TOAST;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.GAME_INSTEAD_OF_RECHARGE_PLATFORM;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.GIFT_BAG_DIALOG_COPY_CODE;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.GIFT_BAG_DIALOG_START_APP;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.QR_COPY;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.QR_SAVE;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.QR_SHARE;
@@ -666,6 +656,7 @@ public class ViewUtil {
         get_welfare_copy_tv.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View view) {
+                GIFT_BAG_DIALOG_COPY_CODE.onEvent("gift_bag_id", item.getGift_bag().getId(), "gift_bag_code", item.getCode());
                 StringUtils.CopyText(item.getCode());
                 G.showToast("复制兑换码成功");
             }
@@ -675,6 +666,7 @@ public class ViewUtil {
             @Override
             public void onClick(View v) {
                 dialog.dismiss();
+                GIFT_BAG_DIALOG_START_APP.onEvent("gift_bag_id", item.getGift_bag().getId(), "package_name", item.getApp().getPackage_names());
                 //启动游戏
                 PackageUtil.startApp(activity, item.getApp().getPackage_names());
             }
@@ -1222,6 +1214,7 @@ public class ViewUtil {
     }
 
     public void showGamePayAccount(Activity activity, PayEntity payEntity) {
+        GAME_INSTEAD_OF_RECHARGE_PLATFORM.onEvent("game_id", payEntity.getGame_id(), "name", payEntity.getGame_name());
         new DialogPayAccount(activity, payEntity).showPayaccount();
     }
 

+ 52 - 12
app/src/main/java/com/sheep/gamegroup/view/activity/ActGameCenter.java

@@ -3,6 +3,7 @@ package com.sheep.gamegroup.view.activity;
 import android.content.Intent;
 import android.support.v4.view.ViewPager;
 import android.view.View;
+import android.widget.ImageButton;
 
 import com.kfzs.duanduan.ActDownloadMgr;
 import com.sheep.gamegroup.absBase.BaseActivity;
@@ -24,33 +25,72 @@ import butterknife.BindView;
 public class ActGameCenter extends BaseActivity {
     @BindView(R.id.act_game_center_vp)
     ViewPager act_game_center_vp;
+
     @Override
     protected int getLayoutId() {
         return R.layout.act_game_center;
     }
+
     private ActGameCenter activity;
+
     @Override
     public void initView() {
         activity = this;
-        TitleBarUtils.getInstance()
-                .setTitleFinish(activity)
-                .setRightSecondBtn(activity, R.mipmap.search_black_img, new View.OnClickListener() {
+        final TitleBarUtils titleBarUtils = TitleBarUtils.getInstance().setTitleFinish(activity);
+        titleBarUtils.addTabs(activity, act_game_center_vp, "玩转游戏", new FgtPlayGame(), "福利中心", new FgtWelfareCenter(),
+                        new ViewPager.OnPageChangeListener() {
+                            @Override
+                            public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
+
+                            }
+
+                            @Override
+                            public void onPageSelected(int position) {
+                                ActGameCenter.this.onPageSelected(titleBarUtils, position);
+
+                            }
+
+                            @Override
+                            public void onPageScrollStateChanged(int state) {
+
+                            }
+                        });
+        onPageSelected(titleBarUtils, 0);
+
+    }
+
+    private void onPageSelected(TitleBarUtils titleBarUtils, int position) {
+        switch (position) {
+            case 0:
+                titleBarUtils.setRightSecondBtn(activity, R.mipmap.search_black_img, new View.OnClickListener() {
                     @Override
                     public void onClick(View view) {
                         Jump2View.getInstance().goGameSearch(activity, null);
                     }
                 })
-                .setRightImgBotton(activity, R.drawable.index_download, new View.OnClickListener() {
+                        .setRightImgBotton(activity, R.drawable.index_download, new View.OnClickListener() {
+                            @Override
+                            public void onClick(View view) {
+                                TitleBarUtils.getInstance()
+                                        .setRightRedPoint(activity, View.GONE);
+                                startActivity(new Intent(activity, ActDownloadMgr.class));
+                                UMConfigUtils.onEvent(UMConfigUtils.Event.GAME_DOWNLOAD_MANAGER);
+                            }
+                        });
+                break;
+            case 1:
+                ImageButton secondImageButton = activity.findViewById(R.id.ibtn_two_right);
+
+                secondImageButton.setVisibility(View.GONE);
+                titleBarUtils.setRightBotton(activity, "我的福利", 0, new View.OnClickListener() {
                     @Override
-                    public void onClick(View view) {
-                        TitleBarUtils.getInstance()
-                                .setRightRedPoint(activity, View.GONE);
-                        startActivity(new Intent(activity, ActDownloadMgr.class));
-                        UMConfigUtils.onEvent(UMConfigUtils.Event.GAME_DOWNLOAD_MANAGER);
+                    public void onClick(View v) {
+                        // 进入我的福利界面
+                        Jump2View.getInstance().goMyWelfare(activity);
                     }
-                })
-                .addTabs(activity, act_game_center_vp,"玩转游戏", new FgtPlayGame(), "福利中心", new FgtWelfareCenter());
-
+                });
+                break;
+        }
     }
 
     @Override

+ 11 - 4
app/src/main/java/com/sheep/gamegroup/view/activity/TaskDetailAct.java

@@ -91,6 +91,7 @@ import rx.functions.Action1;
 import rx.schedulers.Schedulers;
 
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.GAME_INSTEAD_OF_RECHARGE_GET;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.RECEIVE_AWARD_GAME_TASK;
 
 /**
  * 任务详情页面
@@ -1066,7 +1067,10 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
      * @return
      */
     protected ICallBack<String> getCallBack(){
-        return callBack;
+        if (DataUtil.IS_USE_SCREEN_SHOT || DataUtil.IS_LISTEN_SCREEN_SHOT) {
+            return callBack;
+        }
+        return null;
     }
     private int commitScreenShotTaskId;
 
@@ -1143,9 +1147,12 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
      */
     private void acceptedTask() {
         showProgress(true);
+        int release_task_id = taskReleaseEty.getId();
+        String device_id = DeviceUtil.getDeviceId(SheepApp.getInstance());
+        UMConfigUtils.Event.TASK_ACCEPT.onEvent("device_id", device_id, "release_task_id", release_task_id);
         JSONObject object = new JSONObject();
-        object.put("device_id", DeviceUtil.getDeviceId(activity));
-        object.put("release_task_id", taskReleaseEty.getId());
+        object.put("device_id", device_id);
+        object.put("release_task_id", release_task_id);
         addCanAcceptedTaskChildId(object, taskEty);
         SheepApp.getInstance()
                 .getNetComponent()
@@ -1171,7 +1178,6 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
 
                     }
                 });
-        UMConfigUtils.onEvent(UMConfigUtils.Event.TASK_ACCEPT);
     }
 
     @Download.onPre
@@ -1396,6 +1402,7 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
      */
     private void accepteReceiveAward() {
         showProgress();
+        RECEIVE_AWARD_GAME_TASK.onEvent();
         SheepApp.getInstance()
                 .getNetComponent()
                 .getApiService()

+ 5 - 3
app/src/main/java/com/sheep/gamegroup/view/activity/TaskDetailCreditCardAct.java

@@ -257,10 +257,12 @@ public class TaskDetailCreditCardAct extends AbsChooseImageActivity {
     }
 
     private void acceptTask() {
+        int release_task_id = taskReleaseEty.getId();
+        String device_id = DeviceUtil.getDeviceId(SheepApp.getInstance());
+        UMConfigUtils.Event.TASK_ACCEPT.onEvent("device_id", device_id, "release_task_id", release_task_id);
         JSONObject object = new JSONObject();
-        object.put("device_id", DeviceUtil.getDeviceId(activity));
-        object.put("release_task_id", Integer.valueOf(taskReleaseEty.getId() + ""));
-        UMConfigUtils.onEvent(UMConfigUtils.Event.TASK_ACCEPT);
+        object.put("device_id", device_id);
+        object.put("release_task_id", release_task_id);
         SheepApp.getInstance().getNetComponent().getApiService().releaseTaskCreditCard(object)
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())

+ 8 - 1
app/src/main/java/com/sheep/gamegroup/view/adapter/GiftCenterAdapter.java

@@ -29,6 +29,9 @@ import rx.android.schedulers.AndroidSchedulers;
 import rx.functions.Action1;
 import rx.schedulers.Schedulers;
 
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.GIFT_BAG_COPY_CODE;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.GIFT_BAG_LOOK_TIP;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.GIFT_BAG_RECEIVE;
 import static com.sheep.gamegroup.view.adapter.WelfareAdapter.TO_REFRESH;
 
 /**
@@ -101,6 +104,7 @@ public class GiftCenterAdapter extends AdbCommonRecycler<GiftBagApp> {
                 item_download_welfare_btn_center.setOnClickListener(new View.OnClickListener() {
                     @Override
                     public void onClick(View view) {
+                        GIFT_BAG_COPY_CODE.onEvent("gift_bag_id", item.getGift_bag().getId(), "gift_bag_code", item.getCode());
                         StringUtils.CopyText(item.getCode());
                         G.showToast("复制成功");
                     }
@@ -108,6 +112,7 @@ public class GiftCenterAdapter extends AdbCommonRecycler<GiftBagApp> {
                 item_download_welfare_tip_iv.setOnClickListener(new View.OnClickListener() {
                     @Override
                     public void onClick(View view) {
+                        GIFT_BAG_LOOK_TIP.onEvent("gift_bag_id", item.getGift_bag().getId());
                         ViewUtil.showMsgDialog(context, new DialogConfig().setTitle("礼包使用说明").setBtnLeftText("我知道了")
                                 .setMsgGravity(Gravity.START)
                                 .setMsg(String.format(Locale.CHINA, "礼包内容:\n%s\n\n使用方式:\n%s", itemGiftBag.getGiftContent(), itemGiftBag.getUseMethod())));
@@ -119,7 +124,9 @@ public class GiftCenterAdapter extends AdbCommonRecycler<GiftBagApp> {
     }
 
     private void onClickItem(final GiftBagApp item) {
-        SheepApp.getInstance().getNetComponent().getApiService().receiveGiftBag(item.getGift_bag().getId())
+        int gift_bag_id = item.getGift_bag().getId();
+        GIFT_BAG_RECEIVE.onEvent("gift_bag_id", gift_bag_id);
+        SheepApp.getInstance().getNetComponent().getApiService().receiveGiftBag(gift_bag_id)
                         .subscribeOn(Schedulers.io())
                         .observeOn(AndroidSchedulers.mainThread())
                         .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {

+ 0 - 4
app/src/main/java/com/sheep/gamegroup/view/adapter/TryMakeMoneyAdp.java

@@ -62,7 +62,6 @@ import rx.functions.Action1;
 import static com.sheep.gamegroup.model.entity.RecyleType.RUN_TASK;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.GAME_INSTEAD_OF_RECHARGE_GAME;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.GAME_INSTEAD_OF_RECHARGE_GET;
-import static com.sheep.gamegroup.util.UMConfigUtils.Event.GAME_INSTEAD_OF_RECHARGE_PLATFORM;
 
 /**
  * Created by ljy on 2018/3/20.
@@ -239,7 +238,6 @@ public class TryMakeMoneyAdp extends AdpCommonRecy<RecyleObj> {
                         @Override
                         public void onClick(View v) {
                             Jump2View.getInstance().goGameTaskDetailView(context,  item.getRelease_task_id(), item.getGame_id(),1);
-                            UMConfigUtils.IdEvent.TASK.commit(item.getRelease_task_id());
 
                         }
                     });
@@ -347,7 +345,6 @@ public class TryMakeMoneyAdp extends AdpCommonRecy<RecyleObj> {
                     @Override
                     public void onClick(View v) {
                         Jump2View.getInstance().goGameTaskDetailView(context,  item.getRelease_task_id(), item.getGame_id(),1);
-                        UMConfigUtils.IdEvent.TASK.commit(item.getRelease_task_id());
 
                     }
                 });
@@ -418,7 +415,6 @@ public class TryMakeMoneyAdp extends AdpCommonRecy<RecyleObj> {
                 detail_task_tv_center.setOnClickListener(new View.OnClickListener() {
                     @Override
                     public void onClick(View v) {
-                        GAME_INSTEAD_OF_RECHARGE_PLATFORM.onEvent("task_type", item.getTask_type(), "name", item.getName());
                         PayEntity payEntity = new PayEntity();
                         payEntity.setTask_type(item.getTask_type()+"");
                         ViewUtil.newInstance().showGamePayAccount((Activity) context, payEntity);

+ 6 - 1
app/src/main/java/com/sheep/gamegroup/view/adapter/WelfareAdapter.java

@@ -18,6 +18,7 @@ import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.DeviceUtil;
 import com.sheep.gamegroup.util.GlideImageLoader;
 import com.sheep.gamegroup.util.Jump2View;
+import com.sheep.gamegroup.util.UMConfigUtils;
 import com.sheep.gamegroup.util.ViewHolder;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.jiuyan.samllsheep.R;
@@ -31,6 +32,7 @@ import rx.android.schedulers.AndroidSchedulers;
 import rx.functions.Action1;
 import rx.schedulers.Schedulers;
 
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.RECEIVE_AWARD_GAME_TASK;
 import static com.sheep.gamegroup.view.adapter.TryMakeMoneyAdp.PUBLIC_TAG_PREFIX_TEXTVIEW_LIST;
 
 /**
@@ -163,8 +165,10 @@ public class WelfareAdapter extends AdbCommonRecycler<TaskReleaseEty>{
      * 领取任务
      */
     private void acceptedTask(int release_task_id) {
+        String device_id = DeviceUtil.getDeviceId(SheepApp.getInstance());
+        UMConfigUtils.Event.TASK_ACCEPT.onEvent("device_id", device_id, "release_task_id", release_task_id);
         JSONObject object = new JSONObject();
-        object.put("device_id", DeviceUtil.getDeviceId(SheepApp.getInstance()));
+        object.put("device_id", device_id);
         object.put("release_task_id", release_task_id);
         SheepApp.getInstance()
                 .getNetComponent()
@@ -189,6 +193,7 @@ public class WelfareAdapter extends AdbCommonRecycler<TaskReleaseEty>{
      * 领取奖励
      */
     private void acceptedReceiveAward(TaskReleaseEty item) {
+        RECEIVE_AWARD_GAME_TASK.onEvent();
         SheepApp.getInstance()
                 .getNetComponent()
                 .getApiService()

+ 3 - 5
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtPlaGameGift.java

@@ -15,6 +15,7 @@ import com.sheep.gamegroup.model.entity.GameEntity;
 import com.sheep.gamegroup.model.entity.GiftBagApp;
 import com.sheep.gamegroup.model.entity.TaskReleaseEty;
 import com.sheep.gamegroup.util.CommonUtil;
+import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.GlideImageLoader;
 import com.sheep.gamegroup.util.ViewHolder;
 import com.sheep.gamegroup.util.ViewUtil;
@@ -49,7 +50,7 @@ public class FgtPlaGameGift extends BaseFragment {
     public static FgtPlaGameGift newInstance(GameEntity gameEntity){
         FgtPlaGameGift fgt = new FgtPlaGameGift();
         Bundle bundle = new Bundle();
-        bundle.putSerializable("game_entitiy", gameEntity);
+        DataUtil.putObject(bundle, gameEntity);
         fgt.setArguments(bundle);
         return fgt;
     }
@@ -169,10 +170,7 @@ public class FgtPlaGameGift extends BaseFragment {
         // TODO: inflate a fragment view
         View rootView = super.onCreateView(inflater, container, savedInstanceState);
         unbinder = ButterKnife.bind(this, rootView);
-        Bundle bundle = getArguments();
-        if(bundle != null){
-            gameEntity = (GameEntity) bundle.getSerializable("game_entitiy");
-        }
+        gameEntity = DataUtil.getObject(getArguments(), GameEntity.class);
         return rootView;
     }
 

+ 4 - 3
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtPlayGame.java

@@ -4,6 +4,7 @@ import android.app.Activity;
 import android.content.Context;
 import android.os.Bundle;
 import android.os.Handler;
+import android.os.Looper;
 import android.os.Message;
 import android.support.design.widget.TabLayout;
 import android.support.v4.view.ViewPager;
@@ -95,7 +96,7 @@ public class FgtPlayGame extends BaseFragment {
     private GiftpackListAdapter mAdapter;
     private int curPosition = 0;
 
-    Handler mHandler = new Handler(){
+    Handler mHandler = new Handler(Looper.getMainLooper()){
         @Override
         public void handleMessage(Message msg) {
             super.handleMessage(msg);
@@ -149,7 +150,7 @@ public class FgtPlayGame extends BaseFragment {
                 if(welfareCenter == null){
                     ViewUtil.setDefaultText(item_hot_welfare_tv);
                 } else {
-                    //TODO 加载数据
+                    // 加载数据
                     ViewUtil.setText(item_hot_welfare_tv, welfareCenter.getApp().getName());
                     GlideImageLoader.setGameImage(item_hot_welfare_iv, welfareCenter.getApp().getIcon());
                     onClickToPlayGameDetail(holder.itemView, welfareCenter);
@@ -174,7 +175,7 @@ public class FgtPlayGame extends BaseFragment {
                 if(welfareCenter == null){
                     ViewUtil.setDefaultText(item_hot_welfare_tv);
                 } else {
-                    //TODO 加载数据
+                    // 加载数据
                     ViewUtil.setText(item_hot_welfare_tv, welfareCenter.getApp().getName());
                     GlideImageLoader.setGameImage(item_hot_welfare_iv, welfareCenter.getApp().getIcon());
                     onClickToPlayGameDetail(holder.itemView, welfareCenter);

+ 3 - 5
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtPlayGameDetail.java

@@ -15,6 +15,7 @@ import com.sheep.gamegroup.helper.ImageListHelper;
 import com.sheep.gamegroup.model.entity.GameEntity;
 import com.sheep.gamegroup.model.entity.TaskDescEntity;
 import com.sheep.gamegroup.util.CommonUtil;
+import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.ListUtil;
 import com.sheep.gamegroup.util.MyListview;
 import com.sheep.gamegroup.util.ViewUtil;
@@ -60,7 +61,7 @@ public class FgtPlayGameDetail extends BaseFragment {
     public static FgtPlayGameDetail newInstance(GameEntity gameEntity){
         FgtPlayGameDetail fgt = new FgtPlayGameDetail();
         Bundle bundle = new Bundle();
-        bundle.putSerializable("game_entitiy", gameEntity);
+        DataUtil.putObject(bundle, gameEntity);
         fgt.setArguments(bundle);
         return fgt;
     }
@@ -132,10 +133,7 @@ public class FgtPlayGameDetail extends BaseFragment {
         // TODO: inflate a fragment view
         View rootView = super.onCreateView(inflater, container, savedInstanceState);
         unbinder = ButterKnife.bind(this, rootView);
-        Bundle bundle = getArguments();
-        if(bundle != null){
-            gameEntity = (GameEntity) bundle.getSerializable("game_entitiy");
-        }
+        gameEntity = DataUtil.getObject(getArguments(), GameEntity.class);
         return rootView;
     }
 

+ 0 - 3
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtTryMakeMoney.java

@@ -2,9 +2,7 @@ package com.sheep.gamegroup.view.fragment;
 
 import android.app.Activity;
 import android.os.Bundle;
-import android.support.v4.widget.SwipeRefreshLayout;
 import android.support.v7.widget.LinearLayoutManager;
-import android.support.v7.widget.RecyclerView;
 import android.text.TextUtils;
 import android.view.LayoutInflater;
 import android.view.View;
@@ -14,7 +12,6 @@ import android.widget.TextView;
 import com.jcodecraeer.xrecyclerview.XRecyclerView;
 import com.kfzs.duanduan.event.BigEvent;
 import com.kfzs.duanduan.event.EventTypes;
-import com.kfzs.duanduan.utils.NumberFormatUtils;
 import com.sheep.gamegroup.di.components.DaggerFgtTryMakeMoneyComponent;
 import com.sheep.gamegroup.di.modules.TryMakeMoneyModule;
 import com.sheep.gamegroup.model.entity.BaseMessage;

+ 2 - 53
app/src/main/java/com/sheep/jiuyan/samllsheep/utils/TitleBarUtils.java

@@ -1,7 +1,6 @@
 package com.sheep.jiuyan.samllsheep.utils;
 
 import android.app.Activity;
-import android.content.Intent;
 import android.graphics.drawable.ColorDrawable;
 import android.support.annotation.DrawableRes;
 import android.support.design.widget.TabLayout;
@@ -13,15 +12,8 @@ import android.widget.ImageButton;
 import android.widget.ImageView;
 import android.widget.TextView;
 
-import com.kfzs.duanduan.ActDownloadMgr;
 import com.kfzs.duanduan.mine.GiftpackListAdapter;
 import com.sheep.gamegroup.absBase.BaseActivity;
-import com.sheep.gamegroup.util.CommonUtil;
-import com.sheep.gamegroup.util.Jump2View;
-import com.sheep.gamegroup.util.UMConfigUtils;
-import com.sheep.gamegroup.view.adapter.AdpTryMakemoney;
-import com.sheep.gamegroup.view.fragment.FgtTryMakeMoney;
-import com.sheep.gamegroup.view.fragment.FgtWelfareCenter;
 import com.sheep.jiuyan.samllsheep.R;
 
 
@@ -384,7 +376,7 @@ public class TitleBarUtils {
         return this;
     }
 
-    public TitleBarUtils addTabs(final BaseActivity activity, ViewPager viewPager, String tab1, Fragment fragment1, String tab2, Fragment fragment2) {
+    public TitleBarUtils addTabs(final BaseActivity activity, ViewPager viewPager, String tab1, Fragment fragment1, String tab2, Fragment fragment2, ViewPager.OnPageChangeListener listener) {
         //设置标题不可见
         TextView titleView = activity.findViewById(R.id.txt_baseactivity_title);
         titleView.setVisibility(View.GONE);
@@ -401,50 +393,7 @@ public class TitleBarUtils {
 
         tabLayout.addOnTabSelectedListener(new TabLayout.ViewPagerOnTabSelectedListener(viewPager));
         tabLayout.setupWithViewPager(viewPager);
-        viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
-            @Override
-            public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
-
-            }
-
-            @Override
-            public void onPageSelected(int position) {
-                if(position == 0){
-                    setRightSecondBtn(activity, R.mipmap.search_black_img, new View.OnClickListener() {
-                        @Override
-                        public void onClick(View view) {
-                            Jump2View.getInstance().goGameSearch(activity, null);
-                        }
-                    })
-                            .setRightImgBotton(activity, R.drawable.index_download, new View.OnClickListener() {
-                                @Override
-                                public void onClick(View view) {
-                                    TitleBarUtils.getInstance()
-                                            .setRightRedPoint(activity, View.GONE);
-                                    activity.startActivity(new Intent(activity, ActDownloadMgr.class));
-                                    UMConfigUtils.onEvent(UMConfigUtils.Event.GAME_DOWNLOAD_MANAGER);
-                                }
-                            });
-                }else {
-                    ImageButton secondImageButton = activity.findViewById(R.id.ibtn_two_right);
-
-                    secondImageButton.setVisibility(View.GONE);
-                    setRightBotton(activity, "我的福利", 0, new View.OnClickListener() {
-                        @Override
-                        public void onClick(View v) {
-                            // 进入我的福利界面
-                            Jump2View.getInstance().goMyWelfare(activity);
-                        }
-                    });
-                }
-
-            }
-
-            @Override
-            public void onPageScrollStateChanged(int state) {
-
-            }
-        });
+        viewPager.addOnPageChangeListener(listener);
 //        CommonUtil.getInstance().reflex(tabLayout, activity);
         return this;
     }

+ 1 - 1
app/src/main/res/layout/login_act_layout.xml

@@ -63,7 +63,7 @@
             <android.support.v7.widget.AppCompatEditText
                 android:id="@+id/login_et_scope"
                 style="@style/style_login_et"
-                android:hint="请输入邀请码(非必填)"
+                android:hint="请输入邀请码"
                 android:inputType="number"
                 android:maxLength="10"
                 android:gravity="center"/>

+ 2 - 2
gradle.properties

@@ -17,8 +17,8 @@
 # org.gradle.parallel=true
 #android.injected.build.model.only.versioned = 3
 
-VERSION_NAME=3.0.1
-VERSION_CODE=3000001
+VERSION_NAME=3.1.0
+VERSION_CODE=3001000
 ANDROID_COMPILE_SDK_VERSION=27
 ANDROID_BUILD_TOOLS_VERSION=27.0.2
 ANDROID_MIN_SDK_VERSION=18