Based on Android Scaling Animation and Animation Drawables
- Animated screen saver image views ( Released ✔️ 🚀 )
- News feed stories image views ( Baking 🍪 ⌛ )
- Creating custom GIF with set of images ( Baking 🍪 ⌛ )
- First add this line to your app gradle file
implementation 'com.github.Ahmednagyyy:Santoryu:1.0.0'
- Don't forget to add this in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
<com.extremesolution.santoryu.ScreenSaver
android:id="@+id/screen_saver"
android:layout_height="<HEIGHT>"
android:layout_width="<WIDTH>"
/>
// Setting the screen saver with bitmap
screen_saver.setSingleImage(bitmap)
// Setting the screen saver with drawable
screen_saver.setSingleImage(R.drawable.image)
// Setting the screen saver images
val imagesArray = ArrayList<Int>() //or <Bitmap>
imagesArray.add(R.drawable.image1)
imagesArray.add(R.drawable.image2)
imagesArray.add(R.drawable.image3)
// Use default duration between images transition
screen_saver.setMultiDrawables(imagesArray)
// Use custom duration ( in seconds ) between images transition
screen_saver.setMultiDrawables(imagesArray, 10)
// Use animation resource ( scaling animation )
screen_saver.startScreenSaver(R.anim.animation)
// Use library default animation
screen_saver.startScreenSaver()
// To control the animation programaticlly
// PARAM: seconds "Duration", fromX, fromY, toX, toY, pivotX, pivotY, repeat, and reversed
screen_saver.startScreenSaver(16, 1.0F, 1.0F, 1.5F, 1.5F, 0.5F, 0.5F, 10, true)
// Use same method without repeat param for INFINITE count
screen_saver.startScreenSaver(10, 1.0F, 1.0F, 1.5F, 1.5F, 0.5F, 0.5F, true)
// Use same method with default duration
screen_saver.startScreenSaver(1.0F, 1.0F, 1.5F, 1.5F, 0.5F, 0.5F, true)
Still had alot of work to do with Santoryu
- Working on demo example
"You need to accept the fact that you're not the best and have all the will to strive to be better than anyone you face."
~ Zoro Senpai ~