diff options
author | Bryson Steck <steck.bryson@gmail.com> | 2021-05-04 23:31:34 -0600 |
---|---|---|
committer | Bryson Steck <steck.bryson@gmail.com> | 2021-05-04 23:31:34 -0600 |
commit | b202760cdc2b443fd07dcee593ed7f3e09d6b77b (patch) | |
tree | 959051ae90e51212590db5b513e4de93261136cf /app/src/main/java/com/example/wiimmterfaceandroid/RecentCodesAdapter.java | |
parent | 50dfc57c61a01dc20a42129246b458bf90e26154 (diff) | |
download | wiimmfi-watcher-b202760cdc2b443fd07dcee593ed7f3e09d6b77b.tar wiimmfi-watcher-b202760cdc2b443fd07dcee593ed7f3e09d6b77b.tar.gz wiimmfi-watcher-b202760cdc2b443fd07dcee593ed7f3e09d6b77b.tar.bz2 |
watched friend codes work
Diffstat (limited to 'app/src/main/java/com/example/wiimmterfaceandroid/RecentCodesAdapter.java')
-rw-r--r-- | app/src/main/java/com/example/wiimmterfaceandroid/RecentCodesAdapter.java | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/app/src/main/java/com/example/wiimmterfaceandroid/RecentCodesAdapter.java b/app/src/main/java/com/example/wiimmterfaceandroid/RecentCodesAdapter.java deleted file mode 100644 index 7d278de..0000000 --- a/app/src/main/java/com/example/wiimmterfaceandroid/RecentCodesAdapter.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.example.wiimmterfaceandroid; - -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.Button; -import android.widget.TextView; - -import androidx.annotation.NonNull; -import androidx.databinding.ObservableArrayList; -import androidx.recyclerview.widget.RecyclerView; - -import com.example.wiimmterfaceandroid.model.FriendCode; -import com.google.android.material.card.MaterialCardView; -import com.google.android.material.textview.MaterialTextView; - -import java.util.List; - -public class RecentCodesAdapter extends RecyclerView.Adapter<RecentCodesAdapter.ViewHolder>{ - ObservableArrayList<FriendCode> entries; - OnFriendCodeClicked listener; - public interface OnFriendCodeClicked { - public void onClick(FriendCode entry); - } - - public RecentCodesAdapter (ObservableArrayList<FriendCode> entries, OnFriendCodeClicked listener) { - this.entries = entries; - this.listener = listener; - } - - @NonNull - @Override - public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { - View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.recent_friend_codes_item, parent, false); - return new ViewHolder(view); - } - - @Override - public void onBindViewHolder(@NonNull ViewHolder holder, int position) { - Button fcButton = holder.itemView.findViewById(R.id.recent_friend_code_button); - FriendCode currentFC = entries.get(position); - fcButton.setText(currentFC.friendCode); - fcButton.setOnClickListener(view -> { - if (listener == null) return; - listener.onClick(currentFC); - }); - } - - @Override - public int getItemCount() { - return entries.size(); - } - - class ViewHolder extends RecyclerView.ViewHolder { - public ViewHolder(@NonNull View itemView) { - super(itemView); - } - } -} |