Recently we have seen that Instagram has introduced an eye-catching color changing background of the login page in their iOS version of the application. The page’s background keeps changing colors like a gradient which looks really amazing. There are some libraries available on the internet which can create the same effect for you but in this blog, we will learn how this can be done without any libraries.
What we are going to do.
Create some drawable files with different color gradients.
Create another drawable with animation-list tag and add all the created gradient drawables as the items.
Use the animation-list drawable as the background of the view.
Start the animation in the onCreate method of the Activity of the fragment.
Let us see the steps in detail and with some code snippets.
1) Creating drawable files
Create some drawables files which contain gradients. For example:
2 comments