|
|
@ -1,5 +1,6 @@ |
|
|
|
package acr.browser.lightning.fragment; |
|
|
|
package acr.browser.lightning.fragment; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import android.app.Activity; |
|
|
|
import android.content.Context; |
|
|
|
import android.content.Context; |
|
|
|
import android.content.Intent; |
|
|
|
import android.content.Intent; |
|
|
|
import android.graphics.Bitmap; |
|
|
|
import android.graphics.Bitmap; |
|
|
@ -91,6 +92,8 @@ public class BookmarksFragment extends Fragment implements View.OnClickListener, |
|
|
|
// Colors
|
|
|
|
// Colors
|
|
|
|
private int mIconColor, mScrollIndex; |
|
|
|
private int mIconColor, mScrollIndex; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private boolean mIsIncognito; |
|
|
|
|
|
|
|
|
|
|
|
private Observable<BookmarkViewAdapter> initBookmarkManager() { |
|
|
|
private Observable<BookmarkViewAdapter> initBookmarkManager() { |
|
|
|
return Observable.create(new Action<BookmarkViewAdapter>() { |
|
|
|
return Observable.create(new Action<BookmarkViewAdapter>() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -109,8 +112,8 @@ public class BookmarksFragment extends Fragment implements View.OnClickListener, |
|
|
|
final Bundle arguments = getArguments(); |
|
|
|
final Bundle arguments = getArguments(); |
|
|
|
final Context context = getContext(); |
|
|
|
final Context context = getContext(); |
|
|
|
mTabsManager = ((UIController) context).getTabModel(); |
|
|
|
mTabsManager = ((UIController) context).getTabModel(); |
|
|
|
boolean isIncognito = arguments.getBoolean(INCOGNITO_MODE, false); |
|
|
|
mIsIncognito = arguments.getBoolean(INCOGNITO_MODE, false); |
|
|
|
boolean darkTheme = mPreferenceManager.getUseTheme() != 0 || isIncognito; |
|
|
|
boolean darkTheme = mPreferenceManager.getUseTheme() != 0 || mIsIncognito; |
|
|
|
mWebpageBitmap = ThemeUtils.getThemedBitmap(context, R.drawable.ic_webpage, darkTheme); |
|
|
|
mWebpageBitmap = ThemeUtils.getThemedBitmap(context, R.drawable.ic_webpage, darkTheme); |
|
|
|
mFolderBitmap = ThemeUtils.getThemedBitmap(context, R.drawable.ic_folder, darkTheme); |
|
|
|
mFolderBitmap = ThemeUtils.getThemedBitmap(context, R.drawable.ic_folder, darkTheme); |
|
|
|
mIconColor = darkTheme ? ThemeUtils.getIconDarkThemeColor(context) : |
|
|
|
mIconColor = darkTheme ? ThemeUtils.getIconDarkThemeColor(context) : |
|
|
@ -196,6 +199,18 @@ public class BookmarksFragment extends Fragment implements View.OnClickListener, |
|
|
|
mEventBus.unregister(this); |
|
|
|
mEventBus.unregister(this); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void reinitializePreferences() { |
|
|
|
|
|
|
|
Activity activity = getActivity(); |
|
|
|
|
|
|
|
if (activity == null) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
boolean darkTheme = mPreferenceManager.getUseTheme() != 0 || mIsIncognito; |
|
|
|
|
|
|
|
mWebpageBitmap = ThemeUtils.getThemedBitmap(activity, R.drawable.ic_webpage, darkTheme); |
|
|
|
|
|
|
|
mFolderBitmap = ThemeUtils.getThemedBitmap(activity, R.drawable.ic_folder, darkTheme); |
|
|
|
|
|
|
|
mIconColor = darkTheme ? ThemeUtils.getIconDarkThemeColor(activity) : |
|
|
|
|
|
|
|
ThemeUtils.getIconLightThemeColor(activity); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Subscribe |
|
|
|
@Subscribe |
|
|
|
public void addBookmark(@NonNull final BrowserEvents.BookmarkAdded event) { |
|
|
|
public void addBookmark(@NonNull final BrowserEvents.BookmarkAdded event) { |
|
|
|
updateBookmarkIndicator(event.url); |
|
|
|
updateBookmarkIndicator(event.url); |
|
|
|