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 / 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 / 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: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 / 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 / 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;
#!/bin/bash
VIDEO_LENGTH="10"
VIDEO_NAME="gifme.mp4"
GIF_NAME="gifme.gif"
GIF_OPTIMIZED_NAME="gifme-optimized.gif"
VIDEO_PATH="/sdcard/"$VIDEO_NAME
LOCAL_VIDEO_PATH="./"$VIDEO_NAME
package crub.the.flub
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ListView;
/**
* Created by fdoyle on 3/19/14.
@fdoyle
fdoyle / gist:9397785
Created March 6, 2014 19:42
"asyncObservable" example
package com.example.retrofitdemo3;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;
import android.widget.Toast;
import com.example.retrofitdemo3.api.NobelApi;
import com.example.retrofitdemo3.api.NobelService;
@fdoyle
fdoyle / supernova.java
Last active January 1, 2019 19:50
SupernovaView, as demonstrated by the LG G2 lock screen where you click and drag to "punch a hole" through the lock screen to the home screen. This view extends ImageView to the same effect.Probably not as optimized as it could be, but it seems about as smooth as LGs implementation.
package com.lacronicus.supernova;
import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
@fdoyle
fdoyle / gist:7238594
Created October 30, 2013 19:24
Swipe to dismiss view. gotta put this in a library
package com.blah.lol.swipetodismiss;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import android.view.View;
import android.widget.FrameLayout;
import com.blah.lol.R;