This file contains 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 class ScrollViewWithMaxHeight extends ScrollView { | |
public static int WITHOUT_MAX_HEIGHT_VALUE = -1; | |
private int maxHeight = WITHOUT_MAX_HEIGHT_VALUE; | |
public ScrollViewWithMaxHeight(Context context) { | |
super(context); | |
} |
This file contains 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 BaseApiCallback<Result> extends Callback<Result> { | |
private final static String CLASS_NAME = "BaseApiCallback"; | |
@Override | |
public final void onResponse(Response<Result> response) { | |
if (response.getStatusCode() == 0) { | |
LogManager.error(CLASS_NAME, "onResponse", response.getError().getMessage()); | |
notifyError(ErrorType.ERROR_CONECTION); | |
return; | |
} |
This file contains 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.util.Log; | |
public final class LogManager { | |
public static final int VERBOSE = 0; | |
public static final int DEBUG = 1; | |
public static final int INFO = 2; | |
public static final int WARN = 3; | |
public static final int ERROR = 4; | |
public static final int WTF = 5; |
This file contains 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.support.v4.view.ViewPager; | |
import android.view.View; | |
public class FlipPageViewTransformer implements ViewPager.PageTransformer { | |
@Override | |
public void transformPage(View page, float position) { | |
float percentage = 1 - Math.abs(position); | |
page.setCameraDistance(12000); | |
setVisibility(page, position); | |
setTranslation(page); |
This file contains 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
mCVRoot.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { | |
@Override | |
public void onGlobalLayout() { | |
int heightDiff = mCVRoot.getRootView().getHeight() - mCVRoot.getHeight(); | |
if (heightDiff > mDiffLimit) { | |
mOpenKeyboard = true; | |
// TODO | |
} else { |