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 install on your local
./gradlew publishToMavenLocal
Then copy ~/.m2/repository/net/cattaka/adapter-toolbox
to your local project.
Examples
This repository contains example application. You can clone this repository and run example application with Android Studio.
Header and footer
Sections within a RecyclerView
Multiple button in single row
Scramble several data types
Manipulable items within RecyclerView
Expandable tree items within RecyclerView
Dynamically change ItemViewType
Expandable tree within Spinner
Headered list within Spinner
JUnit test with Espresso
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.