Advertisement
rakkagaming

signupFragment

Sep 17th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.85 KB | None | 0 0
  1. package mah.thdta3.robin.android.assignment1;
  2.  
  3.  
  4. import android.os.Bundle;
  5. import android.app.Fragment;
  6. import android.util.Log;
  7. import android.view.LayoutInflater;
  8. import android.view.View;
  9. import android.view.ViewGroup;
  10. import android.widget.Button;
  11. import android.widget.EditText;
  12.  
  13.  
  14. /**
  15. * A simple {@link Fragment} subclass.
  16. */
  17. public class SignupFragment extends Fragment {
  18.  
  19. private Controller controller;
  20. private EditText username;
  21. private EditText password;
  22. private EditText repeatPassword;
  23. private EditText firstname;
  24. private EditText surname;
  25. private Button signupBtn;
  26.  
  27. public SignupFragment() {
  28. // Required empty public constructor
  29. }
  30.  
  31.  
  32. @Override
  33. public View onCreateView(LayoutInflater inflater, ViewGroup container,
  34. Bundle savedInstanceState) {
  35. View v = inflater.inflate(R.layout.fragment_login, container, false);
  36. initializeComponents(v);
  37. initializeListeners();
  38. return v;
  39. }
  40.  
  41. private void initializeListeners() {
  42. signupBtn.setOnClickListener(new View.OnClickListener() {
  43. @Override
  44. public void onClick(View v) {
  45. //Send the input data and create a new User
  46.  
  47. }
  48. });
  49. }
  50.  
  51. private void initializeComponents(View v) {
  52. username = (EditText) v.findViewById(R.id.signupName);
  53. password = (EditText) v.findViewById(R.id.signupPassword);
  54. repeatPassword = (EditText) v.findViewById(R.id.signupRepeatPassword);
  55. firstname = (EditText) v.findViewById(R.id.signupFirstname);
  56. surname = (EditText) v.findViewById(R.id.signupSurname);
  57. signupBtn = (Button) v.findViewById(R.id.signupSignup);
  58. }
  59.  
  60.  
  61. public void setController(Controller controller) {
  62. this.controller = controller;
  63. }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement