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 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) | 基于西瓜视频的责任链埋点思路实现的轻量级埋点框架 | ## 感谢 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 - } }