Skip to content

Instantly share code, notes, and snippets.

View fdoyle's full-sized avatar

Frank Doyle fdoyle

  • San Antonio, TX
View GitHub Profile
@fdoyle
fdoyle / DelayedBaseAdapter
Last active June 14, 2018 08:42
BaseAdapter that allows for delayed content
package com.lacronicus.delayedloadingadapterdriver.app;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AbsListView;
import android.widget.BaseAdapter;
import android.widget.ListView;
import java.util.HashSet;
@fdoyle
fdoyle / gist:024ff17b6550b4acf9ad
Created September 5, 2014 14:32
a thing that doesn't render the top N pixels of a listview.
package com.derp.android
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.util.AttributeSet;
import android.widget.ListView;
@fdoyle
fdoyle / gist:6f9f8d217565d7fea4fd
Last active August 29, 2015 14:09
PullToRefreshLayout - Because guidelines are for scrubs.
package com.derp.android.view;
import android.animation.Animator;
import android.content.Context;
import android.support.v4.widget.SwipeRefreshLayout;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.widget.FrameLayout;
@fdoyle
fdoyle / Optional.java
Created March 21, 2015 03:02
Optional Type Adapter for Gson (using the Optional gist located elsewhere)
package com.derp.gsonoptional;
/**
* Created by fdoyle on 3/20/15.
*/
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
@fdoyle
fdoyle / gist:878969b3e485c675c034
Created March 23, 2015 15:48
Reveal animation, bound in framelayout, but works pre 5.0
package com.derp.revealanimationdemo;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PorterDuff;
@fdoyle
fdoyle / Main.java
Created October 21, 2015 14:31
first stab at a graph deep copy
public class Main {
public static void main(String[] args) {
System.out.println("Hello World");
Node a = new Node("A","A");
Node b = new Node("B","B");
Node c = new Node("C","C");
Node d = new Node("D","D");
@fdoyle
fdoyle / FixedTransformerViewPager.java
Last active August 22, 2022 11:02
PageTransform + padding on viewpager doesn't work. this fixes it
package com.foo.ui.view;
import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.View;
/**
* Created by fdoyle on 11/2/15.
*/
@fdoyle
fdoyle / kotlinlistmethods.kt
Created November 13, 2015 20:50
made these as an exercise, then found out they were in sequence. oh well.
package com.lacronicus.kotlinlistmethods
import java.util.ArrayList
/**
* Created by fdoyle on 11/13/15.
*/
fun <T, R> List<T>.map(mapFunc: (T) -> R) : List<R> {
@fdoyle
fdoyle / Combiner.java
Last active December 21, 2015 21:27
Use case: You have an object with setListener, and you have to listeners. Do Combiner.combine(listener1, listener2), with any given type, and it'll do what you want
package com.lacronicus.combodriver;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
/**
* Created by fdoyle on 12/17/15.
*/
public class ListenerCombiner {
@fdoyle
fdoyle / InterpolatorSmoothScroller.java
Last active March 9, 2016 23:37
Some Recyclerview Stuff
package com.lacronicus;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.View;
import android.view.animation.Interpolator;
import java.util.Random;
/**