Top Related Projects
Paging indicator widgets compatible with the ViewPager from the Android Support Library and ActionBarSherlock.
A lightweight indicator like in nexus 5 launcher
An page indicator for Android ViewPager
Library containing common animations needed for transforming ViewPager scrolling for Android v13+.
A Material Design ViewPager easy to use library
Infinite cycle ViewPager with two-way orientation and interactive effect.
Quick Overview
VerticalViewPager is an Android library that provides a custom ViewPager implementation for vertical swiping. It allows developers to create vertically scrollable pages in their Android applications, offering a unique navigation experience compared to the standard horizontal ViewPager.
Pros
- Easy integration with existing Android projects
- Supports both vertical and horizontal swiping
- Customizable animation and transition effects
- Compatible with FragmentPagerAdapter and PagerAdapter
Cons
- Limited documentation and examples
- Not actively maintained (last update was several years ago)
- May require additional effort to ensure compatibility with newer Android versions
- Lacks some advanced features found in more recent ViewPager alternatives
Code Examples
- Basic implementation of VerticalViewPager:
val verticalViewPager: VerticalViewPager = findViewById(R.id.vertical_view_pager)
val adapter = MyPagerAdapter(supportFragmentManager)
verticalViewPager.adapter = adapter
- Enabling/disabling vertical swiping:
verticalViewPager.setVerticalSwipe(true) // Enable vertical swiping
verticalViewPager.setVerticalSwipe(false) // Disable vertical swiping (horizontal only)
- Setting a custom page transformer for transition effects:
verticalViewPager.setPageTransformer(true, object : ViewPager.PageTransformer {
override fun transformPage(page: View, position: Float) {
// Custom transformation logic
}
})
Getting Started
To use VerticalViewPager in your Android project:
- Add the JitPack repository to your root build.gradle file:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
- Add the dependency to your app's build.gradle file:
dependencies {
implementation 'com.github.kaelaela:VerticalViewPager:1.0.0'
}
- Use VerticalViewPager in your layout XML:
<me.kaelaela.verticalviewpager.VerticalViewPager
android:id="@+id/vertical_view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
- Initialize and use VerticalViewPager in your Activity or Fragment as shown in the code examples above.
Competitor Comparisons
Paging indicator widgets compatible with the ViewPager from the Android Support Library and ActionBarSherlock.
Pros of ViewPagerIndicator
- More comprehensive and feature-rich, offering various indicator styles
- Well-established project with a large community and extensive documentation
- Supports both horizontal and vertical orientations
Cons of ViewPagerIndicator
- Last updated in 2016, potentially outdated for newer Android versions
- Larger library size due to additional features, which may impact app size
Code Comparison
ViewPagerIndicator:
CirclePageIndicator indicator = (CirclePageIndicator)findViewById(R.id.indicator);
ViewPager pager = (ViewPager)findViewById(R.id.pager);
indicator.setViewPager(pager);
VerticalViewPager:
VerticalViewPager verticalViewPager = (VerticalViewPager) findViewById(R.id.vertical_viewpager);
verticalViewPager.setAdapter(new SamplePagerAdapter(getSupportFragmentManager()));
Key Differences
- VerticalViewPager focuses specifically on vertical scrolling, while ViewPagerIndicator provides a range of indicator styles for both horizontal and vertical orientations
- ViewPagerIndicator offers more customization options for indicators, whereas VerticalViewPager is primarily concerned with the scrolling behavior
- VerticalViewPager is more recently maintained, potentially offering better compatibility with newer Android versions
Use Cases
- Choose ViewPagerIndicator for projects requiring diverse indicator styles and extensive customization
- Opt for VerticalViewPager when vertical scrolling is the primary requirement and a lightweight solution is preferred
Community and Support
ViewPagerIndicator has a larger community and more extensive documentation, but its age may limit its relevance for modern Android development. VerticalViewPager, while more focused, benefits from more recent updates and maintenance.
A lightweight indicator like in nexus 5 launcher
Pros of CircleIndicator
- Lightweight and focused on providing a simple, customizable circle indicator
- Supports both ViewPager and ViewPager2
- Easy to implement with minimal setup required
Cons of CircleIndicator
- Limited to horizontal paging only
- Doesn't provide the actual paging functionality, only the indicator
Code Comparison
CircleIndicator:
<me.relex.circleindicator.CircleIndicator
android:id="@+id/indicator"
android:layout_width="match_parent"
android:layout_height="48dp"/>
VerticalViewPager:
<com.kaelaela.verticalviewpager.VerticalViewPager
android:id="@+id/vertical_viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
Summary
CircleIndicator is a specialized library for adding circular indicators to horizontal ViewPagers, while VerticalViewPager focuses on providing vertical paging functionality. CircleIndicator is easier to implement for standard horizontal paging scenarios, but VerticalViewPager offers unique vertical scrolling capabilities. The choice between the two depends on the specific paging direction and indicator requirements of your project.
An page indicator for Android ViewPager
Pros of PageIndicatorView
- More versatile, supporting various indicator styles and animations
- Actively maintained with recent updates and bug fixes
- Extensive documentation and customization options
Cons of PageIndicatorView
- Focused solely on page indicators, not providing vertical paging functionality
- May require additional setup to integrate with custom ViewPager implementations
Code Comparison
VerticalViewPager:
VerticalViewPager viewPager = findViewById(R.id.viewPager);
viewPager.setAdapter(new MyPagerAdapter());
PageIndicatorView:
ViewPager viewPager = findViewById(R.id.viewPager);
PageIndicatorView pageIndicatorView = findViewById(R.id.pageIndicatorView);
pageIndicatorView.setViewPager(viewPager);
Summary
VerticalViewPager is specifically designed for vertical scrolling in ViewPagers, while PageIndicatorView focuses on providing customizable page indicators. PageIndicatorView offers more flexibility in terms of indicator styles and animations, but it doesn't provide vertical paging functionality. VerticalViewPager is simpler to implement for vertical scrolling but has limited customization options for indicators. The choice between the two depends on the specific requirements of your project, whether you need vertical scrolling or advanced indicator customization.
Library containing common animations needed for transforming ViewPager scrolling for Android v13+.
Pros of ViewPagerTransforms
- Offers a wide variety of pre-built page transformation animations
- Supports both horizontal and vertical transformations
- Easy to implement and customize existing transformations
Cons of ViewPagerTransforms
- Focuses solely on page transformations, lacking vertical scrolling functionality
- May require additional code to achieve a fully vertical ViewPager experience
- Some transformations might not be suitable for vertical layouts
Code Comparison
VerticalViewPager:
VerticalViewPager viewPager = findViewById(R.id.viewPager);
viewPager.setAdapter(new MyPagerAdapter());
ViewPagerTransforms:
ViewPager viewPager = findViewById(R.id.viewPager);
viewPager.setPageTransformer(true, new VerticalFlipTransformation());
viewPager.setAdapter(new MyPagerAdapter());
Summary
VerticalViewPager is specifically designed for vertical scrolling, providing a seamless vertical paging experience out of the box. ViewPagerTransforms, on the other hand, offers a rich set of transformation animations for both horizontal and vertical layouts but requires additional setup for a fully vertical ViewPager. While VerticalViewPager is more focused and easier to implement for vertical scrolling, ViewPagerTransforms provides greater flexibility in terms of page transition effects.
A Material Design ViewPager easy to use library
Pros of MaterialViewPager
- Offers a more comprehensive Material Design implementation
- Includes additional features like header animations and parallax effects
- Has a larger community and more frequent updates
Cons of MaterialViewPager
- More complex to set up and customize
- Heavier in terms of resource usage due to additional features
- May require more effort to integrate with existing projects
Code Comparison
VerticalViewPager:
VerticalViewPager viewPager = (VerticalViewPager) findViewById(R.id.viewpager);
viewPager.setAdapter(new PagerAdapter());
MaterialViewPager:
MaterialViewPager mViewPager = (MaterialViewPager) findViewById(R.id.materialViewPager);
mViewPager.getViewPager().setAdapter(new FragmentStatePagerAdapter(getSupportFragmentManager()) {
// Adapter implementation
});
mViewPager.setMaterialViewPagerListener(new MaterialViewPager.Listener() {
// Listener implementation
});
VerticalViewPager focuses on providing a simple vertical scrolling ViewPager, making it easier to implement for basic vertical swiping needs. MaterialViewPager, on the other hand, offers a rich set of Material Design features but requires more setup and customization. The choice between the two depends on the specific requirements of your project, balancing simplicity versus feature richness.
Infinite cycle ViewPager with two-way orientation and interactive effect.
Pros of InfiniteCycleViewPager
- Supports infinite scrolling in both directions
- Offers customizable scaling and rotation effects for items
- Provides smooth animations and transitions between pages
Cons of InfiniteCycleViewPager
- More complex implementation due to additional features
- Potentially higher memory usage for infinite scrolling
- May require more setup and configuration
Code Comparison
VerticalViewPager:
VerticalViewPager viewPager = findViewById(R.id.viewPager);
viewPager.setAdapter(new MyPagerAdapter());
InfiniteCycleViewPager:
InfiniteCycleViewPager viewPager = findViewById(R.id.viewPager);
viewPager.setAdapter(new MyPagerAdapter());
viewPager.setScrollDuration(500);
viewPager.setInterpolator(new AccelerateDecelerateInterpolator());
viewPager.setMediumScaled(true);
The code comparison shows that InfiniteCycleViewPager requires additional configuration for its advanced features, while VerticalViewPager has a simpler setup. InfiniteCycleViewPager offers more customization options out of the box, such as scroll duration, interpolator, and scaling effects.
Both libraries extend the standard ViewPager, but InfiniteCycleViewPager focuses on horizontal scrolling with infinite cycling, while VerticalViewPager primarily enables vertical scrolling. Developers should choose based on their specific requirements for orientation, scrolling behavior, and visual effects.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
VerticalViewPager
Vertically ViewPager and vertically transformer for Android. This library is not copy ViewPager code. Extended class.
Usage
VerticalViewPager viewPager = new VerticalViewPager();
viewPager.setAdapter(adapter);
viewPager.setPageTransformer(false, new DefaultTransformer());
//viewPager.setPageTransformer(false, new ZoomOutTransformer());
//viewPager.setPageTransformer(true, new StackTransformer());
Download from Gradle
dependencies {
compile 'me.kaelaela:verticalviewpager:1.0.0@aar'
}
Next
- Use with scrollable views(ListView, ScrollView, RecyclerView, WebView).
- Add more transformers.(Please contribute me!
- Sticky header.
Me
Yuichi Maekawa(Kaelaela)
- Twitter @Yuichi0531
- kaelaela.31@gmail.com
License
Copyright (C) 2015 kaelaela
Copyright (C) 2013 The Android Open Source Project
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.
Top Related Projects
Paging indicator widgets compatible with the ViewPager from the Android Support Library and ActionBarSherlock.
A lightweight indicator like in nexus 5 launcher
An page indicator for Android ViewPager
Library containing common animations needed for transforming ViewPager scrolling for Android v13+.
A Material Design ViewPager easy to use library
Infinite cycle ViewPager with two-way orientation and interactive effect.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot