I have the following lines of code in a android lib:
method CropImageView.init(c: Context);
begin
mImageView := new ImageView( c );
mImageView.setLayoutParams( new ViewGroup.LayoutParams( -1, -1 ) );
...
With Elements 9.0 the lib compiles without errors.
Now with 9.1 the following error occurs: (E319) No overloaded constructor with 3 parameters for type “ViewGroup.LayoutParams”
I don’t understand why because i set only 2 parameters ( -1, -1 ).
method CropImageView.init(c: Context);
begin
mImageView := new ImageView( c );
mImageView.setLayoutParams( new ViewGroup.LayoutParams( -1 ) );
...
In this case i have the following error: No overloaded constructor with these parameters for type “ViewGroup.LayoutParams”, best matching overload is "constructor (width: Integer; height: Integer)" parameter 1 is “CropImageView” should be “Integer”
I checked with different versions, it seems the error occurs on all 9.x versions.
I tested with 9.0.97.2071, 9.1.99.2141, 9.1.99.2151 and the 9.2.0.2157 beta.
Now i downgraded to version 8.3.95.2031 and the library compiles without error.
Btw, i’m using Java 1.8.0.131 64 bit if this is important.
namespace Test;
interface
uses
java.util,
android.app,
android.content,
android.os,
android.util,
android.view,
android.widget;
type
// Test = public class(FrameLayout)
Test = public class(Activity)
public
method init;
end;
implementation
method Test.init;
begin
var mImageView := new ImageView( nil );
mImageView.setLayoutParams( new ViewGroup.LayoutParams( -1, -1 ) );
end;
end.
If class is Activity then it compiles without error.
If class is FrameLayout then the error occurs.