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. 16
      src/acr/browser/lightning/BrowserActivity.java
  4. 6
      src/acr/browser/lightning/Constants.java
  5. 12
      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

16
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,10 +681,9 @@ 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);
} else { } else {
maxWidth = Utils.convertDpToPixels(300); maxWidth = Utils.convertDpToPixels(300);
@ -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;

6
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=";
@ -28,9 +28,9 @@ public final class Constants {
.toString(); .toString();
public static final String JAVASCRIPT_INVERT_PAGE = "javascript:(function(){var e='img {-webkit-filter: invert(100%);'+'-moz-filter: invert(100%);'+'-o-filter: invert(100%);'+'-ms-filter: invert(100%); }',t=document.getElementsByTagName('head')[0],n=document.createElement('style');if(!window.counter){window.counter=1}else{window.counter++;if(window.counter%2==0){var e='html {-webkit-filter: invert(0%); -moz-filter: invert(0%); -o-filter: invert(0%); -ms-filter: invert(0%); }'}}n.type='text/css';if(n.styleSheet){n.styleSheet.cssText=e}else{n.appendChild(document.createTextNode(e))}t.appendChild(n)})();"; public static final String JAVASCRIPT_INVERT_PAGE = "javascript:(function(){var e='img {-webkit-filter: invert(100%);'+'-moz-filter: invert(100%);'+'-o-filter: invert(100%);'+'-ms-filter: invert(100%); }',t=document.getElementsByTagName('head')[0],n=document.createElement('style');if(!window.counter){window.counter=1}else{window.counter++;if(window.counter%2==0){var e='html {-webkit-filter: invert(0%); -moz-filter: invert(0%); -o-filter: invert(0%); -ms-filter: invert(0%); }'}}n.type='text/css';if(n.styleSheet){n.styleSheet.cssText=e}else{n.appendChild(document.createTextNode(e))}t.appendChild(n)})();";
public static final String JAVASCRIPT_TEXT_REFLOW = "javascript:document.getElementsByTagName('body')[0].style.width=window.innerWidth+'px';"; public static final String JAVASCRIPT_TEXT_REFLOW = "javascript:document.getElementsByTagName('body')[0].style.width=window.innerWidth+'px';";
public static final String LOAD_READING_URL = "ReadingUrl"; public static final String LOAD_READING_URL = "ReadingUrl";
public static final String SEPARATOR = "\\|\\$\\|SEPARATOR\\|\\$\\|"; public static final String SEPARATOR = "\\|\\$\\|SEPARATOR\\|\\$\\|";
public static final String HTTP = "http://"; public static final String HTTP = "http://";
public static final String HTTPS = "https://"; public static final String HTTPS = "https://";

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

@ -48,10 +48,10 @@ public class GeneralSettingsActivity extends ActionBarActivity {
setContentView(R.layout.general_settings); setContentView(R.layout.general_settings);
// set up ActionBar // set up ActionBar
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar); setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
mPreferences = getSharedPreferences(PreferenceConstants.PREFERENCES, 0); mPreferences = getSharedPreferences(PreferenceConstants.PREFERENCES, 0);
if (mPreferences.getBoolean(PreferenceConstants.HIDE_STATUS_BAR, false)) { if (mPreferences.getBoolean(PreferenceConstants.HIDE_STATUS_BAR, false)) {
@ -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