I am trying to make an app and I want to add a splash screen to it. Tired of having static splash screen I'm thinking of making one that I've seen in the root app "KingRoot" but I don't know the name or where to find information about it.
It is treated as if it were the same vertical image but that it occupied 3 vertical screens, that is, you slide with your finger and you go down, the screen that is disappearing at the same time as you go down and the next screen appears, and so on with the third also. I would like to know the name to be able to look up information about it or whether it is natively in C# or Java.
EDITED:
Code to make Slide horizontally and with depth but my need is to convert it to Slide VERTICAL and remove that depth:
public class DepthPageTransformer implements ViewPager2.PageTransformer {
private static final float MIN_SCALE = 0.75f;
public void transformPage(View view, float position) {
int pageWidth = view.getWidth();
if (position < -1) { // [-Infinity,-1)
// This page is way off-screen to the left.
view.setAlpha(0f);
} else if (position <= 0) { // [-1,0]
// Use the default slide transition when moving to the left page
view.setAlpha(1f);
view.setTranslationX(0f);
view.setScaleX(1f);
view.setScaleY(1f);
} else if (position <= 1) { // (0,1]
// Fade the page out.
view.setAlpha(1 - position);
// Counteract the default slide transition
view.setTranslationX(pageWidth * -position);
// Scale the page down (between MIN_SCALE and 1)
float scaleFactor = MIN_SCALE
+ (1 - MIN_SCALE) * (1 - Math.abs(position));
view.setScaleX(scaleFactor);
view.setScaleY(scaleFactor);
} else { // (1,+Infinity]
// This page is way off-screen to the right.
view.setAlpha(0f);
}
}}
Should I change the "X" to "Y"?
I don't know exactly what you want but it reads like a Slide between fragments
According to Google it can be created in this way:
We create the xml of the activity:
We create the snippet:
We add a ViewPager:
And finally the Java file of the activity:
I have never used it but I imagine that here we all learn together nn
I leave you the documentation since it has a couple of interesting transitions at the bottom of the page.
I hope it works for you, I'll still do some tests, it looks great for applications.
Documentation about Slide between fragments