Skip to content

Instantly share code, notes, and snippets.

View DonLiangGit's full-sized avatar

Don DonLiangGit

  • San Francisco
View GitHub Profile
@DonLiangGit
DonLiangGit / CountDownTimer.java
Created October 12, 2016 22:38 — forked from Gautier/CountDownTimer.java
Drop-in alternative for the Android CountDownTimer class, but which you can cancel from within onTick.
/*
* Copyright (C) 2008 The Android Open Source Project
*
* 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
@DonLiangGit
DonLiangGit / RetrofitCachingExample.java
Last active October 3, 2016 03:09 — forked from swankjesse/RetrofitCachingExample.java
Demonstrate HTTP caching with OkHttp and Retrofit.
/*
* Copyright (C) 2013 Square, Inc.
*
* 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
@DonLiangGit
DonLiangGit / SnappyRecyclerView.java
Created September 24, 2016 02:28 — forked from nesquena/SnappyRecyclerView.java
Snap-to-Center RecyclerView Extension
// From: http://stackoverflow.com/a/37816976
public class SnappyRecyclerView extends RecyclerView {
// Use it with a horizontal LinearLayoutManager
// Based on http://stackoverflow.com/a/29171652/4034572
public SnappyRecyclerView(Context context) {
super(context);
}
@DonLiangGit
DonLiangGit / GifDecoder.java
Created January 23, 2016 01:58 — forked from devunwired/GifDecoder.java
An optimized implementation of GifDecoder for Android devices.
/**
* Copyright (c) 2013 Xcellent Creations, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
@DonLiangGit
DonLiangGit / introrx.md
Created October 20, 2015 22:12 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@DonLiangGit
DonLiangGit / Entry.java
Last active September 17, 2015 21:09 — forked from mpost/Entry.java
Android application demonstrating the usage of ViewOverlay and OnPreDrawListener to achieve animations effects.
package com.example.overlay;
public class Entry {
private final int imageResId;
private final String title;
public Entry( int imageResId, String title ) {
this.imageResId = imageResId;
@DonLiangGit
DonLiangGit / Readme.md
Last active August 29, 2015 14:27 — forked from gabrielemariotti/Readme.md
A SimpleSectionedRecyclerViewAdapter: use this class to realize a simple sectioned `RecyclerView.Adapter`.

You can use this class to realize a simple sectioned RecyclerView.Adapter without changing your code.

The RecyclerView should use a LinearLayoutManager. You can use this code also with the TwoWayView with the ListLayoutManager (https://github.com/lucasr/twoway-view)

This is a porting of the class SimpleSectionedListAdapter provided by Google

Screen

Example: