diff --git a/app/build.gradle b/app/build.gradle index ed853e9dae..37ab77463d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -332,7 +332,10 @@ dependencies { implementation(project(':module_core_feature')) { exclude group: 'androidx.swiperefreshlayout' } - implementation(project(':module_feedback')) { +// implementation(project(':module_feedback')) { +// exclude group: 'androidx.swiperefreshlayout' +// } + implementation(project(':feature:new_feedback',)) { exclude group: 'androidx.swiperefreshlayout' } implementation(project(':module_sensors_data')) { diff --git a/app/src/main/java/com/gh/common/DefaultUrlHandler.kt b/app/src/main/java/com/gh/common/DefaultUrlHandler.kt index 178ecddd53..000c4ec595 100644 --- a/app/src/main/java/com/gh/common/DefaultUrlHandler.kt +++ b/app/src/main/java/com/gh/common/DefaultUrlHandler.kt @@ -439,17 +439,17 @@ object DefaultUrlHandler { directToFeedback( context, content, - null, isQaFeedback, qaContentId, + isPlugin = false, + isSmoothGame = false, EntranceConsts.ENTRANCE_BROWSER ) } } EntranceConsts.HOST_HELP_AND_FEEDBACK -> { - val position = uri.getQueryParameter("position") ?: "" - DirectUtils.directToHelpAndFeedback(context, position.toInt()) + DirectUtils.directToHelpAndFeedback(context) } EntranceConsts.HOST_HELP_DETAIL -> { diff --git a/app/src/main/java/com/gh/common/databind/AddKaiFuBindingAdapter.kt b/app/src/main/java/com/gh/common/databind/AddKaiFuBindingAdapter.kt index 235157b8ec..722297d0f3 100644 --- a/app/src/main/java/com/gh/common/databind/AddKaiFuBindingAdapter.kt +++ b/app/src/main/java/com/gh/common/databind/AddKaiFuBindingAdapter.kt @@ -13,14 +13,14 @@ import android.widget.PopupWindow import androidx.core.content.ContextCompat import androidx.databinding.BindingAdapter import androidx.recyclerview.widget.LinearLayoutManager +import com.gh.gamecenter.R import com.gh.gamecenter.common.callback.OnViewClickListener +import com.gh.gamecenter.common.databinding.LayoutPopupContainerBinding import com.gh.gamecenter.common.utils.dip2px import com.gh.gamecenter.common.utils.toDrawable import com.gh.gamecenter.common.view.BugFixedPopupWindow -import com.gh.gamecenter.R import com.gh.gamecenter.databinding.KaifuAddItemBinding import com.gh.gamecenter.databinding.LayoutAddKaifuPopupBinding -import com.gh.gamecenter.databinding.LayoutPopupContainerBinding import com.gh.gamecenter.feature.entity.ServerCalendarEntity import com.gh.gamecenter.servers.add.AddKaiFuPopupAdapter import java.text.SimpleDateFormat diff --git a/app/src/main/java/com/gh/common/provider/DirectProviderImpl.kt b/app/src/main/java/com/gh/common/provider/DirectProviderImpl.kt index 792ed962c1..819f2c66d2 100644 --- a/app/src/main/java/com/gh/common/provider/DirectProviderImpl.kt +++ b/app/src/main/java/com/gh/common/provider/DirectProviderImpl.kt @@ -1,6 +1,7 @@ package com.gh.common.provider import android.content.Context +import android.os.Bundle import com.alibaba.android.arouter.facade.annotation.Route import com.gh.common.util.DirectUtils import com.gh.gamecenter.common.constant.RouteConsts @@ -53,16 +54,16 @@ class DirectProviderImpl : IDirectProvider { DirectUtils.directDouyin(context, userId) } - override fun directToSuggestionFromDiagnosis(context: Context, diagnosis: String) { - DirectUtils.directToSuggestion(context, diagnosis = diagnosis) + override fun directToSuggestionFromDiagnosis(context: Context, content: String, diagnosis: String) { + DirectUtils.directToSuggestion(context, content = content, diagnosis = diagnosis) } override fun directToQa(context: Context, text: String?, id: String) { DirectUtils.directToQa(context, text, id) } - override fun directToHelpAndFeedback(context: Context, position: Int) { - DirectUtils.directToHelpAndFeedback(context, position) + override fun directToHelpAndFeedback(context: Context, bundle: Bundle?) { + DirectUtils.directToHelpAndFeedback(context, bundle) } override fun directToQqGroup(context: Context, groupNumber: String?): Boolean { diff --git a/app/src/main/java/com/gh/common/provider/LinkDirectUtilsProviderImpl.kt b/app/src/main/java/com/gh/common/provider/LinkDirectUtilsProviderImpl.kt index be5dfe1e53..9769a5a644 100644 --- a/app/src/main/java/com/gh/common/provider/LinkDirectUtilsProviderImpl.kt +++ b/app/src/main/java/com/gh/common/provider/LinkDirectUtilsProviderImpl.kt @@ -6,7 +6,6 @@ import com.gh.common.util.DirectUtils import com.gh.gamecenter.common.constant.RouteConsts import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.common.entity.LinkEntity -import com.gh.gamecenter.common.entity.SimpleGameEntity import com.gh.gamecenter.common.entity.SuggestType import com.gh.gamecenter.feature.exposure.ExposureEvent import com.gh.gamecenter.feature.provider.ILinkDirectUtilsProvider @@ -48,17 +47,6 @@ class LinkDirectUtilsProviderImpl : ILinkDirectUtilsProvider { DirectUtils.directToSuggestion(context, type, suggestHintType, content, isQaFeedback, qaContentId) } - override fun directToSuggestion( - context: Context, - type: SuggestType, - suggestHintType: String?, - content: String?, - game: SimpleGameEntity, - platform: String - ) { - DirectUtils.directToSuggestion(context, type, suggestHintType, content, game, platform) - } - override fun directToSuggestion(context: Context, type: SuggestType, hiddenHint: String) { DirectUtils.directToSuggestion(context, type, hiddenHint) } diff --git a/app/src/main/java/com/gh/common/util/DialogUtils.java b/app/src/main/java/com/gh/common/util/DialogUtils.java index 7120de81ae..654df95d1c 100644 --- a/app/src/main/java/com/gh/common/util/DialogUtils.java +++ b/app/src/main/java/com/gh/common/util/DialogUtils.java @@ -1237,7 +1237,7 @@ public class DialogUtils { @Override public Unit invoke() { SimpleGameEntity entity = new SimpleGameEntity(gameId, gameName, ""); - HelpAndFeedbackBridge.startSuggestionActivity(finalContext, SuggestType.gameQuestion, "notfound", "模拟器安装包解析错误", entity, "-"); + HelpAndFeedbackBridge.startSuggestionActivity(finalContext, SuggestType.GAME, "notfound", "模拟器安装包解析错误", entity); dialog.dismiss(); return null; } diff --git a/app/src/main/java/com/gh/common/util/DirectUtils.kt b/app/src/main/java/com/gh/common/util/DirectUtils.kt index c27d7154e8..52407dd7dc 100644 --- a/app/src/main/java/com/gh/common/util/DirectUtils.kt +++ b/app/src/main/java/com/gh/common/util/DirectUtils.kt @@ -15,6 +15,7 @@ import com.gh.common.constant.Config import com.gh.common.exposure.ExposureManager.log import com.gh.common.exposure.ExposureTraceUtils.appendTrace import com.gh.common.util.EntranceUtils.jumpActivity +import com.gh.common.util.EntranceUtils.jumpActivityCompat import com.gh.gamecenter.* import com.gh.gamecenter.amway.AmwayActivity import com.gh.gamecenter.catalog.CatalogActivity @@ -24,7 +25,6 @@ import com.gh.gamecenter.common.base.activity.BaseActivity import com.gh.gamecenter.common.base.activity.BaseActivity_TabLayout import com.gh.gamecenter.common.base.activity.ToolBarActivity import com.gh.gamecenter.common.base.fragment.BaseFragment_TabLayout -import com.gh.gamecenter.common.constant.CommonConsts import com.gh.gamecenter.common.constant.Constants import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.constant.EntranceConsts.* @@ -37,7 +37,9 @@ import com.gh.gamecenter.core.runOnIoThread import com.gh.gamecenter.core.utils.ToastUtils import com.gh.gamecenter.discovery.DiscoveryActivity import com.gh.gamecenter.download.DownloadFragment.Companion.INDEX_UPDATE -import com.gh.gamecenter.entity.* +import com.gh.gamecenter.entity.SubjectData +import com.gh.gamecenter.entity.SubjectRecommendEntity +import com.gh.gamecenter.entity.VideoLinkEntity import com.gh.gamecenter.eventbus.EBSkip import com.gh.gamecenter.feature.entity.GameDetailServer import com.gh.gamecenter.feature.entity.GameEntity @@ -298,7 +300,7 @@ object DirectUtils { "libao", "礼包" -> directToGiftDetail(context, linkEntity.link ?: "", entrance) - "feedback" -> directToFeedback(context, linkEntity.name, linkEntity.text, false, "", entrance) + "feedback" -> directToFeedback(context, linkEntity.name, false, "", false, false, entrance) "qa", "qa_content", "Q&A" -> directToQa(context, linkEntity.text ?: "", linkEntity.link ?: "") @@ -735,72 +737,68 @@ object DirectUtils { // 反馈 @JvmStatic fun directToFeedback(context: Context, content: String? = null, entrance: String? = null) { - directToFeedback(context, content, null, false, "", entrance) + directToFeedback(context, content, false, "", false, false, entrance) } @JvmStatic fun directToFeedback( context: Context, content: String? = null, - hintType: String? = null, isQaFeedback: Boolean = false, qaContentId: String? = "", + isPlugin: Boolean = false, + isSmoothGame: Boolean = false, entrance: String? = null ) { val bundle = Bundle() bundle.putString(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER) - val destination = RouteConsts.activity.suggestionActivity.toDestinationClass() - bundle.putString(KEY_TO, destination?.name ?: "") + bundle.putBoolean(KEY_PLUGIN, isPlugin) + bundle.putBoolean(KEY_SMOOTH_GAME, isSmoothGame) + if (isPlugin) { + bundle.putString(KEY_HIDE_SUGGEST_HINT, "【插件问题】") + } + if (isSmoothGame) { + bundle.putString(KEY_HIDE_SUGGEST_HINT, "【畅玩问题】") + } if (isQaFeedback) { bundle.putBoolean(KEY_IS_QA_FEEDBACK, true) bundle.putString(KEY_QA_CONTENT_ID, qaContentId) - bundle.putSerializable(KEY_SUGGESTTYPE, SuggestType.normal) } else { bundle.putString(KEY_CONTENT, content) - if (TextUtils.isEmpty(hintType)) { - bundle.putSerializable(KEY_SUGGESTTYPE, SuggestType.gameQuestion) - bundle.putString(KEY_SUGGEST_HINT_TYPE, KEY_PLUGIN) - } else { - bundle.putSerializable(KEY_SUGGESTTYPE, SuggestType.normal) - bundle.putString(KEY_SUGGEST_HINT_TYPE, hintType) - } } - - jumpActivity(context, bundle) + context.startActivity(HelpAndFeedbackBridge.getSuggestionCategoryIntent(context, bundle)) } /** - * 畅玩助手反馈跳转 + * 跳转至使用帮助与反馈,请不要随意修改方法名 */ @JvmStatic - fun directToVGameFeedback( + fun directToHelpAndFeedback( context: Context, content: String? = null, - hintType: String? = null, isQaFeedback: Boolean = false, qaContentId: String? = "", + isPlugin: Boolean = false, + isSmoothGame: Boolean = false, entrance: String? = null ) { val bundle = Bundle() bundle.putString(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER) - val destination = RouteConsts.activity.suggestionActivity.toDestinationClass() - bundle.putString(KEY_TO, destination?.name ?: "") + bundle.putBoolean(KEY_PLUGIN, isPlugin) + bundle.putBoolean(KEY_SMOOTH_GAME, isSmoothGame) + if (isPlugin) { + bundle.putString(KEY_HIDE_SUGGEST_HINT, "【插件问题】") + } + if (isSmoothGame) { + bundle.putString(KEY_HIDE_SUGGEST_HINT, "【畅玩问题】") + } if (isQaFeedback) { bundle.putBoolean(KEY_IS_QA_FEEDBACK, true) bundle.putString(KEY_QA_CONTENT_ID, qaContentId) - bundle.putSerializable(KEY_SUGGESTTYPE, SuggestType.cwzsQuestion) } else { bundle.putString(KEY_CONTENT, content) - if (TextUtils.isEmpty(hintType)) { - bundle.putSerializable(KEY_SUGGESTTYPE, SuggestType.gameQuestion) - bundle.putString(KEY_SUGGEST_HINT_TYPE, KEY_PLUGIN) - } else { - bundle.putSerializable(KEY_SUGGESTTYPE, SuggestType.cwzsQuestion) - bundle.putString(KEY_SUGGEST_HINT_TYPE, hintType) - } } - - EntranceUtils.jumpActivityCompat(context, bundle) + directToHelpAndFeedback(context, bundle) } @JvmStatic @@ -1525,15 +1523,14 @@ object DirectUtils { /** * 跳转至使用帮助与反馈,请不要随意修改方法名 - * @param position 使用帮助:[CommonConsts.TAB_MAIN],意见反馈:[CommonConsts.TAB_SUB] */ @JvmStatic - fun directToHelpAndFeedback(context: Context, position: Int = CommonConsts.TAB_MAIN) { + fun directToHelpAndFeedback(context: Context, bundle: Bundle? = null) { val destination = RouteConsts.activity.helpAndFeedbackActivity.toDestinationClass() - val bundle = Bundle() - bundle.putString(KEY_TO, destination?.name ?: "") - bundle.putInt(BaseActivity_TabLayout.PAGE_INDEX, position) - jumpActivity(context, bundle) + val newBundle = Bundle() + newBundle.putString(KEY_TO, destination?.name ?: "") + bundle?.let { newBundle.putAll(it) } + jumpActivityCompat(context, newBundle) } /** @@ -1914,16 +1911,16 @@ object DirectUtils { @JvmStatic fun directToSuggestion( context: Context, - type: SuggestType = SuggestType.normal, + type: SuggestType = SuggestType.APP, hiddenHint: String = "", suggestHintType: String? = null, content: String? = null, - platform: String = "", game: SimpleGameEntity? = null, isQaFeedback: Boolean = false, qaContentId: String = "", fromRatingKey: Boolean = false, diagnosis: String = "", + forceLogin: Boolean = true, requestCode: Int? = null ) { val intent = HelpAndFeedbackBridge.getIntent( @@ -1932,12 +1929,12 @@ object DirectUtils { hiddenHint, suggestHintType, content, - platform, game, isQaFeedback, qaContentId, fromRatingKey, - diagnosis + diagnosis, + forceLogin ) if (requestCode != null) { (context as Activity).startActivityForResult(intent, requestCode) @@ -1980,12 +1977,19 @@ object DirectUtils { } @JvmStatic - fun directToSuggestion(context: Context, type: SuggestType, hiddenHint: String, requestCode: Int?) { + fun directToSuggestion( + context: Context, + type: SuggestType, + hiddenHint: String, + forceLogin: Boolean = true, + requestCode: Int? + ) { directToSuggestion( context = context, type = type, hiddenHint = hiddenHint, suggestHintType = null, + forceLogin = forceLogin, requestCode = requestCode, ) } @@ -2010,26 +2014,6 @@ object DirectUtils { ) } - @JvmStatic - fun directToSuggestion( - context: Context, - type: SuggestType, - suggestHintType: String? = null, - content: String? = null, - game: SimpleGameEntity, - platform: String = "" - ) { - directToSuggestion( - context = context, - type = type, - hiddenHint = "", - suggestHintType = suggestHintType, - content = content, - game = game, - platform = platform - ) - } - @JvmStatic fun directToQGameHome(context: Context) { context.startActivity(QGameHomeWrapperActivity.getIntent(context)) diff --git a/app/src/main/java/com/gh/common/util/DownloadObserver.kt b/app/src/main/java/com/gh/common/util/DownloadObserver.kt index 4702f6c49d..bcde6fc3eb 100644 --- a/app/src/main/java/com/gh/common/util/DownloadObserver.kt +++ b/app/src/main/java/com/gh/common/util/DownloadObserver.kt @@ -17,6 +17,10 @@ import com.gh.gamecenter.common.entity.SimpleGameEntity import com.gh.gamecenter.common.entity.SuggestType import com.gh.gamecenter.common.eventbus.EBShowDialog import com.gh.gamecenter.common.utils.* +import com.gh.gamecenter.core.utils.GsonUtils +import com.gh.gamecenter.core.utils.MtaHelper +import com.gh.gamecenter.core.utils.SPUtils +import com.gh.gamecenter.core.utils.ToastUtils import com.gh.gamecenter.common.utils.NewFlatLogUtils import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.eventbus.EBDownloadStatus @@ -89,8 +93,8 @@ object DownloadObserver { { HelpAndFeedbackBridge.startSuggestionActivity( currentActivity, - SuggestType.gameQuestion, "notfound", - StringUtils.buildString(downloadEntity.name, ",问题反馈:下载链接失效"), + SuggestType.GAME, "notfound", + "问题反馈:下载链接失效", SimpleGameEntity(gameId, downloadEntity.name, "") ) SensorsBridge.trackDownloadLinkRotDialogClick( diff --git a/app/src/main/java/com/gh/common/util/NewFlatLogUtils.kt b/app/src/main/java/com/gh/common/util/NewFlatLogUtils.kt index 5fbfa60cc5..96dabe869d 100644 --- a/app/src/main/java/com/gh/common/util/NewFlatLogUtils.kt +++ b/app/src/main/java/com/gh/common/util/NewFlatLogUtils.kt @@ -2401,6 +2401,34 @@ object NewFlatLogUtils { log(json) } + // QA视频事件 + @JvmStatic + fun logQAVideo( + event: String, + contentId: String, + contentTitle: String, + type: String, + sequence: Int, + videoId: String, + playAction: String, + playProcess: Float, + playTime: Int + ) { + val json = json { + KEY_EVENT to event + "content_id" to contentId + "content_title" to contentTitle + "type" to type + "sequence" to sequence + "video_id" to videoId + "play_action" to playAction + "play_process" to playProcess + "play_time" to playTime + parseAndPutMeta().invoke(this) + } + log(json) + } + @JvmStatic fun logQGameClick(qqGameId: String, qqGameName: String?) { val json = json { diff --git a/app/src/main/java/com/gh/common/xapk/XapkDialogHelper.kt b/app/src/main/java/com/gh/common/xapk/XapkDialogHelper.kt index 7acb4a9636..0d9e9afeab 100644 --- a/app/src/main/java/com/gh/common/xapk/XapkDialogHelper.kt +++ b/app/src/main/java/com/gh/common/xapk/XapkDialogHelper.kt @@ -107,10 +107,10 @@ object XapkDialogHelper { } }, cancelClickCallback = { - val hint = "《" + downloadEntity.name + "》游戏安装包解压失败,问题反馈:" + val hint = "游戏安装包解压失败,问题反馈:" HelpAndFeedbackBridge.startSuggestionActivity( context, - SuggestType.normal, + SuggestType.GAME, null, hint, SimpleGameEntity(downloadEntity.gameId, downloadEntity.name, downloadEntity.icon) diff --git a/app/src/main/java/com/gh/download/dialog/DownloadDialogAdapter.kt b/app/src/main/java/com/gh/download/dialog/DownloadDialogAdapter.kt index 86b8b32526..cb0dbdfd7d 100644 --- a/app/src/main/java/com/gh/download/dialog/DownloadDialogAdapter.kt +++ b/app/src/main/java/com/gh/download/dialog/DownloadDialogAdapter.kt @@ -5,14 +5,14 @@ import android.graphics.drawable.GradientDrawable import android.view.View import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView -import com.gh.gamecenter.common.callback.OnViewClickListener -import com.gh.gamecenter.feature.exposure.ExposureEvent -import com.gh.common.util.* +import com.gh.common.util.DirectUtils import com.gh.gamecenter.NewsDetailActivity import com.gh.gamecenter.R +import com.gh.gamecenter.common.callback.OnViewClickListener import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.databinding.* import com.gh.gamecenter.feature.entity.GameEntity +import com.gh.gamecenter.feature.exposure.ExposureEvent import com.lightgame.adapter.BaseRecyclerAdapter class DownloadDialogAdapter( @@ -100,7 +100,7 @@ class DownloadDialogAdapter( DirectUtils.directToQa(mContext, data.linkText, data.linkId) } "qa_collection" -> { - DirectUtils.directToQaCollection(mContext, data.linkText, data.linkId) + DirectUtils.directToHelpAndFeedback(mContext, isPlugin = true) } else -> { //Utils.toast(mContext, "暂不支持类型:" + data.linkType) diff --git a/app/src/main/java/com/gh/gamecenter/MainActivity.java b/app/src/main/java/com/gh/gamecenter/MainActivity.java index d00f4c164d..88e89da1f1 100644 --- a/app/src/main/java/com/gh/gamecenter/MainActivity.java +++ b/app/src/main/java/com/gh/gamecenter/MainActivity.java @@ -244,7 +244,7 @@ public class MainActivity extends BaseActivity { return null; }, () -> { - DirectUtils.directToSuggestion(MainActivity.this, SuggestType.crash, "APP闪退:", 100); + DirectUtils.directToSuggestion(MainActivity.this, SuggestType.APP, "APP闪退:", false, 100); MtaHelper.onEventWithBasicDeviceInfo( "闪退弹窗", "玩家操作", "点击反馈"); @@ -254,7 +254,7 @@ public class MainActivity extends BaseActivity { DialogHelper.showCenterWarningDialog(this, "发生闪退", "光环助手刚刚发生了闪退,马上反馈以帮助我们更好地修复问题?(只需简单描述你刚才的操作)" , "暂不", "马上反馈", () -> { - DirectUtils.directToSuggestion(MainActivity.this, SuggestType.crash, "APP闪退:", 100); + DirectUtils.directToSuggestion(MainActivity.this, SuggestType.APP, "APP闪退:", false, 100); MtaHelper.onEventWithBasicDeviceInfo( "闪退弹窗", "玩家操作", "点击反馈"); diff --git a/app/src/main/java/com/gh/gamecenter/SkipActivity.java b/app/src/main/java/com/gh/gamecenter/SkipActivity.java index 93a99f84ae..839821d8eb 100644 --- a/app/src/main/java/com/gh/gamecenter/SkipActivity.java +++ b/app/src/main/java/com/gh/gamecenter/SkipActivity.java @@ -121,6 +121,27 @@ public class SkipActivity extends BaseActivity { path = path.substring(1); } + String platform = uri.getQueryParameter(KEY_PLATFORM); + String platformName = PlatformUtils.getInstance(this).getPlatformName(platform); + String gameId = uri.getQueryParameter(EntranceConsts.KEY_GAMEID); + String packageMd5 = uri.getQueryParameter(EntranceConsts.KEY_PACKAGE_MD5); + String isQaFeedbackString = uri.getQueryParameter(EntranceConsts.KEY_IS_QA_FEEDBACK); + String suggestionType = uri.getQueryParameter(KEY_TYPE); + boolean isQaFeedback = !TextUtils.isEmpty(isQaFeedbackString) && isQaFeedbackString.equals("true"); + String content = (TextUtils.isEmpty(gameId) || TextUtils.isEmpty(packageMd5)) ? + String.format("%s—V%s—%s(V%s),", + uri.getQueryParameter(KEY_GAME_NAME), + uri.getQueryParameter(KEY_VERSION), + TextUtils.isEmpty(platformName) ? platform : platformName, + uri.getQueryParameter(KEY_PLATFORM_VERSION)) : + String.format("%s-%s-V%s\n游戏ID:%s\n游戏包MD5:%s\n", + uri.getQueryParameter(KEY_GAME_NAME), + TextUtils.isEmpty(platformName) ? platform : platformName, + uri.getQueryParameter(KEY_VERSION), gameId, packageMd5); + String qaId = uri.getQueryParameter("qa_id"); + String qaContentId = uri.getQueryParameter(EntranceConsts.KEY_QA_CONTENT_ID); + String qaTitle = uri.getQueryParameter(EntranceConsts.KEY_QA_TITLE); + if (host != null) { Intent intent; switch (host) { @@ -141,32 +162,12 @@ public class SkipActivity extends BaseActivity { DirectUtils.directToSubject(this, path, uri.getQueryParameter(KEY_NAME), ENTRANCE_BROWSER, null, false); break; case HOST_SUGGESTION: - String platform = uri.getQueryParameter(KEY_PLATFORM); - String platformName = PlatformUtils.getInstance(this).getPlatformName(platform); - String gameId = uri.getQueryParameter(EntranceConsts.KEY_GAMEID); - String packageMd5 = uri.getQueryParameter(EntranceConsts.KEY_PACKAGE_MD5); - String isQaFeedbackString = uri.getQueryParameter(EntranceConsts.KEY_IS_QA_FEEDBACK); - String suggestionType = uri.getQueryParameter(KEY_TYPE); - boolean isQaFeedback = !TextUtils.isEmpty(isQaFeedbackString) && isQaFeedbackString.equals("true"); - String content = (TextUtils.isEmpty(gameId) || TextUtils.isEmpty(packageMd5)) ? - String.format("%s—V%s—%s(V%s),", - uri.getQueryParameter(KEY_GAME_NAME), - uri.getQueryParameter(KEY_VERSION), - TextUtils.isEmpty(platformName) ? platform : platformName, - uri.getQueryParameter(KEY_PLATFORM_VERSION)) : - String.format("%s-%s-V%s\n游戏ID:%s\n游戏包MD5:%s\n", - uri.getQueryParameter(KEY_GAME_NAME), - TextUtils.isEmpty(platformName) ? platform : platformName, - uri.getQueryParameter(KEY_VERSION), gameId, packageMd5); - String qaId = uri.getQueryParameter("qa_id"); - String qaContentId = uri.getQueryParameter(EntranceConsts.KEY_QA_CONTENT_ID); - String qaTitle = uri.getQueryParameter(EntranceConsts.KEY_QA_TITLE); if (!TextUtils.isEmpty(qaId)) { DirectUtils.directToQa(this, qaTitle, qaId); } else if ("vgame".equals(suggestionType)) { - DirectUtils.directToVGameFeedback(this, content, "game", isQaFeedback, qaContentId, EntranceConsts.ENTRANCE_BROWSER); + DirectUtils.directToFeedback(this, content, isQaFeedback, qaContentId, false, true, EntranceConsts.ENTRANCE_BROWSER); } else { - DirectUtils.directToFeedback(this, content, null, isQaFeedback, qaContentId, EntranceConsts.ENTRANCE_BROWSER); + DirectUtils.directToFeedback(this, content, isQaFeedback, qaContentId, true, false, EntranceConsts.ENTRANCE_BROWSER); } break; case HOST_DOWNLOAD: @@ -412,8 +413,11 @@ public class SkipActivity extends BaseActivity { DirectUtils.directToForum(this, TextUtils.isEmpty(position) ? 0 : Integer.parseInt(position)); break; case EntranceConsts.HOST_HELP_AND_FEEDBACK: - position = uri.getQueryParameter("position"); - DirectUtils.directToHelpAndFeedback(this, TextUtils.isEmpty(position) ? 0 : Integer.parseInt(position)); + if ("vgame".equals(suggestionType)) { + DirectUtils.directToHelpAndFeedback(this, content, isQaFeedback, qaContentId, false, true, EntranceConsts.ENTRANCE_BROWSER); + } else { + DirectUtils.directToHelpAndFeedback(this, content, isQaFeedback, qaContentId, true, false, EntranceConsts.ENTRANCE_BROWSER); + } break; case HOST_GAME_COLLECTION_DETAIL: DirectUtils.directToGameCollectionDetail(this, path, ENTRANCE_BROWSER, "", null); diff --git a/app/src/main/java/com/gh/gamecenter/adapter/LibaoDetailAdapter.java b/app/src/main/java/com/gh/gamecenter/adapter/LibaoDetailAdapter.java index d3cb33785f..ca3053eff2 100644 --- a/app/src/main/java/com/gh/gamecenter/adapter/LibaoDetailAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/adapter/LibaoDetailAdapter.java @@ -27,6 +27,7 @@ import com.gh.gamecenter.R; import com.gh.gamecenter.adapter.viewholder.LibaoDetailContentViewHolder; import com.gh.gamecenter.adapter.viewholder.LibaoDetailTopViewHolder; import com.gh.gamecenter.common.callback.OnRequestCallBackListener; +import com.gh.gamecenter.common.entity.SimpleGameEntity; import com.gh.gamecenter.common.entity.SuggestType; import com.gh.gamecenter.common.retrofit.Response; import com.gh.gamecenter.common.utils.ExtensionsKt; @@ -39,9 +40,9 @@ import com.gh.gamecenter.core.utils.StringUtils; import com.gh.gamecenter.databinding.LibaodetailItemContentBinding; import com.gh.gamecenter.databinding.LibaodetailItemTopBinding; import com.gh.gamecenter.entity.LibaoDetailEntity; +import com.gh.gamecenter.feature.entity.GameEntity; import com.gh.gamecenter.feature.entity.LibaoEntity; import com.gh.gamecenter.feature.entity.LibaoStatusEntity; -import com.gh.gamecenter.feature.entity.GameEntity; import com.gh.gamecenter.feature.entity.MeEntity; import com.gh.gamecenter.feature.entity.UserDataLibaoEntity; import com.gh.gamecenter.feature.game.GameItemViewHolder; @@ -156,12 +157,12 @@ public class LibaoDetailAdapter extends BaseRecyclerAdapter { viewHolder.initItemPadding(); viewHolder.getLoading().setVisibility(View.GONE); + SpannableStringBuilder builder = new SpanBuilder("此礼包有问题?点击反馈") .click(mContext, 7, 11, R.color.theme_font, false, () -> { HelpAndFeedbackBridge.startSuggestionActivity(mContext, - SuggestType.normal, "libao", - StringUtils.buildString(mLibaoEntity.getGame().getName(), ",", - mLibaoEntity.getName(), "有问题:")); + SuggestType.GAME, "libao", + StringUtils.buildString(mLibaoEntity.getName(), "有问题:"), new SimpleGameEntity(mLibaoEntity.getGame().getId(), mLibaoEntity.getGame().getName(), mLibaoEntity.getGame().getIcon())); return null; }) .build(); diff --git a/app/src/main/java/com/gh/gamecenter/adapter/ToolBoxRvAdapter.java b/app/src/main/java/com/gh/gamecenter/adapter/ToolBoxRvAdapter.java deleted file mode 100644 index fee5976632..0000000000 --- a/app/src/main/java/com/gh/gamecenter/adapter/ToolBoxRvAdapter.java +++ /dev/null @@ -1,213 +0,0 @@ -package com.gh.gamecenter.adapter; - -import static com.gh.common.constant.Config.URL_ARTICLE; -import static com.gh.gamecenter.R.string.loading; - -import android.content.Context; -import android.content.Intent; -import android.view.View; -import android.view.ViewGroup; - -import androidx.recyclerview.widget.RecyclerView; - -import com.gh.gamecenter.NewsDetailActivity; -import com.gh.gamecenter.R; -import com.gh.gamecenter.WebActivity; -import com.gh.gamecenter.adapter.viewholder.ReuseViewHolder; -import com.gh.gamecenter.adapter.viewholder.ToolBoxViewHolder; -import com.gh.gamecenter.common.callback.OnRequestCallBackListener; -import com.gh.gamecenter.common.entity.SuggestType; -import com.gh.gamecenter.common.entity.ToolBoxEntity; -import com.gh.gamecenter.common.retrofit.Response; -import com.gh.gamecenter.common.utils.ImageUtils; -import com.gh.gamecenter.common.viewholder.FooterViewHolder; -import com.gh.gamecenter.core.utils.MtaHelper; -import com.gh.gamecenter.core.utils.UrlFilterUtils; -import com.gh.gamecenter.databinding.ToolboxItemBinding; -import com.gh.gamecenter.help.HelpAndFeedbackBridge; -import com.gh.gamecenter.retrofit.RetrofitManager; -import com.lightgame.adapter.BaseRecyclerAdapter; - -import java.util.ArrayList; -import java.util.List; - -import io.reactivex.android.schedulers.AndroidSchedulers; -import io.reactivex.schedulers.Schedulers; -import retrofit2.HttpException; - -/** - * Created by khy on 24/05/17. - */ - -public class ToolBoxRvAdapter extends BaseRecyclerAdapter { - - private OnRequestCallBackListener mCallBackListener; - - private List mEntityList; - - private String mSearchKey; - - private boolean mIsSearch; - private boolean mIsLoading; - private boolean mIsOver; - private boolean mIsNetworkError; - private int mPage; - - public ToolBoxRvAdapter(Context context, OnRequestCallBackListener listener, boolean isSearch, String key) { - super(context); - this.mIsSearch = isSearch; - this.mSearchKey = key; - mPage = 1; - - mCallBackListener = listener; - mEntityList = new ArrayList<>(); - loadData(); - } - - public void loadData() { - if (mIsLoading) { - return; - } - mIsLoading = true; - RetrofitManager.getInstance().getApi() - .getToolKitData(mPage, UrlFilterUtils.getFilterQuery("keyword", mIsSearch ? mSearchKey : "")) - .subscribeOn(Schedulers.io()) - .observeOn(AndroidSchedulers.mainThread()) - .subscribe(new Response>() { - @Override - public void onResponse(List response) { - super.onResponse(response); - if (response.size() > 0) { - mEntityList.addAll(response); - } - mCallBackListener.loadDone(); - - if (response.size() < 20) { - mIsOver = true; - } - - notifyDataSetChanged(); - - mPage++; - mIsLoading = false; - - if (mEntityList.size() == 0) { - mCallBackListener.loadEmpty(); - } - } - - @Override - public void onFailure(HttpException e) { - super.onFailure(e); - mIsLoading = false; - if (mEntityList.size() == 0) { - mCallBackListener.loadError(); - } else { - mIsNetworkError = true; - notifyItemChanged(getItemCount() - 1); - } - } - }); - } - - @Override - public int getItemViewType(int position) { - if (position == 0) { - return 1; - } else if (position == getItemCount() - 1) { - return 2; - } else { - return 3; - } - } - - @Override - public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { - if (viewType == 2) { - View view = mLayoutInflater.inflate(R.layout.refresh_footerview, parent, false); - return new FooterViewHolder(view); - } else if (viewType == 1) { - View view = mLayoutInflater.inflate(R.layout.toolbox_hint_item, parent, false); - return new ReuseViewHolder(view); - } else { - View view = mLayoutInflater.inflate(R.layout.toolbox_item, parent, false); - return new ToolBoxViewHolder(ToolboxItemBinding.bind(view)); - } - - } - - @Override - public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { - if (holder instanceof ToolBoxViewHolder) { - ToolBoxViewHolder viewHolder = (ToolBoxViewHolder) holder; - ToolBoxEntity toolBoxEntity = mEntityList.get(position - 1); - initToolBoxViewHolder(viewHolder, toolBoxEntity); - } else if (holder instanceof FooterViewHolder) { - FooterViewHolder viewHolder = (FooterViewHolder) holder; - initFooterViewHolder(viewHolder); - } else if (holder instanceof ReuseViewHolder) { - holder.itemView.setOnClickListener(v -> { - MtaHelper.onEvent("我的光环_新", "工具箱", "点击反馈"); - HelpAndFeedbackBridge.startSuggestionActivity(mContext, SuggestType.normal, null, null); - }); - } - } - - @Override - public int getItemCount() { - if (mEntityList.size() > 0) { - return mEntityList.size() + 2; - } else { - return 0; - } - - } - - private void initFooterViewHolder(FooterViewHolder viewHolder) { - viewHolder.initItemPadding(); - if (mIsNetworkError) { - viewHolder.getLoading().setVisibility(View.GONE); - viewHolder.getHint().setText(R.string.loading_failed_retry); - viewHolder.itemView.setClickable(true); - viewHolder.itemView.setOnClickListener(v -> loadData()); - } else if (mIsOver) { - viewHolder.getLoading().setVisibility(View.GONE); - viewHolder.getHint().setText(R.string.loading_complete); - viewHolder.itemView.setClickable(false); - } else { - viewHolder.getLoading().setVisibility(View.VISIBLE); - viewHolder.getHint().setText(loading); - viewHolder.itemView.setClickable(false); - } - } - - private void initToolBoxViewHolder(ToolBoxViewHolder viewHolder, final ToolBoxEntity toolBoxEntity) { - viewHolder.binding.toolboxItemDes.setText(toolBoxEntity.getDes()); - viewHolder.binding.toolboxItemTitle.setText(toolBoxEntity.getName()); - ImageUtils.display(viewHolder.binding.toolboxItemGameThumb, toolBoxEntity.getIcon()); - - viewHolder.itemView.setOnClickListener(v -> { - String url = toolBoxEntity.getUrl(); -// http://www.ghzs666.com/article/59291e7ce9a64a496cfd6897.html - if (url != null && url.contains(URL_ARTICLE)) { - String newsId = url.substring(url.lastIndexOf("/") + 1, url.length() - 5); // 5: ".html" - Intent intent = NewsDetailActivity.getIntentById(mContext, newsId, "工具箱列表"); - mContext.startActivity(intent); - } else { - mContext.startActivity(WebActivity.getWebByCollectionTools(mContext, toolBoxEntity, false)); - } - }); - } - - public boolean isOver() { - return mIsOver; - } - - public boolean isLoading() { - return mIsLoading; - } - - public boolean isNetworkError() { - return mIsNetworkError; - } -} diff --git a/app/src/main/java/com/gh/gamecenter/amway/search/AmwaySearchListFragment.kt b/app/src/main/java/com/gh/gamecenter/amway/search/AmwaySearchListFragment.kt index 8168526b46..90b9a6d0c3 100644 --- a/app/src/main/java/com/gh/gamecenter/amway/search/AmwaySearchListFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/amway/search/AmwaySearchListFragment.kt @@ -5,6 +5,7 @@ import android.view.View import androidx.recyclerview.widget.LinearLayoutManager import com.gh.gamecenter.common.base.fragment.ToolbarFragment import com.gh.gamecenter.common.baselist.LoadStatus +import com.gh.gamecenter.common.entity.SimpleGameEntity import com.gh.gamecenter.common.entity.SuggestType import com.gh.gamecenter.common.utils.observeNonNull import com.gh.gamecenter.common.utils.viewModelProviderFromParent @@ -35,7 +36,13 @@ class AmwaySearchListFragment : ToolbarFragment() { mBinding.noDataContainer.reuseNoneDataDescTv.text = "换个搜索词试试~" mBinding.noDataContainer.reuseResetLoadTv.visibility = View.VISIBLE mBinding.noDataContainer.reuseResetLoadTv.setOnClickListener { - HelpAndFeedbackBridge.startSuggestionActivity(requireContext(), SuggestType.gameCollect, "求游戏:") + HelpAndFeedbackBridge.startSuggestionActivity( + requireContext(), + SuggestType.UPDATE, + null, + null, + SimpleGameEntity(name = mViewModel.currentSearchKey) + ) } mBinding.errorContainer.connectionReloadTv.setOnClickListener { diff --git a/app/src/main/java/com/gh/gamecenter/amway/search/AmwaySearchViewModel.kt b/app/src/main/java/com/gh/gamecenter/amway/search/AmwaySearchViewModel.kt index c8f5675bb1..2c9d5156b2 100644 --- a/app/src/main/java/com/gh/gamecenter/amway/search/AmwaySearchViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/amway/search/AmwaySearchViewModel.kt @@ -9,10 +9,10 @@ import com.gh.common.constant.Config import com.gh.common.util.PackageHelper import com.gh.gamecenter.BuildConfig import com.gh.gamecenter.common.baselist.LoadStatus -import com.gh.gamecenter.feature.entity.GameEntity -import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.common.retrofit.BiResponse import com.gh.gamecenter.common.retrofit.Response +import com.gh.gamecenter.feature.entity.GameEntity +import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.retrofit.RetrofitManager import com.halo.assistant.HaloApp import com.lightgame.utils.Utils @@ -23,6 +23,7 @@ import retrofit2.HttpException class AmwaySearchViewModel(application: Application) : AndroidViewModel(application) { private var mTempSearchKey = "" + var currentSearchKey = "" var loadStatus = MutableLiveData() @@ -41,6 +42,7 @@ class AmwaySearchViewModel(application: Application) : AndroidViewModel(applicat fun getSearchResult(searchKey: String) { mTempSearchKey = searchKey + currentSearchKey = searchKey loadStatus.postValue(LoadStatus.INIT_LOADING) RetrofitManager .getInstance().api diff --git a/app/src/main/java/com/gh/gamecenter/download/UpdatableGameAdapter.kt b/app/src/main/java/com/gh/gamecenter/download/UpdatableGameAdapter.kt index 2ad51c0e48..f2da405dbd 100644 --- a/app/src/main/java/com/gh/gamecenter/download/UpdatableGameAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/download/UpdatableGameAdapter.kt @@ -15,6 +15,7 @@ import com.gh.download.DownloadManager import com.gh.download.dialog.DownloadDialog import com.gh.gamecenter.DownloadManagerActivity import com.gh.gamecenter.R +import com.gh.gamecenter.common.databinding.LayoutPopupContainerBinding import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.common.utils.NewFlatLogUtils import com.gh.gamecenter.common.view.BugFixedPopupWindow diff --git a/app/src/main/java/com/gh/gamecenter/forum/detail/ForumDetailFragment.kt b/app/src/main/java/com/gh/gamecenter/forum/detail/ForumDetailFragment.kt index 2c933b811a..48ed91f935 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/detail/ForumDetailFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/detail/ForumDetailFragment.kt @@ -48,6 +48,8 @@ import com.gh.gamecenter.common.base.fragment.BaseLazyTabFragment import com.gh.gamecenter.common.callback.BiCallback import com.gh.gamecenter.common.constant.Constants import com.gh.gamecenter.common.constant.EntranceConsts +import com.gh.gamecenter.common.databinding.ItemIconTabBinding +import com.gh.gamecenter.common.databinding.PopupAllTabsBinding import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.common.mvvm.Status import com.gh.gamecenter.common.utils.* @@ -55,8 +57,6 @@ import com.gh.gamecenter.core.iinterface.IScrollable import com.gh.gamecenter.core.runOnUiThread import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.databinding.FragmentForumDetailBinding -import com.gh.gamecenter.databinding.ItemForumSectionBinding -import com.gh.gamecenter.databinding.PopupForumDetailSectionsBinding import com.gh.gamecenter.entity.* import com.gh.gamecenter.eventbus.EBForumFollowChange import com.gh.gamecenter.eventbus.EBTopCommunityChanged @@ -1080,7 +1080,7 @@ class ForumDetailFragment : BaseLazyTabFragment(), IScrollable { } private fun showSectionsPopupWindow() { - val binding = PopupForumDetailSectionsBinding.inflate(LayoutInflater.from(requireContext()), null, false) + val binding = PopupAllTabsBinding.inflate(LayoutInflater.from(requireContext()), null, false) val popupWindow = PopupWindow( binding.root, LinearLayout.LayoutParams.MATCH_PARENT, @@ -1119,9 +1119,9 @@ class ForumDetailFragment : BaseLazyTabFragment(), IScrollable { } private fun toggleHighlightedView(targetView: View, highlightIt: Boolean) { - val sectionTv = targetView.findViewById(R.id.sectionTv) + val sectionTv = targetView.findViewById(R.id.titleTv) if (highlightIt) { - targetView.background = R.drawable.button_round_primary_light.toDrawable(requireContext()) + targetView.background = R.drawable.button_round_theme_alpha_10.toDrawable(requireContext()) sectionTv?.setTextColor(R.color.theme_font.toColor(requireContext())) } else { targetView.background = R.drawable.button_round_gray_light.toDrawable(requireContext()) @@ -1130,8 +1130,8 @@ class ForumDetailFragment : BaseLazyTabFragment(), IScrollable { } private fun getSectionItemView(entity: ForumDetailEntity.Section): View { - return ItemForumSectionBinding.bind( - LayoutInflater.from(requireContext()).inflate(R.layout.item_forum_section, null) + return ItemIconTabBinding.bind( + LayoutInflater.from(requireContext()).inflate(R.layout.item_icon_tab, null) ).apply { iconIv.goneIf(entity.iconType.isEmpty() || entity.iconType == "none") when { @@ -1139,7 +1139,7 @@ class ForumDetailFragment : BaseLazyTabFragment(), IScrollable { entity.iconType == "new" -> ImageUtils.display(iconIv, R.drawable.icon_section_newest) entity.iconType == "hot" -> ImageUtils.display(iconIv, R.drawable.icon_section_heat) } - sectionTv.text = entity.name + titleTv.text = entity.name }.root.apply { layoutParams = LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, 24F.dip2px()) } diff --git a/app/src/main/java/com/gh/gamecenter/forum/detail/ForumSectionAdapter.kt b/app/src/main/java/com/gh/gamecenter/forum/detail/ForumSectionAdapter.kt index 7e30e717df..0d756e9838 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/detail/ForumSectionAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/detail/ForumSectionAdapter.kt @@ -5,8 +5,8 @@ import android.view.ViewGroup import android.view.ViewGroup.MarginLayoutParams import androidx.recyclerview.widget.RecyclerView import com.gh.gamecenter.R +import com.gh.gamecenter.common.databinding.ItemIconTabBinding import com.gh.gamecenter.common.utils.* -import com.gh.gamecenter.databinding.ItemForumSectionBinding import com.gh.gamecenter.entity.ForumDetailEntity import com.lightgame.adapter.BaseRecyclerAdapter @@ -37,7 +37,7 @@ class ForumSectionAdapter(context: Context, val viewModel: ForumDetailViewModel, entity.iconType == "new" -> ImageUtils.display(holder.binding.iconIv, R.drawable.icon_section_newest) entity.iconType == "hot" -> ImageUtils.display(holder.binding.iconIv, R.drawable.icon_section_heat) } - holder.binding.sectionTv.run { + holder.binding.titleTv.run { text = entity.name setTextColor( if (entity.id == viewModel.selectedSection.id) R.color.theme_font.toColor(mContext) else R.color.text_subtitle.toColor( @@ -55,11 +55,13 @@ class ForumSectionAdapter(context: Context, val viewModel: ForumDetailViewModel, leftMargin = if (position == 0) 16F.dip2px() else 6F.dip2px() } background = - if (entity.id == viewModel.selectedSection.id) R.drawable.button_round_primary_light.toDrawable(mContext) else R.drawable.button_round_gray_light.toDrawable( + if (entity.id == viewModel.selectedSection.id) R.drawable.button_round_theme_alpha_10.toDrawable( + mContext + ) else R.drawable.button_round_gray_light.toDrawable( mContext ) } } - class ForumSectionItemViewHolder(val binding: ItemForumSectionBinding) : RecyclerView.ViewHolder(binding.root) + class ForumSectionItemViewHolder(val binding: ItemIconTabBinding) : RecyclerView.ViewHolder(binding.root) } \ No newline at end of file diff --git a/app/src/main/java/com/gh/gamecenter/gamecollection/choose/AddSearchGameFragment.kt b/app/src/main/java/com/gh/gamecenter/gamecollection/choose/AddSearchGameFragment.kt index 3d9c9c73f7..595cabf074 100644 --- a/app/src/main/java/com/gh/gamecenter/gamecollection/choose/AddSearchGameFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/gamecollection/choose/AddSearchGameFragment.kt @@ -56,7 +56,7 @@ class AddSearchGameFragment : GameFragment() { } mBinding.reuseNoneData.reuseResetLoadTv.setOnClickListener { - HelpAndFeedbackBridge.startSuggestionActivity(requireContext(), SuggestType.gameCollect, "【游戏单添加游戏】") + HelpAndFeedbackBridge.startSuggestionActivity(requireContext(), SuggestType.UPDATE, "【游戏单添加游戏】") } } diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/desc/DescAdapter.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/desc/DescAdapter.kt index ffb396bf61..53d615ca97 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/desc/DescAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/desc/DescAdapter.kt @@ -31,10 +31,10 @@ import com.gh.common.util.NewLogUtils import com.gh.gamecenter.GameNewsActivity import com.gh.gamecenter.R import com.gh.gamecenter.common.base.GlobalActivityManager -import com.gh.gamecenter.common.callback.OnListClickListener import com.gh.gamecenter.common.constant.Constants import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.common.entity.LinkEntity +import com.gh.gamecenter.common.entity.SimpleGameEntity import com.gh.gamecenter.common.entity.SuggestType import com.gh.gamecenter.common.eventbus.EBReuse import com.gh.gamecenter.common.utils.* @@ -170,7 +170,13 @@ class DescAdapter( holder.hint.setText(R.string.game_suggestion_hint) holder.itemView.setOnClickListener { - HelpAndFeedbackBridge.startSuggestionActivity(mContext, SuggestType.gameQuestion, "game", mGameName) + HelpAndFeedbackBridge.startSuggestionActivity( + mContext, + SuggestType.GAME, + "game", + null, + SimpleGameEntity(mGameId, mGameName) + ) MtaHelper.onEvent(MTA_KEY_GAME_NEW, "此游戏有问题_点击反馈", mGameName) } } diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/fuli/FuLiAdapter.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/fuli/FuLiAdapter.kt index 064faaa35b..660451ca58 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/fuli/FuLiAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/fuli/FuLiAdapter.kt @@ -14,6 +14,7 @@ import com.gh.gamecenter.GameNewsActivity import com.gh.gamecenter.NewsDetailActivity import com.gh.gamecenter.R import com.gh.gamecenter.adapter.viewholder.GameDetailNoticeViewHolder +import com.gh.gamecenter.common.entity.SimpleGameEntity import com.gh.gamecenter.common.entity.SuggestType import com.gh.gamecenter.common.utils.goneIf import com.gh.gamecenter.common.utils.setRootBackgroundColor @@ -105,9 +106,14 @@ class FuLiAdapter( holder.itemView.setOnClickListener { HelpAndFeedbackBridge.startSuggestionActivity( mContext, - SuggestType.gameQuestion, + SuggestType.GAME, "game", - mFuLiViewModel?.game?.name + null, + SimpleGameEntity( + mFuLiViewModel?.game?.id ?: "", + mFuLiViewModel?.game?.name ?: "", + mFuLiViewModel?.game?.icon ?: "" + ) ) MtaHelper.onEvent("游戏详情_新", "此游戏有问题_点击反馈", mFuLiViewModel?.game?.name) } diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/fuli/kaifu/ServersCalendarActivity.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/fuli/kaifu/ServersCalendarActivity.kt index 728429d48e..7681d450f3 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/fuli/kaifu/ServersCalendarActivity.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/fuli/kaifu/ServersCalendarActivity.kt @@ -390,7 +390,7 @@ class ServersCalendarActivity : ToolBarActivity() { } HelpAndFeedbackBridge.startSuggestionActivity( this, - SuggestType.normal, + SuggestType.GAME, "service", builder.toString() ) diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/edit/RatingEditActivity.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/edit/RatingEditActivity.kt index 3a2f7d4358..66b7eb4db9 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/edit/RatingEditActivity.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/edit/RatingEditActivity.kt @@ -15,7 +15,6 @@ import androidx.lifecycle.Observer import androidx.lifecycle.ViewModelProviders import com.gh.common.DefaultJsApi import com.gh.common.util.* -import com.gh.common.util.DialogUtils import com.gh.common.util.NewFlatLogUtils import com.gh.common.util.NewLogUtils import com.gh.gamecenter.BuildConfig @@ -31,6 +30,7 @@ import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.entity.ErrorEntity import com.gh.gamecenter.common.entity.NotificationUgc import com.gh.gamecenter.common.entity.SimpleGameEntity +import com.gh.gamecenter.common.entity.SuggestType import com.gh.gamecenter.common.mvvm.Status import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.common.view.dsbridge.DWebView @@ -40,9 +40,8 @@ import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.databinding.ActivityRatingEditBinding import com.gh.gamecenter.databinding.FragmentWebWarningBinding import com.gh.gamecenter.entity.* -import com.gh.gamecenter.login.user.UserManager -import com.gh.gamecenter.common.entity.SuggestType import com.gh.gamecenter.feature.entity.GameEntity +import com.gh.gamecenter.login.user.UserManager import com.halo.assistant.HaloApp import com.lightgame.utils.Utils import com.walkud.rom.checker.RomIdentifier @@ -436,7 +435,7 @@ class RatingEditActivity : ToolBarActivity(), KeyboardHeightObserver { mBinding.mWebView.callHandler("getComment", OnReturnValue { content -> DirectUtils.directToSuggestion( context = this@RatingEditActivity, - type = SuggestType.gameQuestion, + type = SuggestType.GAME, content = content.replace(LABEL_REPLACE_REGEX.toRegex(), ""), fromRatingKey = true, game = SimpleGameEntity(mGame?.id ?: "", mGame?.name ?: "") diff --git a/app/src/main/java/com/gh/gamecenter/help/HelpAndFeedbackBridge.kt b/app/src/main/java/com/gh/gamecenter/help/HelpAndFeedbackBridge.kt index 8271e2c200..311e61eebe 100644 --- a/app/src/main/java/com/gh/gamecenter/help/HelpAndFeedbackBridge.kt +++ b/app/src/main/java/com/gh/gamecenter/help/HelpAndFeedbackBridge.kt @@ -2,6 +2,7 @@ package com.gh.gamecenter.help import android.content.Context import android.content.Intent +import android.os.Bundle import com.alibaba.android.arouter.launcher.ARouter import com.gh.gamecenter.common.constant.RouteConsts import com.gh.gamecenter.common.entity.SimpleGameEntity @@ -23,25 +24,6 @@ object HelpAndFeedbackBridge { mHelpAndFeedbackHelp?.startSuggestionActivity(context, suggestType, suggestHintType, content) } - @JvmStatic - fun startSuggestionActivity( - context: Context?, - suggestType: SuggestType?, - suggestHintType: String?, - content: String?, - isQaFeedback: Boolean, - qaContentId: String? - ) { - mHelpAndFeedbackHelp?.startSuggestionActivity( - context, - suggestType, - suggestHintType, - content, - isQaFeedback, - qaContentId - ) - } - @JvmStatic fun startSuggestionActivity( context: Context?, @@ -53,35 +35,11 @@ object HelpAndFeedbackBridge { mHelpAndFeedbackHelp?.startSuggestionActivity(context, suggestType, suggestHintType, content, game) } - @JvmStatic - fun startSuggestionActivity( - context: Context?, - suggestType: SuggestType?, - suggestHintType: String?, - content: String?, - game: SimpleGameEntity?, - gamePlatform: String? - ) { - mHelpAndFeedbackHelp?.startSuggestionActivity( - context, - suggestType, - suggestHintType, - content, - game, - gamePlatform - ) - } - @JvmStatic fun startSuggestionActivity(context: Context?, suggestType: SuggestType?, hint: String?) { mHelpAndFeedbackHelp?.startSuggestionActivity(context, suggestType, hint) } - @JvmStatic - fun getIntentFromNetworkDiagnosis(context: Context?, diagnosis: String?): Intent? { - return mHelpAndFeedbackHelp?.getIntentFromNetworkDiagnosis(context, diagnosis) - } - @JvmStatic fun getIntent( context: Context?, @@ -89,12 +47,12 @@ object HelpAndFeedbackBridge { hiddenHint: String?, suggestHintType: String?, content: String?, - platform: String?, game: SimpleGameEntity?, isQaFeedback: Boolean, qaContentId: String?, fromRatingKey: Boolean, - diagnosis: String + diagnosis: String, + forceLogin: Boolean ): Intent? { return mHelpAndFeedbackHelp?.getIntent( context, @@ -102,12 +60,17 @@ object HelpAndFeedbackBridge { hiddenHint, suggestHintType, content, - platform, game, isQaFeedback, qaContentId, fromRatingKey, - diagnosis + diagnosis, + forceLogin ) } + + @JvmStatic + fun getSuggestionCategoryIntent(context: Context, bundle: Bundle? = null): Intent? { + return mHelpAndFeedbackHelp?.getSuggestionCategoryIntent(context, bundle) + } } \ No newline at end of file diff --git a/app/src/main/java/com/gh/gamecenter/home/amway/HomeAmwayListViewHolder.kt b/app/src/main/java/com/gh/gamecenter/home/amway/HomeAmwayListViewHolder.kt index 5913bc727f..72beb85ceb 100644 --- a/app/src/main/java/com/gh/gamecenter/home/amway/HomeAmwayListViewHolder.kt +++ b/app/src/main/java/com/gh/gamecenter/home/amway/HomeAmwayListViewHolder.kt @@ -3,6 +3,7 @@ package com.gh.gamecenter.home.amway import android.view.View import androidx.recyclerview.widget.RecyclerView import com.gh.gamecenter.common.base.BaseRecyclerViewHolder +import com.gh.gamecenter.common.utils.LeftPagerSnapHelper import com.gh.gamecenter.common.utils.dip2px import com.gh.gamecenter.common.view.FixLinearLayoutManager import com.gh.gamecenter.databinding.HomeAmwayListBinding diff --git a/app/src/main/java/com/gh/gamecenter/home/horizontalslidevideo/HomeHorizontalSlideVideoListViewHolder.kt b/app/src/main/java/com/gh/gamecenter/home/horizontalslidevideo/HomeHorizontalSlideVideoListViewHolder.kt index a18ceb78ad..f5d4050a14 100644 --- a/app/src/main/java/com/gh/gamecenter/home/horizontalslidevideo/HomeHorizontalSlideVideoListViewHolder.kt +++ b/app/src/main/java/com/gh/gamecenter/home/horizontalslidevideo/HomeHorizontalSlideVideoListViewHolder.kt @@ -8,7 +8,7 @@ import com.gh.gamecenter.databinding.HomeHorizontalSlideVideoListBinding import com.gh.gamecenter.entity.SubjectEntity import com.gh.gamecenter.feature.exposure.ExposureEvent import com.gh.gamecenter.feature.exposure.ExposureSource -import com.gh.gamecenter.home.amway.LeftPagerSnapHelper +import com.gh.gamecenter.common.utils.LeftPagerSnapHelper import com.gh.gamecenter.home.video.ScrollCalculatorHelper class HomeHorizontalSlideVideoListViewHolder(val binding: HomeHorizontalSlideVideoListBinding) : diff --git a/app/src/main/java/com/gh/gamecenter/qa/answer/detail/AnswerDetailFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/answer/detail/AnswerDetailFragment.kt index 108dd8db7f..f24c6f9588 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/answer/detail/AnswerDetailFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/answer/detail/AnswerDetailFragment.kt @@ -699,7 +699,7 @@ open class AnswerDetailFragment : ToolbarFragment() { "投诉" -> { HelpAndFeedbackBridge.startSuggestionActivity( context, - SuggestType.normal, + SuggestType.APP, "report", "回答投诉($mAnswerId):" ) diff --git a/app/src/main/java/com/gh/gamecenter/qa/editor/FullScreenVideoActivity.kt b/app/src/main/java/com/gh/gamecenter/qa/editor/FullScreenVideoActivity.kt index 4240607acb..b7b2c8b5f0 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/editor/FullScreenVideoActivity.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/editor/FullScreenVideoActivity.kt @@ -6,20 +6,31 @@ import android.content.Intent import android.content.pm.ActivityInfo import android.os.Build import android.os.Bundle -import com.gh.gamecenter.common.base.activity.BaseActivity -import com.gh.gamecenter.core.utils.DisplayUtils -import com.gh.gamecenter.common.constant.EntranceConsts -import com.gh.gamecenter.core.utils.MD5Utils -import com.gh.gamecenter.common.utils.NetworkUtils +import com.alibaba.android.arouter.facade.annotation.Route +import com.gh.common.util.NewFlatLogUtils import com.gh.gamecenter.R +import com.gh.gamecenter.common.base.activity.BaseActivity +import com.gh.gamecenter.common.constant.EntranceConsts +import com.gh.gamecenter.common.constant.RouteConsts +import com.gh.gamecenter.common.utils.NetworkUtils +import com.gh.gamecenter.common.utils.roundTo +import com.gh.gamecenter.core.utils.DisplayUtils +import com.gh.gamecenter.core.utils.MD5Utils import com.gh.gamecenter.databinding.ActivityFullScreenVideoBinding import com.gh.gamecenter.forum.home.ForumScrollCalculatorHelper import com.gh.gamecenter.video.detail.CustomManager import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder +@Route(path = RouteConsts.activity.fullScreenVideoActivity) class FullScreenVideoActivity : BaseActivity() { private var mVideoUrl = "" + private var mIsQAVideo = false + private var mQAContentId = "" + private var mQAContentTitle = "" + private var mQAVideoId = "" + private var mQASequence = -1 + private var mQAVideoLength = 0 private lateinit var mBinding: ActivityFullScreenVideoBinding private var mCurrentPosition = -1 @@ -28,18 +39,56 @@ class FullScreenVideoActivity : BaseActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) if (Build.VERSION.SDK_INT != Build.VERSION_CODES.O) { - requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE + requestedOrientation = if (intent.getBooleanExtra(EntranceConsts.KEY_IS_LANDSCAPE, true)) { + ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE + } else { + ActivityInfo.SCREEN_ORIENTATION_PORTRAIT + } } DisplayUtils.transparentStatusBar(this) DisplayUtils.hideNavigationBar(this) mBinding = ActivityFullScreenVideoBinding.bind(mContentView) mVideoUrl = intent.getStringExtra(EntranceConsts.KEY_URL) ?: "" + mIsQAVideo = intent.getBooleanExtra(EntranceConsts.KEY_IS_QA_FEEDBACK, false) + mQAContentId = intent.getStringExtra(EntranceConsts.KEY_ID) ?: "" + mQAContentTitle = intent.getStringExtra(EntranceConsts.KEY_QA_TITLE) ?: "" + mQASequence = intent.getIntExtra(EntranceConsts.KEY_SEQUENCE, -1) + mQAVideoId = intent.getStringExtra(EntranceConsts.KEY_VIDEO_ID) ?: "" + mQAVideoLength = intent.getIntExtra(EntranceConsts.KEY_VIDEO_LENGTH, 0) val poster = intent.getStringExtra(EntranceConsts.KEY_POSTER_PATH) ?: "" val title = intent.getStringExtra(EntranceConsts.KEY_NAVIGATION_TITLE) ?: "" val position = intent.getLongExtra(EntranceConsts.KEY_POSITION, -1L) mBinding.videoView.backBtn.setOnClickListener { finish() } setUpTopVideo(title, mVideoUrl, poster, position) + + mBinding.videoView.logCallback = { + val eventName = when (it) { + "开始播放" -> "qa_video_play" + "暂停播放" -> "qa_video_pause" + "播放完毕" -> "qa_video_finish" + "重新播放" -> "qa_video_replay" + "点击静音" -> "qa_video_click_mute" + "取消静音" -> "qa_video_cancel_mute" + "拖动" -> "qa_video_drag_progress" + else -> "" + } + if (mIsQAVideo && eventName.isNotEmpty() && mQAVideoLength != 0) { + val currentTimeSeconds = mCurrentPosition / 1000F + val progress = (currentTimeSeconds / mQAVideoLength).roundTo(4) + NewFlatLogUtils.logQAVideo( + eventName, + mQAContentId, + mQAContentTitle, + "帮助视频", + mQASequence + 1, + mQAVideoId, + "点击播放", + progress, + currentTimeSeconds.toInt() + ) + } + } } private fun setUpTopVideo(title: String, url: String, poster: String, position: Long) { @@ -83,6 +132,21 @@ class FullScreenVideoActivity : BaseActivity() { } override fun finish() { + if (mIsQAVideo && mQAVideoLength != 0) { + val currentTimeSeconds = mCurrentPosition / 1000F + val progress = (currentTimeSeconds / mQAVideoLength).roundTo(4) + NewFlatLogUtils.logQAVideo( + "qa_video_shut", + mQAContentId, + mQAContentTitle, + "帮助视频", + mQASequence + 1, + mQAVideoId, + "点击播放", + progress, + currentTimeSeconds.toInt() + ) + } if (!isFinishing) { val newIntent = Intent().apply { putExtra(EntranceConsts.KEY_URL, mVideoUrl) @@ -102,12 +166,20 @@ class FullScreenVideoActivity : BaseActivity() { companion object { const val REQUEST_CODE = 10013 - fun start(context: Context, title: String, url: String, poster: String, progress: Long = -1L) { + fun start( + context: Context, + title: String, + url: String, + poster: String, + progress: Long = -1L, + isLandscape: Boolean = true + ) { val intent = Intent(context, FullScreenVideoActivity::class.java) intent.putExtra(EntranceConsts.KEY_URL, url) intent.putExtra(EntranceConsts.KEY_POSITION, progress) intent.putExtra(EntranceConsts.KEY_NAVIGATION_TITLE, title) intent.putExtra(EntranceConsts.KEY_POSTER_PATH, poster) + intent.putExtra(EntranceConsts.KEY_IS_LANDSCAPE, isLandscape) if (context is Activity) { context.startActivityForResult(intent, REQUEST_CODE) } else { diff --git a/app/src/main/java/com/gh/gamecenter/qa/editor/FullScreenVideoView.kt b/app/src/main/java/com/gh/gamecenter/qa/editor/FullScreenVideoView.kt index 8c3813c519..5e1bd70764 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/editor/FullScreenVideoView.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/editor/FullScreenVideoView.kt @@ -44,6 +44,7 @@ class FullScreenVideoView @JvmOverloads constructor(context: Context, attrs: Att private lateinit var mBinding: LayoutFullScreenDetailVideoPortraitBinding val backBtn: View = findViewById(R.id.back) var uuid = UUID.randomUUID().toString() + var logCallback: ((String) -> Unit)? = null init { post { @@ -401,6 +402,7 @@ class FullScreenVideoView @JvmOverloads constructor(context: Context, attrs: Att } fun uploadVideoStreamingPlaying(action: String) { + logCallback?.invoke(action) /*if (video == null || video?.url.isNullOrEmpty()) return runOnIoThread { val isLandscape = mOrientationUtils != null diff --git a/app/src/main/java/com/gh/gamecenter/search/SearchGameIndexFragment.kt b/app/src/main/java/com/gh/gamecenter/search/SearchGameIndexFragment.kt index f122df393d..dcd1b01f5b 100644 --- a/app/src/main/java/com/gh/gamecenter/search/SearchGameIndexFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/search/SearchGameIndexFragment.kt @@ -20,6 +20,7 @@ import com.gh.gamecenter.common.baselist.ListFragment import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.constant.ItemViewType +import com.gh.gamecenter.common.entity.SimpleGameEntity import com.gh.gamecenter.common.entity.SuggestType import com.gh.gamecenter.common.utils.toColor import com.gh.gamecenter.common.utils.viewModelProvider @@ -111,13 +112,19 @@ class SearchGameIndexFragment : ListFragment { Util_System_Keyboard.hideSoftKeyboard(requireActivity()) LogUtils.uploadSearchGame("ask_more_func", "搜索页", mKey, SearchType.fromString(mType).toChinese()) - HelpAndFeedbackBridge.startSuggestionActivity(context, SuggestType.functionSuggest, "", "求功能:$mKey") + HelpAndFeedbackBridge.startSuggestionActivity(context, SuggestType.FUNCTION, "", "求功能:$mKey") } R.id.reuseNoDataSkipGameTv -> { Util_System_Keyboard.hideSoftKeyboard(requireActivity()) LogUtils.uploadSearchGame("ask_more_games", "搜索页", mKey, SearchType.fromString(mType).toChinese()) - HelpAndFeedbackBridge.startSuggestionActivity(context, SuggestType.gameCollect, "", "求游戏:$mKey") + HelpAndFeedbackBridge.startSuggestionActivity( + context, + SuggestType.UPDATE, + null, + null, + SimpleGameEntity(name = mKey) + ) } } } diff --git a/app/src/main/java/com/gh/gamecenter/search/SearchGameResultAdapter.kt b/app/src/main/java/com/gh/gamecenter/search/SearchGameResultAdapter.kt index 64a3268d78..fc978f5282 100644 --- a/app/src/main/java/com/gh/gamecenter/search/SearchGameResultAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/search/SearchGameResultAdapter.kt @@ -23,6 +23,7 @@ import com.gh.gamecenter.adapter.viewholder.SearchGameFooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.constant.Constants import com.gh.gamecenter.common.constant.ItemViewType +import com.gh.gamecenter.common.entity.SimpleGameEntity import com.gh.gamecenter.common.entity.SuggestType import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.common.viewholder.FooterViewHolder @@ -42,12 +43,6 @@ import com.gh.gamecenter.help.HelpAndFeedbackBridge import com.lightgame.download.DownloadEntity import com.lightgame.utils.Util_System_Keyboard import org.greenrobot.eventbus.EventBus -import kotlin.collections.ArrayList -import kotlin.collections.HashMap -import kotlin.collections.List -import kotlin.collections.MutableList -import kotlin.collections.forEach -import kotlin.collections.isNotEmpty import kotlin.collections.set import com.gh.gamecenter.common.base.GlobalActivityManager @@ -211,11 +206,17 @@ class SearchGameResultAdapter( private fun bindFooterItem(holder: SearchGameFooterViewHolder) { holder.binding.skipFunction.setOnClickListener { LogUtils.uploadSearchGame("ask_more_func", " 搜索页", key, SearchType.fromString(type).toChinese()) - HelpAndFeedbackBridge.startSuggestionActivity(mContext, SuggestType.functionSuggest, "求功能:") + HelpAndFeedbackBridge.startSuggestionActivity(mContext, SuggestType.FUNCTION, "", "求功能:$key") } holder.binding.skipGame.setOnClickListener { LogUtils.uploadSearchGame("ask_more_games", " 搜索页", key, SearchType.fromString(type).toChinese()) - HelpAndFeedbackBridge.startSuggestionActivity(mContext, SuggestType.gameCollect, "求游戏:") + HelpAndFeedbackBridge.startSuggestionActivity( + mContext, + SuggestType.UPDATE, + null, + null, + SimpleGameEntity(name = key) + ) } fragment.showAd(holder.binding.hintText, true) } diff --git a/app/src/main/java/com/gh/gamecenter/search/SearchGameResultFragment.kt b/app/src/main/java/com/gh/gamecenter/search/SearchGameResultFragment.kt index d23f5fb10e..52571ece62 100644 --- a/app/src/main/java/com/gh/gamecenter/search/SearchGameResultFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/search/SearchGameResultFragment.kt @@ -259,14 +259,14 @@ open class SearchGameResultFragment : ListFragment { Util_System_Keyboard.hideSoftKeyboard(requireActivity()) MtaHelper.onEvent("游戏搜索", "求游戏", mKey) LogUtils.uploadSearchGame("ask_more_games", "搜索页", mKey, SearchType.fromString(mType).toChinese()) - HelpAndFeedbackBridge.startSuggestionActivity(context, SuggestType.gameCollect, "", "求游戏:$mKey") + HelpAndFeedbackBridge.startSuggestionActivity(context, SuggestType.UPDATE, "", "求游戏:$mKey") } R.id.container_menu_close -> { @@ -300,7 +300,7 @@ open class SearchGameResultFragment : ListFragment) { val processedMessage = StringBuilder().apply { + append("【畅玩问题】") append(game.name) game.getApk().safelyGetInRelease(0)?.version?.run { append("-$this") diff --git a/app/src/main/java/com/gh/vspace/shortcut/ShortcutPermissionDialog.kt b/app/src/main/java/com/gh/vspace/shortcut/ShortcutPermissionDialog.kt index 8cdf95010a..f1d5b08183 100644 --- a/app/src/main/java/com/gh/vspace/shortcut/ShortcutPermissionDialog.kt +++ b/app/src/main/java/com/gh/vspace/shortcut/ShortcutPermissionDialog.kt @@ -10,6 +10,7 @@ import android.view.Window import com.gh.common.util.DirectUtils import com.gh.common.util.NewFlatLogUtils import com.gh.gamecenter.R +import com.gh.gamecenter.common.entity.SuggestType import com.gh.gamecenter.databinding.DialogGameAddShortcutPermissionBinding import com.gh.gamecenter.feature.entity.GameEntity import com.muugi.shortcut.core.Executor @@ -71,6 +72,6 @@ class ShortcutPermissionDialog( mGameEntity.name ?: "", mBinding.serviceTv.text.toString() ) - DirectUtils.directToFeedback(context, "无法正常设置桌面快捷方式权限", hintType = "other") + DirectUtils.directToSuggestion(context, SuggestType.APP, content = "无法正常设置桌面快捷方式权限") } } \ No newline at end of file diff --git a/app/src/main/res/values-night/styles.xml b/app/src/main/res/values-night/styles.xml index d86339ae09..2c88ff88f8 100644 --- a/app/src/main/res/values-night/styles.xml +++ b/app/src/main/res/values-night/styles.xml @@ -132,14 +132,6 @@ @android:style/Animation.Dialog - - - - + \ No newline at end of file diff --git a/module_login/src/main/java/com/gh/gamecenter/login/view/LoginFragment.java b/module_login/src/main/java/com/gh/gamecenter/login/view/LoginFragment.java index c7b1fa89d5..202e85de4d 100644 --- a/module_login/src/main/java/com/gh/gamecenter/login/view/LoginFragment.java +++ b/module_login/src/main/java/com/gh/gamecenter/login/view/LoginFragment.java @@ -1,7 +1,6 @@ package com.gh.gamecenter.login.view; import android.content.Intent; -import android.graphics.drawable.StateListDrawable; import android.os.Bundle; import android.os.Message; import android.text.Editable; @@ -20,7 +19,6 @@ import android.widget.RelativeLayout; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.content.res.AppCompatResources; -import androidx.constraintlayout.widget.ConstraintLayout; import androidx.core.content.ContextCompat; import androidx.lifecycle.Lifecycle; import androidx.lifecycle.Observer; @@ -376,6 +374,9 @@ public class LoginFragment && (mEntrance.contains("我来评论") || mEntrance.contains("我要安利") || mEntrance.contains("评论详情-评论") || mEntrance.contains("评论详情-回复"))) { return "游戏评价/回复"; } + if (mEntrance.contains("意见反馈")) { + return mEntrance; + } return null; } diff --git a/module_message/src/message/java/com/gh/gamecenter/message/provider/AppProviderImpl.kt b/module_message/src/message/java/com/gh/gamecenter/message/provider/AppProviderImpl.kt index 025fedca88..79cf6c79d1 100644 --- a/module_message/src/message/java/com/gh/gamecenter/message/provider/AppProviderImpl.kt +++ b/module_message/src/message/java/com/gh/gamecenter/message/provider/AppProviderImpl.kt @@ -7,6 +7,7 @@ import com.alibaba.android.arouter.facade.annotation.Route import com.gh.gamecenter.common.constant.RouteConsts import com.gh.gamecenter.core.provider.IAppProvider import com.gh.gamecenter.core.provider.IFlavorProvider +import com.gh.gamecenter.message.BuildConfig import com.gh.gamecenter.message.HaloApp import com.gh.gamecenter.message.R @@ -20,6 +21,10 @@ class AppProviderImpl : IAppProvider { return HaloApp.getInstance().getString(R.string.app_name) } + override fun getAppVersion(): String { + return BuildConfig.VERSION_NAME + } + override fun getGid(): String { return "" } diff --git a/module_message/src/message/java/com/gh/gamecenter/message/provider/ConfigProviderImpl.kt b/module_message/src/message/java/com/gh/gamecenter/message/provider/ConfigProviderImpl.kt index fb42a01d7d..5289bcf647 100644 --- a/module_message/src/message/java/com/gh/gamecenter/message/provider/ConfigProviderImpl.kt +++ b/module_message/src/message/java/com/gh/gamecenter/message/provider/ConfigProviderImpl.kt @@ -56,19 +56,19 @@ class ConfigProviderImpl : IConfigProvider { } - fun getVideoSnapshotSuffix(): String { + override fun getVideoSnapshotSuffix(): String { return "" } - fun getImageCropSuffix(): String { + override fun getImageCropSuffix(): String { return "" } - fun getImageInfoSuffix(): String { + override fun getImageInfoSuffix(): String { return "" } - fun getImageResizeSuffix(): String { + override fun getImageResizeSuffix(): String { return "" } diff --git a/module_setting/src/main/java/com/gh/gamecenter/setting/view/NetworkDiagnosisActivity.kt b/module_setting/src/main/java/com/gh/gamecenter/setting/view/NetworkDiagnosisActivity.kt index e6417289d5..0a3e1ca7b2 100644 --- a/module_setting/src/main/java/com/gh/gamecenter/setting/view/NetworkDiagnosisActivity.kt +++ b/module_setting/src/main/java/com/gh/gamecenter/setting/view/NetworkDiagnosisActivity.kt @@ -26,6 +26,7 @@ import com.gh.gamecenter.common.utils.DialogHelper import com.gh.gamecenter.common.utils.copyTextAndToast import com.gh.gamecenter.common.utils.tryCatchInRelease import com.gh.gamecenter.core.provider.IDirectProvider +import com.gh.gamecenter.core.utils.TimeUtils import com.gh.gamecenter.setting.R import io.reactivex.Observable import io.reactivex.ObservableOnSubscribe @@ -243,6 +244,7 @@ class NetworkDiagnosisActivity : ToolBarActivity() { .navigation() as? IDirectProvider directUtils?.directToSuggestionFromDiagnosis( this@NetworkDiagnosisActivity, + "网络诊断结果" + TimeUtils.getFormatTime(System.currentTimeMillis(), "yyyy.MM.dd"), builder.toString().replace(mSuccessHint, "") ) } diff --git a/module_setting/src/setting/java/com/gh/gamecenter/setting/provider/AppProviderImpl.kt b/module_setting/src/setting/java/com/gh/gamecenter/setting/provider/AppProviderImpl.kt index 457eb1c9ec..62e4257887 100644 --- a/module_setting/src/setting/java/com/gh/gamecenter/setting/provider/AppProviderImpl.kt +++ b/module_setting/src/setting/java/com/gh/gamecenter/setting/provider/AppProviderImpl.kt @@ -7,6 +7,7 @@ import com.alibaba.android.arouter.facade.annotation.Route import com.gh.gamecenter.common.constant.RouteConsts import com.gh.gamecenter.core.provider.IAppProvider import com.gh.gamecenter.core.provider.IFlavorProvider +import com.gh.gamecenter.setting.BuildConfig import com.gh.gamecenter.setting.HaloApp import com.gh.gamecenter.setting.R @@ -20,6 +21,10 @@ class AppProviderImpl : IAppProvider { return HaloApp.getInstance().getString(R.string.app_name) } + override fun getAppVersion(): String { + return BuildConfig.VERSION_NAME + } + override fun getGid(): String { return "" } diff --git a/module_setting/src/setting/java/com/gh/gamecenter/setting/provider/ConfigProviderImpl.kt b/module_setting/src/setting/java/com/gh/gamecenter/setting/provider/ConfigProviderImpl.kt index 35fce7435b..f1870d2047 100644 --- a/module_setting/src/setting/java/com/gh/gamecenter/setting/provider/ConfigProviderImpl.kt +++ b/module_setting/src/setting/java/com/gh/gamecenter/setting/provider/ConfigProviderImpl.kt @@ -55,19 +55,19 @@ class ConfigProviderImpl : IConfigProvider { return "" } - fun getVideoSnapshotSuffix(): String { + override fun getVideoSnapshotSuffix(): String { return "" } - fun getImageCropSuffix(): String { + override fun getImageCropSuffix(): String { return "" } - fun getImageInfoSuffix(): String { + override fun getImageInfoSuffix(): String { return "" } - fun getImageResizeSuffix(): String { + override fun getImageResizeSuffix(): String { return "" } diff --git a/module_setting/src/setting/java/com/gh/gamecenter/setting/provider/DirectProviderImpl.kt b/module_setting/src/setting/java/com/gh/gamecenter/setting/provider/DirectProviderImpl.kt index 8510250dfa..945f8d25b9 100644 --- a/module_setting/src/setting/java/com/gh/gamecenter/setting/provider/DirectProviderImpl.kt +++ b/module_setting/src/setting/java/com/gh/gamecenter/setting/provider/DirectProviderImpl.kt @@ -1,6 +1,7 @@ package com.gh.gamecenter.setting.provider import android.content.Context +import android.os.Bundle import com.alibaba.android.arouter.facade.annotation.Route import com.gh.gamecenter.common.constant.RouteConsts import com.gh.gamecenter.core.provider.IDirectProvider @@ -57,7 +58,7 @@ class DirectProviderImpl : IDirectProvider { ToastUtils.toast("调用->DirectProviderImpl.directDouyin") } - override fun directToSuggestionFromDiagnosis(context: Context, diagnosis: String) { + override fun directToSuggestionFromDiagnosis(context: Context, content: String, diagnosis: String) { ToastUtils.toast("调用->DirectProviderImpl.directToSuggestionFromDiagnosis") } @@ -65,7 +66,7 @@ class DirectProviderImpl : IDirectProvider { ToastUtils.toast("调用->DirectProviderImpl.directToQa") } - override fun directToHelpAndFeedback(context: Context, position: Int) { + override fun directToHelpAndFeedback(context: Context, bundle: Bundle?) { ToastUtils.toast("调用->DirectProviderImpl.directToHelpAndFeedback") } @@ -116,6 +117,10 @@ class DirectProviderImpl : IDirectProvider { ToastUtils.toast("调用->DirectProviderImpl.directToWinOrderDetail") } + override fun directToQGame(context: Context) { + ToastUtils.toast("调用->DirectProviderImpl.directToQGame") + } + override fun init(context: Context?) { // Do nothing } diff --git a/module_setting/src/setting/java/com/gh/gamecenter/setting/provider/PackageUtilsProviderImpl.kt b/module_setting/src/setting/java/com/gh/gamecenter/setting/provider/PackageUtilsProviderImpl.kt index 7faf92b48a..441ec48634 100644 --- a/module_setting/src/setting/java/com/gh/gamecenter/setting/provider/PackageUtilsProviderImpl.kt +++ b/module_setting/src/setting/java/com/gh/gamecenter/setting/provider/PackageUtilsProviderImpl.kt @@ -32,6 +32,18 @@ class PackageUtilsProviderImpl : IPackageUtilsProvider { return null } + override fun isSignedByGh(context: Context, packageName: String): Boolean { + return false + } + + override fun getInstalledTime(context: Context, packageName: String): Long { + return 0L + } + + override fun getVersionNameByPackageName(packageName: String): String { + return "" + } + override fun init(context: Context?) { // Do nothing } diff --git a/module_setting/src/setting/java/com/gh/gamecenter/setting/provider/WebProviderImpl.kt b/module_setting/src/setting/java/com/gh/gamecenter/setting/provider/WebProviderImpl.kt index 742477e887..c81be20cf7 100644 --- a/module_setting/src/setting/java/com/gh/gamecenter/setting/provider/WebProviderImpl.kt +++ b/module_setting/src/setting/java/com/gh/gamecenter/setting/provider/WebProviderImpl.kt @@ -50,6 +50,16 @@ class WebProviderImpl : IWebProvider { return null } + override fun getIntentByNews( + context: Context?, + concernLink: String?, + concernGameName: String, + concernId: String?, + entrance: String? + ): Intent? { + return null + } + override fun init(context: Context?) { // Do nothing } diff --git a/module_setting_compose/src/main/java/com/gh/gamecenter/setting/compose/activity/NetworkDiagnosisActivity.kt b/module_setting_compose/src/main/java/com/gh/gamecenter/setting/compose/activity/NetworkDiagnosisActivity.kt index cf18f9b790..0e88ffc1e3 100644 --- a/module_setting_compose/src/main/java/com/gh/gamecenter/setting/compose/activity/NetworkDiagnosisActivity.kt +++ b/module_setting_compose/src/main/java/com/gh/gamecenter/setting/compose/activity/NetworkDiagnosisActivity.kt @@ -26,6 +26,7 @@ import com.gh.gamecenter.common.utils.DialogHelper import com.gh.gamecenter.common.utils.copyTextAndToast import com.gh.gamecenter.common.utils.tryCatchInRelease import com.gh.gamecenter.core.provider.IDirectProvider +import com.gh.gamecenter.core.utils.TimeUtils import com.gh.gamecenter.setting.compose.R import io.reactivex.Observable import io.reactivex.ObservableOnSubscribe @@ -242,6 +243,7 @@ class NetworkDiagnosisActivity : ToolBarActivity() { .navigation() as? IDirectProvider directUtils?.directToSuggestionFromDiagnosis( this@NetworkDiagnosisActivity, + "网络诊断结果" + TimeUtils.getFormatTime(System.currentTimeMillis(), "yyyy.MM.dd"), builder.toString().replace(mSuccessHint, "") ) } diff --git a/module_setting_compose/src/setting/java/com/gh/gamecenter/setting/compose/provider/DirectProviderImpl.kt b/module_setting_compose/src/setting/java/com/gh/gamecenter/setting/compose/provider/DirectProviderImpl.kt index a67629689c..2ed0af5f17 100644 --- a/module_setting_compose/src/setting/java/com/gh/gamecenter/setting/compose/provider/DirectProviderImpl.kt +++ b/module_setting_compose/src/setting/java/com/gh/gamecenter/setting/compose/provider/DirectProviderImpl.kt @@ -1,6 +1,7 @@ package com.gh.gamecenter.setting.compose.provider import android.content.Context +import android.os.Bundle import com.alibaba.android.arouter.facade.annotation.Route import com.gh.gamecenter.common.constant.RouteConsts import com.gh.gamecenter.core.provider.IDirectProvider @@ -57,7 +58,7 @@ class DirectProviderImpl : IDirectProvider { ToastUtils.toast("调用->DirectProviderImpl.directDouyin") } - override fun directToSuggestionFromDiagnosis(context: Context, diagnosis: String) { + override fun directToSuggestionFromDiagnosis(context: Context, content: String, diagnosis: String) { ToastUtils.toast("调用->DirectProviderImpl.directToSuggestionFromDiagnosis") } @@ -66,7 +67,7 @@ class DirectProviderImpl : IDirectProvider { ToastUtils.toast("调用->DirectProviderImpl.directToQa") } - override fun directToHelpAndFeedback(context: Context, position: Int) { + override fun directToHelpAndFeedback(context: Context, bundle: Bundle?) { ToastUtils.toast("调用->DirectProviderImpl.directToHelpAndFeedback") } diff --git a/settings.gradle b/settings.gradle index 830e6dfe01..c8c4809352 100644 --- a/settings.gradle +++ b/settings.gradle @@ -8,7 +8,6 @@ include ':module_common' include ':module_login' include ':module_setting' include ':module_setting_compose' -include ':module_feedback' include ':ndownload' include ':module_core_feature' include ':module_lib' @@ -22,5 +21,6 @@ include ':feature:oaid_lib' include ':feature:oaid' include ':feature:xapk-installer' include ':module_message' +include ':feature:new_feedback' include ':feature:qq_game' include ':feature:realname-window'