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" />