All Projects → ThisIsNSH → Candyview

ThisIsNSH / Candyview

Licence: apache-2.0
Implement any RecyclerView in just 1 Line. CandyView handles everything for you.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Candyview

Poweradapter
Adapter for RecyclerView(only 21KB).RecyclerView万能适配器(仅21KB)
Stars: ✭ 112 (+646.67%)
Mutual labels:  adapter, recyclerview, recyclerview-adapter
MultiTypeAdapter
RecyclerView通用多类型适配器MultiTypeAdapter,以布局文件为单位更细粒度的条目复用。
Stars: ✭ 18 (+20%)
Mutual labels:  adapter, recyclerview, recyclerview-adapter
Flagchatadapter
FlagChatAdapter is easy to implement enchanting recycler view adapter. Just extend your adapter with FlagChatAdapter, impliment some methods and voila! You have got the most beautiful looking chat on your phone. Zero boilerplate code, just put your variables in the right direction.
Stars: ✭ 39 (+160%)
Mutual labels:  adapter, recyclerview, recyclerview-adapter
Modular2Recycler
Modular²Recycler is a RecyclerView.Adapter that is modular squared.
Stars: ✭ 72 (+380%)
Mutual labels:  adapter, recyclerview, recyclerview-adapter
RecyclerELE
Android Library for easy addition of Empty, Loading and Error views in a RecyclerView
Stars: ✭ 27 (+80%)
Mutual labels:  gradle, recyclerview, recyclerview-adapter
Boardview
A draggable boardview for java android (Kanban style)
Stars: ✭ 309 (+1960%)
Mutual labels:  gradle, adapter, recyclerview
Google Books Android Viewer
Android library to bridge between RecyclerView and sources like web page or database. Includes demonstrator (Google Books viewer)
Stars: ✭ 37 (+146.67%)
Mutual labels:  library, adapter, recyclerview
PrimeAdapter
PrimeAdapter makes working with RecyclerView easier.
Stars: ✭ 54 (+260%)
Mutual labels:  adapter, recyclerview, recyclerview-adapter
recycler-adapter
RecyclerView-driven declarative UIs
Stars: ✭ 124 (+726.67%)
Mutual labels:  adapter, view, recyclerview
Tableview
TableView is a powerful Android library for displaying complex data structures and rendering tabular data composed of rows, columns and cells.
Stars: ✭ 2,928 (+19420%)
Mutual labels:  adapter, recyclerview, recyclerview-adapter
Fastadapter
The bullet proof, fast and easy to use adapter library, which minimizes developing time to a fraction...
Stars: ✭ 3,512 (+23313.33%)
Mutual labels:  adapter, recyclerview, recyclerview-adapter
Easyxrecyclerview
主要提供了简单易用强大的RecyclerView库,包括自定义刷新加载效果、极简通用的万能适配器Adapter、万能分割线、多种分组效果、常见状态页面、item动画效果、添加多个header和footer、侧滑、拖拽、Sticky(黏性)效果、多item布局等,各模块之间灵活、解耦、通用、又能相互组合使用。
Stars: ✭ 607 (+3946.67%)
Mutual labels:  recyclerview, recyclerview-adapter
Zoomrecylerlayout
🎢 Zoom Recycler Layout Manager For Android Kotlin
Stars: ✭ 618 (+4020%)
Mutual labels:  recyclerview, recyclerview-adapter
Pbf
A low-level, lightweight protocol buffers implementation in JavaScript.
Stars: ✭ 618 (+4020%)
Mutual labels:  library, fast
Superadapter
[Deprecated]. 🚀 Adapter(BaseAdapter, RecyclerView.Adapter) wrapper for Android. 一个Adapter同时适用RecyclerView、ListView、GridView等。
Stars: ✭ 638 (+4153.33%)
Mutual labels:  adapter, recyclerview
Recyclerview Fastscroller
A fully customizable Fast Scroller for the RecyclerView in Android, written in Kotlin
Stars: ✭ 585 (+3800%)
Mutual labels:  view, recyclerview
Discretescrollview
A scrollable list of items that centers the current element and provides easy-to-use APIs for cool item animations.
Stars: ✭ 5,533 (+36786.67%)
Mutual labels:  view, recyclerview
Windowimageview
An ImageView display in RecyclerView, looks like window.
Stars: ✭ 699 (+4560%)
Mutual labels:  view, recyclerview
Multityperecyclerviewadapter
一个专注于RecyclerView优雅刷新(接管资源和数据源)、高灵活、低耦合、健壮性以及高效性的MVP模式库,支持大多数Adapter
Stars: ✭ 763 (+4986.67%)
Mutual labels:  adapter, recyclerview
Lastadapter
Don't write a RecyclerView adapter again. Not even a ViewHolder!
Stars: ✭ 777 (+5080%)
Mutual labels:  recyclerview, recyclerview-adapter

The easiest way to implement RecyclerView in just 1 Line.

Delicious Facts 🍭

  • Forget creation of tasteless Adapters & monotonous findViewById for your views in adapter.
  • Text data String, int, float ... is automatically set into TextView & Button
  • Image URL String and Image Drawable (int) R.drawable.id is automatically set into ImageView
  • Its all done without any extra line of code. How?
  • Manage properties of all view using single SugarListener or just set attributes for specific views.

Download via Gradle 💻

Add it in your Project build.gradle at the end of repositories:

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

Add the dependency in your App build.gradle:

dependencies {
  implementation 'com.github.ThisIsNSH:CandyView:1.3'
  // add these for internal functioning
  implementation 'com.squareup.picasso:picasso:{latest version}'
  implementation 'com.android.support:recyclerview-v7:{build version}'
}

Get Started 🏁

1. Add the code to create CandyView:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <com.thisisnsh.sugarlibrary.CandyView
        android:id="@+id/candy"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

</LinearLayout>
class ExampleActivity extends Activity {

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    ...

    // Initialize CandyView object
    CandyView candyView = findViewById(R.id.candy);

    // Create RecyclerView using make(Context content, int Layout, List<Model> Data, Model Class)
    candyView.make(this, R.layout.adapter, dataList, Model.class);

  }

}

2. Add SugarListener to explicitly set properties of views accessed using getViewById:

class ExampleActivity extends Activity implements CandyView.SugarListener {

  TextView textView;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    ...
    candyView.addSugarListener(this);
  }

  @Override
  public void onCandyMade() {

    // Initialize required adapter views 
    textView = (TextView) candyView.getViewById(R.id.text);

  }

  @Override
  public void onCandyRecycled(View view, int position) {

    // Set attributes of adapter views for all positions
    textView.setTextColor(getResources().getColor(R.color.colorPrimary));

    // Set attributes of adapter views at a particular position
    if (position == 1)
      textView.setTextColor(getResources().getColor(R.color.colorAccent));

  }

}

Automatically Set Data 🚀

3. Create Model Class with variables having same names as IDs of views in adapter view.

public class Model {

  // Declare data variables 
  String image;
  String name;

  public Model(String image, String name) {
    this.image = image;
    this.name = name;
  }

  // Getter & Setter for the variables
  public String getImage() {
    return image;
  }

  public void setImage(String image) {
    this.image = image;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

}

This example sets the value of name String in name TextView. image String URL is set to image ImageView. R.drawable.id format is also supported for ImageView. Make sure the variable name in Model and ID in layout.xml is same.

<?xml version="1.0" encoding="utf-8"?>
  <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:orientation="vertical">

  <android.support.v7.widget.CardView
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  app:cardBackgroundColor="#fff"
  app:cardCornerRadius="16dp"
  app:cardElevation="4dp"
  app:cardPreventCornerOverlap="true"
  app:cardUseCompatPadding="true">

    <RelativeLayout
    android:layout_width="match_parent"
    android:id="@+id/relative"
    android:layout_height="wrap_content"
    android:gravity="center_vertical">

      <ImageView
      android:id="@+id/image"
      android:layout_width="100dp"
      android:layout_height="100dp"
      android:layout_margin="8dp"
      android:scaleType="centerCrop" />

      <TextView
      android:id="@+id/name"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_margin="8dp"
      android:layout_toRightOf="@id/image"
      android:textColor="#000"
      android:textSize="18sp"/>

    </RelativeLayout>

  </android.support.v7.widget.CardView>

</LinearLayout>

Confused 🤷‍♂️? Download Sample App.

Found a bug 🐛?

  • Please create an issue with appropriate tags
  • We welcome developers to fix the bug and open a PR
  • Keep PR name as Fixes #Issue_Number

Thank you ❤️

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].