I Have a horizontal progress bar in a nested recyclerView. The situation is I want to start the animation of the determinant progress bar when it's 5 dp above the bottom and complete its progress when it reaches the middle of the screen. Just imagine you have a while scrolling the recyclerView. As soon as it appears from the bottom while scrolling the recyclerVeiw it starts increasing its progress and complete its progress when it reaches to the middle of the screen. I am attaching a demo Video of the circular Progressbar how it should be done. Any suggestion will be appreciated.Link of sample
I have tried this and some other samples too
int[] location = new int[2];
holder.progressbar_text.getLocationOnScreen(location);
int menuViewX = location[0];
int menuViewY = location[1];
I have tried to calculate the progress bar location. As you can see I am getting the location of the progressbar vertically which is menuViewY. Here are the solutions that I have tried link1. link2 In the above two questions I have tried all the suggested solutions.
Log.i("bound", "Absolute Position" + menuViewY);
// Progresbar animations
holder.progressbar_text.enableAnimation();
holder.progressbar_text.setScrollBarFadeDuration(9000);
holder.progressbar_text.setAnimationSpeedScale(5);
holder.progressbar_text.setProgress(40);
holder.progressbar_text.setSecondaryProgress(70);