Simple base adapter for recyclerView with custom Freemarker templates. (updated 8.01.2018)
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
gradle/wrapper
library
sample
template
.gitignore
CONTRIBUTING.md
LICENSE
README.md
build.gradle
gradle.properties
gradlew
gradlew.bat
settings.gradle

README.md

NoRecyclerViewAdapter

Download API

Simple base adapter for RecyclerView with custom Freemarker template, which allow create adapter with LAYOUT item and ViewHolder for one click.

The library will adhere to the rule: Only the most necessary methods and the most simple API.

Gradle

Beginning with Gradle 3 compile is deprecated.

implementation 'ru.alexbykov:norecyclerviewadapter:0.0.2'

Install

 public class SampleRecyclerViewAdapter extends NoRecyclerViewAdapter<String, SampleRecyclerViewAdapter.ViewHolder> {
 
     private static final int LAYOUT = R.layout.item_sample;

     @Override
     public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
         return new ViewHolder(inflate(parent, LAYOUT));
     }

     @Override
     public void onBindViewHolder(ViewHolder holder, int position) {
         holder.tvSample.setText(items.get(position));
     }

     public static class ViewHolder extends RecyclerView.ViewHolder {

         private TextView tvSample;

         public ViewHolder(View itemView) {
             super(itemView);
             tvSample = itemView.findViewById(R.id.tvSample);
         }

     }
 }

Actions

   adapter.add(item);
   adapter.add(item, position);
   adapter.addItems(items);
   adapter.remove(position);
   adapter.remove(item);
   adapter.clear();
   adapter.getItem(position);
   adapter.getItems();

Roadmap

  1. DiffUtils support
  2. Wiki

Contributing

If you find any bug, or you have suggestions, don't be shy to create issues or make a PRs in the develop branch. You can read contribution guidelines here

My other libraries:

  1. NoPermission — Simple Android permission library, consist of only one class
  2. NoPaginate — Simple Android pagination library

License

Copyright 2018 Alex Bykov
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.