mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-04-28 12:17:57 +03:00
api-impl: misc APIs for WhatsApp media chooser Activities
This commit is contained in:
parent
69b742263a
commit
e011092025
19 changed files with 123 additions and 26 deletions
|
@ -258,7 +258,7 @@ public class Activity extends ContextThemeWrapper implements Window.Callback, La
|
||||||
protected void onSaveInstanceState(Bundle outState) {
|
protected void onSaveInstanceState(Bundle outState) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void onConfigurationChanged(Configuration newConfig) {
|
public void onConfigurationChanged(Configuration newConfig) {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onLowMemory() {
|
public void onLowMemory() {
|
||||||
|
|
|
@ -395,7 +395,15 @@ public class Intent implements Parcelable {
|
||||||
|
|
||||||
public void setSourceBounds(Rect sourceBounds) {}
|
public void setSourceBounds(Rect sourceBounds) {}
|
||||||
|
|
||||||
|
public Rect getSourceBounds() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public void setSelector(Intent selector) {}
|
public void setSelector(Intent selector) {}
|
||||||
|
|
||||||
public void setClipData(ClipData clip) {}
|
public void setClipData(ClipData clip) {}
|
||||||
|
|
||||||
|
public String resolveType(Context context) {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package android.content.pm;
|
package android.content.pm;
|
||||||
|
|
||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
|
|
||||||
public class ResolveInfo {
|
public class ResolveInfo {
|
||||||
public ActivityInfo activityInfo = new ActivityInfo();
|
public ActivityInfo activityInfo = new ActivityInfo();
|
||||||
|
@ -8,6 +9,22 @@ public class ResolveInfo {
|
||||||
public IntentFilter filter = new IntentFilter();
|
public IntentFilter filter = new IntentFilter();
|
||||||
public int priority = -500;
|
public int priority = -500;
|
||||||
|
|
||||||
|
public Drawable loadIcon(PackageManager pm) {
|
||||||
|
Drawable icon = activityInfo.loadIcon(pm);
|
||||||
|
if (icon == null) {
|
||||||
|
icon = new Drawable();
|
||||||
|
}
|
||||||
|
return icon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CharSequence loadLabel(PackageManager pm) {
|
||||||
|
CharSequence label = activityInfo.loadLabel(pm);
|
||||||
|
if (label == null) {
|
||||||
|
label = "fixme ResolveInfo.loadLabel";
|
||||||
|
}
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
|
||||||
public static class DisplayNameComparator {
|
public static class DisplayNameComparator {
|
||||||
|
|
||||||
public DisplayNameComparator(PackageManager pm) {}
|
public DisplayNameComparator(PackageManager pm) {}
|
||||||
|
|
|
@ -626,9 +626,9 @@ public class BitmapFactory {
|
||||||
|
|
||||||
Trace.traceBegin(Trace.TRACE_TAG_GRAPHICS, "decodeFileDescriptor");
|
Trace.traceBegin(Trace.TRACE_TAG_GRAPHICS, "decodeFileDescriptor");
|
||||||
try {
|
try {
|
||||||
if (nativeIsSeekable(fd)) {
|
//if (nativeIsSeekable(fd)) {
|
||||||
bm = nativeDecodeFileDescriptor(fd, outPadding, opts);
|
// bm = nativeDecodeFileDescriptor(fd, outPadding, opts);
|
||||||
} else {
|
//} else {
|
||||||
FileInputStream fis = new FileInputStream(fd);
|
FileInputStream fis = new FileInputStream(fd);
|
||||||
try {
|
try {
|
||||||
bm = decodeStreamInternal(fis, outPadding, opts);
|
bm = decodeStreamInternal(fis, outPadding, opts);
|
||||||
|
@ -638,7 +638,7 @@ public class BitmapFactory {
|
||||||
} catch (Throwable t) { /* ignore */
|
} catch (Throwable t) { /* ignore */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
//}
|
||||||
|
|
||||||
if (bm == null && opts != null && opts.inBitmap != null) {
|
if (bm == null && opts != null && opts.inBitmap != null) {
|
||||||
throw new IllegalArgumentException("Problem decoding into existing bitmap");
|
throw new IllegalArgumentException("Problem decoding into existing bitmap");
|
||||||
|
|
|
@ -474,6 +474,10 @@ public class Canvas {
|
||||||
return save();
|
return save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int saveLayer(RectF bounds, Paint paint) {
|
||||||
|
return save();
|
||||||
|
}
|
||||||
|
|
||||||
public void drawOval(RectF oval, Paint paint) {
|
public void drawOval(RectF oval, Paint paint) {
|
||||||
Log.w("Canvas", "STUB: drawOval");
|
Log.w("Canvas", "STUB: drawOval");
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,20 @@
|
||||||
package android.graphics.drawable;
|
package android.graphics.drawable;
|
||||||
|
|
||||||
public class TransitionDrawable extends Drawable {
|
import android.graphics.Canvas;
|
||||||
|
|
||||||
public TransitionDrawable(Drawable[] layers) {}
|
public class TransitionDrawable extends LayerDrawable {
|
||||||
|
|
||||||
|
public TransitionDrawable(Drawable[] layers) {
|
||||||
|
super(layers);
|
||||||
|
}
|
||||||
|
|
||||||
public void setCrossFadeEnabled(boolean enabled) {}
|
public void setCrossFadeEnabled(boolean enabled) {}
|
||||||
|
|
||||||
public void startTransition(int duration) {}
|
public void startTransition(int duration) {}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void draw(Canvas canvas) {
|
||||||
|
// always draw the target drawable
|
||||||
|
mLayerState.mChildren[1].mDrawable.draw(canvas);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,4 +56,8 @@ public class AudioManager {
|
||||||
public boolean isStreamMute(int streamType) {
|
public boolean isStreamMute(int streamType) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isMusicActive() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -601,7 +601,7 @@ public class ParcelFileDescriptor implements Closeable {
|
||||||
*
|
*
|
||||||
* @see #canDetectErrors()
|
* @see #canDetectErrors()
|
||||||
*/
|
*/
|
||||||
public int detachFd() { /*
|
public int detachFd() {
|
||||||
if (mWrapped != null) {
|
if (mWrapped != null) {
|
||||||
return mWrapped.detachFd();
|
return mWrapped.detachFd();
|
||||||
} else {
|
} else {
|
||||||
|
@ -609,11 +609,11 @@ public class ParcelFileDescriptor implements Closeable {
|
||||||
throw new IllegalStateException("Already closed");
|
throw new IllegalStateException("Already closed");
|
||||||
}
|
}
|
||||||
final int fd = getFd();
|
final int fd = getFd();
|
||||||
Parcel.clearFileDescriptor(mFd);
|
// Parcel.clearFileDescriptor(mFd);
|
||||||
|
mFd.setInt$(-1);
|
||||||
writeCommStatusAndClose(Status.DETACHED, null);
|
writeCommStatusAndClose(Status.DETACHED, null);
|
||||||
return fd;
|
return fd;
|
||||||
}*/
|
}
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -7,6 +7,6 @@ public class PhoneNumberUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isGlobalPhoneNumber(String phoneNumber) {
|
public static boolean isGlobalPhoneNumber(String phoneNumber) {
|
||||||
return phoneNumber.startsWith("+") || phoneNumber.startsWith("00");
|
return phoneNumber != null && (phoneNumber.startsWith("+") || phoneNumber.startsWith("00"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,4 +74,6 @@ public interface MenuItem {
|
||||||
public MenuItem setNumericShortcut(char numericChar);
|
public MenuItem setNumericShortcut(char numericChar);
|
||||||
|
|
||||||
public boolean expandActionView();
|
public boolean expandActionView();
|
||||||
|
|
||||||
|
public boolean isActionViewExpanded();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
package android.view;
|
package android.view;
|
||||||
|
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
|
|
||||||
public interface SubMenu extends Menu {
|
public interface SubMenu extends Menu {
|
||||||
|
|
||||||
public MenuItem getItem();
|
public MenuItem getItem();
|
||||||
|
|
||||||
public void clearHeader();
|
public void clearHeader();
|
||||||
|
|
||||||
|
public SubMenu setIcon(Drawable icon);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -654,5 +654,9 @@ public class ViewGroup extends View implements ViewParent, ViewManager {
|
||||||
|
|
||||||
public void requestChildFocus(View child, View focused) {}
|
public void requestChildFocus(View child, View focused) {}
|
||||||
|
|
||||||
|
public boolean getClipChildren() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public native boolean native_dispatchTouchEvent(long widget, MotionEvent event, double x, double y);
|
public native boolean native_dispatchTouchEvent(long widget, MotionEvent event, double x, double y);
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,4 +88,12 @@ public class ViewPropertyAnimator {
|
||||||
}
|
}
|
||||||
}, startDelay+duration);
|
}, startDelay+duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ViewPropertyAnimator withEndAction(Runnable runnable) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ViewPropertyAnimator withStartAction(Runnable runnable) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
package android.view.animation;
|
package android.view.animation;
|
||||||
|
|
||||||
import android.animation.TimeInterpolator;
|
public class AccelerateDecelerateInterpolator implements Interpolator {
|
||||||
|
|
||||||
public class AccelerateDecelerateInterpolator implements TimeInterpolator {
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float getInterpolation(float input) {
|
public float getInterpolation(float input) {
|
||||||
|
|
|
@ -163,6 +163,9 @@ public class ImageView extends View {
|
||||||
public final void setColorFilter(int color, PorterDuff.Mode mode) {}
|
public final void setColorFilter(int color, PorterDuff.Mode mode) {}
|
||||||
|
|
||||||
public void setImageTintList(ColorStateList tint) {
|
public void setImageTintList(ColorStateList tint) {
|
||||||
|
if (tint == null)
|
||||||
|
colorFilter = null;
|
||||||
|
else
|
||||||
colorFilter = new PorterDuffColorFilter(tint.getDefaultColor(), PorterDuff.Mode.SRC_IN);
|
colorFilter = new PorterDuffColorFilter(tint.getDefaultColor(), PorterDuff.Mode.SRC_IN);
|
||||||
setImageDrawable(drawable);
|
setImageDrawable(drawable);
|
||||||
}
|
}
|
||||||
|
@ -191,6 +194,10 @@ public class ImageView extends View {
|
||||||
|
|
||||||
public void setColorFilter(ColorFilter cf) {}
|
public void setColorFilter(ColorFilter cf) {}
|
||||||
|
|
||||||
|
public Matrix getImageMatrix() {
|
||||||
|
return Matrix.IDENTITY_MATRIX;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected native long native_constructor(Context context, AttributeSet attrs);
|
protected native long native_constructor(Context context, AttributeSet attrs);
|
||||||
protected native void native_setDrawable(long widget, long paintable);
|
protected native void native_setDrawable(long widget, long paintable);
|
||||||
|
|
|
@ -335,6 +335,12 @@ public class PopupMenu {
|
||||||
throw new UnsupportedOperationException("Unimplemented method 'clearHeader'");
|
throw new UnsupportedOperationException("Unimplemented method 'clearHeader'");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SubMenu setIcon(Drawable icon) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
throw new UnsupportedOperationException("Unimplemented method 'setIcon'");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private class MenuItemImpl implements MenuItem {
|
private class MenuItemImpl implements MenuItem {
|
||||||
|
@ -549,6 +555,12 @@ public class PopupMenu {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
throw new UnsupportedOperationException("Unimplemented method 'expandActionView'");
|
throw new UnsupportedOperationException("Unimplemented method 'expandActionView'");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isActionViewExpanded() {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
throw new UnsupportedOperationException("Unimplemented method 'isActionViewExpanded'");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,11 +19,12 @@ public class ProgressBar extends View {
|
||||||
super(context, attrs, defStyle);
|
super(context, attrs, defStyle);
|
||||||
haveCustomMeasure = false;
|
haveCustomMeasure = false;
|
||||||
TypedArray a = context.obtainStyledAttributes(attrs, com.android.internal.R.styleable.ProgressBar, defStyle, 0);
|
TypedArray a = context.obtainStyledAttributes(attrs, com.android.internal.R.styleable.ProgressBar, defStyle, 0);
|
||||||
|
setIndeterminateDrawable(a.getDrawable(com.android.internal.R.styleable.ProgressBar_indeterminateDrawable));
|
||||||
|
setProgressDrawable(a.getDrawable(com.android.internal.R.styleable.ProgressBar_progressDrawable));
|
||||||
setIndeterminate(a.getBoolean(com.android.internal.R.styleable.ProgressBar_indeterminate, false));
|
setIndeterminate(a.getBoolean(com.android.internal.R.styleable.ProgressBar_indeterminate, false));
|
||||||
if (a.getBoolean(com.android.internal.R.styleable.ProgressBar_indeterminateOnly, false)) {
|
if (a.getBoolean(com.android.internal.R.styleable.ProgressBar_indeterminateOnly, false)) {
|
||||||
setIndeterminate(true);
|
setIndeterminate(true);
|
||||||
}
|
}
|
||||||
setIndeterminateDrawable(a.getDrawable(com.android.internal.R.styleable.ProgressBar_indeterminateDrawable));
|
|
||||||
/* FIXME hack: NewPipe expects this to not be null, but for some reason it is */
|
/* FIXME hack: NewPipe expects this to not be null, but for some reason it is */
|
||||||
if(indeterminateDrawable == null)
|
if(indeterminateDrawable == null)
|
||||||
indeterminateDrawable = new Drawable() {
|
indeterminateDrawable = new Drawable() {
|
||||||
|
|
|
@ -1,4 +1,20 @@
|
||||||
package android.widget;
|
package android.widget;
|
||||||
|
|
||||||
|
import android.app.PendingIntent;
|
||||||
|
|
||||||
public class RemoteViews {
|
public class RemoteViews {
|
||||||
|
|
||||||
|
public RemoteViews(String packageName, int layoutId) {}
|
||||||
|
|
||||||
|
public void setProgressBar(int viewId, int max, int progress, boolean indeterminate) {}
|
||||||
|
|
||||||
|
public void setTextViewText(int viewId, CharSequence text) {}
|
||||||
|
|
||||||
|
public void setImageViewResource(int viewId, int resId) {}
|
||||||
|
|
||||||
|
public void setContentDescription(int viewId, CharSequence text) {}
|
||||||
|
|
||||||
|
public void setOnClickPendingIntent(int viewId, PendingIntent pendingIntent) {}
|
||||||
|
|
||||||
|
public void setViewVisibility(int viewId, int visibility) {}
|
||||||
}
|
}
|
||||||
|
|
|
@ -403,4 +403,6 @@ public class TextView extends View {
|
||||||
public void setShadowLayer(float radius, float dx, float dy, int color) {}
|
public void setShadowLayer(float radius, float dx, float dy, int color) {}
|
||||||
|
|
||||||
public void setBreakStrategy(int strategy) {}
|
public void setBreakStrategy(int strategy) {}
|
||||||
|
|
||||||
|
public void clearComposingText() {}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue