This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import rx.Observable; | |
import rx.functions.Func0; | |
/** | |
* Wraps a source observable for creating a new observable | |
* on every subscribe. | |
* <p/> | |
* For use with {@link Observable#defer(rx.functions.Func0)} | |
*/ | |
public class DeferredObservable<T> implements Func0<Observable<T>> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content"> | |
<ImageView | |
android:id="@+id/image" | |
android:layout_width="match_parent" | |
android:scaleType="centerCrop" | |
android:layout_height="200dp" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.annotation.TargetApi; | |
import android.content.Context; | |
import android.graphics.Bitmap; | |
import android.graphics.BitmapFactory; | |
import android.os.Build; | |
import android.renderscript.Allocation; | |
import android.renderscript.Element; | |
import android.renderscript.RenderScript; | |
import android.renderscript.ScriptIntrinsicBlur; | |
import android.util.AttributeSet; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.widget.BaseAdapter; | |
import java.util.List; | |
public abstract class BaseListAdapter<DataType> extends BaseAdapter { | |
private List<DataType> mItems; | |
@Override | |
public final int getCount() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import android.util.AttributeSet; | |
import android.view.LayoutInflater; | |
import android.view.ViewGroup; | |
import android.widget.ImageView; | |
import android.widget.RelativeLayout; | |
import android.widget.TextView; | |
import butterknife.ButterKnife; | |
import butterknife.InjectView; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export BASH_SILENCE_DEPRECATION_WARNING=1 | |
export HGEDITOR=nano | |
export PS1='\w: ' | |
# important | |
alias shrug="printf '¯\_(ツ)_/¯' | pbcopy" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Applies a touch listener to <code>v</code> which causes the view to 'expand and contract' | |
* based on it's touch state | |
* | |
* @param v | |
* The view to apply the touch listener too | |
* @param bounceTension | |
* The tension (bounce back) to apply when the user lifts their finger from the view | |
*/ | |
public static void applyBounceTouchListener(final View v, final int bounceTension) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class MultiThreadedService extends Service { | |
private volatile List<Looper> mServiceLoopers; | |
private volatile List<ServiceHandler> mServiceHandlers; | |
private String mName; | |
private boolean mRedelivery; | |
public IBinder onBind(Intent intent) { | |
return null; | |
} |
NewerOlder