Skip to content

Instantly share code, notes, and snippets.

@fanjavaid
Created September 1, 2017 03:42
Show Gist options
  • Save fanjavaid/7d06a329ea36b6a22d3502ab1b1c0aa1 to your computer and use it in GitHub Desktop.
Save fanjavaid/7d06a329ea36b6a22d3502ab1b1c0aa1 to your computer and use it in GitHub Desktop.
public class PropertyDetailFragment extends Fragment {
public void addProperty() {
final LayoutInflater inflater = LayoutInflater.from(getActivity());
final ViewKosFieldBinding viewBinding = DataBindingUtil.inflate(inflater, R.layout.view_kos_field, null, false);
viewBinding.imageRemoveField.setVisibility(View.VISIBLE);
viewBinding.imageRemoveField.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mLayoutFieldKos.removeView(viewBinding.getRoot());
}
});
mLayoutFieldKos.addView(viewBinding.getRoot());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment