UX update and slight stability fix.

This commit is contained in:
Alex Hart
2021-01-05 10:16:46 -04:00
committed by Alan Evans
parent e2872d9af8
commit 46d412a6c3
3 changed files with 12 additions and 25 deletions

View File

@@ -64,7 +64,6 @@ final class AudioOutputAdapter extends RecyclerView.Adapter<AudioOutputAdapter.V
static class ViewHolder extends RecyclerView.ViewHolder implements CompoundButton.OnCheckedChangeListener {
private final TextView textView;
private final RadioButton radioButton;
private final Consumer<Integer> onPressed;
@@ -72,16 +71,14 @@ final class AudioOutputAdapter extends RecyclerView.Adapter<AudioOutputAdapter.V
public ViewHolder(@NonNull View itemView, @NonNull Consumer<Integer> onPressed) {
super(itemView);
this.textView = itemView.findViewById(R.id.text);
this.radioButton = itemView.findViewById(R.id.radio);
this.onPressed = onPressed;
}
@CallSuper
void bind(@NonNull WebRtcAudioOutput audioOutput, @Nullable WebRtcAudioOutput selected) {
textView.setText(audioOutput.getLabelRes());
textView.setCompoundDrawablesRelativeWithIntrinsicBounds(audioOutput.getIconRes(), 0, 0, 0);
radioButton.setText(audioOutput.getLabelRes());
radioButton.setCompoundDrawablesRelativeWithIntrinsicBounds(audioOutput.getIconRes(), 0, 0, 0);
radioButton.setOnCheckedChangeListener(null);
radioButton.setChecked(audioOutput == selected);
radioButton.setOnCheckedChangeListener(this);