Advertisement
Guest User

Untitled

a guest
Jan 5th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.12 KB | None | 0 0
  1. package com.androidbie.differenctviewonrecyclerviewitem;
  2.  
  3. import android.support.v7.widget.RecyclerView;
  4. import android.view.View;
  5. import android.widget.Button;
  6. import android.widget.EditText;
  7. import android.widget.LinearLayout;
  8. import android.widget.TextView;
  9.  
  10. /**
  11. * Created by putuguna on 05/01/17.
  12. */
  13.  
  14. public class ViewAdapter {
  15.  
  16. /**
  17. * first, create Input ViewHolder of username and password
  18. */
  19. public class InputUsernameAndPasswordViewHolder extends RecyclerView.ViewHolder{
  20.  
  21. public EditText etUsername;
  22. public EditText etPassword;
  23. public Button btnAddToList;
  24. public Button btnDone;
  25.  
  26. public InputUsernameAndPassword(View itemView) {
  27. super(itemView);
  28.  
  29. etPassword = (EditText) itemView.findViewById(R.id.edit_text_password);
  30. etUsername = (EditText) itemView.findViewById(R.id.edit_text_username);
  31. btnAddToList = (Button) itemView.findViewById(R.id.button_add_to_list);
  32. btnDone = (Button) itemView.findViewById(R.id.button_done);
  33. }
  34. }
  35.  
  36. /**
  37. * Second, create loading view holder to display loading view after finish input data
  38. */
  39. public class LoadingPleaseWaitViewHolder extends RecyclerView.ViewHolder{
  40.  
  41. public LinearLayout llLoading;
  42.  
  43. public LoadingPleaseWait(View itemView) {
  44. super(itemView);
  45.  
  46. llLoading = (LinearLayout) itemView.findViewById(R.id.ll_progressbar);
  47. }
  48. }
  49.  
  50. /**
  51. * Third, create List ViewHolder to display list of username and password
  52. */
  53. public class DetailListPasswordAndUsernameViewHolder extends RecyclerView.ViewHolder{
  54.  
  55. public TextView tvUsername;
  56. public TextView tvPassword;
  57. private LinearLayout llDetailUsernamePassword;
  58.  
  59. public DetailListPasswordAndUsername(View itemView) {
  60. super(itemView);
  61.  
  62. tvUsername = (TextView) itemView.findViewById(R.id.textview_username);
  63. tvPassword = (TextView) itemView.findViewById(R.id.textview_password);
  64. llDetailUsernamePassword = (LinearLayout) itemView.findViewById(R.id.ll_detail_username_password);
  65. }
  66. }
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement