Skip to content
المشاريع

حول

🎨 مكتبة Android لإنشاء رسوم متحركة متدرجة الألوان على غرار Instagram وSpotify.

تطوير الويب والتطبيقات

كيف تُقاس هذه الأرقام

النمو المقاس للنجوم

خلال 24 ساعة
٠
خلال 7 أيام
؜-١
خلال 15 يومًا
؜-١
خلال شهر
جارٍ جمع السجل

تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.

README.md

الأصل

Spark

Build Status Download

Create gradient animations like Instagram&Spotify.

Screenshots

screenshot

Usage

private lateinit var _spark: Spark

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_main)

    _spark = Spark(frameLayout, Spark.ANIM_GREEN_PURPLE, 4000)
    _spark.startAnimation()
}

override fun onDestroy() {
    super.onDestroy()

    _spark.stopAnimation()
}

Installation

Gradle

dependencies {
    implementation 'io.github.tonnyl:spark:x.y.z'
}

Maven

<dependency>
  <groupId>io.github.tonnyl</groupId>
  <artifactId>spark</artifactId>
  <version>x.y.z</version>
  <type>pom</type>
</dependency>

Custom Gradient Colors

Spark has 3 built-in animation-lists, and you can custom your owns.

Create gradient drawables

purple_drawable.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">

    <gradient
        android:centerColor="#e459aa"
        android:endColor="#cd7be6"
        android:startColor="#f14589"
        android:type="linear" />

    <corners android:radius="0dp" />

</shape>

yellow_drawable.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">

    <gradient
        android:centerColor="#F4A37B"
        android:endColor="#F08875"
        android:startColor="#F9CB87"
        android:type="linear"/>

    <corners android:radius="0dp" />

</shape>

Create the Animation List

custom_anim_list.xml

<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
    android:oneshot="false">

    <item
        android:drawable="@drawable/yellow_drawable"
        android:duration="4500" />

    <item
        android:drawable="@drawable/purple_drawable"
        android:duration="4500" />

</animation-list>

Apply Your Custom Animation List

_spark = Spark(
    frameLayout,
    R.drawable.your_custom_anim_list, // Your custom animation
    4000
)

Thanks

Designed by Alexander Zaytsev.

Sketch Gradients

License

Spark is under the MIT license. See the LICENSE for more information.

استكشف مشاريع مشابهة ومرتبطة

جارٍ التحميل…