You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
add missing APIs related to scrolling
This commit is contained in:
@@ -1291,6 +1291,7 @@ public class View extends Object {
|
||||
}
|
||||
|
||||
public void addOnLayoutChangeListener(OnLayoutChangeListener listener) {}
|
||||
public void removeOnLayoutChangeListener(OnLayoutChangeListener listener) {}
|
||||
|
||||
public boolean isSelected() {return false;}
|
||||
|
||||
@@ -1560,4 +1561,12 @@ public class View extends Object {
|
||||
protected int computeHorizontalScrollExtent() {
|
||||
return getWidth();
|
||||
}
|
||||
|
||||
protected int computeVerticalScrollRange() {
|
||||
return getHeight();
|
||||
}
|
||||
|
||||
protected int computeVerticalScrollExtent() {
|
||||
return getHeight();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -315,6 +315,16 @@ public class ViewGroup extends View implements ViewParent, ViewManager {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onNestedPreFling(View target, float velocityX, float velocityY) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onNestedFling(View target, float velocityX, float velocityY, boolean consumed) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static class LayoutParams {
|
||||
public static final int FILL_PARENT = -1;
|
||||
public static final int MATCH_PARENT = -1;
|
||||
|
||||
@@ -8,4 +8,8 @@ public interface ViewParent {
|
||||
public void requestDisallowInterceptTouchEvent(boolean disallowIntercept);
|
||||
|
||||
public abstract boolean onStartNestedScroll(View child, View target, int nestedScrollAxes);
|
||||
|
||||
public boolean onNestedPreFling(View target, float velocityX, float velocityY);
|
||||
|
||||
public boolean onNestedFling(View target, float velocityX, float velocityY, boolean consumed);
|
||||
}
|
||||
|
||||
@@ -2,12 +2,21 @@ package android.view.animation;
|
||||
|
||||
public class DecelerateInterpolator implements Interpolator{
|
||||
|
||||
public DecelerateInterpolator(float value) {}
|
||||
private float factor = 1.0f;
|
||||
|
||||
public DecelerateInterpolator(float value) {
|
||||
factor = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getInterpolation(float input) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'getInterpolation'");
|
||||
float result;
|
||||
if (factor == 1.0f) {
|
||||
result = 1.0f - (1.0f - input) * (1.0f - input);
|
||||
} else {
|
||||
result = 1.0f - (float)Math.pow((1.0f - input), 2 * factor);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user