From 137adee8f122b2539d5f146101e37ff12fd919a1 Mon Sep 17 00:00:00 2001 From: Sascha Huth Date: Wed, 4 Apr 2018 12:05:39 +0100 Subject: [PATCH] fix init issue --- README.md | 2 +- sequencelayout/build.gradle | 4 ++-- .../transferwise/sequencelayout/SequenceLayout.kt | 15 ++++++--------- .../transferwise/sequencelayout/SequenceStep.kt | 1 - .../sequencelayout/SequenceStepDot.kt | 1 - 5 files changed, 9 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index c7052bd..503b4b7 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ And then the actual library dependency to your module's `build.gradle`: ```groovy dependencies { - compile 'com.github.transferwise:sequence-layout:1.0.4' + compile 'com.github.transferwise:sequence-layout:1.0.5' } ``` diff --git a/sequencelayout/build.gradle b/sequencelayout/build.gradle index 247fa6d..ea642fa 100644 --- a/sequencelayout/build.gradle +++ b/sequencelayout/build.gradle @@ -11,8 +11,8 @@ android { defaultConfig { minSdkVersion 19 targetSdkVersion 27 - versionCode 4 - versionName "1.0.4" + versionCode 5 + versionName "1.0.5" archivesBaseName = "com.transferwise.sequencelayout-${versionName}" } diff --git a/sequencelayout/src/main/java/com/transferwise/sequencelayout/SequenceLayout.kt b/sequencelayout/src/main/java/com/transferwise/sequencelayout/SequenceLayout.kt index 9be1919..dba6cd0 100644 --- a/sequencelayout/src/main/java/com/transferwise/sequencelayout/SequenceLayout.kt +++ b/sequencelayout/src/main/java/com/transferwise/sequencelayout/SequenceLayout.kt @@ -6,7 +6,6 @@ import android.graphics.Rect import android.support.annotation.ColorInt import android.support.annotation.StyleRes import android.util.AttributeSet -import android.util.Log import android.view.Gravity import android.view.View import android.view.ViewGroup @@ -57,7 +56,6 @@ public class SequenceLayout(context: Context?, attrs: AttributeSet?, defStyleAtt clipToPadding = false clipChildren = false - onFinishInflate() start() } @@ -243,14 +241,13 @@ public class SequenceLayout(context: Context?, attrs: AttributeSet?, defStyleAtt } override fun onGlobalLayout() { - Log.d("testcount", stepsWrapper.childCount.toString()) - handler.postDelayed({ - if (stepsWrapper.childCount > 0) { - setProgressBarHorizontalOffset() - placeDots() + if (stepsWrapper.childCount > 0) { + setProgressBarHorizontalOffset() + placeDots() + post({ animateToActive() viewTreeObserver.removeOnGlobalLayoutListener(this) - } - }, 500) + }) + } } } \ No newline at end of file diff --git a/sequencelayout/src/main/java/com/transferwise/sequencelayout/SequenceStep.kt b/sequencelayout/src/main/java/com/transferwise/sequencelayout/SequenceStep.kt index b3e3be1..bf3ad2d 100644 --- a/sequencelayout/src/main/java/com/transferwise/sequencelayout/SequenceStep.kt +++ b/sequencelayout/src/main/java/com/transferwise/sequencelayout/SequenceStep.kt @@ -64,7 +64,6 @@ public class SequenceStep(context: Context?, attrs: AttributeSet?) setupSubtitleTextAppearance(attributes) setupActive(attributes) - onFinishInflate() attributes.recycle() } diff --git a/sequencelayout/src/main/java/com/transferwise/sequencelayout/SequenceStepDot.kt b/sequencelayout/src/main/java/com/transferwise/sequencelayout/SequenceStepDot.kt index b07a5b3..2beba4d 100644 --- a/sequencelayout/src/main/java/com/transferwise/sequencelayout/SequenceStepDot.kt +++ b/sequencelayout/src/main/java/com/transferwise/sequencelayout/SequenceStepDot.kt @@ -26,7 +26,6 @@ internal class SequenceStepDot(context: Context?, attrs: AttributeSet?, defStyle init { View.inflate(getContext(), R.layout.sequence_dot, this) isEnabled = false - onFinishInflate() } internal fun setDotBackground(@ColorInt color: Int, @ColorInt progressBackgroundColor: Int) {