Fix the previous fix caused the text could not be selected in AppErrorsDetailActivity, activity_app_errors_detail

This commit is contained in:
2023-01-17 03:59:48 +08:00
parent 2aaa422a56
commit 01a6c1ffa5
2 changed files with 3 additions and 1 deletions

View File

@@ -26,6 +26,7 @@ package com.fankes.apperrorstracking.ui.activity.errors
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.widget.TextView
import androidx.core.view.isGone
import androidx.core.view.isVisible
import com.fankes.apperrorstracking.R
@@ -121,6 +122,8 @@ class AppErrorsDetailActivity : BaseActivity<ActivityAppErrorsDetailBinding>() {
binding.appPanelScrollView.setOnScrollChangeListener { _, _, y, _, _ ->
binding.detailTitleText.text = if (y >= 30.dp(context = this)) appNameOf(appErrorsInfo.packageName) else LocaleString.appName
}
/** 修复在一些小屏设备上设置了 [TextView.setTextIsSelectable] 后布局自动上滑问题 */
binding.appPanelScrollView.post { binding.appPanelScrollView.scrollTo(0, 0) }
binding.detailTitleText.setOnClickListener { binding.appPanelScrollView.smoothScrollTo(0, 0) }
}

View File

@@ -6,7 +6,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorThemeBackground"
android:descendantFocusability="blocksDescendants"
android:orientation="vertical"
tools:context=".ui.activity.errors.AppErrorsDetailActivity"
tools:ignore="ContentDescription,UseCompoundDrawables,SmallSp,UnusedAttribute">