From 73ed15689d3098372f6a2b769b6861317e80970e Mon Sep 17 00:00:00 2001 From: juntao Date: Fri, 30 Jul 2021 18:07:23 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=9F=BA=E6=9C=AC=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E9=87=91=E6=89=8B=E6=8C=87=E5=8A=9F=E8=83=BD=20https://git.ghz?= =?UTF-8?q?s.com/pm/halo-app-issues/-/issues/1362?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/com/gh/download/DownloadManager.java | 8 ++++++++ app/src/main/java/com/gh/gamecenter/entity/GameEntity.kt | 3 +++ libraries/LGLibrary | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/gh/download/DownloadManager.java b/app/src/main/java/com/gh/download/DownloadManager.java index e48ab37d33..88a4181ac0 100644 --- a/app/src/main/java/com/gh/download/DownloadManager.java +++ b/app/src/main/java/com/gh/download/DownloadManager.java @@ -254,6 +254,14 @@ public class DownloadManager implements DownloadStatusListener { String downloadId = PackageInstaller.createDownloadId(gameEntity.getName()); if (SimulatorGameManager.isSimulatorGame(gameEntity)) { path = SimulatorGameManager.getPathByType(gameEntity.getSimulatorType()) + "/" + gameEntity.getName() + "." + apkEntity.getFormat(); + + // 下载模拟器游戏配置文件,地址是 "模拟器游戏类型根目录/cheat/" + if (!TextUtils.isEmpty(gameEntity.getSimulatorGameConfig())) { + String configFilePath = SimulatorGameManager.getPathByType(gameEntity.getSimulatorType()) + "/cheat/" + gameEntity.getName() + ".ini"; + AppExecutor.getIoExecutor().execute(() -> { + FileUtils.downloadFile(gameEntity.getSimulatorGameConfig(), configFilePath); + }); + } } else { path = PackageInstaller.getDownloadPathWithId(downloadId, apkEntity.getFormat()); } diff --git a/app/src/main/java/com/gh/gamecenter/entity/GameEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/GameEntity.kt index 784e4d7f59..da255a100c 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/GameEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/GameEntity.kt @@ -241,6 +241,9 @@ data class GameEntity( @SerializedName("column_recommend") val columnRecommend: LinkEntity? = null, + @SerializedName("simulator_game_config") + val simulatorGameConfig: String? = "", + // 本地字段,使用镜像信息 var useMirrorInfo: Boolean = false, // 本地字段,曝光用 diff --git a/libraries/LGLibrary b/libraries/LGLibrary index 02846264a9..ba2591cec4 160000 --- a/libraries/LGLibrary +++ b/libraries/LGLibrary @@ -1 +1 @@ -Subproject commit 02846264a913f2a3f48a87a0360955574f8993e1 +Subproject commit ba2591cec44568b233ba7b73e2b4edac06b6535f From e13d80d0633a938dcc25d6b751da9c95915a85da Mon Sep 17 00:00:00 2001 From: leafwai Date: Mon, 2 Aug 2021 10:13:56 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E3=80=90=E5=85=89=E7=8E=AF=E5=8A=A9?= =?UTF-8?q?=E6=89=8BV5.1.0=E3=80=910730=E4=BA=A7=E5=93=81=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E9=97=AE=E9=A2=98=EF=BC=8811=EF=BC=89https://git.ghzs?= =?UTF-8?q?.com/pm/halo-app-issues/-/issues/1422?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gh/gamecenter/forum/moderator/ModeratorListAdapter.kt | 5 +++++ app/src/main/res/layout/item_moderator_task.xml | 4 +--- app/src/main/res/layout/moderator_list_item.xml | 6 +++++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/gh/gamecenter/forum/moderator/ModeratorListAdapter.kt b/app/src/main/java/com/gh/gamecenter/forum/moderator/ModeratorListAdapter.kt index 86113be950..5d6a248d15 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/moderator/ModeratorListAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/moderator/ModeratorListAdapter.kt @@ -32,8 +32,13 @@ class ModeratorListAdapter(context: Context, val mViewModel: ModeratorListViewMo override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) { if (holder is ModeratorItemViewHolder) { val personalEntity = datas[position] + var mHasNameLabel = false + if (personalEntity.nameLabel?.isNotEmpty() == true){ + mHasNameLabel = true + } holder.binding.run { entity = personalEntity + hasNameLabel = mHasNameLabel executePendingBindings() followTv.goneIf(personalEntity.id == UserManager.getInstance().userId) diff --git a/app/src/main/res/layout/item_moderator_task.xml b/app/src/main/res/layout/item_moderator_task.xml index 0b3eec8e84..fb4bfb716c 100644 --- a/app/src/main/res/layout/item_moderator_task.xml +++ b/app/src/main/res/layout/item_moderator_task.xml @@ -39,11 +39,9 @@ diff --git a/app/src/main/res/layout/moderator_list_item.xml b/app/src/main/res/layout/moderator_list_item.xml index d51aeb732d..b3a030e658 100644 --- a/app/src/main/res/layout/moderator_list_item.xml +++ b/app/src/main/res/layout/moderator_list_item.xml @@ -4,7 +4,10 @@ xmlns:tools="http://schemas.android.com/tools"> - + + @@ -67,6 +70,7 @@ android:text="@{entity.nameLabel}" android:textColor="@color/theme_font" android:textSize="12sp" + android:visibility="@{hasNameLabel ? View.VISIBLE:View.GONE}" tools:text="@string/app_name" /> From 35954f52c5bbfce6bda025922fa6cb73c07050a0 Mon Sep 17 00:00:00 2001 From: lyr <15622190878@163.com> Date: Mon, 2 Aug 2021 10:58:25 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E3=80=90=E5=85=89=E7=8E=AF=E5=8A=A9?= =?UTF-8?q?=E6=89=8BV5.1.0=E3=80=910730=E4=BA=A7=E5=93=81=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E9=97=AE=E9=A2=98=EF=BC=881-3=EF=BC=89https://git.ghz?= =?UTF-8?q?s.com/pm/halo-app-issues/-/issues/1422?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/gh/common/constant/Constants.java | 2 + .../gh/gamecenter/SplashScreenActivity.java | 4 +- .../forum/home/CommunityHomeFragment.kt | 46 +++++++++++-------- .../forum/home/ForumArticleListFragment.kt | 2 +- .../main/res/layout/community_edit_window.xml | 17 +++++-- 5 files changed, 47 insertions(+), 24 deletions(-) diff --git a/app/src/main/java/com/gh/common/constant/Constants.java b/app/src/main/java/com/gh/common/constant/Constants.java index c55be5db09..51e028c783 100644 --- a/app/src/main/java/com/gh/common/constant/Constants.java +++ b/app/src/main/java/com/gh/common/constant/Constants.java @@ -213,6 +213,8 @@ public class Constants { public static final String SP_QUESTION_VIDEO_GUIDE = "question_video_guide"; // 社区首页引导 public static final String SP_COMMUNITY_HOME_GUIDE = "community_home_guide"; + // 社区首页发布按钮引导 + public static final String SP_COMMUNITY_HOME_VIDEO_GUIDE = "community_home_video_guide"; // 论坛详情申请版主引导 public static final String SP_FORUM_DETAIL_MODERATOR_GUIDE = "forum_detail_moderator_guide"; diff --git a/app/src/main/java/com/gh/gamecenter/SplashScreenActivity.java b/app/src/main/java/com/gh/gamecenter/SplashScreenActivity.java index 581d61f706..713450767c 100644 --- a/app/src/main/java/com/gh/gamecenter/SplashScreenActivity.java +++ b/app/src/main/java/com/gh/gamecenter/SplashScreenActivity.java @@ -121,7 +121,9 @@ public class SplashScreenActivity extends BaseActivity { // 判断是不是光环的新用户 if (SPUtils.getBoolean(Constants.SP_BRAND_NEW_USER, true)) { - mStartMainActivityDirectly = true; + // 引导页需用户点击 “立即体验” 按钮才进入首页,所以这里不能置为true + // https://git.ghzs.com/pm/halo-app-issues/-/issues/1422(第3点) +// mStartMainActivityDirectly = true; SPUtils.setLong(Constants.SP_INITIAL_USAGE_TIME, System.currentTimeMillis()); HaloApp.getInstance().isBrandNewInstall = true; showPrivacyDialog(guideLayout); diff --git a/app/src/main/java/com/gh/gamecenter/forum/home/CommunityHomeFragment.kt b/app/src/main/java/com/gh/gamecenter/forum/home/CommunityHomeFragment.kt index b968d17933..21e4558ca5 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/home/CommunityHomeFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/home/CommunityHomeFragment.kt @@ -95,12 +95,21 @@ class CommunityHomeFragment : LazyFragment() { if (isShow) return mBinding?.run { guideContainer.visibility = View.VISIBLE + guideContainer.setOnClickListener { + guideContainer.visibility = View.GONE + } guideIv.setOnClickListener { + guideContainer.visibility = View.GONE showCommunityEditWindow() } guideTipIv.alpha = 0F - guideTipIv.animate().alpha(1F).setDuration(200).start() + guideTipIv.postDelayed({ + tryCatchInRelease { + guideTipIv.animate().alpha(1F).setDuration(200).start() + } + }, 100) } + SPUtils.setBoolean(Constants.SP_COMMUNITY_HOME_GUIDE, true) } fun setCurrentItem(index: Int) { @@ -217,12 +226,11 @@ class CommunityHomeFragment : LazyFragment() { } private fun showCommunityEditWindow() { - val guideFlag = SPUtils.getBoolean(Constants.SP_COMMUNITY_HOME_GUIDE) val contentView = LayoutInflater.from(context).inflate(R.layout.community_edit_window, null) val params = ViewGroup.LayoutParams(resources.displayMetrics.widthPixels, ViewGroup.LayoutParams.WRAP_CONTENT) val dialog = TrackableDialog( requireContext(), - if (guideFlag) R.style.DialogWindowTransparent else R.style.TransparentDialog, + R.style.DialogWindowTransparent, "社区", UserManager.getInstance().community.name, null, @@ -273,9 +281,6 @@ class CommunityHomeFragment : LazyFragment() { entrance = mEntrance, path = "论坛首页"), VIDEO_REQUEST_CODE) - - SPUtils.setBoolean(Constants.SP_COMMUNITY_HOME_GUIDE, true) - mBinding?.guideContainer?.visibility = View.GONE dialog.dismiss() } } @@ -286,37 +291,40 @@ class CommunityHomeFragment : LazyFragment() { dialog.dismiss() } - if (!guideFlag) { - mBinding?.guideTipIv?.run { - animate().alpha(0F).setDuration(200).withEndAction { visibility = View.GONE }.start() - } + if (!SPUtils.getBoolean(Constants.SP_COMMUNITY_HOME_VIDEO_GUIDE)) { videoEditBtn.visibility = View.INVISIBLE + val emptyView = contentView.findViewById(R.id.emptyView) val guideContainer = contentView.findViewById(R.id.guideContainer) val guideIv = contentView.findViewById(R.id.guideIv) val guideTipIv = contentView.findViewById(R.id.guideTipIv) val screenWidth = resources.displayMetrics.widthPixels val videoItemMargin = (screenWidth - 64F.dip2px() * 3) / 4 + emptyView.visibility = View.VISIBLE + emptyView.setOnClickListener { + dialog.dismiss() + } guideContainer.visibility = View.VISIBLE guideContainer.setOnClickListener { - dialog.dismiss() + videoEditBtn.visibility = View.VISIBLE + guideContainer.visibility = View.GONE } guideIv.layoutParams = (guideIv.layoutParams as ViewGroup.MarginLayoutParams).apply { rightMargin = videoItemMargin - 28F.dip2px() } guideIv.setOnClickListener { + videoEditBtn.visibility = View.VISIBLE + guideContainer.visibility = View.GONE videoEditBtn.performClick() } guideTipIv.alpha = 0F - guideTipIv.animate().alpha(1F).setDuration(200).start() - dialog.setOnDismissListener { - if (!SPUtils.getBoolean(Constants.SP_COMMUNITY_HOME_GUIDE)) { - mBinding?.guideTipIv?.run { - visibility = View.VISIBLE - animate().alpha(1F).setDuration(200).start() - } + guideTipIv.postDelayed({ + tryCatchInRelease { + guideTipIv.animate().alpha(1F).setDuration(200).start() } - } + }, 100) + + SPUtils.setBoolean(Constants.SP_COMMUNITY_HOME_VIDEO_GUIDE, true) } } diff --git a/app/src/main/java/com/gh/gamecenter/forum/home/ForumArticleListFragment.kt b/app/src/main/java/com/gh/gamecenter/forum/home/ForumArticleListFragment.kt index 15c809fe39..86c54675bd 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/home/ForumArticleListFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/home/ForumArticleListFragment.kt @@ -148,7 +148,7 @@ class ForumArticleListFragment : LazyListFragment + + + + + @@ -118,8 +131,6 @@ android:layout_width="match_parent" android:layout_height="188dp" android:layout_alignParentBottom="true" - android:clickable="true" - android:focusable="true" android:background="@drawable/community_edit_window_guide_bg" /> Date: Mon, 2 Aug 2021 11:16:46 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E3=80=90=E5=85=89=E7=8E=AF=E5=8A=A9?= =?UTF-8?q?=E6=89=8BV5.1.0=E3=80=910730=E4=BA=A7=E5=93=81=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E9=97=AE=E9=A2=98=EF=BC=885=EF=BC=89=20https://git.gh?= =?UTF-8?q?zs.com/pm/halo-app-issues/-/issues/1422?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/gh/gamecenter/forum/detail/ForumDetailViewModel.kt | 2 ++ .../java/com/gh/gamecenter/forum/home/CommunityHomeViewModel.kt | 2 ++ 2 files changed, 4 insertions(+) diff --git a/app/src/main/java/com/gh/gamecenter/forum/detail/ForumDetailViewModel.kt b/app/src/main/java/com/gh/gamecenter/forum/detail/ForumDetailViewModel.kt index 442cb8eb02..6b1061d020 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/detail/ForumDetailViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/detail/ForumDetailViewModel.kt @@ -140,6 +140,7 @@ class ForumDetailViewModel(application: Application, val bbsId: String) : Androi answerEntity.images = articleDetailEntity.images answerEntity.imagesInfo = articleDetailEntity.imagesInfo answerEntity.videos = articleDetailEntity.videos + answerEntity.status = articleDetailEntity.status answerEntity.type = "community_article" return answerEntity @@ -159,6 +160,7 @@ class ForumDetailViewModel(application: Application, val bbsId: String) : Androi answerEntity.images = questionDetailEntity.images answerEntity.imagesInfo = questionDetailEntity.imagesInfo answerEntity.videos = questionDetailEntity.videos + answerEntity.status = questionDetailEntity.status answerEntity.type = "question" return answerEntity diff --git a/app/src/main/java/com/gh/gamecenter/forum/home/CommunityHomeViewModel.kt b/app/src/main/java/com/gh/gamecenter/forum/home/CommunityHomeViewModel.kt index e33865d625..37c4cecf9e 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/home/CommunityHomeViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/home/CommunityHomeViewModel.kt @@ -68,6 +68,7 @@ class CommunityHomeViewModel(application: Application) : AndroidViewModel(applic articleEntity.images = articleDetailEntity.images articleEntity.imagesInfo = articleDetailEntity.imagesInfo articleEntity.videos = articleDetailEntity.videos + articleEntity.status = articleDetailEntity.status articleEntity.type = "community_article" return articleEntity @@ -87,6 +88,7 @@ class CommunityHomeViewModel(application: Application) : AndroidViewModel(applic articleEntity.images = questionDetailEntity.images articleEntity.imagesInfo = questionDetailEntity.imagesInfo articleEntity.videos = questionDetailEntity.videos + articleEntity.status = questionDetailEntity.status articleEntity.type = "question" return articleEntity From ab60ed8473600735a65ecb43771718a7903763ed Mon Sep 17 00:00:00 2001 From: leafwai Date: Mon, 2 Aug 2021 14:31:07 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E3=80=90=E5=85=89=E7=8E=AF=E5=8A=A9?= =?UTF-8?q?=E6=89=8BV5.1.0=E3=80=91=E6=96=B0=E7=A4=BE=E5=8C=BA2=E6=9C=9F-?= =?UTF-8?q?=E8=AE=BA=E5=9D=9B=E5=B1=95=E7=A4=BA-=E8=AE=BA=E5=9D=9B?= =?UTF-8?q?=E8=AF=A6=E6=83=85-=E7=89=88=E4=B8=BB=E6=88=90=E5=91=98?= =?UTF-8?q?=EF=BC=880802UI=E6=B5=8B=E8=AF=95=EF=BC=89https://git.ghzs.com/?= =?UTF-8?q?pm/halo-app-issues/-/issues/1345?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/res/layout/item_moderator_task.xml | 8 +++---- .../main/res/layout/moderator_list_item.xml | 22 +++++++------------ 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/app/src/main/res/layout/item_moderator_task.xml b/app/src/main/res/layout/item_moderator_task.xml index fb4bfb716c..7d28f6597f 100644 --- a/app/src/main/res/layout/item_moderator_task.xml +++ b/app/src/main/res/layout/item_moderator_task.xml @@ -3,7 +3,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" - android:layout_height="wrap_content" + android:layout_height="72dp" android:padding="16dp"> diff --git a/app/src/main/res/layout/moderator_list_item.xml b/app/src/main/res/layout/moderator_list_item.xml index b3a030e658..12eca56525 100644 --- a/app/src/main/res/layout/moderator_list_item.xml +++ b/app/src/main/res/layout/moderator_list_item.xml @@ -37,36 +37,30 @@ app:roundingBorderWidth="1dp" />