From 7909e57eb3c48a28ae303cfec5497d90c341a309 Mon Sep 17 00:00:00 2001 From: Erick Tijero Date: Sun, 9 Aug 2020 17:28:17 -0500 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20Restore=20original=20transla?= =?UTF-8?q?tions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/kotlin/koleton/MainSkeletonLoader.kt | 1 + koleton-base/src/main/kotlin/koleton/util/Views.kt | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/koleton-base/src/main/kotlin/koleton/MainSkeletonLoader.kt b/koleton-base/src/main/kotlin/koleton/MainSkeletonLoader.kt index ac0d8fa..aa27f6a 100644 --- a/koleton-base/src/main/kotlin/koleton/MainSkeletonLoader.kt +++ b/koleton-base/src/main/kotlin/koleton/MainSkeletonLoader.kt @@ -82,6 +82,7 @@ internal class MainSkeletonLoader( val originalParent = skeletonView.getParentViewGroup() skeletonView.removeView(view) originalParent.removeView(skeletonView) + view.cloneTranslations(skeletonView) originalParent.addView(view, originalParams) } diff --git a/koleton-base/src/main/kotlin/koleton/util/Views.kt b/koleton-base/src/main/kotlin/koleton/util/Views.kt index a6edf29..11f0fb7 100644 --- a/koleton-base/src/main/kotlin/koleton/util/Views.kt +++ b/koleton-base/src/main/kotlin/koleton/util/Views.kt @@ -10,7 +10,10 @@ import android.widget.FrameLayout import androidx.core.view.ViewCompat import androidx.recyclerview.widget.RecyclerView import koleton.base.R -import koleton.custom.* +import koleton.custom.Attributes +import koleton.custom.RecyclerKoletonView +import koleton.custom.RecyclerViewAttributes +import koleton.custom.SimpleKoletonView import koleton.memory.ViewTargetSkeletonManager internal fun View.visible() { @@ -101,7 +104,13 @@ internal val View.koletonManager: ViewTargetSkeletonManager return manager } -internal fun KoletonView.cloneTranslations(view: View) = run { +internal fun View.cloneTranslations(view: View) { translationX = view.translationX translationY = view.translationY + view.clearTranslations() +} + +internal fun View.clearTranslations() { + translationX = 0f + translationY = 0f } \ No newline at end of file From b185d0c42794bf7333af42cd91cd2f229fceafd0 Mon Sep 17 00:00:00 2001 From: Erick Tijero Date: Sun, 9 Aug 2020 17:29:16 -0500 Subject: [PATCH 2/2] =?UTF-8?q?=E2=AC=86=20Increase=20version=20to=20v0.8.?= =?UTF-8?q?1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- gradle.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 964243a..35ff003 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ You can [download](https://bintray.com/ericktijerou/maven/koleton/_latestVersion ```gradle // In your module's `build.gradle.kts` dependencies { - implementation("com.ericktijerou.koleton:koleton:0.8.0") + implementation("com.ericktijerou.koleton:koleton:0.8.1") } ``` diff --git a/gradle.properties b/gradle.properties index e1ade77..2928503 100644 --- a/gradle.properties +++ b/gradle.properties @@ -27,4 +27,4 @@ compileSdk=29 groupId=com.ericktijerou.koleton vcsUrl=https://github.com/ericktijerou/koleton issueTrackerUrl=https://github.com/ericktijerou/koleton/issues -publishVersion=0.8.0 \ No newline at end of file +publishVersion=0.8.1 \ No newline at end of file