diff --git a/app/src/main/java/com/erif/countanimation/MainActivity.kt b/app/src/main/java/com/erif/countanimation/MainActivity.kt index 58abbf0..b4601d2 100644 --- a/app/src/main/java/com/erif/countanimation/MainActivity.kt +++ b/app/src/main/java/com/erif/countanimation/MainActivity.kt @@ -6,6 +6,7 @@ import android.widget.TextView import androidx.appcompat.app.AppCompatActivity import androidx.core.content.ContextCompat import com.erif.countanimator.CountAnimator +import com.erif.countanimator.format.CountFormat import com.erif.countanimator.format.CountFormatCurrency import com.erif.countanimator.format.CountFormatDecimal @@ -50,20 +51,20 @@ class MainActivity : AppCompatActivity() { anim.start() */ - val anim = CountAnimator(1000, 3000) - anim.format(CountFormatCurrency("IDR", 2)) + val anim = CountAnimator(100, 50) + anim.format(CountFormatCurrency("EUR")) anim.doOnUpdate { _, valueStr -> txt.text = valueStr } anim.doOnEnd { - txt.setTextColor(ContextCompat.getColor(this, R.color.purple_200)) + //txt.setTextColor(ContextCompat.getColor(this, R.color.purple_200)) } btn.setOnClickListener { anim.start() - anim.pause() + /*anim.pause() anim.stop() - anim.resume() + anim.resume()*/ } } diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 66dc399..7b33bb4 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -11,7 +11,7 @@ android:id="@+id/txt" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="1000" + android:text="€100" android:layout_gravity="center_horizontal" android:layout_marginTop="25dp" android:textSize="20sp" />