Skip to content

Commit

Permalink
feature/added submit button listener
Browse files Browse the repository at this point in the history
  • Loading branch information
IbrahimSaeedPurdue authored and IbrahimSaeedPurdue committed Feb 11, 2021
1 parent 365613b commit 4172104
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.sf.stormwaterutilityandroid;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import androidx.appcompat.app.AppCompatActivity;
Expand Down Expand Up @@ -31,15 +32,14 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sample_fordm);
recyclerView = findViewById(R.id.recyclerView2);

setupForm();
}


private void setupForm() {
formBuilder = new FormBuilder(this, recyclerView);



FormElementTextSingleLine projectTextField = FormElementTextSingleLine.createInstance().setTitle("Project/Contact:").setHint("Enter text here");
FormElementTextSingleLine addressTextField = FormElementTextSingleLine.createInstance().setTitle("Address/Lot#(s):").setHint("Enter text here");
FormElementTextSingleLine inspectorTextField = FormElementTextSingleLine.createInstance().setTitle("Inspector:").setHint("Enter name here");
Expand Down Expand Up @@ -96,6 +96,15 @@ private void setupForm() {

FormElementTextMultiLine evidenceTextField = FormElementTextMultiLine.createInstance().setTitle("Evidence of off-site sediment/pollutants.\nHere is a description of type and location:").setHint("Enter text here");

Button submitButton = new Button(getApplicationContext());
submitButton.setText("Submit");
submitButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {

}
});

List<BaseFormElement> formItems = new ArrayList<>();

formItems.add(projectTextField);
Expand All @@ -122,7 +131,8 @@ private void setupForm() {

formItems.add(evidenceTextField);

formBuilder.addFormElements(formItems);

formBuilder.addFormElements(formItems);
recyclerView.addView(submitButton);
}
}

0 comments on commit 4172104

Please sign in to comment.