Awesome Open Source
Awesome Open Source

New in the EasyFlipViewPager  The article on how this library was created is now published. You can read it on this link here. →.


Built with ❤︎ by Wajahat Karim and contributors


📖 Full Demo Video

Demo Video

📱 Download Demo on Android

Download the APK file from here on your Android phone and enjoy the Demo App :)

💥 Achievements

💻 Installation

Since the v1.2.0, all new updates will only support androidx widgets. If you want to use android.support, then use v1.0.0.

Add EasyFlipViewPager in app's build.gradle file:

   implementation 'com.wajahatkarim3.easyflipviewpager:easyflipviewpager:2.0.0'

Or add EasyFlipViewPager as a new dependency inside your pom.xml

<dependency>
  <groupId>com.wajahatkarim3.easyflipviewpager</groupId>
  <artifactId>easyflipviewpager</artifactId>
  <version>2.0.0</version>
  <type>pom</type>
</dependency>

❓ Usage

ViewPager

Just create an object of either BookFlipPageTransformer or CardFlipPageTransformer and assign it to your ViewPager object by calling ViewPager#setPageTransformer(true, myTransformerObject).

ViewPager2

Use these new PageTransformer classes for ViewPager2 instance: BookFlipPageTransformer2 or CardFlipPageTransformer2

💳 Card Flip Example

// Get ViewPager2 and Set Adapter
myViewPager2 = findViewById(R.id.myViewPager2);
pagerAdapter = new MyPagerAdapter(this);
myViewPager2.setAdapter(pagerAdapter);

// Create an object of page transformer
CardFlipPageTransformer2 cardFlipPageTransformer = new CardFlipPageTransformer2();

// Enable / Disable scaling while flipping. If false, then card will only flip as in Poker card example. 
// Otherwise card will also scale like in Gallery demo. By default, its true.
cardFlipPageTransformer.setScalable(false);

// Assign the page transformer to the ViewPager2.
myViewPager2.setPageTransformer(cardFlipPageTransformer);

📄 Book Flip Example

// Get ViewPager2 and Set Adapter        
myViewPager2 = findViewById(R.id.myViewPager2);
pagerAdapter2 = new MyPagerAdapter(this);
myViewPager2.setAdapter(pagerAdapter);

// Create an object of page transformer
BookFlipPageTransformer2 bookFlipPageTransformer = new BookFlipPageTransformer2();

// Enable / Disable scaling while flipping. If true, then next page will scale in (zoom in). By default, its true.
bookFlipPageTransformer.setEnableScale(true);

// The amount of scale the page will zoom. By default, its 5 percent.
bookFlipPageTransformer.setScaleAmountPercent(10f);

// Assign the page transformer to the ViewPager2.
myViewPager2.setPageTransformer(bookFlipPageTransformer);

👨 Developed By

Wajahat Karim

Twitter Web Medium Linkedin

👍 How to Contribute

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

📃 License

Copyright 2020 Wajahat Karim

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Java (697,034) 
Android (41,609) 
Animation (5,223) 
Android Library (3,348) 
Transformer (1,682) 
Viewpager (395) 
Transformations (379) 
Flip (63) 
Flip Animation (26) 
Viewpager Transformer (14) 
Pagetransformer (10) 
Pageflip (8) 
Related Projects
Advertising 📦 9
All Projects
Application Programming Interfaces 📦 120
Applications 📦 181
Artificial Intelligence 📦 72
Blockchain 📦 70
Build Tools 📦 111
Cloud Computing 📦 79
Code Quality 📦 28
Collaboration 📦 30
Command Line Interface 📦 48
Community 📦 81
Companies 📦 60
Compilers 📦 60
Computer Science 📦 74
Configuration Management 📦 39
Content Management 📦 167
Control Flow 📦 197
Data Formats 📦 77
Data Processing 📦 266
Data Storage 📦 132
Economics 📦 60
Frameworks 📦 198
Games 📦 122
Graphics 📦 103
Hardware 📦 148
Integrated Development Environments 📦 47
Learning Resources 📦 147
Legal 📦 28
Libraries 📦 119
Lists Of Projects 📦 21
Machine Learning 📦 336
Mapping 📦 61
Marketing 📦 15
Mathematics 📦 55
Media 📦 228
Messaging 📦 97
Networking 📦 304
Operating Systems 📦 84
Operations 📦 120
Package Managers 📦 52
Programming Languages 📦 229
Runtime Environments 📦 96
Science 📦 42
Security 📦 375
Social Media 📦 26
Software Architecture 📦 70
Software Development 📦 68
Software Performance 📦 57
Software Quality 📦 127
Text Editors 📦 45
Text Processing 📦 131
User Interface 📦 310
User Interface Components 📦 465
Version Control 📦 29
Virtualization 📦 68
Web Browsers 📦 38
Web Servers 📦 25
Web User Interface 📦 194