I'm currently working on custom animations between switch pages in ViewPager. When I move to the left, the "View" moves to the left, and from below its front view comes forward. I would like to make a view that moves to the left (which I command) to shrink, as in the following images:



In the second and third images, I did not imagine a new view facing the front, but I think it was not necessary. Do you know how to change the code?
I would like to change the height of TableLayout, RelativeLayout and FrameLayout and keep the height of both TextViews. Also I would have to change the X-position of the whole view.
I look forward to your creative answers (code). Below I add my animation code.
import android.view.View; import android.widget.RelativeLayout; import android.annotation.SuppressLint; import android.support.v4.view.ViewPager.PageTransformer; public class DepthPageTransformer implements PageTransformer { private static float MIN_SCALE = 0.75f; @SuppressLint("NewApi") public void transformPage(View view, float position) { int pageWidth = view.getWidth(); if (position < -1) {
UPDATE:
I can manipulate the height of the whole view (now I can only do this) with the following code:
LinearLayout relativeLayout = (LinearLayout) view.findViewById(R.id.fragment_object_canvas_linearLayout1); relativeLayout.setLayoutParams(new FrameLayout.LayoutParams(relativeLayout.getWidth(), NEW_HEIGHT_HERE)));
However, I'm not sure what I should put in the NEW_HEIGHT_HERE variable so that it works properly ...
java android layout animation android-viewpager
Marek
source share