diff options
author | Bryson Steck <steck.bryson@gmail.com> | 2021-05-18 20:48:17 -0600 |
---|---|---|
committer | Bryson Steck <steck.bryson@gmail.com> | 2021-05-18 20:48:17 -0600 |
commit | 11aa7c75e16d6819d0681f408c720cbc6a6754ba (patch) | |
tree | 0b9ca87486a52bcdaf3a964406132c12146e3b4f /app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeAdapter.java | |
parent | 39e2d4248878b4b8e501c271d8df5f05f0179b97 (diff) | |
download | wiimmfi-watcher-11aa7c75e16d6819d0681f408c720cbc6a6754ba.tar wiimmfi-watcher-11aa7c75e16d6819d0681f408c720cbc6a6754ba.tar.gz wiimmfi-watcher-11aa7c75e16d6819d0681f408c720cbc6a6754ba.tar.bz2 |
did a ton of stuff i dont remember like a dark mode and small enhancements
Diffstat (limited to 'app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeAdapter.java')
-rw-r--r-- | app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeAdapter.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeAdapter.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeAdapter.java index 715dce8..ded5e65 100644 --- a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeAdapter.java +++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeAdapter.java @@ -2,6 +2,8 @@ package me.brysonsteck.wiimmfiwatcher; import android.content.Context; import android.content.Intent; +import android.content.res.Configuration; +import android.graphics.Color; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -39,6 +41,13 @@ public class WatchCodeAdapter extends RecyclerView.Adapter<WatchCodeAdapter.View public void onBindViewHolder(@NonNull ViewHolder holder, int position) { String currentFC = entries.get(position).friendCode; MaterialButton fcButton = holder.itemView.findViewById(R.id.recent_friend_code_button); + int nightModeFlags = + context.getResources().getConfiguration().uiMode & + Configuration.UI_MODE_NIGHT_MASK; + if (nightModeFlags == Configuration.UI_MODE_NIGHT_YES) { + // Night mode is active, we're using dark theme + fcButton.setBackgroundColor(Color.parseColor("#313131")); + } fcButton.setText(currentFC); fcButton.setOnClickListener(view -> { Intent intent = new Intent(view.getContext(), WiimmfiActivity.class); |