Bugfixes
Fixed bug where homescreen didn't display for custom search URLS. Fixed bug where exit button on tabs didn't work. Fixed bug where special characters weren't properly encoded in searches Updated homepage to be more modern and holo styled
This commit is contained in:
parent
d17049cc88
commit
97f86630d8
Binary file not shown.
BIN
libs/android-support-v4.jar
Normal file
BIN
libs/android-support-v4.jar
Normal file
Binary file not shown.
@ -843,8 +843,10 @@ public class BrowserActivity extends Activity implements BrowserController {
|
|||||||
Collections.sort(mBookmarkList, new SortIgnoreCase());
|
Collections.sort(mBookmarkList, new SortIgnoreCase());
|
||||||
notifyBookmarkDataSetChanged();
|
notifyBookmarkDataSetChanged();
|
||||||
if (mCurrentView != null) {
|
if (mCurrentView != null) {
|
||||||
if (mCurrentView.getUrl().startsWith(Constants.FILE)
|
if (mCurrentView.getUrl()
|
||||||
&& mCurrentView.getUrl().endsWith("bookmarks.html")) {
|
.startsWith(Constants.FILE)
|
||||||
|
&& mCurrentView.getUrl().endsWith(
|
||||||
|
"bookmarks.html")) {
|
||||||
openBookmarkPage(mCurrentView.getWebView());
|
openBookmarkPage(mCurrentView.getWebView());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1342,7 +1344,8 @@ public class BrowserActivity extends Activity implements BrowserController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View getView(final int position, View convertView, ViewGroup parent) {
|
public View getView(final int position, View convertView,
|
||||||
|
ViewGroup parent) {
|
||||||
View row = convertView;
|
View row = convertView;
|
||||||
LightningViewHolder holder = null;
|
LightningViewHolder holder = null;
|
||||||
if (row == null) {
|
if (row == null) {
|
||||||
@ -1945,7 +1948,8 @@ public class BrowserActivity extends Activity implements BrowserController {
|
|||||||
Log.i("Lightning", "onHideCustomView");
|
Log.i("Lightning", "onHideCustomView");
|
||||||
mCurrentView.setVisibility(View.VISIBLE);
|
mCurrentView.setVisibility(View.VISIBLE);
|
||||||
mCustomView.setKeepScreenOn(false);
|
mCustomView.setKeepScreenOn(false);
|
||||||
setFullscreen(mPreferences.getBoolean("hidestatus", false));
|
setFullscreen(mPreferences.getBoolean(
|
||||||
|
PreferenceConstants.HIDE_STATUS_BAR, false));
|
||||||
FrameLayout decor = (FrameLayout) getWindow().getDecorView();
|
FrameLayout decor = (FrameLayout) getWindow().getDecorView();
|
||||||
if (decor != null) {
|
if (decor != null) {
|
||||||
decor.removeView(mFullscreenContainer);
|
decor.removeView(mFullscreenContainer);
|
||||||
@ -2394,10 +2398,10 @@ public class BrowserActivity extends Activity implements BrowserController {
|
|||||||
public class SortIgnoreCase implements Comparator<HistoryItem> {
|
public class SortIgnoreCase implements Comparator<HistoryItem> {
|
||||||
|
|
||||||
public int compare(HistoryItem o1, HistoryItem o2) {
|
public int compare(HistoryItem o1, HistoryItem o2) {
|
||||||
return o1.getTitle().toLowerCase(Locale.getDefault()).compareTo(
|
return o1.getTitle().toLowerCase(Locale.getDefault())
|
||||||
o2.getTitle().toLowerCase(Locale.getDefault()));
|
.compareTo(o2.getTitle().toLowerCase(Locale.getDefault()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -25,10 +25,10 @@ public class Constants {
|
|||||||
public static final String HOMEPAGE = "about:home";
|
public static final String HOMEPAGE = "about:home";
|
||||||
public static final String BAIDU_SEARCH = "http://www.baidu.com/s?wd=";
|
public static final String BAIDU_SEARCH = "http://www.baidu.com/s?wd=";
|
||||||
public static final String YANDEX_SEARCH = "http://yandex.ru/yandsearch?lr=21411&text=";
|
public static final String YANDEX_SEARCH = "http://yandex.ru/yandsearch?lr=21411&text=";
|
||||||
public static final String ADVANCED_SETTINGS_INTENT = "android.intent.action.ADVANCED_SETTINGS";
|
public static final String ADVANCED_SETTINGS_INTENT = "android.intent.action.LIGHTNING_ADVANCED_SETTINGS";
|
||||||
public static final String LICENSE_INTENT = "android.intent.action.LICENSE";
|
public static final String LICENSE_INTENT = "android.intent.action.LIGHTNING_LICENSE";
|
||||||
public static final String SETTINGS_INTENT = "android.intent.action.SETTINGS";
|
public static final String SETTINGS_INTENT = "android.intent.action.LIGHTNING_SETTINGS";
|
||||||
public static final String INCOGNITO_INTENT = "android.intent.action.INCOGNITO";
|
public static final String INCOGNITO_INTENT = "android.intent.action.LIGHTNING_INCOGNITO";
|
||||||
public static final String EXTERNAL_STORAGE = Environment.getExternalStorageDirectory().toString();
|
public static final String EXTERNAL_STORAGE = Environment.getExternalStorageDirectory().toString();
|
||||||
public static final String SEPARATOR = "\\|\\$\\|SEPARATOR\\|\\$\\|";
|
public static final String SEPARATOR = "\\|\\$\\|SEPARATOR\\|\\$\\|";
|
||||||
public static final String HTTP = "http://";
|
public static final String HTTP = "http://";
|
||||||
|
@ -4,20 +4,14 @@
|
|||||||
package acr.browser.lightning;
|
package acr.browser.lightning;
|
||||||
|
|
||||||
public class HomepageVariables {
|
public class HomepageVariables {
|
||||||
public static final String HEAD = "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">"
|
public static final String HEAD = "<!DOCTYPE html><html xmlns=\"http://www.w3.org/1999/xhtml\"><head><meta content=\"en-us\" http-equiv=\"Content-Language\" /><meta content=\"text/html; charset=utf-8\" http-equiv=\"Content-Type\" /><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=0\"><title>Homepage</title></head>" +
|
||||||
+ "<html xmlns=\"http://www.w3.org/1999/xhtml\">"
|
"<style>body{background:#f2f2f2;text-align:center;}#search_input{height:35px; width:100%;outline:none;border:none;font-size: 16px;background-color:transparent;}span { display: block; overflow: hidden; padding-left:5px;vertical-align:middle;}.search_bar{display:table;vertical-align:middle;width:90%;height:35px;max-width:500px;margin:0 auto;background-color:#fff;box-shadow: 0px 3px rgba( 0, 0, 0, 0.1 );font-family: Arial;color: #444;-moz-border-radius: 2px;-webkit-border-radius: 2px;border-radius: 2px;}#search_submit{outline:none;height:37px;float:right;color:#404040;font-size:16px;font-weight:bold;border:none;background-color:transparent;}div.center{vertical-align:middle;height:100%;width:100%;max-height:300px; position: absolute; top:0; bottom: 0; left: 0; right: 0; margin: auto;}img.smaller{width:50%;max-width:300px;}.box { vertical-align:middle;position:relative; display: block; margin: 10px;padding-left:10px;padding-right:10px;padding-top:5px;padding-bottom:5px; background-color:#fff;box-shadow: 0px 3px rgba( 0, 0, 0, 0.1 );font-family: Arial;color: #444;font-size: 12px;-moz-border-radius: 2px;-webkit-border-radius: 2px;border-radius: 2px;}</style><body>" +
|
||||||
+ "<head>"
|
"<div class=\"center\"><img class=\"smaller\" src=\"";
|
||||||
+ "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">"
|
|
||||||
+ "<title>Homepage</title>"
|
|
||||||
+ "</head>"
|
|
||||||
+ "<style>#search_input{height:2em; width:70%;font-size:100%;padding-right:10px;padding-left:10px;vertical-align:middle;}#search_submit{font-family:'Arial';"
|
|
||||||
+ "color:#585858;height:2.5em;font-weight:bold;vertical-align:middle;}div.center{display:block;margin-left:auto; margin-right:auto;text-align:center;vertical-align:middle;}img.smaller{width:50%;}"
|
|
||||||
+ "div.fill{height:100%;}</style><body><div class=\"fill\"></br></br></br></br></br></br></br> <div class=\"center\"><img class=\"smaller\" src=\"";
|
|
||||||
|
|
||||||
public static final String MIDDLE = "\" ></br><form onsubmit=\"return search()\" ><input class=\"search\" type=\"text\" value=\"\" id=\"search_input\" ><input "
|
public static final String MIDDLE = "\" ></br></br><form onsubmit=\"return search()\" class=\"search_bar\"><input "
|
||||||
+ "type=\"submit\" id=\"search_submit\" value=\"Search\" ></form> </div></div></br></br></br></br></br></br></br></br>"
|
+ "type=\"submit\" id=\"search_submit\" value=\"Search\" ><span><input class=\"search\" type=\"text\" value=\"\" id=\"search_input\" ></span></form> </div>"
|
||||||
+ "<script type=\"text/javascript\">function "
|
+ "<script type=\"text/javascript\">function "
|
||||||
+ "search(){if(document.getElementById(\"search_input\").value != \"\"){window.location.href = \"";
|
+ "search(){if(document.getElementById(\"search_input\").value != \"\"){window.location.href = \"";
|
||||||
|
|
||||||
public static final String END = "\" + document.getElementById(\"search_input\").value;}return false;}</script></body></html>";
|
public static final String END = "\" + document.getElementById(\"search_input\").value;document.getElementById(\"search_input\").value = \"\";}return false;}</script></body></html>";
|
||||||
}
|
}
|
||||||
|
@ -810,15 +810,17 @@ public class IncognitoActivity extends Activity implements BrowserController {
|
|||||||
Collections.sort(mBookmarkList, new SortIgnoreCase());
|
Collections.sort(mBookmarkList, new SortIgnoreCase());
|
||||||
notifyBookmarkDataSetChanged();
|
notifyBookmarkDataSetChanged();
|
||||||
if (mCurrentView != null) {
|
if (mCurrentView != null) {
|
||||||
if (mCurrentView.getUrl().startsWith(Constants.FILE)
|
if (mCurrentView.getUrl()
|
||||||
&& mCurrentView.getUrl().endsWith("bookmarks.html")) {
|
.startsWith(Constants.FILE)
|
||||||
|
&& mCurrentView.getUrl().endsWith(
|
||||||
|
"bookmarks.html")) {
|
||||||
openBookmarkPage(mCurrentView.getWebView());
|
openBookmarkPage(mCurrentView.getWebView());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
homePicker.show();
|
homePicker.show();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1261,7 +1263,8 @@ public class IncognitoActivity extends Activity implements BrowserController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View getView(final int position, View convertView, ViewGroup parent) {
|
public View getView(final int position, View convertView,
|
||||||
|
ViewGroup parent) {
|
||||||
View row = convertView;
|
View row = convertView;
|
||||||
LightningViewHolder holder = null;
|
LightningViewHolder holder = null;
|
||||||
|
|
||||||
@ -1284,7 +1287,7 @@ public class IncognitoActivity extends Activity implements BrowserController {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
|
||||||
deleteTab(position);
|
deleteTab(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1816,7 +1819,8 @@ public class IncognitoActivity extends Activity implements BrowserController {
|
|||||||
Log.i("Lightning", "onHideCustomView");
|
Log.i("Lightning", "onHideCustomView");
|
||||||
mCurrentView.setVisibility(View.VISIBLE);
|
mCurrentView.setVisibility(View.VISIBLE);
|
||||||
mCustomView.setKeepScreenOn(false);
|
mCustomView.setKeepScreenOn(false);
|
||||||
setFullscreen(mPreferences.getBoolean("hidestatus", false));
|
setFullscreen(mPreferences.getBoolean(
|
||||||
|
PreferenceConstants.HIDE_STATUS_BAR, false));
|
||||||
FrameLayout decor = (FrameLayout) getWindow().getDecorView();
|
FrameLayout decor = (FrameLayout) getWindow().getDecorView();
|
||||||
if (decor != null) {
|
if (decor != null) {
|
||||||
decor.removeView(mFullscreenContainer);
|
decor.removeView(mFullscreenContainer);
|
||||||
@ -2265,9 +2269,9 @@ public class IncognitoActivity extends Activity implements BrowserController {
|
|||||||
public class SortIgnoreCase implements Comparator<HistoryItem> {
|
public class SortIgnoreCase implements Comparator<HistoryItem> {
|
||||||
|
|
||||||
public int compare(HistoryItem o1, HistoryItem o2) {
|
public int compare(HistoryItem o1, HistoryItem o2) {
|
||||||
return o1.getTitle().toLowerCase(Locale.getDefault()).compareTo(
|
return o1.getTitle().toLowerCase(Locale.getDefault())
|
||||||
o2.getTitle().toLowerCase(Locale.getDefault()));
|
.compareTo(o2.getTitle().toLowerCase(Locale.getDefault()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -153,6 +153,14 @@ public class LightningView {
|
|||||||
String home = "";
|
String home = "";
|
||||||
home = HomepageVariables.HEAD;
|
home = HomepageVariables.HEAD;
|
||||||
switch (mPreferences.getInt(PreferenceConstants.SEARCH, 1)) {
|
switch (mPreferences.getInt(PreferenceConstants.SEARCH, 1)) {
|
||||||
|
case 0:
|
||||||
|
// CUSTOM SEARCH
|
||||||
|
home = home + "file:///android_asset/lightning.png";
|
||||||
|
home = home + HomepageVariables.MIDDLE;
|
||||||
|
home = home
|
||||||
|
+ mPreferences.getString(PreferenceConstants.SEARCH_URL,
|
||||||
|
Constants.GOOGLE_SEARCH);
|
||||||
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
// GOOGLE_SEARCH;
|
// GOOGLE_SEARCH;
|
||||||
home = home + "file:///android_asset/google.png";
|
home = home + "file:///android_asset/google.png";
|
||||||
@ -242,18 +250,21 @@ public class LightningView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void initializePreferences(Context context) {
|
public synchronized void initializePreferences(Context context) {
|
||||||
mPreferences = context.getSharedPreferences(PreferenceConstants.PREFERENCES, 0);
|
mPreferences = context.getSharedPreferences(
|
||||||
mHomepage = mPreferences.getString(PreferenceConstants.HOMEPAGE, Constants.HOMEPAGE);
|
PreferenceConstants.PREFERENCES, 0);
|
||||||
|
mHomepage = mPreferences.getString(PreferenceConstants.HOMEPAGE,
|
||||||
|
Constants.HOMEPAGE);
|
||||||
mAdBlock.updatePreference();
|
mAdBlock.updatePreference();
|
||||||
if (mSettings == null && mWebView != null) {
|
if (mSettings == null && mWebView != null) {
|
||||||
mSettings = mWebView.getSettings();
|
mSettings = mWebView.getSettings();
|
||||||
} else if (mSettings == null) {
|
} else if (mSettings == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mSettings.setGeolocationEnabled(mPreferences.getBoolean(PreferenceConstants.LOCATION,
|
mSettings.setGeolocationEnabled(mPreferences.getBoolean(
|
||||||
false));
|
PreferenceConstants.LOCATION, false));
|
||||||
if (API < 19) {
|
if (API < 19) {
|
||||||
switch (mPreferences.getInt(PreferenceConstants.ADOBE_FLASH_SUPPORT, 0)) {
|
switch (mPreferences.getInt(
|
||||||
|
PreferenceConstants.ADOBE_FLASH_SUPPORT, 0)) {
|
||||||
case 0:
|
case 0:
|
||||||
mSettings.setPluginState(PluginState.OFF);
|
mSettings.setPluginState(PluginState.OFF);
|
||||||
break;
|
break;
|
||||||
@ -308,13 +319,14 @@ public class LightningView {
|
|||||||
mSettings.setLayoutAlgorithm(LayoutAlgorithm.NORMAL);
|
mSettings.setLayoutAlgorithm(LayoutAlgorithm.NORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
mSettings.setBlockNetworkImage(mPreferences.getBoolean(PreferenceConstants.BLOCK_IMAGES,
|
mSettings.setBlockNetworkImage(mPreferences.getBoolean(
|
||||||
false));
|
PreferenceConstants.BLOCK_IMAGES, false));
|
||||||
mSettings.setSupportMultipleWindows(mPreferences.getBoolean(
|
mSettings.setSupportMultipleWindows(mPreferences.getBoolean(
|
||||||
PreferenceConstants.POPUPS, true));
|
PreferenceConstants.POPUPS, true));
|
||||||
mSettings.setUseWideViewPort(mPreferences.getBoolean(PreferenceConstants.USE_WIDE_VIEWPORT,
|
mSettings.setUseWideViewPort(mPreferences.getBoolean(
|
||||||
true));
|
PreferenceConstants.USE_WIDE_VIEWPORT, true));
|
||||||
mWideViewPort = mPreferences.getBoolean(PreferenceConstants.USE_WIDE_VIEWPORT, true);
|
mWideViewPort = mPreferences.getBoolean(
|
||||||
|
PreferenceConstants.USE_WIDE_VIEWPORT, true);
|
||||||
mSettings.setLoadWithOverviewMode(mPreferences.getBoolean(
|
mSettings.setLoadWithOverviewMode(mPreferences.getBoolean(
|
||||||
PreferenceConstants.OVERVIEW_MODE, true));
|
PreferenceConstants.OVERVIEW_MODE, true));
|
||||||
switch (mPreferences.getInt(PreferenceConstants.TEXT_SIZE, 3)) {
|
switch (mPreferences.getInt(PreferenceConstants.TEXT_SIZE, 3)) {
|
||||||
@ -589,7 +601,8 @@ public class LightningView {
|
|||||||
builder.setTitle(mActivity.getString(R.string.title_sign_in));
|
builder.setTitle(mActivity.getString(R.string.title_sign_in));
|
||||||
builder.setView(passLayout);
|
builder.setView(passLayout);
|
||||||
builder.setCancelable(true)
|
builder.setCancelable(true)
|
||||||
.setPositiveButton(mActivity.getString(R.string.title_sign_in),
|
.setPositiveButton(
|
||||||
|
mActivity.getString(R.string.title_sign_in),
|
||||||
new DialogInterface.OnClickListener() {
|
new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog,
|
public void onClick(DialogInterface dialog,
|
||||||
@ -601,7 +614,8 @@ public class LightningView {
|
|||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.setNegativeButton(mActivity.getString(R.string.action_cancel),
|
.setNegativeButton(
|
||||||
|
mActivity.getString(R.string.action_cancel),
|
||||||
new DialogInterface.OnClickListener() {
|
new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog,
|
public void onClick(DialogInterface dialog,
|
||||||
@ -630,7 +644,8 @@ public class LightningView {
|
|||||||
builder.setMessage(
|
builder.setMessage(
|
||||||
mActivity.getString(R.string.message_untrusted_certificate))
|
mActivity.getString(R.string.message_untrusted_certificate))
|
||||||
.setCancelable(true)
|
.setCancelable(true)
|
||||||
.setPositiveButton(mActivity.getString(R.string.action_yes),
|
.setPositiveButton(
|
||||||
|
mActivity.getString(R.string.action_yes),
|
||||||
new DialogInterface.OnClickListener() {
|
new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog,
|
public void onClick(DialogInterface dialog,
|
||||||
@ -659,10 +674,13 @@ public class LightningView {
|
|||||||
public void onFormResubmission(WebView view, final Message dontResend,
|
public void onFormResubmission(WebView view, final Message dontResend,
|
||||||
final Message resend) {
|
final Message resend) {
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(mActivity);
|
AlertDialog.Builder builder = new AlertDialog.Builder(mActivity);
|
||||||
builder.setTitle(mActivity.getString(R.string.title_form_resubmission));
|
builder.setTitle(mActivity
|
||||||
builder.setMessage(mActivity.getString(R.string.message_form_resubmission))
|
.getString(R.string.title_form_resubmission));
|
||||||
|
builder.setMessage(
|
||||||
|
mActivity.getString(R.string.message_form_resubmission))
|
||||||
.setCancelable(true)
|
.setCancelable(true)
|
||||||
.setPositiveButton(mActivity.getString(R.string.action_yes),
|
.setPositiveButton(
|
||||||
|
mActivity.getString(R.string.action_yes),
|
||||||
new DialogInterface.OnClickListener() {
|
new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog,
|
public void onClick(DialogInterface dialog,
|
||||||
@ -782,9 +800,11 @@ public class LightningView {
|
|||||||
} else {
|
} else {
|
||||||
org = origin;
|
org = origin;
|
||||||
}
|
}
|
||||||
builder.setMessage(org + mActivity.getString(R.string.message_location))
|
builder.setMessage(
|
||||||
|
org + mActivity.getString(R.string.message_location))
|
||||||
.setCancelable(true)
|
.setCancelable(true)
|
||||||
.setPositiveButton(mActivity.getString(R.string.action_allow),
|
.setPositiveButton(
|
||||||
|
mActivity.getString(R.string.action_allow),
|
||||||
new DialogInterface.OnClickListener() {
|
new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog,
|
public void onClick(DialogInterface dialog,
|
||||||
@ -792,7 +812,8 @@ public class LightningView {
|
|||||||
callback.invoke(origin, true, remember);
|
callback.invoke(origin, true, remember);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.setNegativeButton(mActivity.getString(R.string.action_dont_allow),
|
.setNegativeButton(
|
||||||
|
mActivity.getString(R.string.action_dont_allow),
|
||||||
new DialogInterface.OnClickListener() {
|
new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog,
|
public void onClick(DialogInterface dialog,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user