feat: 游戏单功能优化(第三期)—客户端 https://jira.shanqu.cc/browse/GHZSCY-5559

This commit is contained in:
叶子维
2024-07-24 14:51:03 +08:00
parent 56e945eb43
commit daa1e4fc64
67 changed files with 2225 additions and 494 deletions

View File

@ -445,5 +445,7 @@ public class Constants {
public static final String DIN_FONT_PATH = "fonts/d_din_bold_only_number.ttf";
public static final String SP_SHOW_GAME_COLLECTION_ADD_GAMES_GUIDE = "show_game_collection_add_games_guide";
public static final String SP_SHOW_GAME_COLLECTION_EDIT_GUIDE = "show_game_collection_edit_guide";
public static final String SP_SHOW_GAME_COLLECTION_DOUBLE_TAP_TOAST = "show_game_collection_double_tap_toast";
}

View File

@ -350,4 +350,5 @@ public class EntranceConsts {
public static final String IS_DETAIL_PAGE = "is_detail_page";
public static final String KEY_IS_FROM_PUSH = "is_from_push";
public static final String KEY_VIDEO_MUTE = "video_mute";
public static final String KEY_SHOW_ADD_GAMES_DIALOG = "show_add_games_dialog";
}

View File

@ -0,0 +1,10 @@
package com.gh.gamecenter.common.entity
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
@Parcelize
data class SensorsEvent(
val eventName: String,
val paramsJson: String
) : Parcelable

View File

@ -329,7 +329,7 @@ object PermissionHelper {
val liStringList = arrayListOf(
"游戏上传及导入\n",
"使用安装包清理功能\n",
"图片保存(游戏详情、资讯论坛、个人主页、信息中心)\n",
"图片保存(游戏详情、游戏单、资讯论坛、个人主页、信息中心)\n",
"图片/视频上传(个人主页信息修改、内容发布/编辑、游戏投稿、意见反馈、实名认证人工审核)"
)
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {

View File

@ -4,6 +4,7 @@ import android.app.Application
import com.alibaba.android.arouter.launcher.ARouter
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.entity.SensorsEvent
import com.gh.gamecenter.common.exposure.ExposureSource
import com.gh.gamecenter.common.json.json
import com.gh.gamecenter.core.provider.ISensorsProvider
@ -314,6 +315,11 @@ object SensorsBridge {
mSensor?.trackEvent(eventName, jsonObject)
}
@JvmStatic
fun trackEvent(sensorsEvent: SensorsEvent) {
mSensor?.trackEvent(sensorsEvent.eventName, JSONObject(sensorsEvent.paramsJson))
}
@JvmStatic
fun profileSet(key: String, value: String) {
mSensor?.profileSet(key, value)

View File

@ -18,6 +18,7 @@ public class VerticalItemDecoration extends RecyclerView.ItemDecoration {
private int mInterval;
private int mIntervalLR;
private boolean mIsShowIntervalTop;
private boolean mIsShowIntervalSecond = true;
public VerticalItemDecoration(Context context, float interval, boolean isShowIntervalTop, int colorRes) {
paint = new Paint();
@ -34,6 +35,11 @@ public class VerticalItemDecoration extends RecyclerView.ItemDecoration {
this(context, interval, isShowIntervalTop, 0);
}
public VerticalItemDecoration(Context context, float interval, boolean isShowIntervalTop, boolean isShowIntervalSecond, int colorRes) {
this(context, interval, isShowIntervalTop, colorRes);
mIsShowIntervalSecond = isShowIntervalSecond;
}
public VerticalItemDecoration(Context context, int interval, boolean isShowIntervalTop, int intervalLR) {
paint = new Paint();
paint.setColor(ContextCompat.getColor(context, R.color.ui_background));
@ -73,8 +79,15 @@ public class VerticalItemDecoration extends RecyclerView.ItemDecoration {
public void getItemOffsets(Rect outRect, View view, RecyclerView parent,
RecyclerView.State state) {
int position = parent.getChildPosition(view);
if (position == 0 && mIsShowIntervalTop) {
outRect.set(0, mInterval, 0, mInterval);
if (position == 0) {
int top = 0, bottom = 0;
if (mIsShowIntervalTop) {
top = mInterval;
}
if (mIsShowIntervalSecond) {
bottom = mInterval;
}
outRect.set(0, top, 0, bottom);
} else {
outRect.set(0, 0, 0, mInterval);
}