Separate dropdown popups from settings pages
This commit is contained in:
@@ -123,7 +123,8 @@ class LogDisplayFragment : Fragment(R.layout.fragment_log_display) {
|
||||
|
||||
private fun LinearLayout.addDropdown(label: String, values: List<String>, selected: Int, onSelected: (Int) -> Unit) {
|
||||
addView(TextView(context).apply { text = label })
|
||||
addView(Spinner(context).apply {
|
||||
addView(Spinner(context, Spinner.MODE_DROPDOWN).apply {
|
||||
setPopupBackgroundDrawable(context.getDrawable(R.drawable.dropdown_popup_background))
|
||||
adapter = ArrayAdapter(context, android.R.layout.simple_spinner_dropdown_item, values)
|
||||
setSelection(selected)
|
||||
onItemSelectedListener = object : android.widget.AdapterView.OnItemSelectedListener {
|
||||
|
||||
Reference in New Issue
Block a user