Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(877)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/preferences/SearchEngineAdapter.java

Issue 1138183003: Use native radiobutton for Default Search Engine picker dialog. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/android/java/res/layout/search_engine.xml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/preferences/SearchEngineAdapter.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/SearchEngineAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/SearchEngineAdapter.java
index 494911b0eed47948cf821c6923cf7cc5c9d7a29b..c9d8dadf9e87115b449893d5baf613cedc8123b4 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/SearchEngineAdapter.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/SearchEngineAdapter.java
@@ -8,6 +8,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Resources;
+import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.text.SpannableString;
@@ -168,8 +169,18 @@ public class SearchEngineAdapter extends BaseAdapter implements LoadListener, On
view.setOnClickListener(this);
view.setTag(position);
+ // TODO(finnur): There's a tinting bug in the AppCompat lib (see http://crbug.com/474695),
+ // which causes the first radiobox to always appear selected, even if it is not. It is being
+ // addressed, but in the meantime we should use the native RadioButton instead.
RadioButton radioButton = (RadioButton) view.findViewById(R.id.radiobutton);
+ // On Lollipop this removes the redundant animation ring on selection but on older versions
+ // it would cause the radio button to disappear.
+ // TODO(finnur): Remove the encompassing if statement once we go back to using the AppCompat
+ // control.
boolean selected = position == mSelectedSearchEnginePosition;
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ radioButton.setBackgroundResource(0);
+ }
radioButton.setChecked(selected);
TextView description = (TextView) view.findViewById(R.id.description);
« no previous file with comments | « chrome/android/java/res/layout/search_engine.xml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698