Skip to content

Instantly share code, notes, and snippets.

View fredgrott's full-sized avatar
👾
focusing on flutter cross platform mobile dev

Fred Grott fredgrott

👾
focusing on flutter cross platform mobile dev
View GitHub Profile
@JakeWharton
JakeWharton / IconCheckBoxPreference.java
Created August 9, 2010 16:37
IconCheckBoxPreference: An Android CheckBox preference with an optional Icon
package com.jakewharton.utilities;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.preference.CheckBoxPreference;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageView;
import com.jakewharton.wakkawallpaper.R;
@tomgibara
tomgibara / SquareGridLayout.java
Created November 27, 2010 01:22
Square grid layout for Android
package com.tomgibara.android.util;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
/**
* A layout that arranges views into a grid of same-sized squares.
@thevery
thevery / RoboBaseAdapter.java
Created January 30, 2011 00:19
RoboBaseAdapter for RoboGuice
package roboguice.astroboy;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import com.google.inject.internal.Nullable;
import roboguice.inject.InjectView;
@paulononaka
paulononaka / AndroidGetPropSystem.java
Created March 18, 2011 14:51
Getting a system property in Android
public static String getPropSystem(String key) throws IOException {
BufferedReader bis = null;
try {
Process ifc = Runtime.getRuntime().exec("getprop " + key);
bis = new BufferedReader(new InputStreamReader(ifc.getInputStream()));
return bis.readLine();
} finally {
bis.close();
}
}
@olim7t
olim7t / LogbackCapture.java
Created March 22, 2011 14:46
Temporarily captures Logback output (mostly useful for tests).
import static ch.qos.logback.classic.Level.ALL;
import static org.slf4j.Logger.ROOT_LOGGER_NAME;
import java.io.ByteArrayOutputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.Logger;
@romannurik
romannurik / DashboardLayout.java
Created March 23, 2011 05:06
A custom Android layout class that arranges children in a grid-like manner, optimizing for even horizontal and vertical whitespace.
/*
* ATTENTION:
*
* This layout is now maintained in the `iosched' code.google.com project:
*
* http://code.google.com/p/iosched/source/browse/android/src/com/google/android/apps/iosched/ui/widget/DashboardLayout.java
*
*/
/*
@hattorix
hattorix / PageIndicator.java
Created May 26, 2011 03:48
iPhone like PageIndicator for Android
package com.gist.hattorix;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.view.View;
public class PageIndicator extends View {
@Overbryd
Overbryd / hacking-club-mate-imatate.md
Created June 22, 2011 13:46
Hacking Club Mate "imatate"

Hacking Club Mate "imatate"

Read about the end result here

Join me when I start brewing my first batch of Club Mate. Inspired by a podcast from chaos radio express on the topic "Hackerbrausen" (Hacker's soda, listen here) I want to try this by myself.

So far I have bought all the necessary ingrediends and tools to get started. And with the help from Jan (@janl) I can even carbonate the end result :)

When? Where?

@arnaudbos
arnaudbos / DocumentView.java
Created July 11, 2011 23:17
(Android)Extended item view
package uk.ac.brookes.arnaudbos.luscinia.widget;
import uk.ac.brookes.arnaudbos.luscinia.R;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.view.LayoutInflater;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
@tomgibara
tomgibara / ViewRenderer.java
Created July 15, 2011 07:08
A base class providing asynchronous rendering for Android Adapter implementations
package com.tomgibara.android.util;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.WeakHashMap;
import java.util.concurrent.Callable;
import java.util.concurrent.Future;
import java.util.concurrent.FutureTask;
import java.util.concurrent.PriorityBlockingQueue;