Skip to content

Instantly share code, notes, and snippets.

View Emeritus-DarranKelinske's full-sized avatar

Darran Kelinske Emeritus-DarranKelinske

View GitHub Profile
@Shywim
Shywim / CursorRecyclerAdapter.java
Last active February 27, 2024 13:42
A custom Adapter for the new RecyclerView, behaving like the CursorAdapter class from previous ListView and alike. Now with Filters and updated doc.
/*
* The MIT License (MIT)
*
* Copyright (c) 2014 Matthieu Harlé
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
public class CustomAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>{
//our items
List<Generic> items = new Arraylist<>();
//headers
List<View> headers = new ArrayList<>();
//footers
List<View> footers = new ArrayList<>();
public static final int TYPE_HEADER = 111;
public static final int TYPE_FOOTER = 222;
/*
* Copyright (c) 2016 Alashov Berkeli
* It is licensed under GNU GPL v. 2 or later. For full terms see the file LICENSE.
*/
package tm.asmanoky.aziada.util.glide;
import android.app.Activity;
import android.content.Context;
import android.graphics.drawable.Drawable;