Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.androidbie.differenctviewonrecyclerviewitem;
- import android.support.v7.widget.RecyclerView;
- import android.view.View;
- import android.widget.Button;
- import android.widget.EditText;
- import android.widget.LinearLayout;
- import android.widget.TextView;
- /**
- * Created by putuguna on 05/01/17.
- */
- public class ViewAdapter {
- /**
- * first, create Input ViewHolder of username and password
- */
- public class InputUsernameAndPasswordViewHolder extends RecyclerView.ViewHolder{
- public EditText etUsername;
- public EditText etPassword;
- public Button btnAddToList;
- public Button btnDone;
- public InputUsernameAndPassword(View itemView) {
- super(itemView);
- etPassword = (EditText) itemView.findViewById(R.id.edit_text_password);
- etUsername = (EditText) itemView.findViewById(R.id.edit_text_username);
- btnAddToList = (Button) itemView.findViewById(R.id.button_add_to_list);
- btnDone = (Button) itemView.findViewById(R.id.button_done);
- }
- }
- /**
- * Second, create loading view holder to display loading view after finish input data
- */
- public class LoadingPleaseWaitViewHolder extends RecyclerView.ViewHolder{
- public LinearLayout llLoading;
- public LoadingPleaseWait(View itemView) {
- super(itemView);
- llLoading = (LinearLayout) itemView.findViewById(R.id.ll_progressbar);
- }
- }
- /**
- * Third, create List ViewHolder to display list of username and password
- */
- public class DetailListPasswordAndUsernameViewHolder extends RecyclerView.ViewHolder{
- public TextView tvUsername;
- public TextView tvPassword;
- private LinearLayout llDetailUsernamePassword;
- public DetailListPasswordAndUsername(View itemView) {
- super(itemView);
- tvUsername = (TextView) itemView.findViewById(R.id.textview_username);
- tvPassword = (TextView) itemView.findViewById(R.id.textview_password);
- llDetailUsernamePassword = (LinearLayout) itemView.findViewById(R.id.ll_detail_username_password);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement