1010import android .view .ViewGroup ;
1111import android .widget .CheckBox ;
1212import android .widget .ImageView ;
13- import android .widget .LinearLayout ;
1413import android .widget .RadioButton ;
1514import android .widget .RadioGroup ;
1615import android .widget .TextView ;
2524import androidx .preference .PreferenceViewHolder ;
2625
2726import org .schabi .newpipe .R ;
27+ import org .schabi .newpipe .databinding .ListRadioIconItemBinding ;
28+ import org .schabi .newpipe .databinding .SingleChoiceDialogViewBinding ;
2829import org .schabi .newpipe .player .MainPlayer ;
2930import org .schabi .newpipe .player .NotificationConstants ;
3031import org .schabi .newpipe .util .DeviceUtils ;
@@ -189,13 +190,12 @@ void updateInfo() {
189190
190191 void openActionChooserDialog () {
191192 final LayoutInflater inflater = LayoutInflater .from (getContext ());
192- final LinearLayout rootLayout = (LinearLayout ) inflater .inflate (
193- R .layout .single_choice_dialog_view , null , false );
194- final RadioGroup radioGroup = rootLayout .findViewById (android .R .id .list );
193+ final SingleChoiceDialogViewBinding binding =
194+ SingleChoiceDialogViewBinding .inflate (inflater );
195195
196196 final AlertDialog alertDialog = new AlertDialog .Builder (getContext ())
197197 .setTitle (SLOT_TITLES [i ])
198- .setView (radioGroup )
198+ .setView (binding . getRoot () )
199199 .setCancelable (true )
200200 .create ();
201201
@@ -207,8 +207,8 @@ void openActionChooserDialog() {
207207
208208 for (int id = 0 ; id < NotificationConstants .SLOT_ALLOWED_ACTIONS [i ].length ; ++id ) {
209209 final int action = NotificationConstants .SLOT_ALLOWED_ACTIONS [i ][id ];
210- final RadioButton radioButton
211- = ( RadioButton ) inflater . inflate ( R . layout . list_radio_icon_item , null );
210+ final RadioButton radioButton = ListRadioIconItemBinding . inflate ( inflater )
211+ . getRoot ( );
212212
213213 // if present set action icon with correct color
214214 if (NotificationConstants .ACTION_ICONS [action ] != 0 ) {
@@ -230,7 +230,7 @@ void openActionChooserDialog() {
230230 radioButton .setLayoutParams (new RadioGroup .LayoutParams (
231231 ViewGroup .LayoutParams .MATCH_PARENT , ViewGroup .LayoutParams .WRAP_CONTENT ));
232232 radioButton .setOnClickListener (radioButtonsClickListener );
233- radioGroup .addView (radioButton );
233+ binding . list .addView (radioButton );
234234 }
235235 alertDialog .show ();
236236
0 commit comments