Adapterlayout

ViewGroup backed by RecyclerView.Adapter = magic
Alternatives To Adapterlayout
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Shimmerrecyclerview3,458
3 years ago13otherKotlin
All Base Adapter528
6 years ago5apache-2.0Java
Adapter terminator, including DataBinding, any ViewGroup, list(Rv, Lv ). Write Adapter, it is enough .Adapter终结者,包含DataBinding,任意ViewGroup,Rv、Lv列表。写Adapter,有它就够了
Adapterlayout57
3 years ago2apache-2.0Kotlin
ViewGroup backed by RecyclerView.Adapter = magic
Universaladapter53
8 years agoapache-2.0Java
A single adapter implementation for any scrolling view or ViewGroup.
Adapter Databinding11
3 years agoapache-2.0Kotlin
adapter-databinding
Xebicon 2013__cc In Aa9
10 years agoJava
A demonstration of the "Custom ViewGroup" advice given during the Clean Code in Android Apps talk of XebiCon 2013.
Listview3
7 years agoJava
a samples of ListView
Android Stacklayout2
9 years agomitJava
Custom ViewGroup of which the top element can be swept away.
Gsectioned Recyclerview2
4 years agomitKotlin
Biblioteca criada de modo a facilitar a criação de um RecyclerView com seções, algo muito comum em diversas aplicações.
Simplemvp_android2
5 years agoJava
Alternatives To Adapterlayout
Select To Compare


Alternative Project Comparisons
Readme

AdapterLayout

ViewGroup backed by RecyclerView.Adapter, allowing for easy data set manipulation with non recycling views. Aka RecyclerView minus the recycling.

Build Status

Dependency

allprojects {
    repositories {
        maven { url "https://jitpack.io" }
    }
}

and within your application build.gradle

dependencies {
    implementation 'com.github.Commit451.AdapterLayout:adapterlayout:latest.release.here'
}

and for FlowLayout support: Maven Central

dependencies {
    //add the latest of FlowLayout
    implementation 'com.wefika:flowlayout:latest.release.here'
    implementation 'com.github.Commit451.AdapterLayout:adapterflowlayout:latest.release.here'
}

and for Kotlin extensions support:

dependencies {
    implementation 'com.github.Commit451.AdapterLayout:adapterlayout-kotlin:latest.release.here'
}

Usage

See the sample project for full usage.

//CheeseAdapter is a RecyclerView adapter
CheeseAdapter cheeseAdapter = new CheeseAdapter();
adapterLinearLayout adapterLinearLayout = (AdapterLinearLayout) findViewById(R.id.adapter_linear_layout);
adapterLinearLayout.setAdapter(cheeseAdapter);

Later, when you get your data set:

ArrayList<Cheese> cheeses = loadCheeses();
//addAll is a method in our custom RecyclerView.Adapter
cheeseAdapter.addAll(cheeses);

At this point, the data will be added to the LinearLayout so long as your RecyclerView.Adapter works correctly. onCreateViewHolder and onBindViewHolder will be called as needed.

But... Why?

This library is useful for displaying data sets that are repeating, but do not need to be recycled as they would be in a RecyclerView. This could be the case if you wanted to display a list of items within a ScrollView, or wanted to use a custom ViewGroup that did not extend RecyclerView.

But Why RecyclerView Adapter?

Most developers should be using RecyclerView instead of ListView and should be familiar with creating a RecyclerView.Adapter. RecyclerView.Adapter also enforces the use of ViewHolders which is better for performance. RecyclerView's adapter also allows for better responses to data structure changes via notifyItemInserted, notifyItemRemoved etc.

Currently Created AdapterLayouts

  • AdapterLinearLayout
  • AdapterFlowLayout (separate dependency)

Creating Your Own AdapterLayout

It is simple to create your own ViewGroup backed by a RecyclerView.Adapter. See the AdapterFlowLayout library and AdapterLayoutDelegate in the library for an example of how to create one.

Limitations

  • Within a RecyclerView.Adapter, you can call getAdapterPosition(). This will always return -1 since there is actually never an associated RecyclerView. Instead, you can call AdapterLayout.getAdapterPosition(holder) to get the position of the ViewHolder within the adapter.

License

Copyright 2018 Commit 451

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.
Popular Viewgroup Projects
Popular Adapter Projects
Popular User Interface Components Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Kotlin
Adapter
Viewgroup
Flowlayout