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 Java APIs needed for WhatsApp MainActivity and ConversationActivity
This commit is contained in:
@@ -65,6 +65,16 @@ public abstract class AbsListView extends AdapterView {
|
||||
|
||||
public void setFastScrollAlwaysVisible(boolean alwaysVisible) {}
|
||||
|
||||
public void setTranscriptMode(int mode) {}
|
||||
|
||||
public int getTranscriptMode() {return 0;}
|
||||
|
||||
public void setSelectionFromTop(int position, int y) {}
|
||||
|
||||
public void smoothScrollBy(int position, int duration) {}
|
||||
|
||||
public void smoothScrollToPositionFromTop(int position, int offset) {}
|
||||
|
||||
public interface OnScrollListener {}
|
||||
|
||||
public interface SelectionBoundsAdjuster {}
|
||||
|
||||
@@ -53,4 +53,18 @@ public abstract class AdapterView extends ViewGroup {
|
||||
public Object getItemAtPosition(int position) {
|
||||
return adapter.getItem(position);
|
||||
}
|
||||
|
||||
public void setEmptyView(View emptyView) {}
|
||||
|
||||
public int getFirstVisiblePosition() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int getLastVisiblePosition() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int getCount() {
|
||||
return adapter.getCount();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public class Button extends TextView {
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharSequence getText() { return "FIXME Button.getText"; }
|
||||
public native CharSequence getText();
|
||||
|
||||
@Override
|
||||
public void setTextSize(float size) {}
|
||||
|
||||
@@ -45,6 +45,10 @@ public abstract class CompoundButton extends Button implements Checkable {
|
||||
public void setTextColor(int color) {}
|
||||
@Override
|
||||
public void setTextSize(float size) {}
|
||||
@Override
|
||||
public CharSequence getText() {
|
||||
return "FIXME CompoundButton.getText()";
|
||||
}
|
||||
|
||||
public void setButtonTintList(ColorStateList list) {
|
||||
}
|
||||
|
||||
@@ -1,4 +1,30 @@
|
||||
package android.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
|
||||
public abstract class CursorAdapter extends BaseAdapter {
|
||||
|
||||
private Cursor cursor;
|
||||
|
||||
public CursorAdapter(Context context, Cursor cursor, boolean autoRequery) {
|
||||
this.cursor = cursor;
|
||||
}
|
||||
|
||||
public CursorAdapter(Context context, Cursor cursor, int flags) {
|
||||
this.cursor = cursor;
|
||||
}
|
||||
|
||||
public void changeCursor(Cursor cursor) {
|
||||
this.cursor = cursor;
|
||||
}
|
||||
|
||||
public Cursor getCursor() {
|
||||
return cursor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return cursor == null ? 0 : cursor.getCount();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,6 +164,10 @@ public class ImageView extends View {
|
||||
|
||||
public void setImageTintMode(PorterDuff.Mode tintMode) {}
|
||||
|
||||
public void setCropToPadding(boolean crop) {}
|
||||
|
||||
public void setColorFilter(int color) {}
|
||||
|
||||
@Override
|
||||
protected native long native_constructor(Context context, AttributeSet attrs);
|
||||
protected native void native_setPixbuf(long widget, long pixbuf);
|
||||
|
||||
@@ -40,4 +40,10 @@ public class ListView extends AbsListView {
|
||||
public void setDivider(Drawable drawable) {}
|
||||
|
||||
public void setSelectionFromTop(int position, int y) {}
|
||||
|
||||
public void addFooterView(View v, Object data, boolean isSelectable) {}
|
||||
|
||||
public void addFooterView(View v) {}
|
||||
|
||||
public void setDividerHeight(int height) {}
|
||||
}
|
||||
|
||||
@@ -304,6 +304,12 @@ public class PopupMenu {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'hasVisibleItems'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public SubMenu addSubMenu(int groupId, int itemId, int order, int titleRes) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'addSubMenu'");
|
||||
}
|
||||
}
|
||||
|
||||
private class SubMenuImpl extends MenuImpl implements SubMenu {
|
||||
@@ -317,6 +323,12 @@ public class PopupMenu {
|
||||
public MenuItem getItem() {
|
||||
return item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearHeader() {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'clearHeader'");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -487,6 +499,12 @@ public class PopupMenu {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'setShowAsActionFlags'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public MenuItem setAlphabeticShortcut(char alphaChar) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'setAlphabeticShortcut'");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,6 +3,8 @@ package android.widget;
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
|
||||
public class PopupWindow {
|
||||
@@ -15,6 +17,22 @@ public class PopupWindow {
|
||||
this(context, null, 0, 0);
|
||||
}
|
||||
|
||||
public PopupWindow() {
|
||||
popover = native_constructor();
|
||||
}
|
||||
|
||||
public PopupWindow(View contentView, int width, int height, boolean focusable) {
|
||||
popover = native_constructor();
|
||||
setContentView(contentView);
|
||||
setWidth(width);
|
||||
setHeight(height);
|
||||
setFocusable(focusable);
|
||||
}
|
||||
|
||||
public PopupWindow(View contentView, int width, int height) {
|
||||
this(contentView, width, height, true);
|
||||
}
|
||||
|
||||
private View contentView;
|
||||
private long popover; // native pointer to GtkPopover
|
||||
|
||||
@@ -60,4 +78,24 @@ public class PopupWindow {
|
||||
}
|
||||
|
||||
public View getContentView() {return contentView;}
|
||||
|
||||
public void setTouchable(boolean touchable) {}
|
||||
|
||||
public void showAsDropDown(View anchor, int xoff, int yoff) {
|
||||
if (!anchor.isAttachedToWindow()) {
|
||||
Log.e("PopupWindow", "anchor is not attached to window");
|
||||
return;
|
||||
}
|
||||
native_showAsDropDown(popover, anchor.widget, xoff, yoff, Gravity.NO_GRAVITY);
|
||||
}
|
||||
|
||||
public void showAtLocation(View parent, int gravity, int x, int y) {
|
||||
native_showAsDropDown(popover, parent.widget, x, y, gravity);
|
||||
}
|
||||
|
||||
public void dismiss() {
|
||||
System.out.println("PopupWindow.dismiss() called");
|
||||
}
|
||||
|
||||
public void setAnimationStyle(int animationStyle) {}
|
||||
}
|
||||
|
||||
4
src/api-impl/android/widget/SectionIndexer.java
Normal file
4
src/api-impl/android/widget/SectionIndexer.java
Normal file
@@ -0,0 +1,4 @@
|
||||
package android.widget;
|
||||
|
||||
public interface SectionIndexer {
|
||||
}
|
||||
@@ -262,6 +262,8 @@ public class TextView extends View {
|
||||
|
||||
public void setCompoundDrawablesRelativeWithIntrinsicBounds(int start, int top, int end, int bottom) {}
|
||||
|
||||
public void setCompoundDrawablesRelativeWithIntrinsicBounds(Drawable start, Drawable top, Drawable end, Drawable bottom) {}
|
||||
|
||||
public boolean getLinksClickable() {return true;}
|
||||
|
||||
public boolean isTextSelectable() {return true;}
|
||||
@@ -297,4 +299,10 @@ public class TextView extends View {
|
||||
public void setCustomSelectionActionModeCallback(ActionMode.Callback actionModeCallback) {}
|
||||
|
||||
public int getExtendedPaddingTop() {return 0;}
|
||||
|
||||
public void setRawInputType(int type) {}
|
||||
|
||||
public TextUtils.TruncateAt getEllipsize() {return null;}
|
||||
|
||||
public void setLines(int lines) {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user