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 some methods needed for androidx preferences
This commit is contained in:
@@ -5,9 +5,12 @@ import android.content.DialogInterface.OnCancelListener;
|
||||
import android.content.DialogInterface.OnDismissListener;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
|
||||
public class Dialog {
|
||||
public class Dialog implements Window.Callback {
|
||||
protected long nativePtr;
|
||||
|
||||
private native long nativeInit();
|
||||
@@ -68,9 +71,46 @@ public class Dialog {
|
||||
System.out.println("totally dismissing the Dialog " + this + " right now, which was most definitely being shown just a moment ago");
|
||||
}
|
||||
|
||||
public Window getWindow() {
|
||||
return new Window(this);
|
||||
}
|
||||
|
||||
public void setCanceledOnTouchOutside(boolean cancel) {}
|
||||
|
||||
public class Builder {
|
||||
public Builder(Context context) {
|
||||
System.out.println("making a Dialog$Builder as we speak, my word!");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onContentChanged() {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'onContentChanged'");
|
||||
}
|
||||
@Override
|
||||
public boolean onCreatePanelMenu(int featureId, Menu menu) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'onCreatePanelMenu'");
|
||||
}
|
||||
@Override
|
||||
public View onCreatePanelView(int featureId) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'onCreatePanelView'");
|
||||
}
|
||||
@Override
|
||||
public boolean onPreparePanel(int featureId, View view, Menu menu) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'onPreparePanel'");
|
||||
}
|
||||
@Override
|
||||
public boolean onMenuItemSelected(int featureId, MenuItem item) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'onMenuItemSelected'");
|
||||
}
|
||||
@Override
|
||||
public void onPanelClosed(int featureId, Menu menu) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'onPanelClosed'");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ import android.telephony.TelephonyManager;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.Slog;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.WindowManagerImpl;
|
||||
import android.view.accessibility.AccessibilityManager;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
@@ -182,6 +183,8 @@ public class Context extends Object {
|
||||
return new InputMethodManager();
|
||||
case "accessibility":
|
||||
return new AccessibilityManager();
|
||||
case "layout_inflater":
|
||||
return new LayoutInflater();
|
||||
default:
|
||||
Slog.e(TAG, "!!!!!!! getSystemService: case >" + name + "< is not implemented yet");
|
||||
return null;
|
||||
|
||||
@@ -129,6 +129,8 @@ public class Drawable {
|
||||
BitmapDrawable drawable = new BitmapDrawable();
|
||||
drawable.inflate(resources, parser, parser, null);
|
||||
return drawable;
|
||||
} else if ("transition".equals(parser.getName())) {
|
||||
return new Drawable();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -11,4 +11,8 @@ public class Layout {
|
||||
}
|
||||
|
||||
public int getLineCount() {return 1;}
|
||||
|
||||
public float getLineWidth(int line) {return 10;}
|
||||
|
||||
public TextPaint getPaint() {return new TextPaint();}
|
||||
}
|
||||
|
||||
@@ -1593,4 +1593,6 @@ public class View extends Object {
|
||||
}
|
||||
|
||||
public void setAccessibilityLiveRegion(int mode) {}
|
||||
|
||||
public void invalidateOutline() {}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,8 @@ package android.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
|
||||
public abstract class AbsListView extends View {
|
||||
public abstract class AbsListView extends AdapterView {
|
||||
|
||||
public AbsListView(Context context) {
|
||||
super(context);
|
||||
@@ -14,4 +13,6 @@ public abstract class AbsListView extends View {
|
||||
super(context, attributeSet);
|
||||
}
|
||||
|
||||
public void setChoiceMode(int choiceMode) {}
|
||||
|
||||
}
|
||||
|
||||
@@ -28,5 +28,7 @@ public abstract class AdapterView extends ViewGroup {
|
||||
|
||||
public void setOnItemSelectedListener(AdapterView.OnItemSelectedListener listener) {}
|
||||
|
||||
public void setOnItemClickListener(AdapterView.OnItemClickListener listener) {}
|
||||
|
||||
public void setSelection(int position, boolean animate) {}
|
||||
}
|
||||
|
||||
@@ -143,4 +143,8 @@ public class ImageView extends View {
|
||||
public void setImageTintList(ColorStateList tint) {}
|
||||
|
||||
public void setImageAlpha(int alpha) {}
|
||||
|
||||
public void setMaxWidth(int width) {}
|
||||
|
||||
public void setMaxHeight(int height) {}
|
||||
}
|
||||
|
||||
@@ -198,4 +198,8 @@ public class TextView extends View {
|
||||
public Layout getLayout() {
|
||||
return new Layout();
|
||||
}
|
||||
|
||||
public int getCurrentTextColor() {return 0;}
|
||||
|
||||
public void setSingleLine(boolean singleLine) {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user