Просмотр исходного кода

添加游戏轮播图的统计分析;
添加随便打入口

zengjiebin лет назад: 7
Родитель
Сommit
3f05859e2a

+ 9 - 1
app/src/main/AndroidManifest.xml

@@ -423,7 +423,15 @@
             android:screenOrientation="portrait"
             android:theme="@style/AppActionTheme" />
         <activity
-            android:name="com.sheep.gamegroup.view.activity.YFActWebX5"
+            android:name="com.sheep.gamegroup.view.activity.ActWebX5YF"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppActionTheme" >
+            <intent-filter>
+                <action android:name="android.intent.action.CREATE_SHORTCUT" />
+            </intent-filter>
+        </activity>
+        <activity
+            android:name="com.sheep.gamegroup.view.activity.ActWebX5SBD"
             android:screenOrientation="portrait"
             android:theme="@style/AppActionTheme" >
             <intent-filter>

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/module/game/fragment/FgtPlayGame.java

@@ -207,7 +207,7 @@ public class FgtPlayGame extends BaseFragment {
                 .setImages(slideshowEtyLists).setBannerTitles(slideshowTitleList)
                 .setOnBannerListener(i -> {
                     try {
-                        CommonUtil.getInstance().clickBanner(getActivity(), i, slideshowEtyLists);
+                        CommonUtil.getInstance().clickGameBanner(getActivity(), i, slideshowEtyLists);
                     } catch (Exception e) {
                         G.showToast(e.getMessage());
                     }

+ 19 - 2
app/src/main/java/com/sheep/gamegroup/util/CommonUtil.java

@@ -66,7 +66,7 @@ import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.usage.AppUsageManager;
 import com.sheep.gamegroup.view.activity.ActMain;
 import com.sheep.gamegroup.view.activity.GameTaskOrderListAct;
-import com.sheep.gamegroup.view.activity.YFActWebX5;
+import com.sheep.gamegroup.view.activity.ActWebX5YF;
 import com.sheep.gamegroup.view.dialog.DialogNewbieTaskList;
 import com.sheep.jiuyan.samllsheep.BuildConfig;
 import com.sheep.jiuyan.samllsheep.Config;
@@ -2235,9 +2235,26 @@ public class CommonUtil {
                 });
     }
 
+    //首页播放图
     public void clickBanner(Activity activity, int position, List<SlideshowEty> slideshowEtyLists) {
+        SlideshowEty item = ListUtil.getItem(slideshowEtyLists, position);
+        if (item == null) {
+            return;
+        }
+        UMConfigUtils.onEvent(UMConfigUtils.Event.BANNER_CLICK_HORIZONTAL);
+        UMConfigUtils.IdEvent.BANNER.commit(item.getId());
         clickBanner(activity, ListUtil.getItem(slideshowEtyLists, position));
     }
+    //游戏轮播图
+    public void clickGameBanner(Activity activity, int position, List<SlideshowEty> slideshowEtyLists) {
+        SlideshowEty item = ListUtil.getItem(slideshowEtyLists, position);
+        if (item == null) {
+            return;
+        }
+        UMConfigUtils.onEvent(UMConfigUtils.Event.GAME_BANNER_CLICK_HORIZONTAL);
+        UMConfigUtils.IdEvent.GAME_BANNER.commit(item.getId());
+        clickBanner(activity, item);
+    }
 
     public void clickBanner(Activity activity, SlideshowEty item) {
         if (item == null) {
@@ -2735,6 +2752,6 @@ public class CommonUtil {
 
     //已经添加有范商城快捷入口
     public boolean hasYouFanLauncher() {
-        return DataUtil.getAsBoolean(YFActWebX5.KEY_HAS_YOU_FAN_LAUNCHER, false);
+        return DataUtil.getAsBoolean(ActWebX5YF.KEY_HAS_YOU_FAN_LAUNCHER, false);
     }
 }

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

@@ -35,7 +35,7 @@ import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.DialogConfig;
 import com.sheep.gamegroup.model.entity.Version;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
-import com.sheep.gamegroup.view.activity.YFActWebX5;
+import com.sheep.gamegroup.view.activity.ActWebX5YF;
 import com.sheep.jiuyan.samllsheep.BuildConfig;
 import com.sheep.jiuyan.samllsheep.Config;
 import com.sheep.jiuyan.samllsheep.R;
@@ -900,7 +900,7 @@ public class SysAppUtil {
         // 为某个包创建快捷方式
         // ShortcutSuperUtils.addShortcutByPackageName(this, this.getPackageName());
     }
-    public static final Class<? extends Activity> yfCls = YFActWebX5.class;
+    public static final Class<? extends Activity> yfCls = ActWebX5YF.class;
     private static Intent getShortCutIntent(Activity activity) {
         // 使用MAIN,可以避免部分手机(比如华为、HTC部分机型)删除应用时无法删除快捷方式的问题
         Intent intent = new Intent(Intent.ACTION_MAIN);

+ 0 - 11
app/src/main/java/com/sheep/gamegroup/util/TestUtil.java

@@ -4,20 +4,15 @@ import android.app.Activity;
 import android.app.Notification;
 import android.app.NotificationChannel;
 import android.app.NotificationManager;
-import android.app.PendingIntent;
-import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.DialogInterface;
 import android.content.Intent;
 import android.content.pm.PackageInfo;
-import android.content.pm.ShortcutInfo;
-import android.content.pm.ShortcutManager;
 import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
 import android.graphics.Canvas;
 import android.graphics.Matrix;
 import android.graphics.Paint;
-import android.graphics.drawable.Icon;
 import android.net.Uri;
 import android.os.Build;
 import android.os.Bundle;
@@ -30,7 +25,6 @@ import android.view.Gravity;
 import android.view.View;
 import android.widget.ArrayAdapter;
 import android.widget.TextView;
-import android.widget.Toast;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
@@ -61,7 +55,6 @@ import com.sheep.gamegroup.view.activity.ActMain;
 import com.sheep.gamegroup.view.activity.ActSheepApkList;
 import com.sheep.gamegroup.view.activity.ActSheepPngList;
 import com.sheep.gamegroup.view.activity.ActTestExpression;
-import com.sheep.gamegroup.view.activity.YFActWebX5;
 import com.sheep.gamegroup.view.activity.NotificationsUtils;
 import com.sheep.gamegroup.view.dialog.DialogGameOrTaskOrGift;
 import com.sheep.gamegroup.view.dialog.DialogLoading;
@@ -80,21 +73,17 @@ import com.umeng.socialize.ShareAction;
 import com.umeng.socialize.UMShareListener;
 import com.umeng.socialize.bean.SHARE_MEDIA;
 import com.umeng.socialize.media.UMImage;
-import com.xys.shortcut_lib.ShortcutSuperUtils;
-import com.xys.shortcut_lib.ShortcutUtils;
 import com.zhy.http.okhttp.OkHttpUtils;
 import com.zhy.http.okhttp.callback.FileCallBack;
 import com.zhy.http.okhttp.callback.StringCallback;
 
 import java.io.File;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
 
-import androidx.annotation.RequiresApi;
 import cn.finalteam.rxgalleryfinal.bean.MediaBean;
 import cn.finalteam.rxgalleryfinal.utils.MediaUtils;
 import cn.jpush.android.api.JPushInterface;

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

@@ -194,6 +194,7 @@ public class UMConfigUtils {
         GAME_GROUP_DETAIL("游戏中心 -> 搜索游戏组 -> 游戏组详情"),
         GAME_GROUP_GAME_DETAIL("游戏中心 -> 搜索游戏组 -> 游戏组详情 -> 游戏详情"),
         HTXD_AD("发现 -> 资讯 -> 点击第5项的鸿途信达广告", "需要传 title ,如:{\"title\": \"我是一个标题\" }"),
+        GAME_BANNER_CLICK_HORIZONTAL("游戏轮播图", "游戏轮播图点击次数"),
         ;
         private String tag;
         private String info;
@@ -264,6 +265,7 @@ public class UMConfigUtils {
         HOME_LIST,//id 1 首页功能列表
         BANNER(),//id 2 首页轮播图
         TASK(),//id 3   任务列表
+        GAME_BANNER(),//id 4   游戏首页轮播图
         ;
 
         private int getType() {

+ 23 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ActWebX5SBD.java

@@ -0,0 +1,23 @@
+package com.sheep.gamegroup.view.activity;
+
+
+import com.sheep.gamegroup.model.entity.WebParams;
+import com.sheep.gamegroup.util.DataUtil;
+import com.sheep.jiuyan.samllsheep.Config;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+
+/**
+ * Created by realicing on 2019/3/20.
+ * realicing@sina.com
+ * 随便打h5
+ */
+public class ActWebX5SBD extends ActWebX5 {
+    public static final String KEY_HAS_SBD_LAUNCHER = "has_sbd_launcher";
+    @Override
+    public void initWebParams() {
+        DataUtil.putAsBoolean(ActWebX5SBD.KEY_HAS_SBD_LAUNCHER, true);
+
+        String url = Config.getUrlByPath(Config.PATH_SBD_HOME);
+        webParams = new WebParams(url, Config.SBD_NAME).tokenFirstUpperCase();
+    }
+}

+ 2 - 2
app/src/main/java/com/sheep/gamegroup/view/activity/YFActWebX5.java

@@ -11,11 +11,11 @@ import com.sheep.jiuyan.samllsheep.SheepApp;
  * realicing@sina.com
  * 有范商城h5
  */
-public class YFActWebX5 extends ActWebX5 {
+public class ActWebX5YF extends ActWebX5 {
     public static final String KEY_HAS_YOU_FAN_LAUNCHER = "has_you_fan_launcher";
     @Override
     public void initWebParams() {
-        DataUtil.putAsBoolean(YFActWebX5.KEY_HAS_YOU_FAN_LAUNCHER, true);
+        DataUtil.putAsBoolean(ActWebX5YF.KEY_HAS_YOU_FAN_LAUNCHER, true);
 
         String url = SheepApp.getInstance().getConnectAddress().getYfShotHomeSheep();
         webParams = new WebParams(url, Config.YF_SHOP_NAME).tokenFirstUpperCase();

+ 7 - 0
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtSmallSheep.java

@@ -90,6 +90,7 @@ import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.gamegroup.util.string.SpannableSb;
 import com.sheep.gamegroup.util.viewHelper.LayoutParamsUtil;
 import com.sheep.gamegroup.view.activity.ActMsg;
+import com.sheep.gamegroup.view.activity.ActWebX5SBD;
 import com.sheep.gamegroup.view.activity.NotificationsUtils;
 import com.sheep.gamegroup.view.adapter.AdbCommonRecycler;
 import com.sheep.gamegroup.view.adapter.AdpTryMakemoney;
@@ -302,6 +303,10 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
         Jump2View.getInstance().goAppTaskSearch(activity, null);
     }
 
+    @OnClick(R.id.home_search_sbd_iv)
+    public void toActWebX5Sbd() {
+        startActivity(new Intent(activity, ActWebX5SBD.class));
+    }
     @OnClick(R.id.home_search_msg_iv)
     public void toActMsg() {
         startActivity(new Intent(activity, ActMsg.class));
@@ -1549,6 +1554,8 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
         adpHomeList.notifyDataSetChanged();
     }
 
+    @BindView(R.id.home_search_sbd_tv)
+    TextView home_search_sbd_tv;
     @BindView(R.id.home_search_msg_tv)
     TextView home_search_msg_tv;
 

+ 6 - 1
app/src/main/java/com/sheep/jiuyan/samllsheep/Config.java

@@ -21,7 +21,8 @@ public class Config {
     public final static String YF_SHOP_HOME_SHEEP = "http://shop.17xmy.com/mobile/?pf=android.sheep.app";//小绵羊加载的有范商城主页地址
     public final static String YF_SHOP_HOME_SHEEP_TEST = "http://t.shop.17xmy.com/mobile/?pf=android.sheep.app";//小绵羊加载的有范商城主页地址
     public static final String YF_SHOP_ORDER_NUMBER_KEY = "order_number";
-
+    //随便打
+    public final static String SBD_NAME = "随便打";
 
     //以龙猫开头的则认为是龙猫app
     public static final String LONG_MAO_APP_NAME = "龙猫";
@@ -40,6 +41,8 @@ public class Config {
     private static final String STATION_SMALL_SHEEP_GAME_COINS = "/small_sheep_game_coins/#";
     //定向奖励
     private static final String STATION_APPOINT_TASK = "/appoint_task/#";
+    //随便打
+    private static final String STATION_SUI_BIAN_DA = "/sui_bian_da/#";
 
     //path
     //有范商城地址的 key
@@ -70,6 +73,8 @@ public class Config {
     public static final String PATH_REGISTER_BIG_TURNTABLE = STATION_H5_REGISTER_TURNTABLE + "/register-big-turntable";
     //跳转定向奖励兑换列表
     public static final String PATH_APPOINT_TASK_LIST = STATION_APPOINT_TASK + "/appoint-task-list";
+    //随便打首页
+    public static final String PATH_SBD_HOME = STATION_SUI_BIAN_DA + "/";
     //small_station地址 key
     public static final String KEY_SMALL_STATION_URL = "small_station_url";
     //small_station地址

+ 27 - 2
app/src/main/res/layout/include_home_search.xml

@@ -15,7 +15,6 @@
         android:layout_height="44dp"
         android:layout_below="@id/home_search_top"
         android:layout_alignParentEnd="true"
-        android:layout_marginStart="4dp"
         android:layout_marginEnd="4dp"
         android:padding="12dp"
         android:src="@mipmap/ic_msg" />
@@ -37,6 +36,32 @@
         android:textColor="@color/white"
         android:textSize="9sp" />
 
+    <ImageView
+        android:id="@+id/home_search_sbd_iv"
+        android:layout_width="44dp"
+        android:layout_height="44dp"
+        android:layout_below="@id/home_search_top"
+        android:layout_toStartOf="@id/home_search_msg_iv"
+        android:padding="12dp"
+        android:src="@mipmap/ic_msg" />
+
+    <TextView
+        android:id="@+id/home_search_sbd_tv"
+        android:layout_width="wrap_content"
+        android:layout_height="14dp"
+        android:layout_below="@id/home_search_top"
+        android:layout_toStartOf="@id/home_search_msg_iv"
+        android:layout_marginTop="10dp"
+        android:layout_marginEnd="4dp"
+        android:background="@drawable/shape_f81b5f_rec_7"
+        android:gravity="center"
+        android:minWidth="14dp"
+        android:paddingStart="4dp"
+        android:paddingEnd="4dp"
+        android:text="0"
+        android:textColor="@color/white"
+        android:textSize="9sp" />
+
     <LinearLayout
         android:id="@+id/to_search_but"
         android:layout_width="match_parent"
@@ -45,7 +70,7 @@
         android:layout_marginStart="@dimen/content_padding"
         android:layout_marginTop="7dp"
         android:layout_marginBottom="7dp"
-        android:layout_toStartOf="@id/home_search_msg_iv"
+        android:layout_toStartOf="@id/home_search_sbd_iv"
         android:background="@drawable/shape_main_search_bar_radius"
         android:gravity="center"
         android:orientation="horizontal"