Browse Source

Switch out "Android Search" for better known Ask.com search

master
Anthony Restaino 10 years ago
parent
commit
0a4f650869
  1. BIN
      assets/ask.png
  2. BIN
      res/mipmap-mdpi/ic_launcher.png
  3. 14
      src/acr/browser/lightning/BrowserActivity.java
  4. 2
      src/acr/browser/lightning/Constants.java
  5. 6
      src/acr/browser/lightning/GeneralSettingsActivity.java
  6. 4
      src/acr/browser/lightning/LightningView.java

BIN
assets/ask.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

BIN
res/mipmap-mdpi/ic_launcher.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

14
src/acr/browser/lightning/BrowserActivity.java

@ -278,14 +278,11 @@ public class BrowserActivity extends ActionBarActivity implements BrowserControl
mSearch = (AutoCompleteTextView) mActionBar.getCustomView().findViewById(R.id.search); mSearch = (AutoCompleteTextView) mActionBar.getCustomView().findViewById(R.id.search);
mUntitledTitle = (String) this.getString(R.string.untitled); mUntitledTitle = (String) this.getString(R.string.untitled);
mDeleteIcon = getResources().getDrawable(R.drawable.ic_action_delete); mDeleteIcon = getResources().getDrawable(R.drawable.ic_action_delete);
mDeleteIcon.setBounds(0, 0, Utils.convertDpToPixels(24), mDeleteIcon.setBounds(0, 0, Utils.convertDpToPixels(24), Utils.convertDpToPixels(24));
Utils.convertDpToPixels(24));
mRefreshIcon = getResources().getDrawable(R.drawable.ic_action_refresh); mRefreshIcon = getResources().getDrawable(R.drawable.ic_action_refresh);
mRefreshIcon.setBounds(0, 0, Utils.convertDpToPixels(24), mRefreshIcon.setBounds(0, 0, Utils.convertDpToPixels(24), Utils.convertDpToPixels(24));
Utils.convertDpToPixels(24));
mCopyIcon = getResources().getDrawable(R.drawable.ic_action_copy); mCopyIcon = getResources().getDrawable(R.drawable.ic_action_copy);
mCopyIcon.setBounds(0, 0, Utils.convertDpToPixels(24), mCopyIcon.setBounds(0, 0, Utils.convertDpToPixels(24), Utils.convertDpToPixels(24));
Utils.convertDpToPixels(24));
mIcon = mRefreshIcon; mIcon = mRefreshIcon;
SearchClass search = new SearchClass(); SearchClass search = new SearchClass();
mSearch.setCompoundDrawables(null, null, mRefreshIcon, null); mSearch.setCompoundDrawables(null, null, mRefreshIcon, null);
@ -684,8 +681,7 @@ public class BrowserActivity extends ActionBarActivity implements BrowserControl
} }
private void setNavigationDrawerWidth() { private void setNavigationDrawerWidth() {
int width = getResources().getDisplayMetrics().widthPixels int width = getResources().getDisplayMetrics().widthPixels - Utils.convertDpToPixels(56);
- Utils.convertDpToPixels(56);
int maxWidth; int maxWidth;
if (isTablet()) { if (isTablet()) {
maxWidth = Utils.convertDpToPixels(320); maxWidth = Utils.convertDpToPixels(320);
@ -798,7 +794,7 @@ public class BrowserActivity extends ActionBarActivity implements BrowserControl
mSearchText = Constants.GOOGLE_SEARCH; mSearchText = Constants.GOOGLE_SEARCH;
break; break;
case 2: case 2:
mSearchText = Constants.ANDROID_SEARCH; mSearchText = Constants.ASK_SEARCH;
break; break;
case 3: case 3:
mSearchText = Constants.BING_SEARCH; mSearchText = Constants.BING_SEARCH;

2
src/acr/browser/lightning/Constants.java

@ -20,7 +20,7 @@ public final class Constants {
public static final String DUCK_LITE_SEARCH = "https://duckduckgo.com/lite/?t=lightning&q="; public static final String DUCK_LITE_SEARCH = "https://duckduckgo.com/lite/?t=lightning&q=";
public static final String STARTPAGE_MOBILE_SEARCH = "https://startpage.com/do/m/mobilesearch?language=english&query="; public static final String STARTPAGE_MOBILE_SEARCH = "https://startpage.com/do/m/mobilesearch?language=english&query=";
public static final String STARTPAGE_SEARCH = "https://startpage.com/do/search?language=english&query="; public static final String STARTPAGE_SEARCH = "https://startpage.com/do/search?language=english&query=";
public static final String ANDROID_SEARCH = "http://www.androidsearchresult.com/search.pg?aff=olb&keyword="; public static final String ASK_SEARCH = "http://www.ask.com/web?qsrc=0&o=0&l=dir&qo=lightningBrowser&q=";
public static final String HOMEPAGE = "about:home"; public static final String HOMEPAGE = "about:home";
public static final String BAIDU_SEARCH = "https://www.baidu.com/s?wd="; public static final String BAIDU_SEARCH = "https://www.baidu.com/s?wd=";
public static final String YANDEX_SEARCH = "https://yandex.ru/yandsearch?lr=21411&text="; public static final String YANDEX_SEARCH = "https://yandex.ru/yandsearch?lr=21411&text=";

6
src/acr/browser/lightning/GeneralSettingsActivity.java

@ -85,7 +85,7 @@ public class GeneralSettingsActivity extends ActionBarActivity {
mSearchText.setText("Google"); mSearchText.setText("Google");
break; break;
case 2: case 2:
mSearchText.setText("Android Search"); mSearchText.setText("Ask");
break; break;
case 3: case 3:
mSearchText.setText("Bing"); mSearchText.setText("Bing");
@ -176,7 +176,7 @@ public class GeneralSettingsActivity extends ActionBarActivity {
AlertDialog.Builder picker = new AlertDialog.Builder(mActivity); AlertDialog.Builder picker = new AlertDialog.Builder(mActivity);
picker.setTitle(getResources().getString(R.string.title_search_engine)); picker.setTitle(getResources().getString(R.string.title_search_engine));
CharSequence[] chars = { getResources().getString(R.string.custom_url), "Google", CharSequence[] chars = { getResources().getString(R.string.custom_url), "Google",
"Android Search", "Bing", "Yahoo", "StartPage", "StartPage (Mobile)", "Ask", "Bing", "Yahoo", "StartPage", "StartPage (Mobile)",
"DuckDuckGo (Privacy)", "DuckDuckGo Lite (Privacy)", "Baidu (Chinese)", "DuckDuckGo (Privacy)", "DuckDuckGo Lite (Privacy)", "Baidu (Chinese)",
"Yandex (Russian)" }; "Yandex (Russian)" };
@ -196,7 +196,7 @@ public class GeneralSettingsActivity extends ActionBarActivity {
mSearchText.setText("Google"); mSearchText.setText("Google");
break; break;
case 2: case 2:
mSearchText.setText("Android Search"); mSearchText.setText("Ask");
break; break;
case 3: case 3:
mSearchText.setText("Bing"); mSearchText.setText("Bing");

4
src/acr/browser/lightning/LightningView.java

@ -145,9 +145,9 @@ public class LightningView {
break; break;
case 2: case 2:
// ANDROID SEARCH; // ANDROID SEARCH;
home = home + "file:///android_asset/lightning.png"; home = home + "file:///android_asset/ask.png";
home = home + HomepageVariables.MIDDLE; home = home + HomepageVariables.MIDDLE;
home = home + Constants.ANDROID_SEARCH; home = home + Constants.ASK_SEARCH;
break; break;
case 3: case 3:
// BING_SEARCH; // BING_SEARCH;

Loading…
Cancel
Save