mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-04-28 12:17:57 +03:00
api-impl: misc stubs for K-9 Mail
This makes the non composeUI parts of K-9 Mail mostly functional.
This commit is contained in:
parent
554b4d346a
commit
64c5ebe5b6
14 changed files with 97 additions and 2 deletions
|
@ -595,4 +595,10 @@ public class Activity extends ContextThemeWrapper implements Window.Callback, La
|
|||
public View getCurrentFocus() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setProgressBarIndeterminateVisibility(boolean indeterminate) {}
|
||||
|
||||
public int getChangingConfigurations() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,6 +61,8 @@ public class Notification implements Parcelable {
|
|||
return "Notification [" + title + ", " + text + ", " + actions + "]";
|
||||
}
|
||||
|
||||
public String getGroup() {return null;}
|
||||
|
||||
public static class Builder {
|
||||
private Notification notification;
|
||||
|
||||
|
|
|
@ -373,4 +373,8 @@ public class Intent implements Parcelable {
|
|||
extras.putParcelableArrayList(name, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public int filterHashCode() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package android.os;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Parcel {
|
||||
|
||||
public static Parcel obtain() {
|
||||
|
@ -55,4 +58,26 @@ public class Parcel {
|
|||
public int dataSize() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void writeStringList(List<String> list) {
|
||||
System.out.println("Parcel.writeStringList(" + list + ")");
|
||||
}
|
||||
|
||||
public void unmarshall(byte[] data, int offset, int length) {}
|
||||
|
||||
public String readString() {
|
||||
return "fixme: Parcel.readString()";
|
||||
}
|
||||
|
||||
public byte readByte() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public ArrayList<String> createStringArrayList() {
|
||||
return new ArrayList<String>();
|
||||
}
|
||||
|
||||
public Parcelable readParcelable(ClassLoader loader) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -346,4 +346,8 @@ public class TextUtils {
|
|||
}
|
||||
return sb;
|
||||
}
|
||||
|
||||
public static String substring(CharSequence s, int start, int end) {
|
||||
return s.subSequence(start, end).toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,4 +37,11 @@ public class DateUtils {
|
|||
public static String formatDateTime(Context context, long millis, int flags) {
|
||||
return new Date(millis).toString();
|
||||
}
|
||||
|
||||
public static String formatDateRange(Context context, long fromMillis, long toMillis, int flags) {
|
||||
if (fromMillis == toMillis)
|
||||
return formatDateTime(context, fromMillis, flags);
|
||||
else
|
||||
return formatDateTime(context, fromMillis, flags) + " - " + formatDateTime(context, toMillis, flags);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2129,4 +2129,6 @@ public class View implements Drawable.Callback {
|
|||
public void setAnimation(Animation animation) {}
|
||||
|
||||
public boolean performAccessibilityAction(int action, Bundle arguments) { return false; }
|
||||
|
||||
public boolean isDirty() { return false; }
|
||||
}
|
||||
|
|
|
@ -61,6 +61,10 @@ public class ViewPropertyAnimator {
|
|||
return this;
|
||||
}
|
||||
|
||||
public ViewPropertyAnimator translationXBy(float translationX) {
|
||||
return this;
|
||||
}
|
||||
|
||||
public void start() {
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
|
||||
|
|
|
@ -4,6 +4,11 @@ public class WebSettings {
|
|||
|
||||
public static enum LayoutAlgorithm {
|
||||
NORMAL,
|
||||
NARROW_COLUMNS,
|
||||
}
|
||||
|
||||
public static enum RenderPriority {
|
||||
HIGH,
|
||||
}
|
||||
|
||||
public String getUserAgentString() {
|
||||
|
@ -41,4 +46,10 @@ public class WebSettings {
|
|||
public void setAppCacheEnabled(boolean enabled) {}
|
||||
|
||||
public void setAppCachePath(String path) {}
|
||||
|
||||
public void setLoadWithOverviewMode(boolean overview) {}
|
||||
|
||||
public void setRenderPriority(RenderPriority priority) {}
|
||||
|
||||
public void setBlockNetworkLoads(boolean block) {}
|
||||
}
|
||||
|
|
|
@ -43,6 +43,7 @@ public class WebView extends View {
|
|||
}
|
||||
|
||||
public void setVerticalScrollBarEnabled(boolean enabled) {}
|
||||
public void setVerticalScrollbarOverlay(boolean overlay) {}
|
||||
|
||||
public void addJavascriptInterface(Object object, String name) {
|
||||
// HACK: directly call onRenderingDone for OctoDroid, as the javascript interface is not implemented yet
|
||||
|
@ -82,6 +83,8 @@ public class WebView extends View {
|
|||
return getContext().getResources().getAssets();
|
||||
}
|
||||
|
||||
public void resumeTimers() {}
|
||||
|
||||
@Override
|
||||
protected native long native_constructor(Context context, AttributeSet attrs);
|
||||
private native void native_loadDataWithBaseURL(long widget, String baseUrl, String data, String mimeType, String encoding);
|
||||
|
|
|
@ -6,6 +6,8 @@ import android.util.AttributeSet;
|
|||
|
||||
public class AutoCompleteTextView extends EditText {
|
||||
|
||||
private ListAdapter adapter;
|
||||
|
||||
public interface OnDismissListener {
|
||||
}
|
||||
|
||||
|
@ -31,7 +33,13 @@ public class AutoCompleteTextView extends EditText {
|
|||
return 0;
|
||||
}
|
||||
|
||||
public void setAdapter(ListAdapter adapter) {}
|
||||
public void setAdapter(ListAdapter adapter) {
|
||||
this.adapter = adapter;
|
||||
}
|
||||
|
||||
public ListAdapter getAdapter() {
|
||||
return adapter;
|
||||
}
|
||||
|
||||
public void setThreshold(int threshold) {}
|
||||
|
||||
|
@ -39,4 +47,10 @@ public class AutoCompleteTextView extends EditText {
|
|||
return 0;
|
||||
}
|
||||
|
||||
public int getListSelection() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void performCompletion() {}
|
||||
|
||||
}
|
|
@ -41,7 +41,8 @@ public class ImageView extends View {
|
|||
colorFilter = new PorterDuffColorFilter(a.getColor(com.android.internal.R.styleable.ImageView_tint, 0),
|
||||
PorterDuff.Mode.values()[a.getInt(com.android.internal.R.styleable.ImageView_tintMode, PorterDuff.Mode.SRC_IN.nativeInt)]);
|
||||
setImageDrawable(a.getDrawable(com.android.internal.R.styleable.ImageView_src));
|
||||
setScaleType(scaletype_from_int[a.getInt(com.android.internal.R.styleable.ImageView_scaleType, 3 /*CENTER*/)]);
|
||||
if (a.hasValue(com.android.internal.R.styleable.ImageView_scaleType))
|
||||
setScaleType(scaletype_from_int[a.getInt(com.android.internal.R.styleable.ImageView_scaleType, 3 /*CENTER*/)]);
|
||||
a.recycle();
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import android.content.res.ColorStateList;
|
|||
import android.content.res.TypedArray;
|
||||
import android.graphics.Typeface;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.text.BoringLayout;
|
||||
import android.text.Editable;
|
||||
import android.text.InputFilter;
|
||||
|
@ -371,4 +372,14 @@ public class TextView extends View {
|
|||
public void setCompoundDrawableTintList(ColorStateList tint) {}
|
||||
|
||||
public void setIncludeFontPadding(boolean includePadding) {}
|
||||
|
||||
public float getLineSpacingExtra() {return 0.f;}
|
||||
|
||||
public Bundle getInputExtras(boolean key) {
|
||||
return new Bundle();
|
||||
}
|
||||
|
||||
public void setError(CharSequence error) {
|
||||
System.out.println("ERROR: " + error);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -559,6 +559,7 @@ srcs = [
|
|||
'android/widget/ImageView.java',
|
||||
'android/widget/LinearLayout.java',
|
||||
'android/widget/ListAdapter.java',
|
||||
'android/widget/ListPopupWindow.java',
|
||||
'android/widget/ListView.java',
|
||||
'android/widget/MediaController.java',
|
||||
'android/widget/MultiAutoCompleteTextView.java',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue