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
use AndroidLayout class also in View implementation
drop the onMeasure hack from WrapperWidget
This commit is contained in:
committed by
Julian Winkler
parent
3c03223085
commit
0a8b8a3874
@@ -88,6 +88,7 @@ public class Context extends Object {
|
||||
InputStream inStream = ClassLoader.getSystemClassLoader().getResourceAsStream("AndroidManifest.xml");
|
||||
try {
|
||||
manifest = AndroidManifestBlock.load(inStream);
|
||||
application_info.targetSdkVersion = manifest.getTargetSdkVersion();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -809,9 +809,10 @@ public class View extends Object {
|
||||
|
||||
private int oldWidthMeasureSpec;
|
||||
private int oldHeightMeasureSpec;
|
||||
private boolean layoutRequested;
|
||||
private boolean layoutRequested = true;
|
||||
private int oldWidth;
|
||||
private int oldHeight;
|
||||
private boolean haveCustomMeasure;
|
||||
|
||||
public View() {
|
||||
this(Context.this_application);
|
||||
@@ -951,7 +952,10 @@ public class View extends Object {
|
||||
};
|
||||
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
native_measure(widget, widthMeasureSpec, heightMeasureSpec, false);
|
||||
if (haveCustomMeasure) // calling native_measure here would create infinite loop
|
||||
setMeasuredDimension(getDefaultSize(getSuggestedMinimumWidth(), widthMeasureSpec), getDefaultSize(getSuggestedMinimumHeight(), heightMeasureSpec));
|
||||
else
|
||||
native_measure(widget, widthMeasureSpec, heightMeasureSpec, false);
|
||||
}
|
||||
|
||||
public void setPressed(boolean pressed) {
|
||||
@@ -1121,10 +1125,10 @@ public class View extends Object {
|
||||
}
|
||||
|
||||
protected int getSuggestedMinimumHeight() {
|
||||
return 50;
|
||||
return 10;
|
||||
}
|
||||
protected int getSuggestedMinimumWidth() {
|
||||
return 100;
|
||||
return 10;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user