Loading app/src/main/java/org/mozilla/fenix/settings/search/AddSearchEngineFragment.kt +4 −2 Original line number Diff line number Diff line Loading @@ -93,7 +93,7 @@ class AddSearchEngineFragment : Fragment(), CompoundButton.OnCheckedChangeListen availableEngines.forEachIndexed(setupSearchEngineItem) val engineItem = makeCustomButton(layoutInflater) val engineItem = makeCustomButton(layoutInflater, res = resources) engineItem.id = CUSTOM_INDEX engineItem.radio_button.isChecked = selectedIndex == CUSTOM_INDEX engineViews.add(engineItem) Loading Loading @@ -250,11 +250,12 @@ class AddSearchEngineFragment : Fragment(), CompoundButton.OnCheckedChangeListen toggleCustomForm(selectedIndex == -1) } private fun makeCustomButton(layoutInflater: LayoutInflater): View { private fun makeCustomButton(layoutInflater: LayoutInflater, res: Resources): View { val wrapper = layoutInflater .inflate(R.layout.custom_search_engine_radio_button, null) as ConstraintLayout wrapper.setOnClickListener { wrapper.radio_button.isChecked = true } wrapper.radio_button.setOnCheckedChangeListener(this) wrapper.minHeight = res.getDimensionPixelSize(R.dimen.radio_button_preference_height) return wrapper } Loading @@ -280,6 +281,7 @@ class AddSearchEngineFragment : Fragment(), CompoundButton.OnCheckedChangeListen engineIcon.setBounds(0, 0, iconSize, iconSize) wrapper.engine_icon.setImageDrawable(engineIcon) wrapper.overflow_menu.visibility = View.GONE wrapper.minHeight = res.getDimensionPixelSize(R.dimen.radio_button_preference_height) return wrapper } Loading app/src/main/res/layout/custom_search_engine_radio_button.xml +5 −3 Original line number Diff line number Diff line Loading @@ -20,7 +20,8 @@ android:textAppearance="?android:attr/textAppearanceListItem" android:layout_marginStart="@dimen/search_bar_search_engine_icon_padding" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent"/> <TextView android:id="@+id/engine_text" android:textColor="?primaryText" Loading @@ -29,8 +30,9 @@ android:layout_marginStart="@dimen/search_bar_search_icon_margin" android:layout_marginEnd="@dimen/radio_button_padding_horizontal" android:text="@string/search_add_custom_engine_label_other" android:textSize="16sp" app:layout_constraintStart_toEndOf="@id/radio_button" app:layout_constraintTop_toTopOf="@id/radio_button" app:layout_constraintBottom_toBottomOf="@id/radio_button" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" /> </androidx.constraintlayout.widget.ConstraintLayout> Loading
app/src/main/java/org/mozilla/fenix/settings/search/AddSearchEngineFragment.kt +4 −2 Original line number Diff line number Diff line Loading @@ -93,7 +93,7 @@ class AddSearchEngineFragment : Fragment(), CompoundButton.OnCheckedChangeListen availableEngines.forEachIndexed(setupSearchEngineItem) val engineItem = makeCustomButton(layoutInflater) val engineItem = makeCustomButton(layoutInflater, res = resources) engineItem.id = CUSTOM_INDEX engineItem.radio_button.isChecked = selectedIndex == CUSTOM_INDEX engineViews.add(engineItem) Loading Loading @@ -250,11 +250,12 @@ class AddSearchEngineFragment : Fragment(), CompoundButton.OnCheckedChangeListen toggleCustomForm(selectedIndex == -1) } private fun makeCustomButton(layoutInflater: LayoutInflater): View { private fun makeCustomButton(layoutInflater: LayoutInflater, res: Resources): View { val wrapper = layoutInflater .inflate(R.layout.custom_search_engine_radio_button, null) as ConstraintLayout wrapper.setOnClickListener { wrapper.radio_button.isChecked = true } wrapper.radio_button.setOnCheckedChangeListener(this) wrapper.minHeight = res.getDimensionPixelSize(R.dimen.radio_button_preference_height) return wrapper } Loading @@ -280,6 +281,7 @@ class AddSearchEngineFragment : Fragment(), CompoundButton.OnCheckedChangeListen engineIcon.setBounds(0, 0, iconSize, iconSize) wrapper.engine_icon.setImageDrawable(engineIcon) wrapper.overflow_menu.visibility = View.GONE wrapper.minHeight = res.getDimensionPixelSize(R.dimen.radio_button_preference_height) return wrapper } Loading
app/src/main/res/layout/custom_search_engine_radio_button.xml +5 −3 Original line number Diff line number Diff line Loading @@ -20,7 +20,8 @@ android:textAppearance="?android:attr/textAppearanceListItem" android:layout_marginStart="@dimen/search_bar_search_engine_icon_padding" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent"/> <TextView android:id="@+id/engine_text" android:textColor="?primaryText" Loading @@ -29,8 +30,9 @@ android:layout_marginStart="@dimen/search_bar_search_icon_margin" android:layout_marginEnd="@dimen/radio_button_padding_horizontal" android:text="@string/search_add_custom_engine_label_other" android:textSize="16sp" app:layout_constraintStart_toEndOf="@id/radio_button" app:layout_constraintTop_toTopOf="@id/radio_button" app:layout_constraintBottom_toBottomOf="@id/radio_button" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" /> </androidx.constraintlayout.widget.ConstraintLayout>