From 3b55eaabf482510fb37271172d1472435dfcedf5 Mon Sep 17 00:00:00 2001 From: yezhiqiu <983577727@qq.com> Date: Thu, 16 Apr 2026 18:17:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E8=AE=A2=E9=98=85=E7=9A=84?= =?UTF-8?q?=E5=A5=97=E9=A4=90=E5=88=97=E8=A1=A8=EF=BC=8C=E4=B8=8D=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=80=92=E8=AE=A1=E6=97=B6=EF=BC=8C=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E8=AE=A2=E9=98=85=E7=9A=84=E5=A5=97=E9=A4=90?= =?UTF-8?q?=E6=89=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../compile-file-map.properties | 2 +- app/build.gradle | 2 +- .../ui/fragment/data/RouteV3Fragment.kt | 39 +++++++++++++------ .../abbidot/tracker/vm/DeviceDFUViewModel.kt | 2 +- 4 files changed, 31 insertions(+), 14 deletions(-) diff --git a/FastBleLib/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties b/FastBleLib/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties index dd0f8d5..eb347c1 100644 --- a/FastBleLib/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +++ b/FastBleLib/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties @@ -1 +1 @@ -#Thu Apr 09 17:00:19 CST 2026 +#Thu Apr 16 16:49:17 CST 2026 diff --git a/app/build.gradle b/app/build.gradle index 46117e3..0767a30 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -30,7 +30,7 @@ android { targetSdkVersion 35 versionCode 2202 // versionName "2.2.2" - versionName "2.2.2-Beta2" + versionName "2.2.2-Beta3" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" diff --git a/app/src/main/java/com/abbidot/tracker/ui/fragment/data/RouteV3Fragment.kt b/app/src/main/java/com/abbidot/tracker/ui/fragment/data/RouteV3Fragment.kt index a1482e0..f23db0c 100644 --- a/app/src/main/java/com/abbidot/tracker/ui/fragment/data/RouteV3Fragment.kt +++ b/app/src/main/java/com/abbidot/tracker/ui/fragment/data/RouteV3Fragment.kt @@ -1,9 +1,11 @@ package com.abbidot.tracker.ui.fragment.data +import android.animation.ValueAnimator import android.annotation.SuppressLint import android.content.Context import android.view.MotionEvent import android.view.View +import android.view.animation.LinearInterpolator import android.widget.SeekBar import androidx.core.view.WindowInsetsCompat import androidx.core.view.isVisible @@ -144,7 +146,7 @@ class RouteV3Fragment : BaseFragment(FragmentRouteV3Bind llMapRouteLineV3ZoomingLayout.setOnTouchListener { _, event -> if (rlMapRouteLineV3TimeLayout.isVisible) { - if (mLastScrollViewHeight == 0) { + if (mTotalHeight == 0) { mTotalHeight = cvHomeRouteV3Card.height + svHomeRouteMapScroll.height mLastScrollViewHeight = svHomeRouteMapScroll.height } @@ -157,7 +159,7 @@ class RouteV3Fragment : BaseFragment(FragmentRouteV3Bind MotionEvent.ACTION_MOVE -> { val dy = mLastY - event.rawY - if (abs(dy) >50){ + if (abs(dy) > 50) { val layoutParams = svHomeRouteMapScroll.layoutParams val diff = (svHomeRouteMapScroll.height + dy).toInt() isSlideUp = dy >= 0.0f @@ -176,18 +178,16 @@ class RouteV3Fragment : BaseFragment(FragmentRouteV3Bind MotionEvent.ACTION_UP -> { LogUtil.e("ACTION_UP") - val layoutParams = svHomeRouteMapScroll.layoutParams +// val layoutParams = svHomeRouteMapScroll.layoutParams if (mDiffHeight > mTotalHeight / 2) { setSeekBarShowHide(false) - layoutParams.height = mTotalHeight - svHomeRouteMapScroll.layoutParams = layoutParams +// layoutParams.height = mTotalHeight +// svHomeRouteMapScroll.layoutParams = layoutParams + animateViewHeight(svHomeRouteMapScroll, mTotalHeight) isListExpand = true } else { - svHomeRouteMapScroll.postDelayed( - { mHistoryDataMapCommon.setLatLngData(mHistoryDataList) }, 200 - ) if (mDiffHeight > mLastScrollViewHeight) { - layoutParams.height = if (isSlideUp) { + val height = if (isSlideUp) { isListExpand = true setSeekBarShowHide(false) mTotalHeight / 2 @@ -203,8 +203,12 @@ class RouteV3Fragment : BaseFragment(FragmentRouteV3Bind } mLastScrollViewHeight } + animateViewHeight(svHomeRouteMapScroll, height, 300) } - svHomeRouteMapScroll.layoutParams = layoutParams +// svHomeRouteMapScroll.layoutParams = layoutParams + svHomeRouteMapScroll.postDelayed( + { mHistoryDataMapCommon.setLatLngData(mHistoryDataList) }, 500 + ) } } } @@ -231,6 +235,19 @@ class RouteV3Fragment : BaseFragment(FragmentRouteV3Bind initState() } + private fun animateViewHeight(view: View, targetHeight: Int, duration: Long = 500) { + val animator = ValueAnimator.ofInt(view.height, targetHeight) + animator.duration = duration // 设置动画持续时间 + animator.interpolator = LinearInterpolator() // 设置插值器 + animator.addUpdateListener { animation -> + val animatedValue = animation.animatedValue as Int + val layoutParams = view.layoutParams + layoutParams.height = animatedValue + view.layoutParams = layoutParams + } + animator.start() + } + private fun getHomeV2Activity(): HomeV2Activity? { return if (null == activity) { LogUtil.e("RouteV2Fragment,getHomeV2Activity,null == activity") @@ -487,7 +504,7 @@ class RouteV3Fragment : BaseFragment(FragmentRouteV3Bind */ private fun setSeekBarShowHide(show: Boolean) { mViewBinding.apply { - if (show && !isListExpand) { + if (show && !isListExpand && mHistoryDataList.isNotEmpty()) { vsbMapRouteLineV3.visibility = View.VISIBLE ivMapRouteLineV3LastBtn.visibility = View.VISIBLE ivMapRouteLineV3NextBtn.visibility = View.VISIBLE diff --git a/app/src/main/java/com/abbidot/tracker/vm/DeviceDFUViewModel.kt b/app/src/main/java/com/abbidot/tracker/vm/DeviceDFUViewModel.kt index 655556e..1f4149f 100644 --- a/app/src/main/java/com/abbidot/tracker/vm/DeviceDFUViewModel.kt +++ b/app/src/main/java/com/abbidot/tracker/vm/DeviceDFUViewModel.kt @@ -125,7 +125,7 @@ class DeviceDFUViewModel(application: Application) : AndroidViewModel(applicatio override fun onUpgradeFailed( state: FirmwareUpgradeManager.State?, error: McuMgrException? ) { - LogUtil.e("DfuProgressListener -->> onError") + LogUtil.e("DfuProgressListener -->> onError${error.toString()}") val stateBean = DFUStateBean(context.getString(R.string.txt_upgrade_fail), mDFUFailCode) mDfuStateLiveData.value = stateBean