S
Stefan Ram
For example, in Android, there is this interface specification:
public void setLayoutParams (ViewGroup.LayoutParams params)
Set the layout parameters associated with this view. ...
params The layout parameters for this view, ...
. An example usage:
final android.widget.LinearLayout.LayoutParams parameters
= new android.widget.LinearLayout.LayoutParams
( android.view.ViewGroup.LayoutParams.MATCH_PARENT,
android.view.ViewGroup.LayoutParams.MATCH_PARENT, 1f );
Main.this.increment.setLayoutParams( parameters );
I think there is something missing in the documentation:
Can the »parameters« object be reused to supply the same
parameter values to other calls of »setLayoutParams« with
other target objects? Or even with other parameter values?
Has setLayoutParams made its own copy of the parameter values,
or has it just stored a reference to the parameters object?
This is like a kind of ownership: Who owns »parameters«
after the call to »setLayoutParams«? The caller or the callee?
Or is there a common standard in the Java world for this?
public void setLayoutParams (ViewGroup.LayoutParams params)
Set the layout parameters associated with this view. ...
params The layout parameters for this view, ...
. An example usage:
final android.widget.LinearLayout.LayoutParams parameters
= new android.widget.LinearLayout.LayoutParams
( android.view.ViewGroup.LayoutParams.MATCH_PARENT,
android.view.ViewGroup.LayoutParams.MATCH_PARENT, 1f );
Main.this.increment.setLayoutParams( parameters );
I think there is something missing in the documentation:
Can the »parameters« object be reused to supply the same
parameter values to other calls of »setLayoutParams« with
other target objects? Or even with other parameter values?
Has setLayoutParams made its own copy of the parameter values,
or has it just stored a reference to the parameters object?
This is like a kind of ownership: Who owns »parameters«
after the call to »setLayoutParams«? The caller or the callee?
Or is there a common standard in the Java world for this?