Skip to content

Instantly share code, notes, and snippets.

@dnanib
dnanib / AndroidLogger.java
Last active December 4, 2020 03:47
Lombok @CustomLog for Android's Log.* logging system
package com.example.log;
import android.util.Log;
import com.example.BuildConfig;
import com.google.common.io.ByteStreams;
import java.io.PrintStream;
public class AndroidLogger extends PrintStream {
private final String mLogtag;
@dnanib
dnanib / ViewScreenshot.java
Created August 19, 2020 06:45
A small Java class to take a screenshot of a View in Android
package com.example.lib.screenshots;
import android.annotation.TargetApi;
import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.Rect;
import android.os.Handler;
import android.view.PixelCopy;
import android.view.View;