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
View.onMeasure: handle MEASURE_SPEC_AT_MOST properly
We decide between simple widgets which handles MEASURE_SPEC_AT_MOST the same way as MEASURE_SPEC_EXACTLY, and complex widgets which handles MEASURE_SPEC_AT_MOST by measuring the content
This commit is contained in:
@@ -33,6 +33,11 @@ public class ImageView extends View {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
native_measure(widget, widthMeasureSpec, heightMeasureSpec, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected native long native_constructor(Context context, AttributeSet attrs);
|
||||
protected native void native_setPixbuf(long pixbuf);
|
||||
|
||||
@@ -66,6 +66,11 @@ public class TextView extends View {
|
||||
setText(getContext().getResources().getText(resId));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
native_measure(widget, widthMeasureSpec, heightMeasureSpec, true);
|
||||
}
|
||||
|
||||
private native final void native_set_markup(int bool);
|
||||
|
||||
public native final void native_setText(String text);
|
||||
|
||||
Reference in New Issue
Block a user