In this short post I’ll fix the problem, occurred during writing previous article (it is no official way to connect data binding and ViewModel)- that’s time we will use android components to store screen state during phone rotation. To implement this, I removed databinding library from my project and add live data libraries instead. It is needed to mention that activity layout file was changed also – databinding root layout is removed. To connect xml-views with activities I’ll use popular butter knife library, so it is added into my project also. Continue reading Android Components investigation – part 2 – ViewModel + Lifecycle that’s time really
Author: admin
Android Components investigation – part 1 – ViewModel and Lifecycle aware components
In this post I will try use newly released android components for the real-life application example. Lets start from ViewModel class and new approach to handle android lifecycle. Full project example can be found on my github, brach databinding. Continue reading Android Components investigation – part 1 – ViewModel and Lifecycle aware components
Animating custom views
In the previous post I’ve described a way to create custom drawing view in Android. Now let’s see how to add animations into such views. Example of what we want to achieve is on the video:
Creating custom views in Android
I will describe the way to implement custom view in Android to get something like this:
and also an approach to add some animation into this view.
Removing unused resources in Android project
It is useful sometimes to check your application resources and remove unused ones. With Android Studio this task may be done easily by pressing Control + Alt + Shift (cmd + Shift + A for Mac with MacOS 10.5+ keymap) and writing “Unused resources”. This will execute proper Lint task (you can preview refactoring or just implement it).
The answer was found here.
Removing files from the Git
The task – to remove file from the Git (and leave it in the filesystem).
The problem occurs when you commit some file into the Git accidentally. This file will be under version control even if you put into .gitignore file. For me it’s often happens with *.iml files.
Frame-by-frame animation in Android
Sometimes we need to add some special animation to indicate changes in the view state and emphasise this changes via visual representation. For example I decided to made custom animation of the “like quote” feature in my application. Initially quotation has two different states – favourite and normal. These states represented by ImageView:
So, my task was to draw some transition between these states.
Animation for list reloading
As we know from android design guides, content should come to the screen from the edges in meaningful way. So, I decided to animate showing content of my list and also to add animation for reloading the list. I’ve used RecyclerView for my list of cards. It has a few build-in animations + we can set animation in onBindViewHolder method for every view-item. But for my task, I’ve decided to animate whole list itself.
Animation of MenuItem in ActionBar
About this blog
This is private blog of Anton Derevyanko – a happy android developer. I will share knowledge here about my applications and my tasks. Welcome!