aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeAdapter.java
diff options
context:
space:
mode:
authorBryson Steck <steck.bryson@gmail.com>2021-05-30 16:58:39 -0600
committerBryson Steck <steck.bryson@gmail.com>2021-05-30 16:58:39 -0600
commite771101c6c390d13d8657a449ddf164db3c1aa30 (patch)
tree44d77d0da2fbeb66099132e7caa3d3fd4a32c34b /app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeAdapter.java
parent1ed362fdcac42fd2c18d1b580c8e20196564ba47 (diff)
downloadwiimmfi-watcher-e771101c6c390d13d8657a449ddf164db3c1aa30.tar
wiimmfi-watcher-e771101c6c390d13d8657a449ddf164db3c1aa30.tar.gz
wiimmfi-watcher-e771101c6c390d13d8657a449ddf164db3c1aa30.tar.bz2
recent friend codes now clears errortext if any
Diffstat (limited to 'app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeAdapter.java')
-rw-r--r--app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeAdapter.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeAdapter.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeAdapter.java
index ded5e65..53828f9 100644
--- a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeAdapter.java
+++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeAdapter.java
@@ -13,6 +13,7 @@ import androidx.databinding.ObservableArrayList;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.button.MaterialButton;
+import com.google.android.material.textview.MaterialTextView;
import java.util.ArrayList;
@@ -22,11 +23,13 @@ import me.brysonsteck.wiimmfiwatcher.wiimmfi.WiimmfiActivity;
public class WatchCodeAdapter extends RecyclerView.Adapter<WatchCodeAdapter.ViewHolder>{
ObservableArrayList<FriendCode> entries;
Context context;
+ MaterialTextView errorText;
ArrayList<String> recentCodes;
- public WatchCodeAdapter(Context context, ObservableArrayList<FriendCode> entries) {
+ public WatchCodeAdapter(Context context, ObservableArrayList<FriendCode> entries, MaterialTextView errorText) {
this.context = context;
this.entries = entries;
+ this.errorText = errorText;
this.recentCodes = new ArrayList<>();
}
@@ -50,6 +53,7 @@ public class WatchCodeAdapter extends RecyclerView.Adapter<WatchCodeAdapter.View
}
fcButton.setText(currentFC);
fcButton.setOnClickListener(view -> {
+ errorText.setText("");
Intent intent = new Intent(view.getContext(), WiimmfiActivity.class);
intent.putExtra("friendCode", currentFC);
context.startActivity(intent);