Skip to content

Instantly share code, notes, and snippets.

View arriolac's full-sized avatar
🌍

Chris Arriola arriolac

🌍
View GitHub Profile
@arriolac
arriolac / AutoNextTextWatcher.java
Last active August 29, 2015 13:57
TextWatcher that will proceed to the next focusable view once the specified length has been reached
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.widget.EditText;
/**
* Created by chris on 3/13/14.
*/
public class AutoNextTextWatcher implements TextWatcher {
@arriolac
arriolac / AlphaImageButton.java
Created March 26, 2014 18:36
AlphaImageButton - auto shows disabled state on an ImageButton.
import android.content.Context;
import android.util.AttributeSet;
import android.widget.ImageButton;
public class AlphaImageButton extends ImageButton {
private static final float ENABLED_ALPHA = 1.0f;
private static final float DISABLED_ALPHA = 0.5f;
public AlphaImageButton(Context context) {
@arriolac
arriolac / BundleUtil.java
Last active August 29, 2015 14:04
Utility class for writing Parcelables into a Bundle (ExampleActivity.java uses the Parceler library: https://github.com/johncarl81/parceler).
import android.os.Bundle;
import android.os.Parcelable;
/**
* Utility class for {@link android.os.Bundle}.
* Created by chris on 8/6/14.
*/
public class BundleUtil {
private static final String EXTRA_PARCELABLE_COUNT = "parcelable_count";
@arriolac
arriolac / DrawingViewArchitecture.md
Created September 7, 2015 16:57
DrawingView Architecture

This is the proposed architecture for implementing drawing on text, photos and videos on Leo.

DrawingView

  • This is the custom view that will display the drawing created by the user.
  • Will be the View on "top" (relative to z-axis) of all the other views in AddTextActivity except the top bar Views.
  • Notes:
    • overrides onTouchEvent(...)
    • has a method called setEnabled(boolean enabled)
      • enabled value will be returned by onTouchEvent(...). this means that it will intercept all touch events when enabled.
  • Note: this will be toggled by the compose views (enabled when in drawing mode, disabled when not in drawing mode).
@arriolac
arriolac / .bashrc
Last active December 30, 2015 07:18
Useful Bash Aliases and Functions
### aliases for vim ###
# Given two files, performs a diff
alias mvimdiff='mvim -d'
# Given two files, does a vertical split
alias mvimvsplit='mvim -O'
### git ###
@arriolac
arriolac / FlatIterator.java
Last active January 6, 2016 20:01
An Iterator that flattens iterating over a list of Iterators.
import java.util.Iterator;
import java.util.List;
import java.util.NoSuchElementException;
/**
* An Iterator that flattens iterating over a list of Iterators.
*
* Created by chris on 1/5/16.
*/
@arriolac
arriolac / ActionBarDrawerToggle.java
Created February 23, 2016 20:44
ActionBarDrawerToggle with no animation
new ActionBarDrawerToggle(this, drawerLayout, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close) {
@Override public void onDrawerSlide(View drawerView, float slideOffset) {
super.onDrawerSlide(drawerView, 0);
}
};
@arriolac
arriolac / ReminderIntentService.java
Last active July 27, 2016 16:48
IntentService for displaying a reminder
package chrisarriola.me.remind;
import android.app.IntentService;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import chrisarriola.me.DataPath;
import chrisarriola.me.remind.util.LogUtil;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.api.GoogleApiClient;
public class AutomaticDripCoffeeMaker extends BaseCoffeeMaker {
public AutomaticDropCoffeeMaker() {
super();
}
public void scheduleBrew() {
// schedules a call to #brew()
}

Keybase proof

I hereby claim:

  • I am arriolac on github.
  • I am chrisarriola (https://keybase.io/chrisarriola) on keybase.
  • I have a public key ASBSQlNOoGj57_pr5_Rn2ei1zRfC6Xm4GHkigxYOwjIXCQo

To claim this, I am signing this object: