Browse Source

Support bookmark importing from chrome variants and stock browser, lint fixes

master
Anthony Restaino 9 years ago
parent
commit
79d619f82b
  1. 2
      app/src/main/java/acr/browser/lightning/activity/SettingsActivity.java
  2. 4
      app/src/main/java/acr/browser/lightning/browser/BrowserPresenter.java
  3. 2
      app/src/main/java/acr/browser/lightning/constant/BookmarkPage.java
  4. 160
      app/src/main/java/acr/browser/lightning/database/BookmarkLocalSync.java
  5. 10
      app/src/main/java/acr/browser/lightning/database/BookmarkManager.java
  6. 194
      app/src/main/java/acr/browser/lightning/fragment/BookmarkSettingsFragment.java
  7. 2
      app/src/main/java/acr/browser/lightning/object/SearchAdapter.java
  8. 2
      app/src/main/java/acr/browser/lightning/react/Observable.java
  9. 2
      app/src/main/java/acr/browser/lightning/view/LightningWebClient.java
  10. 5
      app/src/main/res/values/strings.xml
  11. 9
      app/src/main/res/xml/preference_bookmarks.xml

2
app/src/main/java/acr/browser/lightning/activity/SettingsActivity.java

@ -21,7 +21,7 @@ import acr.browser.lightning.R;
public class SettingsActivity extends ThemableSettingsActivity { public class SettingsActivity extends ThemableSettingsActivity {
private static final List<String> mFragments = new ArrayList<>(); private static final List<String> mFragments = new ArrayList<>(6);
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {

4
app/src/main/java/acr/browser/lightning/browser/BrowserPresenter.java

@ -33,10 +33,10 @@ public class BrowserPresenter {
@Inject PreferenceManager mPreferences; @Inject PreferenceManager mPreferences;
@Inject Bus mEventBus; @Inject Bus mEventBus;
@NonNull private BrowserView mView; @NonNull private final BrowserView mView;
@Nullable private LightningView mCurrentTab; @Nullable private LightningView mCurrentTab;
private boolean mIsIncognito; private final boolean mIsIncognito;
private boolean mIsNewIntent; private boolean mIsNewIntent;
public BrowserPresenter(@NonNull BrowserView view, boolean isIncognito) { public BrowserPresenter(@NonNull BrowserView view, boolean isIncognito) {

2
app/src/main/java/acr/browser/lightning/constant/BookmarkPage.java

@ -63,7 +63,7 @@ public final class BookmarkPage extends AsyncTask<Void, Void, Void> {
private File mFilesDir; private File mFilesDir;
private File mCacheDir; private File mCacheDir;
private Application mApp; private final Application mApp;
private final BookmarkManager mManager; private final BookmarkManager mManager;
@NonNull private final WeakReference<LightningView> mTabReference; @NonNull private final WeakReference<LightningView> mTabReference;
private final Bitmap mFolderIcon; private final Bitmap mFolderIcon;

160
app/src/main/java/acr/browser/lightning/database/BookmarkLocalSync.java

@ -11,6 +11,9 @@ import android.util.Log;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import acr.browser.lightning.react.Action;
import acr.browser.lightning.react.Observable;
import acr.browser.lightning.react.Subscriber;
import acr.browser.lightning.utils.Utils; import acr.browser.lightning.utils.Utils;
public class BookmarkLocalSync { public class BookmarkLocalSync {
@ -28,18 +31,20 @@ public class BookmarkLocalSync {
@NonNull private final Context mContext; @NonNull private final Context mContext;
public enum Source {
STOCK,
CHROME_STABLE,
CHROME_BETA,
CHROME_DEV
}
public BookmarkLocalSync(@NonNull Context context) { public BookmarkLocalSync(@NonNull Context context) {
mContext = context; mContext = context;
} }
@NonNull public List<HistoryItem> getBookmarksFromContentUri(String contentUri) {
@WorkerThread
public List<HistoryItem> getBookmarksFromStockBrowser() {
List<HistoryItem> list = new ArrayList<>(); List<HistoryItem> list = new ArrayList<>();
if (!isStockSupported()) { Cursor cursor = getBrowserCursor(contentUri);
return list;
}
Cursor cursor = getStockCursor();
try { try {
if (cursor != null) { if (cursor != null) {
for (int n = 0; n < cursor.getColumnCount(); n++) { for (int n = 0; n < cursor.getColumnCount(); n++) {
@ -69,114 +74,109 @@ public class BookmarkLocalSync {
return list; return list;
} }
@NonNull @Nullable
@WorkerThread @WorkerThread
public List<HistoryItem> getBookmarksFromChrome() { private Cursor getBrowserCursor(String contentUri) {
List<HistoryItem> list = new ArrayList<>(); Cursor cursor;
if (!isChromeSupported()) { Uri uri = Uri.parse(contentUri);
return list;
}
Cursor cursor = getChromeCursor();
try { try {
if (cursor != null) { cursor = mContext.getContentResolver().query(uri,
for (int n = 0; n < cursor.getColumnCount(); n++) { new String[]{COLUMN_URL, COLUMN_TITLE, COLUMN_BOOKMARK}, null, null, null);
Log.d(TAG, cursor.getColumnName(n)); } catch (IllegalArgumentException e) {
} return null;
}
return cursor;
}
while (cursor.moveToNext()) { @NonNull
if (cursor.getInt(2) == 1) { public Observable<List<Source>> getSupportedBrowsers() {
String url = cursor.getString(0); return Observable.create(new Action<List<Source>>() {
String title = cursor.getString(1); @Override
if (url.isEmpty()) { public void onSubscribe(@NonNull Subscriber<List<Source>> subscriber) {
continue; List<Source> sources = new ArrayList<>(1);
} if (isBrowserSupported(STOCK_BOOKMARKS_CONTENT)) {
if (title == null || title.isEmpty()) { sources.add(Source.STOCK);
title = Utils.getDomainName(url); }
} if (isBrowserSupported(CHROME_BOOKMARKS_CONTENT)) {
if (title != null) { sources.add(Source.CHROME_STABLE);
list.add(new HistoryItem(url, title));
}
}
} }
if (isBrowserSupported(CHROME_BETA_BOOKMARKS_CONTENT)) {
sources.add(Source.CHROME_BETA);
}
if (isBrowserSupported(CHROME_DEV_BOOKMARKS_CONTENT)) {
sources.add(Source.CHROME_DEV);
}
subscriber.onNext(sources);
subscriber.onComplete();
} }
} catch (Exception e) { });
e.printStackTrace(); }
}
private boolean isBrowserSupported(String contentUri) {
Cursor cursor = getBrowserCursor(contentUri);
boolean supported = cursor != null;
Utils.close(cursor); Utils.close(cursor);
return list; return supported;
}
@NonNull
@WorkerThread
public List<HistoryItem> getBookmarksFromStockBrowser() {
return getBookmarksFromContentUri(STOCK_BOOKMARKS_CONTENT);
} }
@NonNull
@WorkerThread @WorkerThread
public boolean isStockSupported() { public List<HistoryItem> getBookmarksFromChrome() {
Cursor cursor = getStockCursor(); return getBookmarksFromContentUri(CHROME_BOOKMARKS_CONTENT);
Utils.close(cursor);
return cursor != null;
} }
@NonNull
@WorkerThread @WorkerThread
public boolean isChromeSupported() { public List<HistoryItem> getBookmarksFromChromeBeta() {
Cursor cursor = getChromeCursor(); return getBookmarksFromContentUri(CHROME_BETA_BOOKMARKS_CONTENT);
Utils.close(cursor); }
@NonNull
@WorkerThread
public List<HistoryItem> getBookmarksFromChromeDev() {
return getBookmarksFromContentUri(CHROME_DEV_BOOKMARKS_CONTENT);
}
@WorkerThread
public boolean isBrowserImportSupported() {
Cursor chrome = getChromeCursor();
Utils.close(chrome);
Cursor dev = getChromeDevCursor(); Cursor dev = getChromeDevCursor();
Utils.close(dev); Utils.close(dev);
Cursor beta = getChromeBetaCursor(); Cursor beta = getChromeBetaCursor();
return cursor != null || dev != null || beta != null; Cursor stock = getStockCursor();
Utils.close(stock);
return chrome != null || dev != null || beta != null || stock != null;
} }
@Nullable @Nullable
@WorkerThread @WorkerThread
private Cursor getChromeBetaCursor() { private Cursor getChromeBetaCursor() {
Cursor cursor; return getBrowserCursor(CHROME_BETA_BOOKMARKS_CONTENT);
Uri uri = Uri.parse(CHROME_BETA_BOOKMARKS_CONTENT);
try {
cursor = mContext.getContentResolver().query(uri,
new String[]{COLUMN_URL, COLUMN_TITLE, COLUMN_BOOKMARK}, null, null, null);
} catch (IllegalArgumentException e) {
return null;
}
return cursor;
} }
@Nullable @Nullable
@WorkerThread @WorkerThread
private Cursor getChromeDevCursor() { private Cursor getChromeDevCursor() {
Cursor cursor; return getBrowserCursor(CHROME_DEV_BOOKMARKS_CONTENT);
Uri uri = Uri.parse(CHROME_DEV_BOOKMARKS_CONTENT);
try {
cursor = mContext.getContentResolver().query(uri,
new String[]{COLUMN_URL, COLUMN_TITLE, COLUMN_BOOKMARK}, null, null, null);
} catch (IllegalArgumentException e) {
return null;
}
return cursor;
} }
@Nullable @Nullable
@WorkerThread @WorkerThread
private Cursor getChromeCursor() { private Cursor getChromeCursor() {
Cursor cursor; return getBrowserCursor(CHROME_BOOKMARKS_CONTENT);
Uri uri = Uri.parse(CHROME_BOOKMARKS_CONTENT);
try {
cursor = mContext.getContentResolver().query(uri,
new String[]{COLUMN_URL, COLUMN_TITLE, COLUMN_BOOKMARK}, null, null, null);
} catch (IllegalArgumentException e) {
return null;
}
return cursor;
} }
@Nullable @Nullable
@WorkerThread @WorkerThread
private Cursor getStockCursor() { private Cursor getStockCursor() {
Cursor cursor; return getBrowserCursor(STOCK_BOOKMARKS_CONTENT);
Uri uri = Uri.parse(STOCK_BOOKMARKS_CONTENT);
try {
cursor = mContext.getContentResolver().query(uri,
new String[]{COLUMN_URL, COLUMN_TITLE, COLUMN_BOOKMARK}, null, null, null);
} catch (IllegalArgumentException e) {
return null;
}
return cursor;
} }
public void printAllColumns() { public void printAllColumns() {

10
app/src/main/java/acr/browser/lightning/database/BookmarkManager.java

@ -282,6 +282,16 @@ public class BookmarkManager {
mExecutor.execute(new BookmarksWriter(new LinkedList<>(mBookmarksMap.values()))); mExecutor.execute(new BookmarksWriter(new LinkedList<>(mBookmarksMap.values())));
} }
/**
* This method deletes ALL bookmarks created
* by the user. Use this method carefully and
* do not use it without explicit user consent.
*/
public synchronized void deleteAllBookmarks() {
mBookmarksMap = new HashMap<>();
mExecutor.execute(new BookmarksWriter(new LinkedList<>(mBookmarksMap.values())));
}
/** /**
* This method edits a particular bookmark in the bookmark database * This method edits a particular bookmark in the bookmark database
* *

194
app/src/main/java/acr/browser/lightning/fragment/BookmarkSettingsFragment.java

@ -6,6 +6,8 @@ package acr.browser.lightning.fragment;
import android.Manifest; import android.Manifest;
import android.app.Activity; import android.app.Activity;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
@ -15,9 +17,15 @@ import android.preference.PreferenceFragment;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.support.v7.app.AlertDialog; import android.support.v7.app.AlertDialog;
import android.util.Log;
import android.widget.ArrayAdapter;
import com.anthonycr.grant.PermissionsManager;
import com.anthonycr.grant.PermissionsResultAction;
import java.io.File; import java.io.File;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Comparator; import java.util.Comparator;
import java.util.List; import java.util.List;
@ -26,13 +34,13 @@ import javax.inject.Inject;
import acr.browser.lightning.R; import acr.browser.lightning.R;
import acr.browser.lightning.app.BrowserApp; import acr.browser.lightning.app.BrowserApp;
import acr.browser.lightning.constant.Constants;
import acr.browser.lightning.database.BookmarkLocalSync; import acr.browser.lightning.database.BookmarkLocalSync;
import acr.browser.lightning.database.BookmarkLocalSync.Source;
import acr.browser.lightning.database.BookmarkManager; import acr.browser.lightning.database.BookmarkManager;
import acr.browser.lightning.database.HistoryItem; import acr.browser.lightning.database.HistoryItem;
import acr.browser.lightning.react.OnSubscribe;
import com.anthonycr.grant.PermissionsManager; import acr.browser.lightning.react.Schedulers;
import com.anthonycr.grant.PermissionsResultAction;
import acr.browser.lightning.utils.Preconditions; import acr.browser.lightning.utils.Preconditions;
import acr.browser.lightning.utils.Utils; import acr.browser.lightning.utils.Utils;
@ -41,6 +49,7 @@ public class BookmarkSettingsFragment extends PreferenceFragment implements Pref
private static final String SETTINGS_EXPORT = "export_bookmark"; private static final String SETTINGS_EXPORT = "export_bookmark";
private static final String SETTINGS_IMPORT = "import_bookmark"; private static final String SETTINGS_IMPORT = "import_bookmark";
private static final String SETTINGS_IMPORT_BROWSER = "import_browser"; private static final String SETTINGS_IMPORT_BROWSER = "import_browser";
private static final String SETTINGS_DELETE_BOOKMARKS = "delete_bookmarks";
@Nullable private Activity mActivity; @Nullable private Activity mActivity;
@ -53,27 +62,41 @@ public class BookmarkSettingsFragment extends PreferenceFragment implements Pref
Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE,
Manifest.permission.WRITE_EXTERNAL_STORAGE Manifest.permission.WRITE_EXTERNAL_STORAGE
}; };
private ImportBookmarksTask mImportTaskReference;
private static final File mPath = new File(Environment.getExternalStorageDirectory().toString()); private static final File mPath = new File(Environment.getExternalStorageDirectory().toString());
private class ImportBookmarksTask extends AsyncTask<Void, Void, Integer> { private class ImportBookmarksTask extends AsyncTask<Void, Void, Integer> {
@NonNull private final WeakReference<Activity> mActivityReference; @NonNull private final WeakReference<Activity> mActivityReference;
private final Source mSource;
public ImportBookmarksTask(Activity activity) { public ImportBookmarksTask(Activity activity, Source source) {
mActivityReference = new WeakReference<>(activity); mActivityReference = new WeakReference<>(activity);
mSource = source;
} }
@Override @Override
protected Integer doInBackground(Void... params) { protected Integer doInBackground(Void... params) {
List<HistoryItem> list = null; List<HistoryItem> list;
if (getSync().isStockSupported()) { Log.d(Constants.TAG, "Loading bookmarks from: " + mSource.name());
list = getSync().getBookmarksFromStockBrowser(); switch (mSource) {
} else if (getSync().isChromeSupported()) { case STOCK:
list = getSync().getBookmarksFromChrome(); list = getSync().getBookmarksFromStockBrowser();
break;
case CHROME_STABLE:
list = getSync().getBookmarksFromChrome();
break;
case CHROME_BETA:
list = getSync().getBookmarksFromChromeBeta();
break;
case CHROME_DEV:
list = getSync().getBookmarksFromChromeDev();
break;
default:
list = new ArrayList<>(0);
break;
} }
int count = 0; int count = 0;
if (list != null && !list.isEmpty()) { if (!list.isEmpty()) {
mBookmarkManager.addBookmarkList(list); mBookmarkManager.addBookmarkList(list);
count = list.size(); count = list.size();
} }
@ -124,30 +147,28 @@ public class BookmarkSettingsFragment extends PreferenceFragment implements Pref
public void onDestroy() { public void onDestroy() {
super.onDestroy(); super.onDestroy();
mActivity = null; mActivity = null;
if (mImportTaskReference != null) {
mImportTaskReference.cancel(false);
}
} }
private void initPrefs() { private void initPrefs() {
Preference exportpref = findPreference(SETTINGS_EXPORT); Preference exportPref = findPreference(SETTINGS_EXPORT);
Preference importpref = findPreference(SETTINGS_IMPORT); Preference importPref = findPreference(SETTINGS_IMPORT);
Preference deletePref = findPreference(SETTINGS_DELETE_BOOKMARKS);
exportpref.setOnPreferenceClickListener(this); exportPref.setOnPreferenceClickListener(this);
importpref.setOnPreferenceClickListener(this); importPref.setOnPreferenceClickListener(this);
deletePref.setOnPreferenceClickListener(this);
BrowserApp.getTaskThread().execute(mInitializeImportPreference); BrowserApp.getTaskThread().execute(new Runnable() {
} @Override
public void run() {
Preference importStock = findPreference(SETTINGS_IMPORT_BROWSER);
importStock.setEnabled(getSync().isBrowserImportSupported());
importStock.setOnPreferenceClickListener(BookmarkSettingsFragment.this);
}
});
private final Runnable mInitializeImportPreference = new Runnable() { }
@Override
public void run() {
Preference importStock = findPreference(SETTINGS_IMPORT_BROWSER);
importStock.setEnabled(getSync().isStockSupported() || getSync().isChromeSupported());
importStock.setOnPreferenceClickListener(BookmarkSettingsFragment.this);
}
};
@Override @Override
public boolean onPreferenceClick(@NonNull Preference preference) { public boolean onPreferenceClick(@NonNull Preference preference) {
@ -182,14 +203,125 @@ public class BookmarkSettingsFragment extends PreferenceFragment implements Pref
}); });
return true; return true;
case SETTINGS_IMPORT_BROWSER: case SETTINGS_IMPORT_BROWSER:
mImportTaskReference = new ImportBookmarksTask(getActivity()); getSync().getSupportedBrowsers().subscribeOn(Schedulers.worker())
mImportTaskReference.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); .observeOn(Schedulers.main()).subscribe(new OnSubscribe<List<Source>>() {
@Override
public void onNext(@Nullable List<Source> items) {
Activity activity = getActivity();
if (items == null || activity == null) {
return;
}
List<String> titles = buildTitleList(activity, items);
showChooserDialog(activity, titles);
}
});
return true;
case SETTINGS_DELETE_BOOKMARKS:
showDeleteBookmarksDialog();
return true; return true;
default: default:
return false; return false;
} }
} }
private void showDeleteBookmarksDialog() {
Activity activity = getActivity();
if (activity == null) {
return;
}
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setTitle(R.string.action_delete);
builder.setMessage(R.string.action_delete_all_bookmarks);
builder.setNegativeButton(R.string.no, null);
builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
mBookmarkManager.deleteAllBookmarks();
}
});
builder.show();
}
@NonNull
private List<String> buildTitleList(@NonNull Activity activity, @NonNull List<Source> items) {
List<String> titles = new ArrayList<>();
String title;
for (Source source : items) {
switch (source) {
case STOCK:
titles.add(getString(R.string.stock_browser));
break;
case CHROME_STABLE:
title = getTitle(activity, "com.android.chrome");
if (title != null) {
titles.add(title);
}
break;
case CHROME_BETA:
title = getTitle(activity, "com.chrome.beta");
if (title != null) {
titles.add(title);
}
break;
case CHROME_DEV:
title = getTitle(activity, "com.chrome.beta");
if (title != null) {
titles.add(title);
}
break;
default:
break;
}
}
return titles;
}
private void showChooserDialog(final Activity activity, List<String> list) {
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
final ArrayAdapter<String> adapter = new ArrayAdapter<>(activity,
android.R.layout.simple_list_item_1);
for (String title : list) {
adapter.add(title);
}
builder.setTitle(R.string.supported_browsers_title);
builder.setAdapter(adapter, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
String title = adapter.getItem(which);
Source source = null;
if (title.equals(getString(R.string.stock_browser))) {
source = Source.STOCK;
} else if (title.equals(getTitle(activity, "com.android.chrome"))) {
source = Source.CHROME_STABLE;
} else if (title.equals(getTitle(activity, "com.android.beta"))) {
source = Source.CHROME_BETA;
} else if (title.equals(getTitle(activity, "com.android.dev"))) {
source = Source.CHROME_DEV;
}
if (source != null) {
new ImportBookmarksTask(activity, source).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
}
});
builder.show();
}
@Nullable
private String getTitle(@NonNull Activity activity, @NonNull String packageName) {
PackageManager pm = activity.getPackageManager();
try {
ApplicationInfo info = pm.getApplicationInfo(packageName, PackageManager.GET_META_DATA);
CharSequence title = pm.getApplicationLabel(info);
if (title != null) {
return title.toString();
}
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
return null;
}
private void loadFileList(@Nullable File path) { private void loadFileList(@Nullable File path) {
File file; File file;
if (path != null) { if (path != null) {

2
app/src/main/java/acr/browser/lightning/object/SearchAdapter.java

@ -308,7 +308,7 @@ public class SearchAdapter extends BaseAdapter implements Filterable {
protected List<HistoryItem> doInBackground(String... arg0) { protected List<HistoryItem> doInBackground(String... arg0) {
mIsExecuting = true; mIsExecuting = true;
List<HistoryItem> filter = new ArrayList<>(); List<HistoryItem> filter = new ArrayList<>(5);
String query = arg0[0]; String query = arg0[0];
try { try {
query = SPACE_PATTERN.matcher(query).replaceAll("+"); query = SPACE_PATTERN.matcher(query).replaceAll("+");

2
app/src/main/java/acr/browser/lightning/react/Observable.java

@ -144,7 +144,7 @@ public class Observable<T> {
private static class SubscriberImpl<T> implements Subscriber<T> { private static class SubscriberImpl<T> implements Subscriber<T> {
@Nullable private OnSubscribe<T> mOnSubscribe; @Nullable private OnSubscribe<T> mOnSubscribe;
@NonNull private Observable<T> mObservable; @NonNull private final Observable<T> mObservable;
private boolean mOnCompleteExecuted = false; private boolean mOnCompleteExecuted = false;
public SubscriberImpl(@NonNull OnSubscribe<T> onSubscribe, @NonNull Observable<T> observable) { public SubscriberImpl(@NonNull OnSubscribe<T> onSubscribe, @NonNull Observable<T> observable) {

2
app/src/main/java/acr/browser/lightning/view/LightningWebClient.java

@ -194,7 +194,7 @@ public class LightningWebClient extends WebViewClient {
@NonNull @NonNull
private static List<Integer> getAllSslErrorMessageCodes(@NonNull SslError error) { private static List<Integer> getAllSslErrorMessageCodes(@NonNull SslError error) {
List<Integer> errorCodeMessageCodes = new ArrayList<>(); List<Integer> errorCodeMessageCodes = new ArrayList<>(1);
if (error.hasError(SslError.SSL_DATE_INVALID)) { if (error.hasError(SslError.SSL_DATE_INVALID)) {
errorCodeMessageCodes.add(R.string.message_certificate_date_invalid); errorCodeMessageCodes.add(R.string.message_certificate_date_invalid);

5
app/src/main/res/values/strings.xml

@ -42,7 +42,7 @@
<string name="block">Block Images</string> <string name="block">Block Images</string>
<string name="window">Allow sites to open new windows</string> <string name="window">Allow sites to open new windows</string>
<string name="cookies">Enable Cookies</string> <string name="cookies">Enable Cookies</string>
<string name="importbookmarks">Import bookmarks from Browser</string> <string name="importbookmarks">Import bookmarks from browser</string>
<string name="size">Text size</string> <string name="size">Text size</string>
<string name="recommended">Recommended</string> <string name="recommended">Recommended</string>
<string name="search">Search Engine</string> <string name="search">Search Engine</string>
@ -50,6 +50,8 @@
<string name="wideViewPort">Use wide viewport</string> <string name="wideViewPort">Use wide viewport</string>
<string name="overViewMode">Load pages in overview mode</string> <string name="overViewMode">Load pages in overview mode</string>
<string name="restore">Restore lost tabs on start</string> <string name="restore">Restore lost tabs on start</string>
<string name="supported_browsers_title">Supported Browsers</string>
<string name="stock_browser">Stock Browser</string>
<string name="stock_browser_unavailable">No stock browser detected</string> <string name="stock_browser_unavailable">No stock browser detected</string>
<string name="stock_browser_available">Supported stock browser detected</string> <string name="stock_browser_available">Supported stock browser detected</string>
<string name="fullScreenOption">Hide status bar while browsing</string> <string name="fullScreenOption">Hide status bar while browsing</string>
@ -230,4 +232,5 @@
<string name="remove_identifying_headers">Remove Identifying Headers</string> <string name="remove_identifying_headers">Remove Identifying Headers</string>
<string name="action_add_to_homescreen">Add to Homescreen</string> <string name="action_add_to_homescreen">Add to Homescreen</string>
<string name="message_added_to_homescreen">Shortcut Added to Homescreen</string> <string name="message_added_to_homescreen">Shortcut Added to Homescreen</string>
<string name="action_delete_all_bookmarks">Delete all bookmarks</string>
</resources> </resources>

9
app/src/main/res/xml/preference_bookmarks.xml

@ -4,12 +4,15 @@
<PreferenceCategory android:title="@string/bookmark_settings"> <PreferenceCategory android:title="@string/bookmark_settings">
<Preference <Preference
android:key="export_bookmark" android:key="export_bookmark"
android:title="@string/export_bookmarks" /> android:title="@string/export_bookmarks"/>
<Preference <Preference
android:key="import_bookmark" android:key="import_bookmark"
android:title="@string/import_backup" /> android:title="@string/import_backup"/>
<Preference <Preference
android:key="import_browser" android:key="import_browser"
android:title="@string/importbookmarks" /> android:title="@string/importbookmarks"/>
<Preference
android:key="delete_bookmarks"
android:title="@string/action_delete_all_bookmarks"/>
</PreferenceCategory> </PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>
Loading…
Cancel
Save