Skip to content

Instantly share code, notes, and snippets.

package com.company.components;
import android.animation.Animator;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.PixelFormat;
import android.graphics.Rect;
class RotationMatrix {
/**
* Draws the data from SurfaceTexture onto the current EGL surface.
*/
public void draw(boolean flipY, boolean flipX) {
float[] normaliseMatrix = new float[16];
// unfortunately this gives unconsistent results, so we'll perform all fixes manually
//mSurfaceTexture.getTransformMatrix(normaliseMatrix);
System.arraycopy(IDENTITY, 0, normaliseMatrix, 0, IDENTITY.length);
@dmide
dmide / CustomTextView.java
Created February 9, 2021 11:24
Simple CustomTextView
class CustomTextView extends View {
private static final String SUPERSTATE = "superState", TEXT = "text",
TEXTSIZE = "textsize";
private String mText = "";
private Paint mTextPaint;
private int mTextSize, mTextX, mTextY, mCenter;
public CustomTextView(Context context) {
this(context, null);
}