|
|
@ -49,6 +49,7 @@ import acr.browser.lightning.dialog.LightningDialogBuilder; |
|
|
|
import acr.browser.lightning.preference.PreferenceManager; |
|
|
|
import acr.browser.lightning.preference.PreferenceManager; |
|
|
|
import acr.browser.lightning.async.ImageDownloadTask; |
|
|
|
import acr.browser.lightning.async.ImageDownloadTask; |
|
|
|
import acr.browser.lightning.utils.ThemeUtils; |
|
|
|
import acr.browser.lightning.utils.ThemeUtils; |
|
|
|
|
|
|
|
import acr.browser.lightning.utils.UrlUtils; |
|
|
|
import acr.browser.lightning.view.LightningView; |
|
|
|
import acr.browser.lightning.view.LightningView; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -193,12 +194,14 @@ public class BookmarksFragment extends Fragment implements View.OnClickListener, |
|
|
|
@Subscribe |
|
|
|
@Subscribe |
|
|
|
public void addBookmark(final BrowserEvents.AddBookmark event) { |
|
|
|
public void addBookmark(final BrowserEvents.AddBookmark event) { |
|
|
|
final HistoryItem item = new HistoryItem(event.url, event.title); |
|
|
|
final HistoryItem item = new HistoryItem(event.url, event.title); |
|
|
|
if (mBookmarkManager.addBookmark(item)) { |
|
|
|
if (!UrlUtils.isSpecialUrl(item.getUrl())) { |
|
|
|
mBookmarks.add(item); |
|
|
|
if (mBookmarkManager.addBookmark(item)) { |
|
|
|
Collections.sort(mBookmarks, new BookmarkManager.SortIgnoreCase()); |
|
|
|
mBookmarks.add(item); |
|
|
|
mBookmarkAdapter.notifyDataSetChanged(); |
|
|
|
Collections.sort(mBookmarks, new BookmarkManager.SortIgnoreCase()); |
|
|
|
mEventBus.post(new BookmarkEvents.Added(item)); |
|
|
|
mBookmarkAdapter.notifyDataSetChanged(); |
|
|
|
updateBookmarkIndicator(event.url); |
|
|
|
mEventBus.post(new BookmarkEvents.Added(item)); |
|
|
|
|
|
|
|
updateBookmarkIndicator(event.url); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|