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: fixes for apps using old support library
This commit is contained in:
@@ -268,7 +268,8 @@ public class Activity extends ContextThemeWrapper implements Window.Callback, La
|
|||||||
System.out.printf("%x\n", root_view.id);
|
System.out.printf("%x\n", root_view.id);
|
||||||
System.out.println("~~~~~~~~~~~");
|
System.out.println("~~~~~~~~~~~");
|
||||||
|
|
||||||
setContentView(root_view);
|
window.setContentView(root_view);
|
||||||
|
onContentChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setContentView(View view, ViewGroup.LayoutParams layoutParams) {
|
public void setContentView(View view, ViewGroup.LayoutParams layoutParams) {
|
||||||
|
|||||||
@@ -350,6 +350,7 @@ public class Intent implements Parcelable {
|
|||||||
|
|
||||||
public void setExtrasClassLoader(ClassLoader loader) {}
|
public void setExtrasClassLoader(ClassLoader loader) {}
|
||||||
public Intent setClassName(Context packageContext, String className) {
|
public Intent setClassName(Context packageContext, String className) {
|
||||||
|
setComponent(new ComponentName(packageContext, className));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,6 +37,10 @@ public class Paint {
|
|||||||
native_set_color(paint, color);
|
native_set_color(paint, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setARGB(int a, int r, int g, int b) {
|
||||||
|
setColor(Color.argb(a, r, g, b));
|
||||||
|
}
|
||||||
|
|
||||||
public int getColor() {
|
public int getColor() {
|
||||||
return native_get_color(paint);
|
return native_get_color(paint);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ public class LayoutInflater {
|
|||||||
context = new ContextThemeWrapper(context, themeResId);
|
context = new ContextThemeWrapper(context, themeResId);
|
||||||
}
|
}
|
||||||
ta.recycle();
|
ta.recycle();
|
||||||
|
constructor.setAccessible(true);
|
||||||
View view_instance = (View)constructor.newInstance(context, attrs);
|
View view_instance = (View)constructor.newInstance(context, attrs);
|
||||||
|
|
||||||
return view_instance;
|
return view_instance;
|
||||||
|
|||||||
@@ -67,4 +67,6 @@ public interface MenuItem {
|
|||||||
public CharSequence getTitleCondensed();
|
public CharSequence getTitleCondensed();
|
||||||
|
|
||||||
public CharSequence getTitle();
|
public CharSequence getTitle();
|
||||||
|
|
||||||
|
public MenuItem setNumericShortcut(char numericChar);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ public class ViewGroup extends View implements ViewParent, ViewManager {
|
|||||||
// Reusing removeView in removeViewInLayout is not possible, because e.g.
|
// Reusing removeView in removeViewInLayout is not possible, because e.g.
|
||||||
// ViewPager overrides removeView to call removeViewInLayout
|
// ViewPager overrides removeView to call removeViewInLayout
|
||||||
protected void removeViewInternal(View child) {
|
protected void removeViewInternal(View child) {
|
||||||
if (child.parent != this)
|
if (child == null || child.parent != this)
|
||||||
return;
|
return;
|
||||||
child.parent = null;
|
child.parent = null;
|
||||||
children.remove(child);
|
children.remove(child);
|
||||||
|
|||||||
@@ -539,6 +539,12 @@ public class PopupMenu {
|
|||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
throw new UnsupportedOperationException("Unimplemented method 'getTitle'");
|
throw new UnsupportedOperationException("Unimplemented method 'getTitle'");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MenuItem setNumericShortcut(char numericChar) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
throw new UnsupportedOperationException("Unimplemented method 'setNumericShortcut'");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import android.database.DataSetObserver;
|
|||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
|
|
||||||
public class Spinner extends AbsSpinner {
|
public class Spinner extends AbsSpinner {
|
||||||
private Observer observer = new Observer();
|
private Observer observer;
|
||||||
|
|
||||||
public Spinner(Context context) {
|
public Spinner(Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
@@ -27,6 +27,8 @@ public class Spinner extends AbsSpinner {
|
|||||||
protected native void native_setAdapter(long widget, SpinnerAdapter adapter);
|
protected native void native_setAdapter(long widget, SpinnerAdapter adapter);
|
||||||
|
|
||||||
public void setAdapter(SpinnerAdapter adapter) {
|
public void setAdapter(SpinnerAdapter adapter) {
|
||||||
|
if (observer == null)
|
||||||
|
observer = new Observer();
|
||||||
SpinnerAdapter oldAdapter = getAdapter();
|
SpinnerAdapter oldAdapter = getAdapter();
|
||||||
if (oldAdapter != null)
|
if (oldAdapter != null)
|
||||||
oldAdapter.unregisterDataSetObserver(observer);
|
oldAdapter.unregisterDataSetObserver(observer);
|
||||||
|
|||||||
Reference in New Issue
Block a user