Skip to content

Ahmednagyyy/Santoryu

Repository files navigation

Santoryu

Based on Android Scaling Animation and Animation Drawables

Features

  • Animated screen saver image views ( Released ✔️ 🚀 )
  • News feed stories image views ( Baking 🍪 ⌛ )
  • Creating custom GIF with set of images ( Baking 🍪 ⌛ )

Installation

  • 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' }
		}
	}

Usage

	<com.extremesolution.santoryu.ScreenSaver
            android:id="@+id/screen_saver"
            android:layout_height="<HEIGHT>"
            android:layout_width="<WIDTH>"
    />

For single image screen saver

     // Setting the screen saver with bitmap
     screen_saver.setSingleImage(bitmap)

     // Setting the screen saver with drawable
     screen_saver.setSingleImage(R.drawable.image)
	 

For multiple images screen saver

	// 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)

For Animation config

	 // 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 ~