Merge branch 'dev' of gitlab.ghzhushou.com:halo/assistant-android into dev

This commit is contained in:
kehaoyuan
2018-06-25 14:22:47 +08:00
17 changed files with 133 additions and 36 deletions

View File

@ -3,10 +3,14 @@ package com.gh.common.util;
import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.os.Build;
import android.text.TextUtils;
import com.gh.common.constant.Config;
import com.gh.gamecenter.BuildConfig;
import com.halo.assistant.HaloApp;
import com.lightgame.config.CommonDebug;
import com.lightgame.utils.Util_System_Phone_State;
import com.tencent.bugly.crashreport.CrashReport;
import com.tencent.stat.MtaSDkException;
import com.tencent.stat.StatConfig;
@ -64,8 +68,13 @@ public class DataUtils {
StatConfig.setDebugEnable(false);
// 设置数据上报策略
StatConfig.setStatSendStrategy(StatReportStrategy.PERIOD);
StatConfig.setSendPeriodMinutes(5);
// 测试渠道的时候即时上传,方便查看日志
if ("GH_TEST".equals(HaloApp.getInstance().getChannel())) {
StatConfig.setStatSendStrategy(StatReportStrategy.INSTANT);
} else {
StatConfig.setStatSendStrategy(StatReportStrategy.PERIOD);
StatConfig.setSendPeriodMinutes(5);
}
// 设置启用Tlink
StatConfig.setTLinkStatus(true);
@ -157,14 +166,23 @@ public class DataUtils {
// 游戏下载
public static void onGameDownloadEvent(Context context, String gameName, String platform, String entrance, String status) {
Map<String, Object> kv = new HashMap<>();
platform = PlatformUtils.getInstance(HaloApp.getInstance().getApplication()).getPlatformName(platform);
kv.put("版本", platform);
kv.put("状态", status);
kv.put("用户机型", Build.MODEL);
kv.put("设备IMEI", Util_System_Phone_State.getDeviceId(HaloApp.getInstance().getApplication()));
kv.put("网络状态", DeviceUtils.getNetwork(HaloApp.getInstance().getApplication()));
kv.put("光环助手版本", BuildConfig.VERSION_NAME);
onEvent(context, "游戏下载", gameName, kv);
Map<String, Object> kv2 = new HashMap<>();
kv2.put("版本", platform);
kv2.put("状态", status);
kv2.put("位置", entrance);
kv2.put("游戏分平台", gameName + "-" + platform);
kv2.put("光环助手版本", BuildConfig.VERSION_NAME);
onEvent(context, "游戏下载位置", gameName, kv2);
}

View File

@ -687,21 +687,13 @@ public class DialogUtils {
titleTv.setText(title);
positiveTv.setText(positive);
negativeTv.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dialog.dismiss();
}
});
negativeTv.setOnClickListener(view -> dialog.dismiss());
positiveTv.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (cmListener != null) {
cmListener.onConfirm();
}
dialog.dismiss();
positiveTv.setOnClickListener(view -> {
if (cmListener != null) {
cmListener.onConfirm();
}
dialog.dismiss();
});
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);

View File

@ -367,6 +367,9 @@ public class DownloadItemUtils {
}
break;
case "插件化":
if (entrance.contains("我的游戏")) {
DataUtils.onMtaEvent(context, "我的游戏_启动", "插件化", gameEntity.getName());
}
if (NetworkUtils.isWifiConnected(context)) {
plugin(context, gameEntity, downloadBtn, entrance, location, traceEvent);
} else {
@ -377,6 +380,9 @@ public class DownloadItemUtils {
install(context, gameEntity, position, adapter);
break;
case "启动":
if (entrance.contains("我的游戏")) {
DataUtils.onMtaEvent(context, "我的游戏_启动", "启动", gameEntity.getName());
}
DataUtils.onGameLaunchEvent(context, gameEntity.getName(), gameEntity.getApk().get(0).getPlatform(), location);
PackageUtils.launchApplicationByPackageName(context, gameEntity.getApk().get(0).getPackageName());
@ -386,6 +392,9 @@ public class DownloadItemUtils {
DownloadManagerActivity.getDownloadMangerIntent(context, gameEntity.getApk().get(0).getUrl(), entrance + "+(" + location.split(":")[0] + ")"));
break;
case "更新":
if (entrance.contains("我的游戏")) {
DataUtils.onMtaEvent(context, "我的游戏_启动", "更新", gameEntity.getName());
}
if (NetworkUtils.isWifiConnected(context)) {
update(context, gameEntity, entrance, location, traceEvent);
} else {

View File

@ -58,6 +58,7 @@ public class IntentUtils {
}
public static void startCategoryListActivity(Context context, String categoryTitle, CategoryEntity category) {
DataUtils.onMtaEvent(context, "分类大全", categoryTitle, category.getName());
context.startActivity(CategoryListActivity.Companion.getIntent(context, categoryTitle, category, "全部"));
}
}

View File

@ -5,6 +5,7 @@ import android.util.AttributeSet
import android.view.View
import android.widget.LinearLayout
import android.widget.TextView
import com.gh.common.util.DataUtils
import com.gh.gamecenter.R
import com.gh.gamecenter.category.CategoryListActivity
import com.gh.gamecenter.entity.CategoryEntity
@ -40,7 +41,10 @@ class SubCategoryView @JvmOverloads constructor(context: Context, attrs: Attribu
private fun setCategory(tv: TextView, category: CategoryEntity) {
tv.text = category.name
tv.setOnClickListener { tv.context.startActivity(CategoryListActivity.getIntent(tv.context, categoryTitle!!, primeCategory!!, category.name!!)) }
tv.setOnClickListener {
DataUtils.onMtaEvent(context, "分类大全", categoryTitle, primeCategory?.name!! + "-" + category.name!!)
tv.context.startActivity(CategoryListActivity.getIntent(tv.context, categoryTitle!!, primeCategory!!, category.name!!))
}
}
}

View File

@ -9,6 +9,7 @@ import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
@ -80,6 +81,7 @@ import com.lightgame.download.DownloadConfig;
import com.lightgame.download.DownloadEntity;
import com.lightgame.download.DownloadStatus;
import com.lightgame.download.FileUtils;
import com.lightgame.utils.Util_System_Phone_State;
import com.lightgame.utils.Utils;
import com.tencent.bugly.beta.tinker.TinkerManager;
import com.tencent.bugly.crashreport.CrashReport;
@ -242,8 +244,9 @@ public class MainActivity extends BaseActivity {
DataUtils.onMtaEvent(getApplication(), "解析包错误分析"
, "游戏名字", downloadEntity.getName() + ":"
+ PlatformUtils.getInstance(getApplicationContext()).getPlatformName(downloadEntity.getPlatform())
, "网络状态", DeviceUtils.getNetwork(getApplication()));
, "网络状态", DeviceUtils.getNetwork(getApplication())
, "用户机型", Build.MODEL
, "设备IMEI", Util_System_Phone_State.getDeviceId(getApplication()));
}
}
}
@ -276,10 +279,15 @@ public class MainActivity extends BaseActivity {
// 统计下载完成事件
private void statDoneEvent(DownloadEntity downloadEntity) {
ExposureUtils.DownloadType type;
String platform = PlatformUtils.getInstance(HaloApp.getInstance().getApplication()).getPlatformName(downloadEntity.getPlatform());
Map<String, Object> kv1 = new HashMap<>();
kv1.put("版本", downloadEntity.getPlatform());
kv1.put("版本", platform);
kv1.put("状态", "下载完成");
kv1.put("用户机型", Build.MODEL);
kv1.put("设备IMEI", Util_System_Phone_State.getDeviceId(HaloApp.getInstance().getApplication()));
kv1.put("网络状态", DeviceUtils.getNetwork(HaloApp.getInstance().getApplication()));
kv1.put("光环助手版本", BuildConfig.VERSION_NAME);
if (downloadEntity.isUpdate()) {
type = ExposureUtils.DownloadType.UPDATE;
DataUtils.onEvent(MainActivity.this, "游戏更新", downloadEntity.getName(), kv1);
@ -292,6 +300,8 @@ public class MainActivity extends BaseActivity {
kv2.put("版本", downloadEntity.getPlatform());
kv2.put("状态", "下载完成");
kv2.put("位置", downloadEntity.getEntrance());
kv2.put("游戏分平台", downloadEntity.getName() + "-" + platform);
kv2.put("光环助手版本", BuildConfig.VERSION_NAME);
DataUtils.onEvent(MainActivity.this, "游戏下载位置", downloadEntity.getName(), kv2);
if (downloadEntity.isPluggable()) {

View File

@ -8,6 +8,7 @@ import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.LayerDrawable;
import android.os.Build;
import android.support.v4.util.ArrayMap;
import android.text.TextUtils;
import android.util.SparseArray;
@ -19,6 +20,7 @@ import android.widget.TextView;
import com.gh.common.exposure.ExposureEvent;
import com.gh.common.exposure.ExposureUtils;
import com.gh.common.util.DataUtils;
import com.gh.common.util.DeviceUtils;
import com.gh.common.util.DialogUtils;
import com.gh.common.util.DisplayUtils;
import com.gh.common.util.ImageUtils;
@ -26,6 +28,7 @@ import com.gh.common.util.NetworkUtils;
import com.gh.common.util.PackageUtils;
import com.gh.common.util.PlatformUtils;
import com.gh.download.DownloadManager;
import com.gh.gamecenter.BuildConfig;
import com.gh.gamecenter.DownloadManagerActivity;
import com.gh.gamecenter.R;
import com.gh.gamecenter.VoteActivity;
@ -34,10 +37,12 @@ import com.gh.gamecenter.entity.ApkEntity;
import com.gh.gamecenter.entity.CollectionCloseEntity;
import com.gh.gamecenter.entity.GameEntity;
import com.gh.gamecenter.manager.PackageManager;
import com.halo.assistant.HaloApp;
import com.lightgame.adapter.BaseRecyclerAdapter;
import com.lightgame.download.DownloadEntity;
import com.lightgame.download.DownloadStatus;
import com.lightgame.download.FileUtils;
import com.lightgame.utils.Util_System_Phone_State;
import com.lightgame.utils.Utils;
import java.util.HashMap;
@ -351,15 +356,23 @@ public class PlatformAdapter extends BaseRecyclerAdapter<PlatformViewHolder> {
public void download(ApkEntity apkEntity, TextView mDownloadItemTvStatus, String method) {
String msg = FileUtils.isCanDownload(mContext, apkEntity.getSize());
if (TextUtils.isEmpty(msg)) {
String platform = PlatformUtils.getInstance(HaloApp.getInstance().getApplication()).getPlatformName(apkEntity.getPlatform());
Map<String, Object> kv = new HashMap<>();
kv.put("版本", apkEntity.getPlatform());
kv.put("版本", platform);
kv.put("状态", "下载开始");
kv.put("用户机型", Build.MODEL);
kv.put("设备IMEI", Util_System_Phone_State.getDeviceId(HaloApp.getInstance().getApplication()));
kv.put("网络状态", DeviceUtils.getNetwork(HaloApp.getInstance().getApplication()));
kv.put("光环助手版本", BuildConfig.VERSION_NAME);
DataUtils.onEvent(mContext, "游戏下载", mGameEntity.getName(), kv);
Map<String, Object> kv2 = new HashMap<>();
kv2.put("版本", apkEntity.getPlatform());
kv2.put("状态", "下载开始");
kv2.put("位置", mEntrance + "-开始");
kv2.put("游戏分平台", mGameEntity.getName() + "-" + platform);
kv2.put("光环助手版本", BuildConfig.VERSION_NAME);
DataUtils.onEvent(mContext, "游戏下载位置", mGameEntity.getName(), kv2);
Map<String, Object> kv6 = new HashMap<>();

View File

@ -11,6 +11,7 @@ import android.view.View;
import com.gh.base.fragment.BaseFragment;
import com.gh.common.util.DataCollectionUtils;
import com.gh.common.util.DataUtils;
import com.gh.common.util.DisplayUtils;
import com.gh.common.util.NewsUtils;
import com.gh.common.util.QQUtils;
@ -171,6 +172,7 @@ public class FuliFragment extends BaseFragment {
isCanShowKaiFuHint = true;
EventBus.getDefault().post(new EBReuse("showKaifuHint"));
} else if (GameDetailFragment.SCROLL_TO_KAIFU.equals(reuse.getType()) && layoutManager != null) {
DataUtils.onMtaEvent(getContext(), "游戏详情开服表按钮", mGameEntity.getName());
int position = layoutManager.getItemCount() - 2;
if (position > 0)
layoutManager.smoothScrollToPosition(mRecyclerView, null, position);

View File

@ -3,9 +3,7 @@ package com.gh.gamecenter.gamedetail;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.drawable.ColorDrawable;
import android.preference.PreferenceManager;
import android.support.v4.content.ContextCompat;
@ -20,6 +18,7 @@ import android.widget.LinearLayout;
import android.widget.TextView;
import com.gh.base.OnViewClickListener;
import com.gh.common.util.DataUtils;
import com.gh.common.util.DisplayUtils;
import com.gh.common.util.StringUtils;
import com.gh.gamecenter.R;
@ -408,11 +407,13 @@ public class GameDetailKaiFuAdapter extends BaseRecyclerAdapter<ViewHolder> {
calendarServer.size() > 1 ? "新服×" + calendarServer.size() : "新服" : remark);
holder.itemView.setEnabled(true);
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
initKaifuDetail(entity);
}
holder.itemView.setOnClickListener(v -> {
Calendar calendar = Calendar.getInstance();
DataUtils.onMtaEvent(mContext,
"游戏详情开服表按钮",
mGameEntity.getName(),
calendar.get(Calendar.YEAR) + "-" + (calendar.get(Calendar.MONTH) + 1) + "-" + entity.getDay());
initKaifuDetail(entity);
});
} else {
viewHolder.calendarHint.setVisibility(View.GONE);

View File

@ -1,6 +1,7 @@
package com.gh.gamecenter.manager;
import android.content.SharedPreferences;
import android.os.Build;
import android.preference.PreferenceManager;
import android.text.TextUtils;
@ -20,6 +21,7 @@ import com.gh.gamecenter.retrofit.Response;
import com.gh.gamecenter.retrofit.RetrofitManager;
import com.gh.gamecenter.retrofit.service.ApiService;
import com.halo.assistant.HaloApp;
import com.lightgame.utils.Util_System_Phone_State;
import com.lightgame.utils.Utils;
import org.greenrobot.eventbus.EventBus;
@ -183,7 +185,10 @@ public class UserManager {
if (code == 400802 || code == 400401) { // 自动注销
EventBus.getDefault().post(new EBReuse(PersonalFragment.LOGOUT_TAG));
DataUtils.onMtaEvent(HaloApp.getInstance().getApplication(), "登录异常统计_自动登录"
, "错误码_RefreshToken", code + "_" + refreshToken.getValue());
, "错误码_RefreshToken", code + "_" + refreshToken.getValue()
, "网络状态", DeviceUtils.getNetwork(HaloApp.getInstance().getApplication())
, "用户机型", Build.MODEL
, "设备IMEI", Util_System_Phone_State.getDeviceId(HaloApp.getInstance().getApplication()));
}
} catch (Exception e1) {
e1.printStackTrace();

View File

@ -181,8 +181,10 @@ public class PersonalFragment extends BaseFragment implements Observer<ApiRespon
.throttleFirst(1, TimeUnit.SECONDS)
.subscribe(aVoid -> {
if (mUserInfoEntity != null) {
DataUtils.onEvent(getActivity(), "我的光环", "签到");
sign();
} else {
DataUtils.onEvent(getActivity(), "我的光环", "微信登录");
GetLoginDataUtils.getInstance(getActivity()).WCLogin(this);
}
});
@ -217,15 +219,19 @@ public class PersonalFragment extends BaseFragment implements Observer<ApiRespon
switch (view.getId()) {
case R.id.personal_login_qq:
if (mUserInfoEntity != null) {
DataUtils.onEvent(getActivity(), "我的光环", "收藏");
startActivity(CollectionActivity.getCollectionActivity(getContext()));
} else {
DataUtils.onEvent(getActivity(), "我的光环", "QQ登录");
GetLoginDataUtils.getInstance(getActivity()).QQLogin(this, getActivity());
}
break;
case R.id.personal_login_weibo:
if (mUserInfoEntity != null) {
DataUtils.onEvent(getActivity(), "我的光环", "消息");
startActivityForResult(MessageActivity.getIntent(getContext(), "(我的光环)+(消息中心)"), REQUEST_MESSAGE);
} else {
DataUtils.onEvent(getActivity(), "我的光环", "微博登录");
GetLoginDataUtils.getInstance(getActivity()).WeiBoLogin(this, getActivity());
}
break;
@ -239,18 +245,23 @@ public class PersonalFragment extends BaseFragment implements Observer<ApiRespon
}
if (mUserInfoEntity != null) {
DataUtils.onEvent(getActivity(), "我的光环", "个人中心");
startActivity(UserInfoActivity.getIntent(getContext()));
} else {
DataUtils.onEvent(getActivity(), "我的光环", "手机登录");
startActivity(LoginActivity.getIntent(getContext()));
}
break;
case R.id.personal_game:
DataUtils.onEvent(getActivity(), "我的光环", "我的游戏");
startActivity(InstallActivity.getIntent(getContext()));
break;
case R.id.personal_share:
DataUtils.onEvent(getActivity(), "我的光环", "分享");
startActivity(ShareGhActivity.getIntent(getContext()));
break;
case R.id.personal_suggestion:
DataUtils.onEvent(getActivity(), "我的光环", "反馈");
startActivity(SuggestSelectActivity.getIntent(getActivity()));
break;
case R.id.personal_setting:
@ -260,9 +271,8 @@ public class PersonalFragment extends BaseFragment implements Observer<ApiRespon
mPersonalSettingUpdateHint.getVisibility() == View.VISIBLE, "(我的光环)"));
break;
case R.id.personal_ask:
CheckLoginUtils.checkLogin(getContext(), () -> {
startActivity(MyAskActivity.getIntent(getContext()));
});
DataUtils.onEvent(getActivity(), "我的光环", "我的问答");
CheckLoginUtils.checkLogin(getContext(), () -> startActivity(MyAskActivity.getIntent(getContext())));
break;
}
}
@ -333,12 +343,15 @@ public class PersonalFragment extends BaseFragment implements Observer<ApiRespon
}
switch (data.getType()) {
case "game":
DataUtils.onMtaEvent(getActivity(), "我的光环_签到跳转", "游戏", signEntity.getTitle());
GameDetailActivity.startGameDetailActivity(getContext(), data.getLink(), entrance);
break;
case "news":
DataUtils.onMtaEvent(getActivity(), "我的光环_签到跳转", "文章", signEntity.getTitle());
startActivity(NewsDetailActivity.getIntentById(getContext(), data.getLink(), entrance));
break;
case "column":
DataUtils.onMtaEvent(getActivity(), "我的光环_签到跳转", "专题", signEntity.getTitle());
SubjectActivity.startSubjectActivity(getContext(), data.getLink(), null, false, entrance);
break;
}

View File

@ -169,9 +169,12 @@ public class AskFragment extends BaseFragment {
mHasClickedSelectGame = true;
sp.edit().putBoolean(SP_KEY_CLICKED_SELECT_GAME, mHasClickedSelectGame).apply();
}
DataUtils.onMtaEvent(getContext(), "问答页面", UserManager.getInstance().getCommunity().getName(), "选择游戏");
startActivityForResult(CommunitiesSelectActivity.getIntent(getContext()), COMMUNITIES_SELECT_REQUEST);
break;
case R.id.ask_search:
DataUtils.onMtaEvent(getContext(), "问答页面", UserManager.getInstance().getCommunity().getName(), "搜索");
startActivity(AskSearchActivity.getIntent(getContext()));
break;
case R.id.ask_hot:

View File

@ -3,6 +3,7 @@ package com.gh.gamecenter.qa.column
import android.content.Context
import android.view.ViewGroup
import com.gh.base.BaseRecyclerViewHolder
import com.gh.common.util.DataUtils
import com.gh.gamecenter.R
import com.gh.gamecenter.databinding.AskColumnTagItemBinding
import com.gh.gamecenter.manager.UserManager
@ -37,8 +38,12 @@ class AskColumnAdapter(context: Context) : BaseRecyclerAdapter<AskColumnAdapter.
holder.binding.entity = entity
holder.itemView.setOnClickListener({
if (position == itemCount - 1) {
DataUtils.onMtaEvent(mContext, "问答页面",
UserManager.getInstance().community.name, "专栏-调整排序")
mContext.startActivity(AskTabOrderActivity.getIntent(mContext))
} else {
DataUtils.onMtaEvent(mContext, "问答页面",
UserManager.getInstance().community.name, "专栏-" + entity?.name)
mContext.startActivity(AskColumnDetailActivity.getIntentByColumn(mContext, entity!!, UserManager.getInstance().community))
}
})

View File

@ -16,6 +16,7 @@ import android.widget.TextView;
import com.gh.base.OnListClickListener;
import com.gh.common.constant.ItemViewType;
import com.gh.common.util.DataUtils;
import com.gh.common.util.DisplayUtils;
import com.gh.common.util.ImageUtils;
import com.gh.gamecenter.R;
@ -244,9 +245,12 @@ public class QuestionsDetailAdapter extends ListAdapter<AnswerEntity> {
tagTv.setLayoutParams(params);
mTagRl.addView(view);
view.setOnClickListener(v ->
mContext.startActivity(AskColumnDetailActivity.Companion.getIntentByTag(mContext, tag
, new CommunityEntity(mQuestionsDetailEntity.getCommunityId(), mQuestionsDetailEntity.getCommunityName()))));
view.setOnClickListener(v -> {
DataUtils.onMtaEvent(mContext, "问题标签", mQuestionsDetailEntity.getCommunityName(), mQuestionsDetailEntity.getTitle() + "-" + tag);
mContext.startActivity(AskColumnDetailActivity.Companion.getIntentByTag(mContext, tag,
new CommunityEntity(mQuestionsDetailEntity.getCommunityId(),
mQuestionsDetailEntity.getCommunityName())));
});
}
private void setAnswerTv(TextView answerTv, @StringRes int answerTvId) {

View File

@ -4,6 +4,7 @@ import android.arch.lifecycle.LiveData;
import android.arch.lifecycle.MediatorLiveData;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Build;
import android.preference.PreferenceManager;
import android.text.TextUtils;
@ -24,7 +25,9 @@ import com.gh.gamecenter.retrofit.Response;
import com.gh.gamecenter.retrofit.RetrofitManager;
import com.gh.gamecenter.retrofit.service.ApiService;
import com.gh.gamecenter.room.AppDatabase;
import com.halo.assistant.HaloApp;
import com.lightgame.config.CommonDebug;
import com.lightgame.utils.Util_System_Phone_State;
import com.lightgame.utils.Utils;
import org.json.JSONException;
@ -239,7 +242,10 @@ public class UserRepository {
Utils.toast(mContext, mContext.getString(R.string.login_failure_hint_code, code));
}
Utils.log("login->onFailure:: code:" + code + " content:" + content.toString());
DataUtils.onMtaEvent(mContext, "登录异常统计_手动登录", "错误码", String.valueOf(code));
DataUtils.onMtaEvent(mContext, "登录异常统计_手动登录", "错误码", String.valueOf(code)
, "网络状态", DeviceUtils.getNetwork(HaloApp.getInstance().getApplication())
, "用户机型", Build.MODEL
, "设备IMEI", Util_System_Phone_State.getDeviceId(HaloApp.getInstance().getApplication()));
} else {
Utils.toast(mContext, mContext.getString(R.string.login_failure_hint_code, httpException.code()));
}

View File

@ -20,6 +20,7 @@ import android.widget.RelativeLayout;
import android.widget.TextView;
import com.gh.common.constant.Config;
import com.gh.common.util.DataUtils;
import com.gh.common.util.DialogUtils;
import com.gh.common.util.EntranceUtils;
import com.gh.common.util.LoginUtils;
@ -245,9 +246,11 @@ public class SettingsFragment extends NormalFragment {
}.start();
break;
case R.id.setting_rl_autoinstall:
DataUtils.onMtaEvent(getActivity(), "我的光环_设置", "设置功能", "下载完成自动安装游戏");
mSettingAutoinstallSb.performClick();
break;
case R.id.setting_rl_cache:
DataUtils.onMtaEvent(getActivity(), "我的光环_设置", "设置功能", "清除缓存");
DialogUtils.showWarningDialog(getContext(), "清除缓存", "清空缓存后未安装的游戏可能需要重新下载,确定清空?",
() -> {
loadingDialog = DialogUtils.showWaitDialog(getContext(), "清除缓存中...");
@ -255,15 +258,19 @@ public class SettingsFragment extends NormalFragment {
});
break;
case R.id.setting_cv_font_size:
DataUtils.onMtaEvent(getActivity(), "我的光环_设置", "设置功能", "正文字号");
fontSize();
break;
case setting_rl_about:
DataUtils.onMtaEvent(getActivity(), "我的光环_设置", "设置功能", "关于");
startActivity(AboutActivity.getIntent(getContext(), mIsUpdate));
break;
case R.id.setting_rl_concerngame:
DataUtils.onMtaEvent(getActivity(), "我的光环_设置", "设置功能", "安装完成自动关注游戏");
mSettingConcerngameSb.performClick();
break;
case R.id.setting_logout_rl:
DataUtils.onMtaEvent(getActivity(), "我的光环_设置", "设置功能", "退出账号");
DialogUtils.showForceDialog(getContext(), "注销登录", "退出账号即会回到游客状态,很多功能将无法使用(例如评论、客服消息),确定退出吗?",
"确定退出", "取消", () -> {
loadingDialog = DialogUtils.showWaitDialog(getContext(), "退出登录中...");
@ -275,11 +282,14 @@ public class SettingsFragment extends NormalFragment {
}, null);
break;
case R.id.setting_rl_kc_path:
DataUtils.onMtaEvent(getActivity(), "我的光环_设置", "设置功能", "免流量传送接收目录");
dirPath = Environment.getExternalStorageDirectory().getPath() + "/GH-KC";
case R.id.setting_rl_pic_path:
DataUtils.onMtaEvent(getActivity(), "我的光环_设置", "设置功能", "图片保存目录");
if (TextUtils.isEmpty(dirPath))
dirPath = Environment.getExternalStorageDirectory().getPath() + "/pictures/ghzhushou";
case R.id.setting_rl_download_path:
DataUtils.onMtaEvent(getActivity(), "我的光环_设置", "设置功能", "游戏下载目录");
if (TextUtils.isEmpty(dirPath))
dirPath = Environment.getExternalStorageDirectory().getPath() + "/gh-download";
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
@ -294,6 +304,7 @@ public class SettingsFragment extends NormalFragment {
}
break;
case R.id.setting_network_diagnosis:
DataUtils.onMtaEvent(getActivity(), "我的光环_设置", "设置功能", "网络诊断");
startActivity(new Intent(getContext(), NetworkDiagnosisActivity.class));
break;
default:

View File

@ -3,7 +3,7 @@
apply from: 'dependencies.gradle'
buildscript {
ext.kotlin_version = '1.2.10'
ext.kotlin_version = '1.2.41'
repositories {
maven { url "https://maven.google.com" }
maven { url "https://dl.bintray.com/thelasterstar/maven/" } //weiboSDK