Skip to content

Instantly share code, notes, and snippets.

@idotnetdev
idotnetdev / BaseRecyclerAdapter.java
Created March 31, 2022 07:08 — forked from vahid-m/BaseRecyclerAdapter.java
Abstract RecyclerView.Adapter
//T is a type of items
//when inheriting, just create constructor matching super,
//and override viewHolder() method that will return ViewHolder for given item type
public abstract class BaseRecyclerAdapter<T> extends RecyclerView.Adapter<BaseRecyclerAdapter.BaseViewHolder> {
public interface OnItemClickListener<T> {
void onClick(T item);
}
public class ProductComments
{
public int Id { get; set; }
public virtual ApplicationUser CreatedBy { get; set; }
public int CreatedById { get; set; }
public DateTime CreatedOn { get; set; }
public string Comment { get; set; }
public string Ip { get; set; }
public string UserAgent { get; set; }
public int Likes { get; set; }
public class GoogleMapsAPIProjection
{
private readonly double PixelTileSize = 256d;
private readonly double DegreesToRadiansRatio = 180d / Math.PI;
private readonly double RadiansToDegreesRatio = Math.PI / 180d;
private readonly PointF PixelGlobeCenter;
private readonly double XPixelsToDegreesRatio;
private readonly double YPixelsToRadiansRatio;
public GoogleMapsAPIProjection(double zoomLevel)