Skip to content

Instantly share code, notes, and snippets.

Living in the moment

ZhangLei tuesda

Living in the moment
View GitHub Profile
private static int getMaxSizeInternal() {
EGL10 egl = (EGL10) EGLContext.getEGL();
EGLDisplay dpy = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
int[] versions = new int[2];
egl.eglInitialize(dpy, versions);
EGLConfig[] configs = new EGLConfig[1];
int[] numConfig = new int[1];
egl.eglGetConfigs(dpy, configs, 1, numConfig);
View GetScreenshot of recyclerView
public static Bitmap getScreenshotFromRecyclerView(RecyclerView view) {
RecyclerView.Adapter adapter = view.getAdapter();
Bitmap bigBitmap = null;
if (adapter != null) {
int size = adapter.getItemCount();
int height = 0;
Paint paint = new Paint();
int iHeight = 0;
final int maxMemory = (int) Runtime.getRuntime().maxMemory();