LiquidSwipe is a ViewPager library that can be used to make Awesome Onboarding designs.

Overview

LiquidSwipe

LiquidSwipe is a ViewPager library that can be used to make Awesome Onboarding designs.

Usage

Set up the dependency

  1. Add the mavenCentral() repository to your root build.gradle at the end of repositories:
allprojects {
	repositories {
		...
		mavenCentral()
	}
}
  1. Add the LiquidSwipe dependency in the build.gradle:
implementation group: 'com.apachat', name: 'liquidswipe-android', version: '1.10.6'

Badge:

Maven Central

Use ViewPager instead of the normal ViewPager

<androidx.constraintlayout.widget.ConstraintLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <com.apachat.liquidswipe.core.ViewPager
        android:id="@+id/viewpager"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

</androidx.constraintlayout.widget.ConstraintLayout>

Use a Layout as the base container in the fragment layouts

<?xml version="1.0" encoding="utf-8"?>
<com.apachat.liquidswipe.core.layout.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".DummyFragment">

    <!--  Fill with your views, just like you would in a normal ConstraintLayout  -->

</com.apachat.liquidswipe.core.layout.ConstraintLayout>

<!--  Also supports FrameLayout & LinearLayout  -->

And you're done, easy-peasy. ^_^

Touch Interactive - Making the LiquidSwipe wave center Y value match the touch Y value

Rather than having the wave center Y value always be layout.height/2 , it would be more aesthetically pleasing for it to be the same as the touch Y value. The following code can be used to dynamically change the waveCenterY based on the touch position on the ViewPager. (The reason this isn't done internally in the library is because the viewpager layouts don't get the touch events when said touch events are consumed directly by the viewpager)

  1. In the Activity/Fragment class containing the ViewPager
// Create an array of ClipPathProvider, one for each layout in the PagerAdapter
val Customize = Array(titleArray.count()) {
    Customize()
}

// Pass the ClipPathProvider array to the adapter
viewpager.adapter = CustomPagerAdapter(this, Customize)
// Similar logic can also be applied for your custom FragmentPagerAdapter/FragmentStatePagerAdapter

// Listen to onTouch events on the viewpager and update the waveCenterY value of the ClipPathProviders
viewpager.setOnTouchListener { _, event ->
    val waveCenterY = event.y
    Customize.map {
        it.waveCenterY = waveCenterY
    }
    false
}
  1. In the PagerAdapter
// Set the layout's clipPathProvider to the corresponding `Customize`
(layout as? Layout)?.clipPathProvider = Customize[position]

Bugs and Feedback

For bugs, questions and discussions please use the Github Issues.

You might also like...
Paging indicator widgets compatible with the ViewPager from the Android Support Library and ActionBarSherlock.
Paging indicator widgets compatible with the ViewPager from the Android Support Library and ActionBarSherlock.

Android ViewPagerIndicator Paging indicator widgets that are compatible with the ViewPager from the Android Support Library to improve discoverability

A custom ViewPager title strip which gives continuous feedback to the user when scrolling
A custom ViewPager title strip which gives continuous feedback to the user when scrolling

SmartTabLayout A custom ViewPager title strip which gives continuous feedback to the user when scrolling. This library has been added some features an

A different beautiful ViewPager, with quick swipe controls
A different beautiful ViewPager, with quick swipe controls

HollyViewPager Usage Add a HollyViewPager in your layout com.github.florent37.hollyviewpager.HollyViewPager android:id="@+id/hollyViewPager"

An interactive indicator to navigate between the different pages of a ViewPager
An interactive indicator to navigate between the different pages of a ViewPager

Android PagerSlidingTabStrip (default Material Design) This library is not maintained anymore and there will be no further releases. For most of the c

Combine ViewPager and Animations to provide a simple way to create applications' guide pages.
Combine ViewPager and Animations to provide a simple way to create applications' guide pages.

WoWoViewPager WoWoViewPager combines ViewPager and Animations to provide a simple way to create applications' guide pages. When users are dragging WoW

An android ViewPager extension allowing infinite scrolling

NO LONGER MAINTAINED LoopingViewPager An android ViewPager extension allowing infinite scrolling. You can use it with "standart" PagerAdapter (inflati

Augment Android's ViewPager with wrap-around functionality.

Infinite View Pager Augment Android's ViewPager with wrap-around functionality. Original StackOverflow question: http://stackoverflow.com/questions/75

ViewPager that slides vertically.
ViewPager that slides vertically.

ExpandablePager Layout that contains a ViewPager and can slide vertically between 2 states (expanded and collapsed). #Requirements Android 4.0+ (Ice C

[Development stopped in 2014. Unfinished and not stable - not recommended to use.] An easy-to-use ViewPager subclass with parallax background effect for Android apps.

Development stopped in 2014 Not developed since 2014. Unfinished and not stable - not recommended to use. ParallaxViewPager An easy-to-use ViewPager s

Releases(1.10.6)
Owner
Farham Hosseini
Calm, creative and forward-thinking
Farham Hosseini
Android auto scroll viewpager or viewpager in viewpager

Android Auto Scroll ViewPager ViewPager which can auto scrolling, cycling, decelerating. ViewPager which can be slided normal in parent ViewPager. Att

Trinea 1.7k Dec 10, 2022
Android LiquidSwipe Library

Android LiquidSwipe Library

Chrisvin Jem 838 Dec 29, 2022
Pixplicity 915 Nov 8, 2022
UltraViewPager is an extension for ViewPager to provide multiple features in a single ViewPager.

UltraViewPager 中文文档 ProjectUltraViewPager is a ViewPager extension that encapsulates multiple features, mainly to provide a unified solution for multi

Alibaba 5k Dec 20, 2022
Don't write a ViewPager Adapter! Hook up your ViewPager to your data model using Android Data Binding Framework. With Kotlin support!

Don't write a ViewPager Adapter! Hook up your ViewPager to your data model using Android Data Binding Framework. Show some ❤️ ?? Sweet and short libra

Rakshak R.Hegde 180 Nov 18, 2022
Persons cards list viewpager - Persons cards list viewpager using kotlin

persons_cards_list_viewpager Дизайн и условие взяты из https://github.com/appKOD

Mironov Ury 1 Mar 1, 2022
Android Concentric Onboarding library

Android Concentric Onboarding library

Chrisvin Jem 50 Sep 13, 2022
Library containing common animations needed for transforming ViewPager scrolling for Android v13+.

ViewPagerTransforms Library containing common animations needed for transforming ViewPager scrolling on Android v13+. This library is a rewrite of the

Ian Thomas 2.5k Dec 31, 2022
Paging indicator widgets compatible with the ViewPager from the Android Support Library and ActionBarSherlock.

Android ViewPagerIndicator Paging indicator widgets that are compatible with the ViewPager from the Android Support Library to improve discoverability

Jake Wharton 10.2k Jan 3, 2023
A Material Design ViewPager easy to use library

MaterialViewPager Material Design ViewPager easy to use library Sample And have a look on a sample Youtube Video : Youtube Link Download In your modul

Florent CHAMPIGNY 8.2k Dec 29, 2022