Description
A PagedGrid is a ViewPager which pages are GridLayout with equal distributed rows and columns.This project is an Android library, written in Kotlin, that helps you create a PagedGrid component and manage its pages and cell views.
This module provides a component with no added features, but a simple way to rapidly create particular Android views reducing the complexity, for example control panels, launchers and tables.
PagedGrid alternatives and similar packages
Based on the "Kotlin" category.
Alternatively, view PagedGrid alternatives based on common mentions on social networks and blogs.
-
android-youtube-player
YouTube Player library for Android and Chromecast, stable and customizable. -
DrawableToolbox
๐ ๏ธ The missing DrawableToolbox for Android. Get rid of the boring and always repeated drawable.xml files. -
kotlin-android-template
Android + Kotlin + Github Actions + ktlint + Detekt + Gradle Kotlin DSL + buildSrc = โค๏ธ -
Navigation Toolbar for Android
Navigation toolbar is a slide-modeled UI navigation controller made by @Ramotion -
KAndroid
Lightweight library providing useful extensions to eliminate boilerplate code in Android SDK. -
NotyKT ๐๏ธ
๐ NotyKT is a complete Kotlin-stack (Backend + Android) application ๐ฑ built to demonstrate the use of Modern development tools with best practices implementation. -
MaterialTimelineView
With MaterialTimelineView you can easily create a material looking timeline. -
CrunchyCalendar โ awesome calendar widget for android apps
A beautiful material calendar with endless scroll, range selection and a lot more! -
Android Kotlin Samples
Some basic Android code samples writen in Kotlin. -
Swagger Gradle Codegen
๐ซ A Gradle plugin to generate networking code from a Swagger spec file. -
Awesome Jetpack compose
A collaborative list of awesome jetpack compose resources. -
CameraViewEx
CameraViewEx makes integration of camera implementation and various camera features into any Android project very easy. -
Events Calendar
A user-friendly library that helps you achieve a cool Calendar UI with events mapping. -
Pdf Viewer For Android
A Lightweight PDF Viewer Android library which only occupies around 125kb while most of the Pdf viewer occupies up to 16MB space. -
Vanilla Place Picker
Simple(vanilla) yet 'Do it all' place picker for your place picking needs in Android -
Aimybox voice assistant
Embeddable voice assistant for Android apps written in Kotlin -
Maildroid
๐ Maildroid is a small robust android library for sending emails using SMTP server ๐ -
SSCustomEditTextOutLineBorder
Same as an Outlined text fields presented in Material Design page but with some dynamic changes -
ParallaxScrollingView
Parallax scrolling either by offset or automatically. -
SSCustomBottomNavigation
Animated tabbar with native control -
Kotlin-AgendaCalendarView
CalendarView widget (Outlook) -
Kotlin Example
An example for who are all going to start learning Kotlin programming language to develop Android application. -
Google Places AutoComplete EditText
A simple library that can connect your autocomplete edittext to Google places api -
User Consent SDK for Android
Configurable User Consent SDK For Androir -
MVVM-To-Do-App
Android To-Do MVVM Architecture App written in Kotlin.(ViewModel, ROOM, Livedata, Coroutines) -
EasyPermissions-ktx
๐ Kotlin version of the popular google/easypermissions wrapper library to simplify basic system permissions logic on Android M or higher. -
Viola
With Viola android face detection library, you can detect faces in a bitmap, crop faces using predefined algorithm and get additional information from the detected faces. -
fusion
An Easy-to-use Kotlin based Customizable Modules Collection with Material Layouts by BlackBeared.
Get performance insights in less than 4 minutes
Do you think we are missing an alternative of PagedGrid or a related project?
README
PagedGrid
A PagedGrid
is a ViewPager
which pages are GridLayout
with equal distributed rows and columns.
This project is an Android library, written in Kotlin, that helps you create a PagedGrid
component and manage its pages and cell views.
Motivation
This module provides a component with no added features, but a simple way to rapidly create particular Android views reducing the complexity, for example control panels, launchers and tables.
[](readme_res/portrait.gif)
Getting started
Add the module as dependency using the latest version number, specified above.
Add the JitPack repository to your build file
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Add the dependency using the latest version number, specified above.
dependencies {
implementation 'com.github.arabello:PagedGrid:x.x.x'
}
It is possible to build the latest commit on the master branch, using the tag master-SNAPSHOT
dependencies {
implementation 'com.github.arabello:PagedGrid:master-SNAPSHOT'
}
Usage
Notation: (ColumnIndex, RowIndex) [ColumnIndex, RowIndex]
Add the custom view to your layout
<io.matteopellegrino.pagedgrid.PagedGridView
android:id="@+id/pagedGridView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
Assign an instance of GridAdapter
to the PagedGrid
val gridAdapter = GridAdapter(arrayOf())
pagedGridView.adapter = gridAdapter
Create an EmptyGrid
page, specifying the number of columns and rows
val page1 = EmptyGrid(4, 5)
The page (grid) is a matrix of Element
interface.
DrawableIcon
and BitmapIcon
are ready to use implementation of Element
.
Add an element to the page using column and rows indexes.
page1[0, 2] = DrawableIcon("Photo Filter", R.drawable.ic_photo_filter_black_24dp)
page1[2, 2] = DrawableIcon("Portrait", R.drawable.ic_portrait_black_24dp)
You can create your own element just extending AbstractElement
.
page1[1, 1] = object : AbstractElement() {
override fun inflateView(parent: ViewGroup): View {
val layout = LayoutInflater.from(parent.context).inflate(R.layout.custom, null)
val img = layout.findViewById(R.id.img)
val txt = layout.findViewById(R.id.txt)
img.scaleType = ImageView.ScaleType.CENTER_CROP
img.setImageBitmap(BitmapFactory.decodeResource(resources, R.mipmap.img_4))
txt.setText(R.string.mytext)
return layout
}
}
Once pages are ready, add them (or assign) to the adapter and notify the changes.
gridAdapter.pages += page1
gridAdapter.notifyDataSetChanged()
The method setOnInflateViewListener
allows you to access the cell View
when created, extremely
useful for attaching Android events.
You can easily iterate over pages and cells (elements) as showed below.
gridAdapter.pages.forEach { page ->
page.forEachIndexed { x, y, elem ->
elem.setOnInflateViewListener { view ->
view.setOnClickListener {
Toast.makeText(baseContext, "View on ($x, $y) clicked", Toast.LENGTH_SHORT).show()
}
}
}
}
For further details and specific uses case, please see the sample app
Personalization
Here the personalization properties (first value as default)
<io.matteopellegrino.pagedgrid.PagedGridView
app:animationEnabled="true|false"
app:orientation="portrait|landscape"
app:pageIndicatorUnselected="@android:color/gray"
app:pageIndicatorSelected="@android:color/black" />
Animation
When the content of a page change and it is currently displayed, the component animates the transition to the new content as showed below.
[](readme_res/animation.gif)
Landscape
The landscape mode is supported, but it is severely rigid. The component is rotated clockwise only and the scroll becomes vertical. In this way
the coordinate of each element related to a page remain the same considering the top-left corner as the origin (0,0)
[](readme_res/landscape.gif)
Credits
For the third party dependencies, thanks to
For the sample app illustrations, thanks to unDraw
License
MIT License
Copyright (c) 2018 Matteo Pellegrino
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.
*Note that all licence references and agreements mentioned in the PagedGrid README section above
are relevant to that project's source code only.