Skip to content

Instantly share code, notes, and snippets.

View mcxiaoke's full-sized avatar

Hello World mcxiaoke

  • Earth
View GitHub Profile
public class CheckableFrameLayout extends FrameLayout implements Checkable {
private static final int[] CHECKED_STATE_SET = {
android.R.attr.state_activated,
android.R.attr.state_checked,
};
private boolean mChecked;
public CheckableFrameLayout(Context context) {
super(context);
package some.awesome.package;
import it.sephiroth.android.library.imagezoom.ImageViewTouch;
import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
public class ImageViewTouchViewPager extends ViewPager {
/*
* Copyright (c) 2013 Alex Curran
*
* 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
// Copyright 2012 Square, Inc.
package com.squareup.widgets;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.widget.ImageView;
/** Maintains an aspect ratio based on either width or height. Disabled by default. */
public class AspectRatioImageView extends ImageView {
import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.GestureDetector;
import android.view.GestureDetector.SimpleOnGestureListener;
import android.view.MotionEvent;
/**
* Custom {@link ViewPager} implementation that will handle horizontal scroll events by himself. Default ViewPager
* becomes hardly usable when it's nested into ScrollView based containers (such as ScrollView, ListView, etc.). It is
STORE_FILE=/path/to/your.keystore
STORE_PASSWORD=yourkeystorepass
KEY_ALIAS=projectkeyalias
KEY_PASSWORD=keyaliaspassword
@mcxiaoke
mcxiaoke / lolcat.rb
Created September 6, 2013 06:06 — forked from xaethos/lolcat.rb
#!/usr/bin/env ruby
require 'colorize'
require 'optparse'
class LOLCat
def initialize options = {}
@tagspecs = options[:tagspecs] || []
@whitelist = options[:processes] || []
@processes = Hash.new
end
# built application files
*.apk
*.ap_
# files for the dex VM
*.dex
# Java class files
*.class
package net.vvakame.sapmle;
import java.util.List;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.util.Log;
import android.view.ActionProvider;
import android.view.Menu;