Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9e42e9b4 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[Expressive Design] Add null check for icon view in dropdown list." into main

parents 72f667e3 11d1c56f
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -24,8 +24,10 @@ import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.android.settingslib.widget.SettingsSpinnerPreference.Style;
import com.android.settingslib.widget.spinner.R;

@@ -71,7 +73,9 @@ public class SettingsSpinnerAdapter<T> extends ArrayAdapter<T> {
        }
        TextView textView = view.findViewById(android.R.id.text1);
        ImageView iconView = view.findViewById(android.R.id.icon);
        if (iconView != null) {
            iconView.setVisibility((position == mSelectedPosition) ? View.VISIBLE : View.GONE);
        }
        String item = (String) getItem(position);
        textView.setText(item);
        return view;