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
@KonajuGames
KonajuGames / gist:1954646
Created March 2, 2012 01:33
Android OpenGL background context
using System;
using OpenTK;
using OpenTK.Graphics;
using OpenTK.Graphics.ES20;
using OpenTK.Platform;
using OpenTK.Platform.Android;
using Android.Views;
using Android.Content;
@printminion
printminion / photo_monkey.py
Created February 10, 2012 20:18
Android Monkeyrunner - photo_monkey.py
# This is a monkeyrunner jython script that opens a connection to an Android
# device and starts camera app and makes photos by touching the camerabutton.
#
# See http://developer.android.com/guide/developing/tools/monkeyrunner_concepts.html
#
# usage: monkeyrunner photo_monkey.py
#
# Imports the monkeyrunner modules used by this program
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
@bepcyc
bepcyc / HeapInfo.java
Created January 30, 2012 12:59
Logging Heap info in Android
/**
* Logging Heap Info for Android
* @source <a href="http://stackoverflow.com/a/8018476/918211">StackOverflow Thread</a>
*/
public static void logHeap(Class clazz) {
final String APP = "MyApp";
Double allocated = new Double(Debug.getNativeHeapAllocatedSize())/1048576d;
Double available = new Double(Debug.getNativeHeapSize())/1048576.0d;
Double free = new Double(Debug.getNativeHeapFreeSize())/1048576.0d;
DecimalFormat df = new DecimalFormat();
@tleach
tleach / ReflectingLayout.java
Created January 19, 2012 16:04
An Android Layout which can be used to apply a "reflection" effect to all child Views it contains.
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.LinearGradient;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.PorterDuff.Mode;
import android.graphics.PorterDuffXfermode;
import android.graphics.Shader.TileMode;
import android.util.AttributeSet;
@Pretz
Pretz / RoundedImageView.java
Created January 10, 2012 02:47
Andround Rounded Image View
package com.yelp.android.ui.widgets;
import com.yelp.android.R;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
@donnfelker
donnfelker / count_bubble.xml
Created December 2, 2011 20:44
Count Bubble Layout
<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="90"
android:startColor="#b30e13"
android:endColor="#f5343b"
/>
@9re
9re / .gitignore
Created November 30, 2011 01:09
InputFilter & DynamicLayout
gen/
bin/
.classpath
.project
@ivasilov
ivasilov / nativeHeap.java
Created November 8, 2011 12:43
Code for logging native heap usage on Android
public static void logHeap(Class clazz) {
Double allocated = new Double(Debug.getNativeHeapAllocatedSize())/new Double((1048576));
Double available = new Double(Debug.getNativeHeapSize())/1048576.0;
Double free = new Double(Debug.getNativeHeapFreeSize())/1048576.0;
DecimalFormat df = new DecimalFormat();
df.setMaximumFractionDigits(2);
df.setMinimumFractionDigits(2);
String APP = "Bitmap";
Log.d(APP, "debug. =================================");
@matthawley
matthawley / RoboGuice-2b2-Proguard
Created October 31, 2011 16:33
Latest RoboGuice Proguard File
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-ignorewarnings
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable,*Annotation*,Signature
@mosabua
mosabua / gist:1316903
Created October 26, 2011 16:28
ExpandableListFragment
package android.support.v4.app;
import android.os.Bundle;
import android.os.Handler;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnCreateContextMenuListener;