Merge branch 'fix/GHZS-3064' into 'dev'
fix: 修复帮助与反馈页面帮助视频轮播与下拉刷新的滑动冲突 See merge request halo/android/assistant-android!1302
This commit is contained in:
@ -1,7 +1,10 @@
|
||||
package com.gh.gamecenter.feedback.view.help
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.*
|
||||
import android.view.Gravity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import android.view.ViewGroup.MarginLayoutParams
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.PopupWindow
|
||||
@ -65,7 +68,9 @@ class HelpAndFeedbackFragment : BaseFragment<Any>() {
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
DisplayUtils.setLightStatusBar(requireActivity(), !mIsDarkModeOn && mIsCollapsed)
|
||||
initMenu()
|
||||
changeToolbarStyle(mIsCollapsed)
|
||||
mBinding.run {
|
||||
swipeRefreshLayout.setColorSchemeResources(R.color.theme)
|
||||
swipeRefreshLayout.setOnRefreshListener {
|
||||
@ -88,7 +93,7 @@ class HelpAndFeedbackFragment : BaseFragment<Any>() {
|
||||
}
|
||||
|
||||
ViewCompat.setOnApplyWindowInsetsListener(appbar) { _, insets ->
|
||||
(toolbar.layoutParams as ViewGroup.MarginLayoutParams).topMargin =
|
||||
(toolbar.layoutParams as MarginLayoutParams).topMargin =
|
||||
insets.systemWindowInsetTop
|
||||
insets.consumeSystemWindowInsets()
|
||||
}
|
||||
@ -99,9 +104,11 @@ class HelpAndFeedbackFragment : BaseFragment<Any>() {
|
||||
|
||||
collapsingToolbar.scrimVisibleHeightTrigger = collapsingTrigger
|
||||
collapsingToolbar.scrimShownAction = {
|
||||
mIsCollapsed = it
|
||||
DisplayUtils.setLightStatusBar(requireActivity(), !mIsDarkModeOn && it)
|
||||
changeToolbarStyle(it)
|
||||
if (mIsCollapsed != it) {
|
||||
mIsCollapsed = it
|
||||
DisplayUtils.setLightStatusBar(requireActivity(), !mIsDarkModeOn && it)
|
||||
changeToolbarStyle(it)
|
||||
}
|
||||
}
|
||||
|
||||
appbar.addOnOffsetChangedListener { appBarLayout, verticalOffset ->
|
||||
@ -112,11 +119,6 @@ class HelpAndFeedbackFragment : BaseFragment<Any>() {
|
||||
mBinding.swipeRefreshLayout.isEnabled = absOffset <= 2
|
||||
}
|
||||
|
||||
reuseNoConnection.connectionReloadTv.setOnClickListener {
|
||||
reuseNoConnection.root.visibility = View.GONE
|
||||
mViewModel.initData()
|
||||
}
|
||||
|
||||
searchContainer.setOnClickListener {
|
||||
requireContext().startActivity(QaSearchActivity.getIntent(requireContext()))
|
||||
}
|
||||
@ -149,6 +151,16 @@ class HelpAndFeedbackFragment : BaseFragment<Any>() {
|
||||
})
|
||||
helpVideoRv.addOnItemTouchListener(object : RecyclerView.SimpleOnItemTouchListener() {
|
||||
override fun onInterceptTouchEvent(rv: RecyclerView, e: MotionEvent): Boolean {
|
||||
when (e.action) {
|
||||
MotionEvent.ACTION_DOWN -> {
|
||||
mBinding.swipeRefreshLayout.isEnabled = false
|
||||
}
|
||||
|
||||
MotionEvent.ACTION_UP -> {
|
||||
mBinding.swipeRefreshLayout.isEnabled = true
|
||||
}
|
||||
}
|
||||
|
||||
val isStop = e.action == MotionEvent.ACTION_DOWN || e.action == MotionEvent.ACTION_MOVE
|
||||
if (isStop) mHelpVideoAdapter?.stopScroll() else mHelpVideoAdapter?.startScroll()
|
||||
return false
|
||||
@ -327,6 +339,7 @@ class HelpAndFeedbackFragment : BaseFragment<Any>() {
|
||||
override fun onDarkModeChanged() {
|
||||
super.onDarkModeChanged()
|
||||
DisplayUtils.setLightStatusBar(requireActivity(), !mIsDarkModeOn && mIsCollapsed)
|
||||
changeToolbarStyle(mIsCollapsed)
|
||||
mBinding.run {
|
||||
helpVideoCv.setCardBackgroundColor(R.color.background_white.toColor(requireContext()))
|
||||
helpCenterCv.setCardBackgroundColor(R.color.background_white.toColor(requireContext()))
|
||||
|
||||
@ -36,13 +36,6 @@
|
||||
android:adjustViewBounds="true"
|
||||
app:srcCompat="@drawable/help_head" />
|
||||
|
||||
<View
|
||||
android:id="@+id/nightMaskView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black_alpha_20"
|
||||
android:visibility="gone" />
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
style="@style/Base_ToolbarStyle"
|
||||
@ -77,7 +70,7 @@
|
||||
android:gravity="center"
|
||||
android:singleLine="true"
|
||||
android:text="帮助与反馈"
|
||||
android:textColor="@color/white"
|
||||
android:textColor="@color/text_black"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
@ -150,6 +143,7 @@
|
||||
android:id="@+id/nestedScrollView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:overScrollMode="never"
|
||||
app:behavior_overlapTop="16dp"
|
||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
|
||||
|
||||
@ -359,13 +353,5 @@
|
||||
</androidx.cardview.widget.CardView>
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
<include
|
||||
android:id="@+id/reuse_no_connection"
|
||||
layout="@layout/reuse_no_connection"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone" />
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
Reference in New Issue
Block a user