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 settings
This commit is contained in:
@@ -896,6 +896,15 @@ public class View implements Drawable.Callback {
|
||||
minHeight = a.getDimensionPixelSize(com.android.internal.R.styleable.View_minHeight, 0);
|
||||
}
|
||||
}
|
||||
onCreateDrawableState(0);
|
||||
}
|
||||
|
||||
protected int[] onCreateDrawableState(int extraSpace) {
|
||||
return new int[0];
|
||||
}
|
||||
|
||||
protected static int[] mergeDrawableStates(int[] curState, int[] newState) {
|
||||
return new int[0];
|
||||
}
|
||||
|
||||
public View findViewById(int id) {
|
||||
|
||||
@@ -7,6 +7,7 @@ import android.util.AttributeSet;
|
||||
public class ViewStub extends View {
|
||||
|
||||
private int layoutResource;
|
||||
private int inflatedId = View.NO_ID;
|
||||
|
||||
public ViewStub(Context context) {
|
||||
this(context, null, 0);
|
||||
@@ -28,6 +29,8 @@ public class ViewStub extends View {
|
||||
throw new IllegalStateException("ViewStub must have a valid layoutResource");
|
||||
ViewGroup parent = (ViewGroup) getParent();
|
||||
View view = LayoutInflater.from(getContext()).inflate(layoutResource, parent, false);
|
||||
if (inflatedId != View.NO_ID)
|
||||
view.setId(inflatedId);
|
||||
int index = parent.indexOfChild(this);
|
||||
parent.removeView(this);
|
||||
parent.addView(view, index, getLayoutParams());
|
||||
@@ -43,4 +46,8 @@ public class ViewStub extends View {
|
||||
setMeasuredDimension(0, 0);
|
||||
}
|
||||
|
||||
public void setInflatedId(int inflatedId) {
|
||||
this.inflatedId = inflatedId;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user