From 3825c84c61a6a9f181c88a4335b139e75ff82171 Mon Sep 17 00:00:00 2001 From: DylanCai Date: Fri, 7 Mar 2025 23:27:22 +0800 Subject: [PATCH 1/3] refactor: optimize the sample of fade animatable --- .../sample/kotlin/delegate/FadeAnimatable.kt | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/sample-kotlin/src/main/java/com/dylanc/loadingstateview/sample/kotlin/delegate/FadeAnimatable.kt b/sample-kotlin/src/main/java/com/dylanc/loadingstateview/sample/kotlin/delegate/FadeAnimatable.kt index a475a64..bb52b5f 100644 --- a/sample-kotlin/src/main/java/com/dylanc/loadingstateview/sample/kotlin/delegate/FadeAnimatable.kt +++ b/sample-kotlin/src/main/java/com/dylanc/loadingstateview/sample/kotlin/delegate/FadeAnimatable.kt @@ -7,25 +7,19 @@ import com.dylanc.loadingstateview.ViewType /** * @author Dylan Cai */ -class FadeAnimatable @JvmOverloads constructor( - private val duration: Long = DEFAULT_DURATION -) : LoadingStateView.Animatable { +class FadeAnimatable(private val duration: Long = 600) : LoadingStateView.Animatable { override fun toggleViewsAnimation(showView: View, hideView: View, showViewType: Any, hideViewType: Any) { - showView.alpha = 0f - showView.visibility = View.VISIBLE - showView.animate().alpha(1f).setDuration(duration) - if (showViewType === ViewType.LOADING && hideViewType === ViewType.CONTENT) { + showView.visibility = View.VISIBLE hideView.visibility = View.GONE } else { + showView.alpha = 0f + showView.visibility = View.VISIBLE + showView.animate().alpha(1f).setDuration(duration) hideView.animate().alpha(0f).setDuration(duration).withEndAction { hideView.alpha = 1f hideView.visibility = View.GONE } } } - - companion object { - private const val DEFAULT_DURATION: Long = 600 - } } From 27e594d5bb06d779b76ff27ead73644cc85509a1 Mon Sep 17 00:00:00 2001 From: DylanCai Date: Fri, 4 Apr 2025 23:55:50 +0800 Subject: [PATCH 2/3] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index deff2c7..4b7790f 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,7 @@ dependencies { | [Longan](https://github.com/DylanCaiCoding/Longan) | Probably the best Kotlin utils library for Android. | | [ViewBindingKTX](https://github.com/DylanCaiCoding/ViewBindingKTX) | The most comprehensive utils of ViewBinding. | | [MMKV-KTX](https://github.com/DylanCaiCoding/MMKV-KTX) | Use MMKV with property delegates. | +| [MultiBaseUrls](https://github.com/DylanCaiCoding/MultiBaseUrls) | Use annotation to allow Retrofit to support multiple baseUrl and dynamically change baseUrl | | [Tracker](https://github.com/DylanCaiCoding/Tracker) | A lightweight tracking framework based on the tracking idea of Buzzvideo.| ## Thanks From a91fa3f3142bd8edad7d7f23ef6ea91e0d699e85 Mon Sep 17 00:00:00 2001 From: DylanCai Date: Sat, 5 Apr 2025 22:26:22 +0800 Subject: [PATCH 3/3] Update README_ZH.md --- README_ZH.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README_ZH.md b/README_ZH.md index 372a99d..94bc0b6 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -75,6 +75,7 @@ dependencies { | [Longan](https://github.com/DylanCaiCoding/Longan) | 可能是最好用的 Kotlin 工具库 | | [ViewBindingKTX](https://github.com/DylanCaiCoding/ViewBindingKTX) | 最全面的 ViewBinding 工具 | | [MMKV-KTX](https://github.com/DylanCaiCoding/MMKV-KTX) | 最灵活易用的 MMKV 工具 | +| [MultiBaseUrls](https://github.com/DylanCaiCoding/MultiBaseUrls) | 用注解让 Retrofit 同时支持多个 baseUrl 以及动态改变 baseUrl | | [Tracker](https://github.com/DylanCaiCoding/Tracker) | 基于西瓜视频的责任链埋点思路实现的轻量级埋点框架 | ## 感谢