Skip to content

This is utility classes for RecyclerView and classic AdapterView(such as ListView, Spinner).

Notifications You must be signed in to change notification settings

cattaka/AdapterToolbox

Repository files navigation

AdapterToolbox

This is utility classes for RecyclerView and classic AdapterView(such as ListView, Spinner).

  • ScrambleAdapter
    • This separate creating ViewHolder logic from RecyclerView.Adapter.
    • Once gave DataClass-ViewHolder relation, this will bind them automatically.
    • The relation of DataClass-ViewHolder are declared by ViewHolderFactory.
  • ViewHolderFactory
    • Describe the relation of DataClass-ViewHolder.
    • This has onCreateViewHolder() / onBindViewHolder() / isAssignable() / etc methods.
  • ListenerRelay
    • Empty implementation of frequently used listeners. This is used by ScrambleAdapter.
  • CodeLabelAdapter
    • The adapter for Enum. But you can adopt this to other standard data classes.
  • ClassicScrambleAdapter
    • Classic version of ScrambleAdapter. It can go with classic AdapterView(such as ListView, Spinner).
  • AbsTreeItemAdapter
    • This provides foldable tree list.
  • AbsChoosableTreeItemAdapter
    • This supports single choice and multi choice mode.

How to use

Add folloing lines to build.gradle

repositories {
    maven {
        url "http://dl.bintray.com/cattaka/maven"
    }
}

dependencies {
    compile 'net.cattaka:adapter-toolbox:$VERSION@aar'
}

Put $VERSION that you want to use. You can check available versions here. https://bintray.com/cattaka/maven/adapter-toolbox/view

Examples

This repository contains example application. You can clone this repository and run example application with Android Studio.

Header and footer

Header and footer

Sections within a RecyclerView

Sections within a RecyclerView

Multiple button in single row

Multiple button in single row

Scramble several data types

Scramble several data types

Manipulable items within RecyclerView

Manipulable items within RecyclerView

Expandable tree items within RecyclerView

Expandable tree items within RecyclerView

Dynamically change ItemViewType

Dynamically change ItemViewType

Expandable tree within Spinner

Expandable tree within Spinner

Headered list within Spinner

Headered list within Spinner

JUnit test with Espresso

IMAGE ALT TEXT HERE

License

Copyright 2016 Takao Sumitomo
Copyright 2014 Josh Burton

   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.

About

This is utility classes for RecyclerView and classic AdapterView(such as ListView, Spinner).

Resources

Stars

Watchers

Forks

Packages

No packages published