Skip to content

Commit

Permalink
change interface class
Browse files Browse the repository at this point in the history
  • Loading branch information
eriffanani committed Oct 26, 2022
1 parent e2327bb commit a4d98d4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions app/src/main/java/com/erif/countanimation/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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()*/
}

}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand Down

0 comments on commit a4d98d4

Please sign in to comment.