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
api-impl: misc stubs and fixes for WhatsApp
This commit is contained in:
@@ -386,6 +386,10 @@ public class Activity extends ContextThemeWrapper implements Window.Callback, La
|
|||||||
Dialog dialog = dialogs.get(id);
|
Dialog dialog = dialogs.get(id);
|
||||||
if (dialog == null)
|
if (dialog == null)
|
||||||
dialogs.put(id, dialog = onCreateDialog(id));
|
dialogs.put(id, dialog = onCreateDialog(id));
|
||||||
|
if (dialog == null) {
|
||||||
|
Slog.w(TAG, "Dialog " + id + " was not created");
|
||||||
|
return;
|
||||||
|
}
|
||||||
onPrepareDialog(id, dialog);
|
onPrepareDialog(id, dialog);
|
||||||
dialog.show();
|
dialog.show();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -191,4 +191,6 @@ public class Dialog implements Window.Callback, DialogInterface {
|
|||||||
public boolean onTouchEvent(MotionEvent event) {
|
public boolean onTouchEvent(MotionEvent event) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setOnKeyListener(OnKeyListener onKeyListener) {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -145,6 +145,7 @@ public class GskCanvas extends Canvas {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void concat(Matrix matrix) {
|
public void concat(Matrix matrix) {
|
||||||
|
if (matrix != null)
|
||||||
native_concat(snapshot, matrix.native_instance);
|
native_concat(snapshot, matrix.native_instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -341,6 +341,10 @@ public class Paint {
|
|||||||
|
|
||||||
public MaskFilter setMaskFilter(MaskFilter filter) { return filter; }
|
public MaskFilter setMaskFilter(MaskFilter filter) { return filter; }
|
||||||
|
|
||||||
|
public boolean isFakeBoldText() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
private static native long native_create();
|
private static native long native_create();
|
||||||
private static native long native_clone(long paint);
|
private static native long native_clone(long paint);
|
||||||
private static native void native_recycle(long paint);
|
private static native void native_recycle(long paint);
|
||||||
|
|||||||
@@ -354,6 +354,8 @@ public class Drawable {
|
|||||||
return densityDpi == 0 ? DisplayMetrics.DENSITY_DEFAULT : densityDpi;
|
return densityDpi == 0 ? DisplayMetrics.DENSITY_DEFAULT : densityDpi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setFilterBitmap(boolean filter) {}
|
||||||
|
|
||||||
protected static native long native_paintable_from_path(String path);
|
protected static native long native_paintable_from_path(String path);
|
||||||
protected native long native_constructor();
|
protected native long native_constructor();
|
||||||
protected native void native_invalidate(long paintable);
|
protected native void native_invalidate(long paintable);
|
||||||
|
|||||||
@@ -29,12 +29,19 @@ public class DrawableContainer extends Drawable {
|
|||||||
this.state = state;
|
this.state = state;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class DrawableContainerState {
|
@Override
|
||||||
|
public ConstantState getConstantState() {
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class DrawableContainerState extends ConstantState {
|
||||||
|
|
||||||
private Drawable drawables[] = new Drawable[10];
|
private Drawable drawables[] = new Drawable[10];
|
||||||
private int childCount = 0;
|
private int childCount = 0;
|
||||||
|
private DrawableContainer owner;
|
||||||
|
|
||||||
public DrawableContainerState(DrawableContainerState orig, DrawableContainer owner, Resources res) {
|
public DrawableContainerState(DrawableContainerState orig, DrawableContainer owner, Resources res) {
|
||||||
|
this.owner = owner;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getCapacity() {
|
public int getCapacity() {
|
||||||
@@ -62,6 +69,21 @@ public class DrawableContainer extends Drawable {
|
|||||||
System.arraycopy(drawables, 0, newDrawables, 0, oldSize);
|
System.arraycopy(drawables, 0, newDrawables, 0, oldSize);
|
||||||
drawables = newDrawables;
|
drawables = newDrawables;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Drawable newDrawable(Resources res) {
|
||||||
|
return owner;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Drawable newDrawable() {
|
||||||
|
return owner;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getChangingConfigurations() {
|
||||||
|
return owner.getChangingConfigurations();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
10
src/api-impl/android/media/ThumbnailUtils.java
Normal file
10
src/api-impl/android/media/ThumbnailUtils.java
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
package android.media;
|
||||||
|
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
|
||||||
|
public class ThumbnailUtils {
|
||||||
|
|
||||||
|
public static Bitmap extractThumbnail(Bitmap source, int width, int height) {
|
||||||
|
return Bitmap.createScaledBitmap(source, width, height, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,12 @@
|
|||||||
package android.text.method;
|
package android.text.method;
|
||||||
|
|
||||||
|
import android.text.Spannable;
|
||||||
|
import android.view.MotionEvent;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
public class BaseMovementMethod implements MovementMethod {
|
public class BaseMovementMethod implements MovementMethod {
|
||||||
|
|
||||||
|
public boolean onTouchEvent(TextView widget, Spannable buffer, MotionEvent event) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,4 +3,5 @@ package android.text.style;
|
|||||||
public class AbsoluteSizeSpan {
|
public class AbsoluteSizeSpan {
|
||||||
public AbsoluteSizeSpan() {}
|
public AbsoluteSizeSpan() {}
|
||||||
public AbsoluteSizeSpan(int dummy) {}
|
public AbsoluteSizeSpan(int dummy) {}
|
||||||
|
public AbsoluteSizeSpan(int size, boolean dip) {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,5 +2,10 @@ package android.text.style;
|
|||||||
|
|
||||||
public interface LeadingMarginSpan {
|
public interface LeadingMarginSpan {
|
||||||
|
|
||||||
public static class Standard implements LeadingMarginSpan {}
|
public static class Standard implements LeadingMarginSpan {
|
||||||
|
|
||||||
|
public Standard(int indent) {}
|
||||||
|
|
||||||
|
public Standard(int first_indent, int rest_indent) {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,14 @@ package android.text.style;
|
|||||||
|
|
||||||
public class StyleSpan {
|
public class StyleSpan {
|
||||||
|
|
||||||
public StyleSpan(int style) {}
|
private int style;
|
||||||
|
|
||||||
|
public StyleSpan(int style) {
|
||||||
|
this.style = style;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getStyle() {
|
||||||
|
return style;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package android.view;
|
package android.view;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
|
|
||||||
public interface MenuItem {
|
public interface MenuItem {
|
||||||
@@ -76,4 +77,6 @@ public interface MenuItem {
|
|||||||
public boolean expandActionView();
|
public boolean expandActionView();
|
||||||
|
|
||||||
public boolean isActionViewExpanded();
|
public boolean isActionViewExpanded();
|
||||||
|
|
||||||
|
public MenuItem setIntent(Intent intent);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2223,4 +2223,12 @@ public class View implements Drawable.Callback {
|
|||||||
public boolean isDuplicateParentStateEnabled() { return false; }
|
public boolean isDuplicateParentStateEnabled() { return false; }
|
||||||
|
|
||||||
public void setBackgroundTintMode(PorterDuff.Mode tintMode) {}
|
public void setBackgroundTintMode(PorterDuff.Mode tintMode) {}
|
||||||
|
|
||||||
|
public void setNextFocusLeftId(int id) {}
|
||||||
|
|
||||||
|
public void setNextFocusRightId(int id) {}
|
||||||
|
|
||||||
|
public void setNextFocusDownId(int id) {}
|
||||||
|
|
||||||
|
public void setNextFocusUpId(int id) {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -496,7 +496,9 @@ public class ViewGroup extends View implements ViewParent, ViewManager {
|
|||||||
public LayoutParams(Context context, AttributeSet attrs) {
|
public LayoutParams(Context context, AttributeSet attrs) {
|
||||||
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ViewGroup_Layout);
|
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ViewGroup_Layout);
|
||||||
setBaseAttributes(a, R.styleable.ViewGroup_Layout_layout_width, R.styleable.ViewGroup_Layout_layout_height);
|
setBaseAttributes(a, R.styleable.ViewGroup_Layout_layout_width, R.styleable.ViewGroup_Layout_layout_height);
|
||||||
this.gravity = attrs.getAttributeIntValue("http://schemas.android.com/apk/res/android", "layout_gravity", -1);
|
a.recycle();
|
||||||
|
a = context.obtainStyledAttributes(attrs, new int[] { android.R.attr.layout_gravity });
|
||||||
|
gravity = a.getInt(0, -1);
|
||||||
a.recycle();
|
a.recycle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3644,4 +3644,8 @@ public class ListView extends AbsListView {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setItemsCanFocus(boolean itemsCanFocus) {
|
||||||
|
mItemsCanFocus = itemsCanFocus;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -561,6 +561,12 @@ public class PopupMenu {
|
|||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
throw new UnsupportedOperationException("Unimplemented method 'isActionViewExpanded'");
|
throw new UnsupportedOperationException("Unimplemented method 'isActionViewExpanded'");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MenuItem setIntent(Intent intent) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
throw new UnsupportedOperationException("Unimplemented method 'setIntent'");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package android.widget;
|
package android.widget;
|
||||||
|
|
||||||
import android.app.PendingIntent;
|
import android.app.PendingIntent;
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
|
||||||
public class RemoteViews {
|
public class RemoteViews {
|
||||||
|
|
||||||
@@ -17,4 +18,16 @@ public class RemoteViews {
|
|||||||
public void setOnClickPendingIntent(int viewId, PendingIntent pendingIntent) {}
|
public void setOnClickPendingIntent(int viewId, PendingIntent pendingIntent) {}
|
||||||
|
|
||||||
public void setViewVisibility(int viewId, int visibility) {}
|
public void setViewVisibility(int viewId, int visibility) {}
|
||||||
|
|
||||||
|
public void setImageViewBitmap(int viewId, Bitmap bitmap) {}
|
||||||
|
|
||||||
|
public void removeAllViews(int viewId) {}
|
||||||
|
|
||||||
|
public RemoteViews clone() {
|
||||||
|
return new RemoteViews(null, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addView(int viewId, RemoteViews child) {}
|
||||||
|
|
||||||
|
public void setViewPadding(int viewId, int left, int top, int right, int bottom) {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package android.widget;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
|
|
||||||
public class TextSwitcher extends ViewAnimator {
|
public class TextSwitcher extends ViewSwitcher {
|
||||||
|
|
||||||
public TextSwitcher(Context context) {
|
public TextSwitcher(Context context) {
|
||||||
this(context, null);
|
this(context, null);
|
||||||
|
|||||||
@@ -293,6 +293,7 @@ srcs = [
|
|||||||
'android/media/Ringtone.java',
|
'android/media/Ringtone.java',
|
||||||
'android/media/RingtoneManager.java',
|
'android/media/RingtoneManager.java',
|
||||||
'android/media/SoundPool.java',
|
'android/media/SoundPool.java',
|
||||||
|
'android/media/ThumbnailUtils.java',
|
||||||
'android/media/audiofx/AudioEffect.java',
|
'android/media/audiofx/AudioEffect.java',
|
||||||
'android/media/projection/MediaProjectionManager.java',
|
'android/media/projection/MediaProjectionManager.java',
|
||||||
'android/media/session/MediaController.java',
|
'android/media/session/MediaController.java',
|
||||||
|
|||||||
Reference in New Issue
Block a user