Skip to content

Instantly share code, notes, and snippets.

View Tagakov's full-sized avatar
🦊

Vladimir Tagakov Tagakov

🦊
View GitHub Profile
public class PagerLayoutManager extends LinearLayoutManager {
private static final int SETTLE_DURATION = 600;
private static final float DEFAULT_FLING_THRESHOLD_DP = 10f;
private final int flingThreshold;
private int scrollState;
public PagerLayoutManager(Context context) {
@Tagakov
Tagakov / DevButton.java
Last active July 30, 2016 09:49
Hidden button for debugging purposes. Should be used with: debugCompile 'com.squareup:seismic:1.0.2'
import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.hardware.SensorManager;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Vibrator;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
@Tagakov
Tagakov / SectorClipProgress.java
Last active August 29, 2015 14:22
Example of clipPath like behavior with use of BItmapShader.
package com.tagakov.testapplication;
import android.animation.ValueAnimator;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
@Tagakov
Tagakov / SectorClipProgress.java
Last active August 29, 2015 14:22
Example of clipPath like behavior with use of hardware accelerated Xfermode.
package com.tagakov.testapplication;
import android.animation.ValueAnimator;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.PorterDuff;
@Tagakov
Tagakov / My SO question RxJava
Last active August 29, 2015 14:21
Stack overflow question about rxjava and retrofit. How to transform observable's error to another observable?
How do I transform observable's error to another observable?
I am trying to implement algorithm showed on scheme below:
![Block scheme][1]
[1]: http://i.stack.imgur.com/777p5.png
I am using a tutorial named Grokking RxJava to start my learning and found that flatMap operator can convert one Observable returning by Retrofit into another which allows me to do a chain of invocations of server methods. But in the tutorial chaining methods always return success result. **How I can do the same chaining if one of the remote methods returns error?**