Skip to content

Instantly share code, notes, and snippets.

import android.content.Context;
import android.util.AttributeSet;
public class RotatableImageView extends {
private float angle = 0f;
public RotatableImageView(Context context) {
sujithkanna /
Created May 14, 2018 — forked from davestevens/
Let’s Encrypt setup for Apache, NGINX & Node.js

Let's Encrypt

Examples of getting certificates from Let's Encrypt working on Apache, NGINX and Node.js servers.

Obtain certificates

I chose to use the manual method, you have to make a file available to verify you own the domain. Follow the commands from running

git clone
cd letsencrypt
mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
int count = mRecyclerView.getChildCount();
View Slide
// To evaluate value between x and y base on fraction(0 - 1)
private IntEvaluator mIntEvaluator = new IntEvaluator();
// Interpolator just for curvy animations.
private Interpolator mInterpolator = new AccelerateDecelerateInterpolator();
public void invalidateSlider(MenuViewHolder holder) {
SliderImageView imageCard = holder.imageCard;
// top defines the pixel position of the item in the screen
float top = holder.itemView.getTop() + holder.itemView.getMeasuredHeight();
float height = App.getInstance().getResources().getDisplayMetrics().heightPixels
public static class MenuViewHolder extends RecyclerView.ViewHolder {
public TextView content;
public CardView contentView;
public SliderImageView imageCard;
public MenuViewHolder(View itemView) {
content = (TextView) itemView.findViewById(;
contentView = (CardView) itemView.findViewById(;
imageCard = (SliderImageView) itemView.findViewById(;
public class SliderImageView extends View {
private static final String TAG = "SliderImageView";
private Bitmap mBitmapImage;
private float mAnimateFactor = 0f;
private Rect mSrcBounds = new Rect();
private Rect mDrawBounds = new Rect();
private Paint mBitmapPaint = new Paint();
protected void onDraw(Canvas canvas) {
canvas.drawBitmap(mBitmapImage, mSrcBounds, mDrawBounds, mBitmapPaint);
public class SliderImageView extends View {
public SliderImageView(Context context) {
public SliderImageView(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
public SliderImageView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
IntEvaluator evaluator = new IntEvaluator();
float fraction = 0; // 0 to 1
int leftCurvePointX = evaluator.evaluate(fraction, greatLeftStartX, goodLeftPointX);