Description
With AccordionRecycler you can easily create awesome RecyclerViews, containing infinitely nested items and the ability to expand or collapse any part of the View at will.
AccordionRecycler alternatives and similar packages
Based on the "Kotlin" category.
Alternatively, view AccordionRecycler alternatives based on common mentions on social networks and blogs.
-
CalendarView
A highly customizable calendar view and compose library for Android and Kotlin Multiplatform. -
Balloon
:balloon: Modernized and sophisticated tooltips, fully customizable with an arrow and animations for Android. -
kotlin-android-template
Android + Kotlin + Github Actions + ktlint + Detekt + Gradle Kotlin DSL + buildSrc = โค๏ธ -
NotyKT ๐๏ธ
๐ NotyKT is a complete ๐Kotlin-stack (Backend + Android) ๐ฑ application built to demonstrate the use of Modern development tools with best practices implementation๐ฆธ. -
Material Chip View
Material Chip view. Can be used as tags for categories, contacts or creating text clouds -
DrawableToolbox
๐ ๏ธ The missing drawable toolbox for Android. Create drawables programmatically and get rid of the boring and always repeated drawable.xml files. -
Navigation Toolbar for Android
:octocat: Navigation toolbar is a slide-modeled UI navigation controller made by @Ramotion -
Capturable
๐Jetpack Compose utility library for capturing Composable content and transforming it into Bitmap Image๐ผ๏ธ -
Pdf Viewer For Android
A Lightweight PDF Viewer Android library which only occupies around 80kb while most of the Pdf viewer occupies up to 16MB space. -
Carousel Recyclerview
Carousel Recyclerview let's you create carousel layout with the power of recyclerview by creating custom layout manager. -
SSComposeCookBook
A Collection of major Jetpack compose UI components which are commonly used.๐๐๐ -
Pluto Debug Framework
Android Pluto is a on-device debugging framework for Android applications, which helps intercept Network calls, capture Crashes & ANRs, manipulate application data on-the-go, and much more. -
CrunchyCalendar โ awesome calendar widget for android apps
A beautiful material calendar with endless scroll, range selection and a lot more! -
SSCustomBottomNavigation
Animated TabBar with native control and Jetpack Navigation support..โจ๐๐ -
Permission Flow for Android
Know about real-time state of a Android app Permissions with Kotlin Flow APIs. -
Only
:bouquet: An easy way to persist and run code block only as many times as necessary on Android. -
Nextflix-Composable
Includes jetpack compose, navigation, paging, hilt, retrofit, coil, coroutines, flow.. -
EasyPermissions-ktx
๐ Kotlin version of the popular google/easypermissions wrapper library to simplify basic system permissions logic on Android M or higher. -
Compose Compiler Reports to HTML Generator
A utility (Gradle Plugin + CLI) to convert Jetpack Compose compiler metrics and reports to beautified HTML page. -
Events Calendar
Events Calendar is a user-friendly library that helps you achieve a cool Calendar UI with events mapping. You can customise every pixel of the calendar as per your wish and still achieve in implementing all the functionalities of the native android calendar in addition with adding dots to the calendar which represents the presence of an event on the respective dates. It can be done easily, you are just a few steps away from implementing your own badass looking Calendar for your very own project! -
MidJourney Images Compose Multiplatform Mobile Application
This application is developed to display the images created by MidJourney. The application is developed with Compose Multiplatform and works on many platforms including Android and iOS platforms. -
FlowMVI
A Kotlin Multiplatform MVI library based on coroutines with a rich DSL and a powerful plugin system. -
SSCustomEditTextOutLineBorder
Same as the Outlined text fields presented on the Material Design page but with some dynamic changes. ๐ ๐ -
TimelineView
A customizable and easy-to-use Timeline View library for Android. Works as a RecyclerView decorator (ItemDecoration)
InfluxDB - Purpose built for real-time analytics at any scale.
Do you think we are missing an alternative of AccordionRecycler or a related project?
README
AccordionRecycler
Android RecyclerView Adapter with nested items & expand/contract functionality
With AccordionRecycler you can easily create awesome RecyclerViews, containing infinitely nested items and the ability to expand or collapse any part of the View at will.
Installation
implementation 'com.izikode.izilib:accordionrecycler:0.5'
Usage
Have your Model Classes implement the AccordionRecyclerData
interface.
- The Adapter needs a way to get the ViewType, Primary data and the Enclosed (child) data, if existing. You use the above interface to provide those.
- Fill the diamond operator with the type the model provides.
- Optionally, you can use a base class as a reference for your different data sub-classes and also your ViewHolders. In the provided demo, and examples below, ColorData is the base class and it provided itself. ```kotlin abstract class ColorData : AccordionRecyclerData
data class RedData(
var arrayOfPink: Array<PinkData> = arrayOf()
) : ColorData(RedViewHolder.VIEW_TYPE) {
override val mainData: ColorData?
get() = this
override val enclosedDataArray: Array<out AccordionRecyclerData<out ColorData?>>?
get() = arrayOfPink
}
data class GrayData( ... ) : ColorData() { ... } data class PinkData( ... ) : ColorData() { ... } data class WhiteData( ... ) : ColorData() { ... }
#### Have your ViewHolders extend the ```AccordionRecyclerViewHolder``` abstract class.
- Provide the ViewHolder constructor with the parent ViewGroup and the layout to be inflated.
- Fill the diamond operator with the type of Model being handled.
- Again, optionally, create a base ViewHolder as a reference.
```kotlin
abstract class ColorViewHolder<Data>( ... ) : AccordionRecyclerViewHolder<Data> where Data : ColorData
class RedViewHolder(parent: ViewGroup) : ColorViewHolder<RedData>(parent, R.layout.view_holder_red) {
override var data: RedData? = null
companion object {
const val VIEW_TYPE = 2
}
}
class GrayViewHolder( ... ) : ColorViewHolder<GrayData>
class PinkViewHolder( ... ) : ColorViewHolder<GrayData>
class WhiteViewHolder( ... ) : ColorViewHolder<RedData>
Create an Adapter that extends the AccordionRecyclerAdapter
abstract class.
- Override the
buildViewHolder
function to provide new ViewHolder instances. - Override the
updateViewHolder
function to update each item being recycled. TheAccordionRecyclerItemDetails
parameter contains information about the current item and all enclosing (parent) items, when existing. This allows for unlimited visual combinations for all view types. - Expand/Collapse is accomplished with:
removeItem
to remove an item and all it's child items, if existing.removeEnclosedItems
to remove the child items only.addItems
to add all items and their child items, if existing.addEnclosedItems
to add all items as child items to another.
Optionally, you can modify how each item is handled when it is iterated and added into the recycler data. You do that by overriding the
processForAdditionalItems
function. You can use this feature to handle edge case. One such case is shown in the demo, in which whenever a Pink item does not have any child White items, a new item is added, showing the text 'Nothing to see here'.class MainAccordionAdapter : AccordionRecyclerAdapter<ColorViewHolder<out ColorData>, ColorData>() { override fun buildViewHolder(parent: ViewGroup, viewType: Int): ColorViewHolder<out ColorData> = when(viewType) { RedViewHolder.VIEW_TYPE -> RedViewHolder(parent) PinkViewHolder.VIEW_TYPE -> PinkViewHolder(parent) WhiteViewHolder.VIEW_TYPE -> WhiteViewHolder(parent) else -> GrayViewHolder(parent) } override fun updateViewHolder(position: Int, viewHolder: ColorViewHolder<out ColorData>, data: ColorData?, details: AccordionRecyclerItemDetails) { when (viewHolder) { is RedViewHolder -> viewHolder.apply { ... } is PinkViewHolder -> viewHolder.apply { ... } is WhiteViewHolder -> viewHolder.apply { ... } else -> (viewHolder as GrayViewHolder).apply { ... } } } override fun processForAdditionalItems(position: Int, item: AccordionRecyclerData<out ColorData?>?) : Array<out AccordionRecyclerData<out ColorData?>?> = item?.let { if (it is PinkData && it.enclosedDataArray.isNullOrEmpty()) { arrayOf( it, EmptyPinkViewHolder.EmptyPinkData() ) } else { super.processForAdditionalItems(position, item) } } ?: super.processForAdditionalItems(position, item)
}
#### For a full example, see the sample app.
## Licence
Copyright 2018 Fanis Veizis
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 all licence references and agreements mentioned in the AccordionRecycler README section above
are relevant to that project's source code only.