All Projects → rakshakhegde → Lastpageradapter

rakshakhegde / Lastpageradapter

Don't write a ViewPager Adapter! Hook up your ViewPager to your data model using Android Data Binding Framework. With Kotlin support!

Programming Languages

java
68154 projects - #9 most used programming language
kotlin
9241 projects

Projects that are alternatives of or similar to Lastpageradapter

Nested Fragments
Samples of nested fragments in various widgets (TabHost, ViewPager)
Stars: ✭ 115 (-36.46%)
Mutual labels:  viewpager
Viewpager Swift
Simple View Pager library for swift using UIPageViewController and Scroll View
Stars: ✭ 136 (-24.86%)
Mutual labels:  viewpager
Dropindicator
A ViewPager indicator use Bezier curve
Stars: ✭ 161 (-11.05%)
Mutual labels:  viewpager
Zjywidget
🎨 一组实用炫酷自定义View的集合(包括源码及demo)包括常见的支付、扫描、解锁动画、炫酷转盘式菜单等效果。A collection of Android cool custom views
Stars: ✭ 121 (-33.15%)
Mutual labels:  viewpager
Widgetlayout
自定义ViewGroup的集合(有 kotlin 实现分支):提高编写效率和 UI 绘制性能,少嵌套,易用易扩展。
Stars: ✭ 130 (-28.18%)
Mutual labels:  viewpager
Imageviewer
A simple and customizable Android full-screen image viewer 一个简单且可自定义的Android全屏图像浏览器
Stars: ✭ 1,889 (+943.65%)
Mutual labels:  viewpager
Parallaxviewpager
a simple ViewPager with parallax effect
Stars: ✭ 103 (-43.09%)
Mutual labels:  viewpager
Tabman
™️ A powerful paging view controller with interactive indicator bars
Stars: ✭ 2,235 (+1134.81%)
Mutual labels:  viewpager
Banner
🔥🔥🔥Banner 2.0 来了!Android广告图片轮播控件,内部基于ViewPager2实现,Indicator和UI都可以自定义。
Stars: ✭ 11,682 (+6354.14%)
Mutual labels:  viewpager
Cardslider
Card Slider is an android component allows you to implement carousel effect with infinite indicators and more features
Stars: ✭ 160 (-11.6%)
Mutual labels:  viewpager
Xbanner
🔥【图片轮播】支持图片无限轮播,支持AndroidX、自定义指示点、显示提示文字、切换动画、自定义布局,一屏显示多个等功能
Stars: ✭ 1,734 (+858.01%)
Mutual labels:  viewpager
Shviewpager
A simple view pager for iOS. Compatible with iOS 8.0 or later.
Stars: ✭ 127 (-29.83%)
Mutual labels:  viewpager
Producttour
ProductTour is android sample project implementing a parallax effect welcome page using ViewPager and PageTransformer, similar to the one found in Google's app like Sheet, Drive, Docs...
Stars: ✭ 1,839 (+916.02%)
Mutual labels:  viewpager
Pageboy
📖 A simple, highly informative page view controller
Stars: ✭ 1,652 (+812.71%)
Mutual labels:  viewpager
Expandingpager
ExpandingPager is a card peek/pop controller
Stars: ✭ 1,906 (+953.04%)
Mutual labels:  viewpager
Whatsappviewpager
Swipeable tabs like WhatsApp in Android
Stars: ✭ 115 (-36.46%)
Mutual labels:  viewpager
Wormtabstrip
🐛 WormTabStrip ViewPager for iOS written in Swift, which gives continuous feedback to the user when scrolling
Stars: ✭ 145 (-19.89%)
Mutual labels:  viewpager
Bannerviewpager
🚀 An awesome banner view for Android,Based on ViewPager2. 这可能是全网最好用的ViewPager轮播图。简单、高效,一行代码实现循环轮播,一屏三页任意变,指示器样式任你挑。
Stars: ✭ 2,603 (+1338.12%)
Mutual labels:  viewpager
Viewpagerdots
👀 Simple, compact Kotlin library for ViewPager page indicators.
Stars: ✭ 168 (-7.18%)
Mutual labels:  viewpager
Flipviewpager.draco
This project aims to provide a working page flip implementation for usage in ListView.
Stars: ✭ 1,849 (+921.55%)
Mutual labels:  viewpager

BuddyBuild Release android min api size Android Arsenal MaterialUp

LastPagerAdapter Hero Banner

Don't write a ViewPager Adapter! Hook up your ViewPager to your data model using Android Data Binding Framework.

Show some ❤️

GitHub stars GitHub forks GitHub watchers GitHub followers
Twitter Follow

💋 Sweet and short library

Use the language of your choice.

// Java
new LastPagerAdapter(BR.model)
    .add(R.layout.layout_one, "First Layout Title", modelObject1)
    .add(R.layout.layout_two, "Second Layout Title", modelObject2)
    .into(viewPager);
// Kotlin
viewpager.lastPagerAdapter(BR.model) {
    add(R.layout.layout_one, "First Layout Title", modelObject1)
    add(R.layout.layout_two, "Second Layout Title", modelObject2)
}

Download the demo apk to play around with the LastPagerAdapter demo app.

Demo GIF

Or try the limited 1 min live app demo at Appetize.

👑 Features

LastPagerAdapter
🚝 Within a few lines easily hook up your data models with your ViewPager
🔗 Based on Android Data Binding
Written in Kotlin. A concise language you should definitely check out, if you haven't already.
✏️ No need to write any PagerAdapter (FragmentPagerAdapter, etc.)
Doesn't rely on Fragments. It has complex lifecycle and best be avoided. More reasons why
No need to modify your existing model classes
📃 Supports different View layouts and hooking it up with ViewPager is a breeze
👌 Super easy API. Concise syntax. Less Bugs for you to worry about. Boosted Productivity.
📝 Helpful error stacktraces
🚀 Very fast — no reflection
📱 Minimum Android SDK: Gingerbread API 9

🏛 Build

Add this in your root build.gradle at the end of repositories:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Step 2. Add the dependency in your module's gradle file

// apply plugin: 'kotlin-kapt'  // this line only for Kotlin projects

android {
    ...
    dataBinding.enabled true
}

dependencies {
    compile 'com.github.rakshakhegde:LastPagerAdapter:1.2'
    // kapt 'com.android.databinding:compiler:GRADLE_PLUGIN_VERSION' // this line only for Kotlin projects
}

🤔 How to use

<layout> as root for your View layouts is a must:

<layout xmlns:android="http://schemas.android.com/apk/res/android" >

    <data>
        <variable name="model" type="io.github.rakshakhegde.lastpageradaptersample.TextModel" />
    </data>

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@{model.text}" />

</layout>

It is important for all the model types to have the same variable name, in this case "model". This name is passed to the adapter constructor as BR.variableName, in this case BR.model:

// Java
new LastPagerAdapter(BR.model)
    .add(R.layout.text_layout, "Optional Layout Title", optionalTextModelObject, optionalWidth)
    .into(viewPager); // don't forget this line
// Kotlin
viewpager.lastPagerAdapter(BR.model) {
    add(R.layout.text_layout, "Optional Layout Title", optionalTextModelObject, optionalWidth)
}

Except the layoutId, everything else is optional

And that is how easy it is. Download the demo apk to play around with the LastPagerAdapter demo app.

👎 Known Issues

  • Customizability in terms of having independent names for models in XML is not present
  • API seems a bit verbose for large number of similar views. Could implement a version which accepts arrays. Anyways, a loop could be used there.
  • Callbacks for creation or destruction of Views is not implemented (I didn't implement them because personally my use case didn't require it). Feel free to Pull Request this one.

✨ My Recommended Repos

✨ Acknowledgements

Library and API Structure inspired from LastAdapter

Library Concept inspired from SmartTabLayout's Utils

Logo and Hero Banner created by Govindaraj Karthikeyan. Check him out on Bēhance

Core Logo created using Roman Nurik's awesome Android Asset Studio 🔥🔥🔥

🤸‍♂️ Author

Catch me at @rakshakhegde

Email | Twitter | Facebook | Google+ | Linked.in

🍴 Contribute

Please file bugs, suggest improvements and feel free to contribute

💋 Keep It Simple Silly

Changelog

  • v1.2
    • Documentation Update
    • Upgraded internal working
    • Updated library versions
    • Fix AndroidManifest

📝 License

Copyright 2017 Rakshak Hegde

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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].