mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-04-28 12:17:57 +03:00
api-impl: fixes for apps using old support library
This commit is contained in:
parent
64c5ebe5b6
commit
98e7989ccb
8 changed files with 20 additions and 3 deletions
|
@ -268,7 +268,8 @@ public class Activity extends ContextThemeWrapper implements Window.Callback, La
|
|||
System.out.printf("%x\n", root_view.id);
|
||||
System.out.println("~~~~~~~~~~~");
|
||||
|
||||
setContentView(root_view);
|
||||
window.setContentView(root_view);
|
||||
onContentChanged();
|
||||
}
|
||||
|
||||
public void setContentView(View view, ViewGroup.LayoutParams layoutParams) {
|
||||
|
|
|
@ -350,6 +350,7 @@ public class Intent implements Parcelable {
|
|||
|
||||
public void setExtrasClassLoader(ClassLoader loader) {}
|
||||
public Intent setClassName(Context packageContext, String className) {
|
||||
setComponent(new ComponentName(packageContext, className));
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -37,6 +37,10 @@ public class Paint {
|
|||
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() {
|
||||
return native_get_color(paint);
|
||||
}
|
||||
|
|
|
@ -84,6 +84,7 @@ public class LayoutInflater {
|
|||
context = new ContextThemeWrapper(context, themeResId);
|
||||
}
|
||||
ta.recycle();
|
||||
constructor.setAccessible(true);
|
||||
View view_instance = (View)constructor.newInstance(context, attrs);
|
||||
|
||||
return view_instance;
|
||||
|
|
|
@ -67,4 +67,6 @@ public interface MenuItem {
|
|||
public CharSequence getTitleCondensed();
|
||||
|
||||
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.
|
||||
// ViewPager overrides removeView to call removeViewInLayout
|
||||
protected void removeViewInternal(View child) {
|
||||
if (child.parent != this)
|
||||
if (child == null || child.parent != this)
|
||||
return;
|
||||
child.parent = null;
|
||||
children.remove(child);
|
||||
|
|
|
@ -539,6 +539,12 @@ public class PopupMenu {
|
|||
// TODO Auto-generated method stub
|
||||
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;
|
||||
|
||||
public class Spinner extends AbsSpinner {
|
||||
private Observer observer = new Observer();
|
||||
private Observer observer;
|
||||
|
||||
public Spinner(Context context) {
|
||||
super(context);
|
||||
|
@ -27,6 +27,8 @@ public class Spinner extends AbsSpinner {
|
|||
protected native void native_setAdapter(long widget, SpinnerAdapter adapter);
|
||||
|
||||
public void setAdapter(SpinnerAdapter adapter) {
|
||||
if (observer == null)
|
||||
observer = new Observer();
|
||||
SpinnerAdapter oldAdapter = getAdapter();
|
||||
if (oldAdapter != null)
|
||||
oldAdapter.unregisterDataSetObserver(observer);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue