I have my own layout
public class PersonView extends LinearLayout{
public PersonView(Context context, AttributeSet attrs) {
super(context, attrs);
initUi(context);
}
public PersonView(Context context) {
super(context);
initUi(context);
}
private void initUi(Context context){
LayoutInflater.from(context).inflate(R.layout.person_view, this, true);
profilePicture = (ImageView)findViewById(R.id.profile_picture);
...
}
Layout is defined in xml
<merge xmlns:android="http://schemas.android.com/apk/res/android">
...
Then i use it in another layout
Case 1
<my.package.PersonView android:layout_margin="10dp" .../>
Case 2
// In this case android:layout_margin is NOT specified so I want for my PersonView some default value should be used (say 5pt)
<my.package.PersonView .../>
What should I do for my custom PersonView layout to achieve Case 2?
source
share