Skip to content

Instantly share code, notes, and snippets.

@gelitenight
gelitenight / 0_reuse_code.js
Created May 20, 2017 03:29
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@gelitenight
gelitenight / ScaleImageView.java
Created December 17, 2013 03:53
This view will auto determine the width or height by determining if the height or width is set(exact size or match_parent) and scale the other dimension depending on the images dimension This view also contains an ImageChangeListener which calls changed(boolean isEmpty) once a change has been made to the ImageView @author Maurycy Wojtowicz
package com.feizan.android.snowball.ui.imageview;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.widget.ImageView;
import android.widget.RelativeLayout;
/**
@gelitenight
gelitenight / android.gitignore
Created December 17, 2013 03:23
.gitignore for android project
# Eclipse
.project
.classpath
.settings
.checkstyle
# IntelliJ IDEA
.idea
*.iml
*.ipr
@gelitenight
gelitenight / Example.java
Last active November 8, 2023 08:42
A way to easily traverse any view hierarchy in Android
/* basic usage */
ViewGroup root = (ViewGroup) findViewById(android.R.id.content);
LayoutTraverser.build(new LayoutTraverser.Processor() {
@Override
public void process(View view) {
// do stuff with the view
}
}).traverse(root);