diff --git a/BrowserActivity.apk b/BrowserActivity.apk index 2d9b4f5..cc683b4 100644 Binary files a/BrowserActivity.apk and b/BrowserActivity.apk differ diff --git a/libs/android-support-v4.jar b/libs/android-support-v4.jar new file mode 100644 index 0000000..ee6f13a Binary files /dev/null and b/libs/android-support-v4.jar differ diff --git a/src/acr/browser/lightning/BrowserActivity.java b/src/acr/browser/lightning/BrowserActivity.java index 2a40270..35edae4 100644 --- a/src/acr/browser/lightning/BrowserActivity.java +++ b/src/acr/browser/lightning/BrowserActivity.java @@ -843,8 +843,10 @@ public class BrowserActivity extends Activity implements BrowserController { Collections.sort(mBookmarkList, new SortIgnoreCase()); notifyBookmarkDataSetChanged(); if (mCurrentView != null) { - if (mCurrentView.getUrl().startsWith(Constants.FILE) - && mCurrentView.getUrl().endsWith("bookmarks.html")) { + if (mCurrentView.getUrl() + .startsWith(Constants.FILE) + && mCurrentView.getUrl().endsWith( + "bookmarks.html")) { openBookmarkPage(mCurrentView.getWebView()); } } @@ -1342,7 +1344,8 @@ public class BrowserActivity extends Activity implements BrowserController { } @Override - public View getView(final int position, View convertView, ViewGroup parent) { + public View getView(final int position, View convertView, + ViewGroup parent) { View row = convertView; LightningViewHolder holder = null; if (row == null) { @@ -1945,7 +1948,8 @@ public class BrowserActivity extends Activity implements BrowserController { Log.i("Lightning", "onHideCustomView"); mCurrentView.setVisibility(View.VISIBLE); mCustomView.setKeepScreenOn(false); - setFullscreen(mPreferences.getBoolean("hidestatus", false)); + setFullscreen(mPreferences.getBoolean( + PreferenceConstants.HIDE_STATUS_BAR, false)); FrameLayout decor = (FrameLayout) getWindow().getDecorView(); if (decor != null) { decor.removeView(mFullscreenContainer); @@ -2394,10 +2398,10 @@ public class BrowserActivity extends Activity implements BrowserController { public class SortIgnoreCase implements Comparator { public int compare(HistoryItem o1, HistoryItem o2) { - return o1.getTitle().toLowerCase(Locale.getDefault()).compareTo( - o2.getTitle().toLowerCase(Locale.getDefault())); + return o1.getTitle().toLowerCase(Locale.getDefault()) + .compareTo(o2.getTitle().toLowerCase(Locale.getDefault())); } } -} +} \ No newline at end of file diff --git a/src/acr/browser/lightning/Constants.java b/src/acr/browser/lightning/Constants.java index ddf8cf7..bd46d4f 100644 --- a/src/acr/browser/lightning/Constants.java +++ b/src/acr/browser/lightning/Constants.java @@ -25,10 +25,10 @@ public class Constants { public static final String HOMEPAGE = "about:home"; 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 ADVANCED_SETTINGS_INTENT = "android.intent.action.ADVANCED_SETTINGS"; - public static final String LICENSE_INTENT = "android.intent.action.LICENSE"; - public static final String SETTINGS_INTENT = "android.intent.action.SETTINGS"; - public static final String INCOGNITO_INTENT = "android.intent.action.INCOGNITO"; + public static final String ADVANCED_SETTINGS_INTENT = "android.intent.action.LIGHTNING_ADVANCED_SETTINGS"; + public static final String LICENSE_INTENT = "android.intent.action.LIGHTNING_LICENSE"; + public static final String SETTINGS_INTENT = "android.intent.action.LIGHTNING_SETTINGS"; + public static final String INCOGNITO_INTENT = "android.intent.action.LIGHTNING_INCOGNITO"; public static final String EXTERNAL_STORAGE = Environment.getExternalStorageDirectory().toString(); public static final String SEPARATOR = "\\|\\$\\|SEPARATOR\\|\\$\\|"; public static final String HTTP = "http://"; diff --git a/src/acr/browser/lightning/HomepageVariables.java b/src/acr/browser/lightning/HomepageVariables.java index 0cb32de..a4404d0 100644 --- a/src/acr/browser/lightning/HomepageVariables.java +++ b/src/acr/browser/lightning/HomepageVariables.java @@ -4,20 +4,14 @@ package acr.browser.lightning; public class HomepageVariables { - public static final String HEAD = "" - + "" - + "" - + "" - + "Homepage" - + "" - + "







Homepage" + + "" + + "









" + public static final String MIDDLE = "\" >

" + ""; + public static final String END = "\" + document.getElementById(\"search_input\").value;document.getElementById(\"search_input\").value = \"\";}return false;}"; } diff --git a/src/acr/browser/lightning/IncognitoActivity.java b/src/acr/browser/lightning/IncognitoActivity.java index 4ca76aa..bfdb20b 100644 --- a/src/acr/browser/lightning/IncognitoActivity.java +++ b/src/acr/browser/lightning/IncognitoActivity.java @@ -810,15 +810,17 @@ public class IncognitoActivity extends Activity implements BrowserController { Collections.sort(mBookmarkList, new SortIgnoreCase()); notifyBookmarkDataSetChanged(); if (mCurrentView != null) { - if (mCurrentView.getUrl().startsWith(Constants.FILE) - && mCurrentView.getUrl().endsWith("bookmarks.html")) { + if (mCurrentView.getUrl() + .startsWith(Constants.FILE) + && mCurrentView.getUrl().endsWith( + "bookmarks.html")) { openBookmarkPage(mCurrentView.getWebView()); } } } }); homePicker.show(); - + } /** @@ -1261,7 +1263,8 @@ public class IncognitoActivity extends Activity implements BrowserController { } @Override - public View getView(final int position, View convertView, ViewGroup parent) { + public View getView(final int position, View convertView, + ViewGroup parent) { View row = convertView; LightningViewHolder holder = null; @@ -1284,7 +1287,7 @@ public class IncognitoActivity extends Activity implements BrowserController { @Override public void onClick(View view) { - + deleteTab(position); } @@ -1816,7 +1819,8 @@ public class IncognitoActivity extends Activity implements BrowserController { Log.i("Lightning", "onHideCustomView"); mCurrentView.setVisibility(View.VISIBLE); mCustomView.setKeepScreenOn(false); - setFullscreen(mPreferences.getBoolean("hidestatus", false)); + setFullscreen(mPreferences.getBoolean( + PreferenceConstants.HIDE_STATUS_BAR, false)); FrameLayout decor = (FrameLayout) getWindow().getDecorView(); if (decor != null) { decor.removeView(mFullscreenContainer); @@ -2265,9 +2269,9 @@ public class IncognitoActivity extends Activity implements BrowserController { public class SortIgnoreCase implements Comparator { public int compare(HistoryItem o1, HistoryItem o2) { - return o1.getTitle().toLowerCase(Locale.getDefault()).compareTo( - o2.getTitle().toLowerCase(Locale.getDefault())); + return o1.getTitle().toLowerCase(Locale.getDefault()) + .compareTo(o2.getTitle().toLowerCase(Locale.getDefault())); } } -} +} \ No newline at end of file diff --git a/src/acr/browser/lightning/LightningView.java b/src/acr/browser/lightning/LightningView.java index 2127d86..5fceeb6 100644 --- a/src/acr/browser/lightning/LightningView.java +++ b/src/acr/browser/lightning/LightningView.java @@ -153,6 +153,14 @@ public class LightningView { String home = ""; home = HomepageVariables.HEAD; 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: // GOOGLE_SEARCH; home = home + "file:///android_asset/google.png"; @@ -242,18 +250,21 @@ public class LightningView { } public synchronized void initializePreferences(Context context) { - mPreferences = context.getSharedPreferences(PreferenceConstants.PREFERENCES, 0); - mHomepage = mPreferences.getString(PreferenceConstants.HOMEPAGE, Constants.HOMEPAGE); + mPreferences = context.getSharedPreferences( + PreferenceConstants.PREFERENCES, 0); + mHomepage = mPreferences.getString(PreferenceConstants.HOMEPAGE, + Constants.HOMEPAGE); mAdBlock.updatePreference(); if (mSettings == null && mWebView != null) { mSettings = mWebView.getSettings(); } else if (mSettings == null) { return; } - mSettings.setGeolocationEnabled(mPreferences.getBoolean(PreferenceConstants.LOCATION, - false)); + mSettings.setGeolocationEnabled(mPreferences.getBoolean( + PreferenceConstants.LOCATION, false)); if (API < 19) { - switch (mPreferences.getInt(PreferenceConstants.ADOBE_FLASH_SUPPORT, 0)) { + switch (mPreferences.getInt( + PreferenceConstants.ADOBE_FLASH_SUPPORT, 0)) { case 0: mSettings.setPluginState(PluginState.OFF); break; @@ -308,13 +319,14 @@ public class LightningView { mSettings.setLayoutAlgorithm(LayoutAlgorithm.NORMAL); } - mSettings.setBlockNetworkImage(mPreferences.getBoolean(PreferenceConstants.BLOCK_IMAGES, - false)); + mSettings.setBlockNetworkImage(mPreferences.getBoolean( + PreferenceConstants.BLOCK_IMAGES, false)); mSettings.setSupportMultipleWindows(mPreferences.getBoolean( PreferenceConstants.POPUPS, true)); - mSettings.setUseWideViewPort(mPreferences.getBoolean(PreferenceConstants.USE_WIDE_VIEWPORT, - true)); - mWideViewPort = mPreferences.getBoolean(PreferenceConstants.USE_WIDE_VIEWPORT, true); + mSettings.setUseWideViewPort(mPreferences.getBoolean( + PreferenceConstants.USE_WIDE_VIEWPORT, true)); + mWideViewPort = mPreferences.getBoolean( + PreferenceConstants.USE_WIDE_VIEWPORT, true); mSettings.setLoadWithOverviewMode(mPreferences.getBoolean( PreferenceConstants.OVERVIEW_MODE, true)); switch (mPreferences.getInt(PreferenceConstants.TEXT_SIZE, 3)) { @@ -589,7 +601,8 @@ public class LightningView { builder.setTitle(mActivity.getString(R.string.title_sign_in)); builder.setView(passLayout); builder.setCancelable(true) - .setPositiveButton(mActivity.getString(R.string.title_sign_in), + .setPositiveButton( + mActivity.getString(R.string.title_sign_in), new DialogInterface.OnClickListener() { @Override 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() { @Override public void onClick(DialogInterface dialog, @@ -630,7 +644,8 @@ public class LightningView { builder.setMessage( mActivity.getString(R.string.message_untrusted_certificate)) .setCancelable(true) - .setPositiveButton(mActivity.getString(R.string.action_yes), + .setPositiveButton( + mActivity.getString(R.string.action_yes), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, @@ -659,10 +674,13 @@ public class LightningView { public void onFormResubmission(WebView view, final Message dontResend, final Message resend) { AlertDialog.Builder builder = new AlertDialog.Builder(mActivity); - builder.setTitle(mActivity.getString(R.string.title_form_resubmission)); - builder.setMessage(mActivity.getString(R.string.message_form_resubmission)) + builder.setTitle(mActivity + .getString(R.string.title_form_resubmission)); + builder.setMessage( + mActivity.getString(R.string.message_form_resubmission)) .setCancelable(true) - .setPositiveButton(mActivity.getString(R.string.action_yes), + .setPositiveButton( + mActivity.getString(R.string.action_yes), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, @@ -782,9 +800,11 @@ public class LightningView { } else { org = origin; } - builder.setMessage(org + mActivity.getString(R.string.message_location)) + builder.setMessage( + org + mActivity.getString(R.string.message_location)) .setCancelable(true) - .setPositiveButton(mActivity.getString(R.string.action_allow), + .setPositiveButton( + mActivity.getString(R.string.action_allow), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, @@ -792,7 +812,8 @@ public class LightningView { callback.invoke(origin, true, remember); } }) - .setNegativeButton(mActivity.getString(R.string.action_dont_allow), + .setNegativeButton( + mActivity.getString(R.string.action_dont_allow), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog,