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
@arnaudbos
arnaudbos / ScrollViewListener.java
Created August 1, 2011 23:24
(Android)Create a ScrollView synchronizer
public interface ScrollViewListener
{
void onScrollChanged(SynchronizerScrollView scrollView, int x, int y, int oldx, int oldy);
}
@franciscojunior
franciscojunior / TitleFlowIndicator.java
Created August 3, 2011 15:43
Sample of viewflow with fragments. Note that you have to use the custom file TitleFlowIndicator below because it contains the support for the FragmentPagerAdapter
/*
* Copyright (C) 2011 Patrik Åkerfeldt
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@megamind-android
megamind-android / OrientationDemo.java
Created August 19, 2011 14:44
Android-Designing for Orientation changes
package com.webile.OrientationDemo;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import android.app.Activity;
@jgilfelt
jgilfelt / gist:1231694
Created September 21, 2011 09:50
Android - AsyncTask with inline callback boilerplate
private void asyncTaskWithInlineCallback() {
// display UI progress indicator
// ...
new MyAsyncTask() {
protected void onPostExecute(Boolean result) {
// dismiss UI progress indicator
// process the result
// ...
}
@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;
@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
@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. =================================");
@9re
9re / .gitignore
Created November 30, 2011 01:09
InputFilter & DynamicLayout
gen/
bin/
.classpath
.project
@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"
/>
@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;