android/GameAdapter: Fix the getColor calls using the wrong context
This commit is contained in:
parent
1cfa0e97a2
commit
fc0ace03d2
@ -16,7 +16,6 @@ import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import org.citra.citra_emu.CitraApplication;
|
||||
import org.citra.citra_emu.R;
|
||||
import org.citra.citra_emu.activities.EmulationActivity;
|
||||
import org.citra.citra_emu.model.GameDatabase;
|
||||
@ -101,7 +100,8 @@ public final class GameAdapter extends RecyclerView.Adapter<GameViewHolder> impl
|
||||
holder.company = mCursor.getString(GameDatabase.GAME_COLUMN_COMPANY);
|
||||
|
||||
final int backgroundColorId = isValidGame(holder.path) ? R.color.card_view_background : R.color.card_view_disabled;
|
||||
holder.setBackgroundColor(ContextCompat.getColor(CitraApplication.getAppContext(), backgroundColorId));
|
||||
View itemView = holder.getItemView();
|
||||
itemView.setBackgroundColor(ContextCompat.getColor(itemView.getContext(), backgroundColorId));
|
||||
} else {
|
||||
Log.error("[GameAdapter] Can't bind view; Cursor is not valid.");
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ public class GameViewHolder extends RecyclerView.ViewHolder {
|
||||
textFileName = itemView.findViewById(R.id.text_filename);
|
||||
}
|
||||
|
||||
public void setBackgroundColor(int color){
|
||||
itemView.setBackgroundColor(color);
|
||||
public View getItemView() {
|
||||
return itemView;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user