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
some fixes to make NewPipe not crash when layouting
This commit is contained in:
14
src/api-impl/android/view/GestureDetector.java
Normal file
14
src/api-impl/android/view/GestureDetector.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package android.view;
|
||||
|
||||
public class GestureDetector {
|
||||
|
||||
public interface OnGestureListener {
|
||||
}
|
||||
|
||||
public interface OnDoubleTapListener {
|
||||
}
|
||||
|
||||
public static class SimpleOnGestureListener implements OnGestureListener {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1201,4 +1201,31 @@ public class View extends Object {
|
||||
|
||||
protected boolean awakenScrollBars() {return false;}
|
||||
public Matrix getMatrix() {return new Matrix();}
|
||||
|
||||
protected static final int[] EMPTY_STATE_SET = new int[0];
|
||||
|
||||
/**
|
||||
* Utility to return a default size. Uses the supplied size if the
|
||||
* MeasureSpec imposed no constraints. Will get larger if allowed
|
||||
* by the MeasureSpec.
|
||||
*
|
||||
* @param size Default size for this view
|
||||
* @param measureSpec Constraints imposed by the parent
|
||||
* @return The size this view should be.
|
||||
*/
|
||||
public static int getDefaultSize(int size, int measureSpec) {
|
||||
int result = size;
|
||||
int specMode = MeasureSpec.getMode(measureSpec);
|
||||
int specSize = MeasureSpec.getSize(measureSpec);
|
||||
switch (specMode) {
|
||||
case MeasureSpec.UNSPECIFIED:
|
||||
result = size;
|
||||
break;
|
||||
case MeasureSpec.AT_MOST:
|
||||
case MeasureSpec.EXACTLY:
|
||||
result = specSize;
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,4 +35,12 @@ public class ViewConfiguration {
|
||||
public boolean hasPermanentMenuKey() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static int getDoubleTapTimeout() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int getScaledDoubleTapSlop() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public class ViewGroup extends View implements ViewParent, ViewManager {
|
||||
addView(child, new LayoutParams(width, height));
|
||||
}
|
||||
|
||||
public void addView(View child, int index, LayoutParams params) {
|
||||
private void addViewInternal(View child, int index, LayoutParams params) {
|
||||
if (child.parent == this)
|
||||
return;
|
||||
if (params != null) {
|
||||
@@ -67,6 +67,15 @@ public class ViewGroup extends View implements ViewParent, ViewManager {
|
||||
native_addView(widget, child.widget, index, params);
|
||||
}
|
||||
|
||||
public void addView(View child, int index, LayoutParams params) {
|
||||
addViewInternal(child, index, params);
|
||||
}
|
||||
|
||||
protected boolean addViewInLayout(View child, int index, LayoutParams params) {
|
||||
addViewInternal(child, index, params);
|
||||
return true;
|
||||
}
|
||||
|
||||
public void removeView(View child) {
|
||||
if (child.parent != this)
|
||||
return;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package android.view;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.TimeInterpolator;
|
||||
|
||||
public class ViewPropertyAnimator {
|
||||
@@ -9,4 +10,22 @@ public class ViewPropertyAnimator {
|
||||
public ViewPropertyAnimator setInterpolator(TimeInterpolator interpolator) {
|
||||
return this;
|
||||
}
|
||||
|
||||
public ViewPropertyAnimator setListener(Animator.AnimatorListener listener) {
|
||||
return this;
|
||||
}
|
||||
|
||||
public ViewPropertyAnimator alpha(float alpha) {
|
||||
return this;
|
||||
}
|
||||
|
||||
public ViewPropertyAnimator setDuration(long duration) {
|
||||
return this;
|
||||
}
|
||||
|
||||
public ViewPropertyAnimator setStartDelay(long duration) {
|
||||
return this;
|
||||
}
|
||||
|
||||
public void start() {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user