From 4a8df255bd32fdf9e3a2d6425b880450f374e700 Mon Sep 17 00:00:00 2001 From: Anthony Restaino Date: Sun, 31 Jul 2016 14:50:03 -0400 Subject: [PATCH] Switch from png to vector --- app/build.gradle | 6 +-- .../lightning/activity/BrowserActivity.java | 13 ++++--- .../lightning/async/ImageDownloadTask.java | 5 ++- .../lightning/constant/BookmarkPage.java | 2 +- .../lightning/constant/HistoryPage.java | 2 +- .../browser/lightning/constant/StartPage.java | 2 +- .../browser/lightning/utils/ThemeUtils.java | 35 ++++++++++++++++-- .../main/res/drawable-hdpi/ic_action_back.png | Bin 212 -> 0 bytes .../res/drawable-hdpi/ic_action_collapse.png | Bin 219 -> 0 bytes .../res/drawable-hdpi/ic_action_delete.png | Bin 282 -> 0 bytes .../res/drawable-hdpi/ic_action_desktop.png | Bin 242 -> 0 bytes .../res/drawable-hdpi/ic_action_expand.png | Bin 227 -> 0 bytes .../res/drawable-hdpi/ic_action_forward.png | Bin 204 -> 0 bytes .../main/res/drawable-hdpi/ic_action_home.png | Bin 293 -> 0 bytes .../res/drawable-hdpi/ic_action_invert.png | Bin 331 -> 0 bytes .../main/res/drawable-hdpi/ic_action_plus.png | Bin 153 -> 0 bytes .../res/drawable-hdpi/ic_action_reading.png | Bin 126 -> 0 bytes .../res/drawable-hdpi/ic_action_refresh.png | Bin 492 -> 0 bytes .../main/res/drawable-hdpi/ic_action_star.png | Bin 649 -> 0 bytes .../main/res/drawable-hdpi/ic_action_tabs.png | Bin 135 -> 0 bytes .../res/drawable-hdpi/ic_action_text_size.png | Bin 163 -> 0 bytes .../main/res/drawable-hdpi/ic_bookmark.png | Bin 480 -> 0 bytes app/src/main/res/drawable-hdpi/ic_folder.png | Bin 196 -> 0 bytes app/src/main/res/drawable-hdpi/ic_history.png | Bin 633 -> 0 bytes app/src/main/res/drawable-hdpi/ic_search.png | Bin 524 -> 0 bytes app/src/main/res/drawable-hdpi/ic_webpage.png | Bin 808 -> 0 bytes .../main/res/drawable-mdpi/ic_action_home.png | Bin 206 -> 0 bytes app/src/main/res/drawable-mdpi/ic_webpage.png | Bin 493 -> 0 bytes .../res/drawable-xhdpi/ic_action_back.png | Bin 174 -> 0 bytes .../res/drawable-xhdpi/ic_action_collapse.png | Bin 199 -> 0 bytes .../res/drawable-xhdpi/ic_action_delete.png | Bin 290 -> 0 bytes .../res/drawable-xhdpi/ic_action_desktop.png | Bin 268 -> 0 bytes .../res/drawable-xhdpi/ic_action_expand.png | Bin 209 -> 0 bytes .../res/drawable-xhdpi/ic_action_forward.png | Bin 180 -> 0 bytes .../res/drawable-xhdpi/ic_action_home.png | Bin 311 -> 0 bytes .../res/drawable-xhdpi/ic_action_invert.png | Bin 372 -> 0 bytes .../res/drawable-xhdpi/ic_action_plus.png | Bin 137 -> 0 bytes .../res/drawable-xhdpi/ic_action_reading.png | Bin 124 -> 0 bytes .../res/drawable-xhdpi/ic_action_refresh.png | Bin 626 -> 0 bytes .../res/drawable-xhdpi/ic_action_star.png | Bin 807 -> 0 bytes .../res/drawable-xhdpi/ic_action_tabs.png | Bin 121 -> 0 bytes .../drawable-xhdpi/ic_action_text_size.png | Bin 149 -> 0 bytes .../main/res/drawable-xhdpi/ic_bookmark.png | Bin 593 -> 0 bytes app/src/main/res/drawable-xhdpi/ic_folder.png | Bin 230 -> 0 bytes .../main/res/drawable-xhdpi/ic_history.png | Bin 851 -> 0 bytes app/src/main/res/drawable-xhdpi/ic_search.png | Bin 535 -> 0 bytes .../main/res/drawable-xhdpi/ic_webpage.png | Bin 1141 -> 0 bytes .../res/drawable-xxhdpi/ic_action_back.png | Bin 316 -> 0 bytes .../drawable-xxhdpi/ic_action_collapse.png | Bin 331 -> 0 bytes .../res/drawable-xxhdpi/ic_action_delete.png | Bin 490 -> 0 bytes .../res/drawable-xxhdpi/ic_action_desktop.png | Bin 461 -> 0 bytes .../res/drawable-xxhdpi/ic_action_expand.png | Bin 337 -> 0 bytes .../res/drawable-xxhdpi/ic_action_forward.png | Bin 328 -> 0 bytes .../res/drawable-xxhdpi/ic_action_home.png | Bin 598 -> 0 bytes .../res/drawable-xxhdpi/ic_action_invert.png | Bin 668 -> 0 bytes .../res/drawable-xxhdpi/ic_action_plus.png | Bin 177 -> 0 bytes .../res/drawable-xxhdpi/ic_action_reading.png | Bin 162 -> 0 bytes .../res/drawable-xxhdpi/ic_action_refresh.png | Bin 1134 -> 0 bytes .../res/drawable-xxhdpi/ic_action_star.png | Bin 1528 -> 0 bytes .../res/drawable-xxhdpi/ic_action_tabs.png | Bin 160 -> 0 bytes .../drawable-xxhdpi/ic_action_text_size.png | Bin 194 -> 0 bytes .../main/res/drawable-xxhdpi/ic_bookmark.png | Bin 1050 -> 0 bytes .../main/res/drawable-xxhdpi/ic_folder.png | Bin 363 -> 0 bytes .../main/res/drawable-xxhdpi/ic_history.png | Bin 1602 -> 0 bytes .../main/res/drawable-xxhdpi/ic_search.png | Bin 1010 -> 0 bytes .../main/res/drawable-xxhdpi/ic_webpage.png | Bin 1902 -> 0 bytes app/src/main/res/drawable/ic_action_back.xml | 9 +++++ .../main/res/drawable/ic_action_collapse.xml | 9 +++++ .../main/res/drawable/ic_action_delete.xml | 9 +++++ .../main/res/drawable/ic_action_desktop.xml | 9 +++++ .../main/res/drawable/ic_action_expand.xml | 9 +++++ .../main/res/drawable/ic_action_forward.xml | 9 +++++ app/src/main/res/drawable/ic_action_home.xml | 9 +++++ .../main/res/drawable/ic_action_invert.xml | 9 +++++ app/src/main/res/drawable/ic_action_plus.xml | 9 +++++ .../main/res/drawable/ic_action_reading.xml | 9 +++++ .../main/res/drawable/ic_action_refresh.xml | 9 +++++ app/src/main/res/drawable/ic_action_star.xml | 9 +++++ app/src/main/res/drawable/ic_action_tabs.xml | 9 +++++ .../main/res/drawable/ic_action_text_size.xml | 9 +++++ app/src/main/res/drawable/ic_bookmark.xml | 9 +++++ app/src/main/res/drawable/ic_folder.xml | 9 +++++ app/src/main/res/drawable/ic_history.xml | 12 ++++++ app/src/main/res/drawable/ic_search.xml | 9 +++++ app/src/main/res/drawable/ic_webpage.xml | 9 +++++ app/src/main/res/layout/bookmark_drawer.xml | 11 +++--- app/src/main/res/layout/search_interface.xml | 17 +++++---- app/src/main/res/layout/tab_drawer.xml | 13 ++++--- app/src/main/res/layout/tab_list_item.xml | 5 ++- .../res/layout/tab_list_item_horizontal.xml | 21 ++++++----- app/src/main/res/layout/tab_strip.xml | 3 +- 91 files changed, 259 insertions(+), 50 deletions(-) delete mode 100644 app/src/main/res/drawable-hdpi/ic_action_back.png delete mode 100644 app/src/main/res/drawable-hdpi/ic_action_collapse.png delete mode 100644 app/src/main/res/drawable-hdpi/ic_action_delete.png delete mode 100644 app/src/main/res/drawable-hdpi/ic_action_desktop.png delete mode 100644 app/src/main/res/drawable-hdpi/ic_action_expand.png delete mode 100644 app/src/main/res/drawable-hdpi/ic_action_forward.png delete mode 100644 app/src/main/res/drawable-hdpi/ic_action_home.png delete mode 100644 app/src/main/res/drawable-hdpi/ic_action_invert.png delete mode 100644 app/src/main/res/drawable-hdpi/ic_action_plus.png delete mode 100644 app/src/main/res/drawable-hdpi/ic_action_reading.png delete mode 100644 app/src/main/res/drawable-hdpi/ic_action_refresh.png delete mode 100644 app/src/main/res/drawable-hdpi/ic_action_star.png delete mode 100644 app/src/main/res/drawable-hdpi/ic_action_tabs.png delete mode 100644 app/src/main/res/drawable-hdpi/ic_action_text_size.png delete mode 100644 app/src/main/res/drawable-hdpi/ic_bookmark.png delete mode 100644 app/src/main/res/drawable-hdpi/ic_folder.png delete mode 100644 app/src/main/res/drawable-hdpi/ic_history.png delete mode 100644 app/src/main/res/drawable-hdpi/ic_search.png delete mode 100644 app/src/main/res/drawable-hdpi/ic_webpage.png delete mode 100644 app/src/main/res/drawable-mdpi/ic_action_home.png delete mode 100644 app/src/main/res/drawable-mdpi/ic_webpage.png delete mode 100644 app/src/main/res/drawable-xhdpi/ic_action_back.png delete mode 100644 app/src/main/res/drawable-xhdpi/ic_action_collapse.png delete mode 100644 app/src/main/res/drawable-xhdpi/ic_action_delete.png delete mode 100644 app/src/main/res/drawable-xhdpi/ic_action_desktop.png delete mode 100644 app/src/main/res/drawable-xhdpi/ic_action_expand.png delete mode 100644 app/src/main/res/drawable-xhdpi/ic_action_forward.png delete mode 100644 app/src/main/res/drawable-xhdpi/ic_action_home.png delete mode 100644 app/src/main/res/drawable-xhdpi/ic_action_invert.png delete mode 100644 app/src/main/res/drawable-xhdpi/ic_action_plus.png delete mode 100644 app/src/main/res/drawable-xhdpi/ic_action_reading.png delete mode 100644 app/src/main/res/drawable-xhdpi/ic_action_refresh.png delete mode 100644 app/src/main/res/drawable-xhdpi/ic_action_star.png delete mode 100644 app/src/main/res/drawable-xhdpi/ic_action_tabs.png delete mode 100644 app/src/main/res/drawable-xhdpi/ic_action_text_size.png delete mode 100644 app/src/main/res/drawable-xhdpi/ic_bookmark.png delete mode 100644 app/src/main/res/drawable-xhdpi/ic_folder.png delete mode 100644 app/src/main/res/drawable-xhdpi/ic_history.png delete mode 100644 app/src/main/res/drawable-xhdpi/ic_search.png delete mode 100644 app/src/main/res/drawable-xhdpi/ic_webpage.png delete mode 100644 app/src/main/res/drawable-xxhdpi/ic_action_back.png delete mode 100644 app/src/main/res/drawable-xxhdpi/ic_action_collapse.png delete mode 100644 app/src/main/res/drawable-xxhdpi/ic_action_delete.png delete mode 100644 app/src/main/res/drawable-xxhdpi/ic_action_desktop.png delete mode 100644 app/src/main/res/drawable-xxhdpi/ic_action_expand.png delete mode 100644 app/src/main/res/drawable-xxhdpi/ic_action_forward.png delete mode 100644 app/src/main/res/drawable-xxhdpi/ic_action_home.png delete mode 100644 app/src/main/res/drawable-xxhdpi/ic_action_invert.png delete mode 100644 app/src/main/res/drawable-xxhdpi/ic_action_plus.png delete mode 100644 app/src/main/res/drawable-xxhdpi/ic_action_reading.png delete mode 100644 app/src/main/res/drawable-xxhdpi/ic_action_refresh.png delete mode 100644 app/src/main/res/drawable-xxhdpi/ic_action_star.png delete mode 100644 app/src/main/res/drawable-xxhdpi/ic_action_tabs.png delete mode 100644 app/src/main/res/drawable-xxhdpi/ic_action_text_size.png delete mode 100644 app/src/main/res/drawable-xxhdpi/ic_bookmark.png delete mode 100644 app/src/main/res/drawable-xxhdpi/ic_folder.png delete mode 100644 app/src/main/res/drawable-xxhdpi/ic_history.png delete mode 100644 app/src/main/res/drawable-xxhdpi/ic_search.png delete mode 100644 app/src/main/res/drawable-xxhdpi/ic_webpage.png create mode 100644 app/src/main/res/drawable/ic_action_back.xml create mode 100644 app/src/main/res/drawable/ic_action_collapse.xml create mode 100644 app/src/main/res/drawable/ic_action_delete.xml create mode 100644 app/src/main/res/drawable/ic_action_desktop.xml create mode 100644 app/src/main/res/drawable/ic_action_expand.xml create mode 100644 app/src/main/res/drawable/ic_action_forward.xml create mode 100644 app/src/main/res/drawable/ic_action_home.xml create mode 100644 app/src/main/res/drawable/ic_action_invert.xml create mode 100644 app/src/main/res/drawable/ic_action_plus.xml create mode 100644 app/src/main/res/drawable/ic_action_reading.xml create mode 100644 app/src/main/res/drawable/ic_action_refresh.xml create mode 100644 app/src/main/res/drawable/ic_action_star.xml create mode 100644 app/src/main/res/drawable/ic_action_tabs.xml create mode 100644 app/src/main/res/drawable/ic_action_text_size.xml create mode 100644 app/src/main/res/drawable/ic_bookmark.xml create mode 100644 app/src/main/res/drawable/ic_folder.xml create mode 100644 app/src/main/res/drawable/ic_history.xml create mode 100644 app/src/main/res/drawable/ic_search.xml create mode 100644 app/src/main/res/drawable/ic_webpage.xml diff --git a/app/build.gradle b/app/build.gradle index ff3f662..56c449f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,11 +10,7 @@ android { minSdkVersion 14 targetSdkVersion 23 versionName "4.3.3" - generatedDensities = [] - } - - aaptOptions { - additionalParameters "--no-version-vectors" + vectorDrawables.useSupportLibrary = true } sourceSets { diff --git a/app/src/main/java/acr/browser/lightning/activity/BrowserActivity.java b/app/src/main/java/acr/browser/lightning/activity/BrowserActivity.java index 39e409b..69eb221 100644 --- a/app/src/main/java/acr/browser/lightning/activity/BrowserActivity.java +++ b/app/src/main/java/acr/browser/lightning/activity/BrowserActivity.java @@ -353,12 +353,13 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements mRefreshIcon = ThemeUtils.getThemedDrawable(this, R.drawable.ic_action_refresh, mDarkTheme); mClearIcon = ThemeUtils.getThemedDrawable(this, R.drawable.ic_action_delete, mDarkTheme); - int iconBounds = Utils.dpToPx(30); + int iconBounds = Utils.dpToPx(24); mDeleteIcon.setBounds(0, 0, iconBounds, iconBounds); mRefreshIcon.setBounds(0, 0, iconBounds, iconBounds); mClearIcon.setBounds(0, 0, iconBounds, iconBounds); mIcon = mRefreshIcon; SearchListenerClass search = new SearchListenerClass(); + mSearch.setCompoundDrawablePadding(Utils.dpToPx(3)); mSearch.setCompoundDrawables(null, null, mRefreshIcon, null); mSearch.setOnKeyListener(search); mSearch.setOnFocusChangeListener(search); @@ -2163,10 +2164,12 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements return; } - if (!mBookmarkManager.isBookmark(url)) { - addBookmark(title, url); - } else { - deleteBookmark(title, url); + if (!UrlUtils.isSpecialUrl(url)) { + if (!mBookmarkManager.isBookmark(url)) { + addBookmark(title, url); + } else { + deleteBookmark(title, url); + } } } diff --git a/app/src/main/java/acr/browser/lightning/async/ImageDownloadTask.java b/app/src/main/java/acr/browser/lightning/async/ImageDownloadTask.java index e229e8f..1b5378a 100644 --- a/app/src/main/java/acr/browser/lightning/async/ImageDownloadTask.java +++ b/app/src/main/java/acr/browser/lightning/async/ImageDownloadTask.java @@ -45,7 +45,7 @@ public class ImageDownloadTask extends AsyncTask { this.mContextReference = new WeakReference<>(context.getApplicationContext()); } - @Nullable + @NonNull @Override protected Bitmap doInBackground(Void... params) { Bitmap mIcon = null; @@ -65,6 +65,9 @@ public class ImageDownloadTask extends AsyncTask { final String hash = String.valueOf(uri.getHost().hashCode()); final File image = new File(cache, hash + ".png"); final String urlDisplay = uri.getScheme() + "://" + uri.getHost() + "/favicon.ico"; + if (Constants.FILE.startsWith(uri.getScheme())) { + return mDefaultBitmap; + } // checks to see if the image exists if (!image.exists()) { FileOutputStream fos = null; diff --git a/app/src/main/java/acr/browser/lightning/constant/BookmarkPage.java b/app/src/main/java/acr/browser/lightning/constant/BookmarkPage.java index 6e4a02a..7016483 100644 --- a/app/src/main/java/acr/browser/lightning/constant/BookmarkPage.java +++ b/app/src/main/java/acr/browser/lightning/constant/BookmarkPage.java @@ -42,7 +42,7 @@ public final class BookmarkPage extends AsyncTask { private static final String HEADING_2 = "\n" + "\n" + - "\n" + "
"; diff --git a/app/src/main/java/acr/browser/lightning/constant/HistoryPage.java b/app/src/main/java/acr/browser/lightning/constant/HistoryPage.java index e628e8a..c1a581f 100644 --- a/app/src/main/java/acr/browser/lightning/constant/HistoryPage.java +++ b/app/src/main/java/acr/browser/lightning/constant/HistoryPage.java @@ -28,7 +28,7 @@ public class HistoryPage extends AsyncTask { private static final String HEADING_1 = ""; - private static final String HEADING_2 = "
"; + private static final String HEADING_2 = "
"; private static final String PART1 = "
{ private static final String HEAD_2 = "" + "" - + "