Add jitpack
maven in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Add the dependency to your app build.gradle
file (not your project build.gradle file).
dependencies {
implementation 'com.github.astrit-veliu:Smoolider:1.2'
}
Smoolider
is used the same as a normal ViewPager but more beautiful and with other functionalities. You can use my adapter, or implement a new one.
Include the widget in xml.
<?xml version="1.0" encoding="UTF-8"?>
<com.av.smoothviewpager.Smoolider.SmoothViewpager
android:id="@+id/smoolider"
android:paddingRight="10dp"
android:layout_alignParentBottom="true"
android:clipToPadding = "false"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</com.av.smoothviewpager.Smoolider.SmoothViewpager>
After attaching the adapter to SmoothViewpager you can start/cancel autoplay of slides, adjust the quality of images and interact with other widgets. (See the example for more details)
//simply call the setAdapter method with parameter a list of PageModel objects, where you can also add your own object into it
viewpager.setAdapter(getDemoData())
viewpager.setOnPageClick { page ->
viewpager.removePage(page) //will remove the page object from Smoolider and jumps to first postion
viewpager.addPage(page) //will add the page object from Smoolider and jumps to its position
}
viewpager.setOnPageSelected { position, page ->
//here you get the current position and the Page Object in case you want to do some actions with its data
}
Smoolider is released under the MIT license. See LICENSE for details.
MIT License
Copyright (c) 2019 Astrit Veliu
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.