Skip to content

Create a Custom Element in a Fragment using NexusDialog #70

Description

@ThilinaF

I want to create custom elements through a fragment using nexusDialog Library (https://github.com/dkharrat/NexusDialog ) i created a custom element using the example given from the developer but i have no idea how to generate those custom components in fragment not activtiy. i want to pass data into edit text and get values of edittext to the fragment using the library

here is my code

Custom Component


 public class EditTextComp extends FormElementController {
    EditText editText = null;

    TextView textView = null;

    public EditTextComp(Context context) {
        super(context, null);

    }


    @Override
    protected View createView() {
        return createComponent();
    }

    @Override
    public void refresh() {

    }

    @Override
    public void setError(String message) {

    }




    private View createComponent() {

        LayoutInflater inflater = LayoutInflater.from(getContext());
        return inflater.inflate(R.layout.compound_comp_edit_text, null);

    }

    public EditText getEditText() {
        return (EditText) getView().findViewById(R.id.editText);
    }

}

how can i create this in a fragment?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions