Skip to content
Proyek

Tentang

Implementasi animasi switch untuk Android dari Oleg Frolov

Desain dan media

Cara angka ini diukur

Pertumbuhan bintang terukur

dalam 24 jam
0
dalam 7 hari
-1
dalam 15 hari
-3
dalam 1 bulan
-5

Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.

README.md

Asli

Switcher

sample

License Platform API Android Arsenal

Created this cool switch animation from Oleg Frolov as an android library.

Read on Medium

APK

Install the latest release

USAGE

Just add Switcher view in your layout XML and Switcher library in your project via Gradle:

dependencies {
  implementation 'io.github.bitvale:switcher:1.1.2'
}

XML

<com.bitvale.switcher.SwitcherX // or SwitcherC
    android:id="@+id/switcher"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:switcher_on_color="@color/on_color"
    app:switcher_off_color="@color/off_color"
    app:switcher_icon_color="@color/icon_color" />

You must use the following properties in your XML to change your Switcher.

Properties:
  • android:checked (boolean) -> default true
  • app:switcher_on_color (color) -> default #48ea8b
  • app:switcher_off_color (color) -> default #ff4651
  • app:switcher_icon_color (color) -> default white
  • app:elevation (dimension) -> default 4dp

Kotlin

switcher.setOnCheckedChangeListener { checked ->
    if (checked) action()
}

LICENCE

Switcher by Alexander Kolpakov is licensed under an Apache License 2.0.

Jelajahi proyek terkait

Memuat…