OpenLauncherTeam / openlauncher

Customizable and Open Source Launcher for Android
Apache License 2.0
1.43k stars 416 forks source link

Cell Layout switching effect #189

Open syefulislam opened 7 years ago

syefulislam commented 7 years ago

I want to add slide effect when we switch home careen one cell layout to another. But can’t understand how and where I add this effect. I have attached screenshots for better understanding. Red boarder mark mention effect style and name. screenshot_20170712-144615 screenshot_20170712-144621

dkanada commented 7 years ago

Pretty sure you would want to implement that here in the adapter for the desktop view.

MFlisar commented 7 years ago

Normally you just set a transformer to the ViewPager like pager.setPageTransformer(true, new CustomTransformer());. The adapter does not need to know anything about it.

Calling this somewhere in the in it function of the Desktop class should do the trick. Not sure though if the SmoothViewPager has any changes that interfere with that but probably not. But I've not checked this...

BennyKok commented 7 years ago

you mean swipe effect? as the desktop we were using is a customized viewpager, so you can bridge any view pager animation lib (eg https://github.com/ToxicBakery/ViewPagerTransforms) to the SmoothViewPager and SmoothViewPager 's PageTransformer we were using.

You can grab the source and replace all the original ViewPager usage and PageTransformer usage to the SmoothViewPager and PageTransformer (SmoothViewPager's inner class).

a bit hacky, but this will do the trick.