Browse Source
- Fixed a several bugs with UI - moved strings from menu.xml into strings.xml for easier translation - updated Incognito codemaster
Anthony Restaino
12 years ago
29 changed files with 438 additions and 651 deletions
@ -1,11 +0,0 @@
@@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" > |
||||
<item android:id="@+id/history" android:title="Verlauf" android:titleCondensed="Verlauf" android:orderInCategory="1"></item> |
||||
<item android:id="@+id/bookmark" android:title="Zu Lesezeichen hinzufügen" android:titleCondensed="Zu Lesezeichen hinzufügen" android:orderInCategory="2"></item> |
||||
<item android:id="@+id/allBookmarks" android:titleCondensed="Lesezeichen" android:title="Lesezeichen" android:orderInCategory="3"></item> |
||||
<item android:id="@+id/share" android:title="Teilen" android:titleCondensed="Teilen" android:orderInCategory="4"></item> |
||||
<item android:id="@+id/settings" android:title="Einstellungen" android:titleCondensed="Einstellungen" android:orderInCategory="6"></item> |
||||
<item android:id="@+id/forward" android:title="Vorwärts" android:orderInCategory="5" android:titleCondensed="Vorwärts"></item> |
||||
|
||||
|
||||
</menu> |
@ -1,10 +0,0 @@
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<menu |
||||
xmlns:android="http://schemas.android.com/apk/res/android"> |
||||
<item android:id="@id/history" android:orderInCategory="1" android:title="History" android:titleCondensed="History" /> |
||||
<item android:id="@id/bookmark" android:orderInCategory="2" android:title="Anadir a Marcadores" android:titleCondensed="Anadir a Marcadores" /> |
||||
<item android:id="@id/allBookmarks" android:orderInCategory="3" android:title="Marcadores" android:titleCondensed="Marcadores" /> |
||||
<item android:id="@id/share" android:orderInCategory="4" android:title="Compartir" android:titleCondensed="Compartir" /> |
||||
<item android:id="@id/settings" android:orderInCategory="5" android:title="Ajustes" android:titleCondensed="Ajustes" /> |
||||
<item android:id="@+id/forward" android:title="Adelante" android:orderInCategory="5" android:titleCondensed="Adelante"></item> |
||||
</menu> |
@ -1,11 +0,0 @@
@@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" > |
||||
<item android:id="@+id/history" android:title="History" android:titleCondensed="History" android:orderInCategory="1"></item> |
||||
<item android:id="@+id/bookmark" android:title="Ajouter aux favoris" android:titleCondensed="Aj. Favoris" android:orderInCategory="2"></item> |
||||
<item android:id="@+id/allBookmarks" android:titleCondensed="Favoris" android:title="Favoris" android:orderInCategory="3"></item> |
||||
<item android:id="@+id/share" android:title="Partager..." android:titleCondensed="Partager" android:orderInCategory="4"></item> |
||||
<item android:id="@+id/settings" android:title="Paramètres" android:titleCondensed="Paramètres" android:orderInCategory="6"></item> |
||||
<item android:id="@+id/forward" android:title="Suivant" android:orderInCategory="5" android:titleCondensed="Suivant"></item> |
||||
|
||||
|
||||
</menu> |
@ -1,11 +0,0 @@
@@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" > |
||||
<item android:id="@+id/history" android:title="History" android:titleCondensed="History" android:orderInCategory="1"></item> |
||||
<item android:id="@+id/bookmark" android:title="Aggiungi ai preferiti" android:titleCondensed="Aggiungi ai preferiti" android:orderInCategory="2"></item> |
||||
<item android:id="@+id/allBookmarks" android:titleCondensed="Segnalibri" android:title="Segnalibri" android:orderInCategory="3"></item> |
||||
<item android:id="@+id/share" android:title="Azione" android:titleCondensed="Azione" android:orderInCategory="4"></item> |
||||
<item android:id="@+id/settings" android:title="Impostazioni" android:titleCondensed="Impostazioni" android:orderInCategory="6"></item> |
||||
<item android:id="@+id/forward" android:title="Avanti" android:orderInCategory="5" android:titleCondensed="Avanti"></item> |
||||
|
||||
|
||||
</menu> |
@ -1,12 +0,0 @@
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" > |
||||
<item android:id="@+id/history" android:titleCondensed="History" android:title="History" android:orderInCategory="1"></item> |
||||
<item android:id="@+id/bookmark" android:titleCondensed="添加书签" android:title="添加书签" android:orderInCategory="2"></item> |
||||
<item android:id="@+id/allBookmarks" android:titleCondensed="书签列表" android:title="书签" android:orderInCategory="3"></item> |
||||
<item android:id="@+id/share" android:titleCondensed="分享页面" android:title="分享" android:orderInCategory="4"></item> |
||||
<item android:id="@+id/settings" android:titleCondensed="应用设置" android:title="设置" android:orderInCategory="6"></item> |
||||
<item android:id="@+id/tabs" android:titleCondensed="显示以及隐藏标签" android:title="显示/隐藏标签" android:orderInCategory="5"></item> |
||||
<item android:id="@+id/forward" android:titleCondensed="前进页面" android:title="前进" android:orderInCategory="7"></item> |
||||
|
||||
|
||||
</menu> |
@ -1,10 +0,0 @@
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<menu |
||||
xmlns:android="http://schemas.android.com/apk/res/android"> |
||||
<item android:id="@id/history" android:orderInCategory="1" android:title="History" android:titleCondensed="History" /> |
||||
<item android:id="@id/bookmark" android:orderInCategory="2" android:title="加入到書簽" android:titleCondensed="加入書簽" /> |
||||
<item android:id="@id/allBookmarks" android:orderInCategory="3" android:title="我的書簽" android:titleCondensed="我的書簽清單" /> |
||||
<item android:id="@id/share" android:orderInCategory="4" android:title="分享頁面" android:titleCondensed="分享頁面" /> |
||||
<item android:id="@id/settings" android:orderInCategory="6" android:title="設定" android:titleCondensed="瀏覽器設定" /> |
||||
<item android:id="@id/forward" android:orderInCategory="5" android:title="前往下個頁面" android:titleCondensed="前往下個頁面" /> |
||||
</menu> |
@ -1,9 +0,0 @@
@@ -1,9 +0,0 @@
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" > |
||||
|
||||
<item |
||||
android:id="@+id/action_settings" |
||||
android:orderInCategory="100" |
||||
android:showAsAction="never" |
||||
android:title="@string/action_settings"/> |
||||
|
||||
</menu> |
@ -1,8 +1,8 @@
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" > |
||||
<item android:id="@+id/history" android:title="History" android:titleCondensed="History" android:orderInCategory="1"></item> |
||||
<item android:id="@+id/allBookmarks" android:titleCondensed="Bookmarks" android:title="Bookmarks" android:orderInCategory="3"></item> |
||||
<item android:id="@+id/incognito" android:title="New Tab" android:orderInCategory="5" android:titleCondensed="New Tab"></item> |
||||
<item android:id="@+id/history" android:title="@string/menu_history" android:titleCondensed="@string/menu_history" android:orderInCategory="1"></item> |
||||
<item android:id="@+id/allBookmarks" android:titleCondensed="@string/menu_bookmarks" android:title="@string/menu_bookmarks" android:orderInCategory="3"></item> |
||||
<item android:id="@+id/incognito" android:title="@string/menu_new_tab" android:orderInCategory="5" android:titleCondensed="@string/menu_new_tab"></item> |
||||
|
||||
|
||||
</menu> |
@ -1,11 +1,11 @@
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" > |
||||
<item android:id="@+id/history" android:title="History" android:titleCondensed="History" android:orderInCategory="1"></item> |
||||
<item android:id="@+id/bookmark" android:title="Add to bookmarks" android:titleCondensed="Add bookmark" android:orderInCategory="2"></item> |
||||
<item android:id="@+id/allBookmarks" android:titleCondensed="Bookmarks" android:title="Bookmarks" android:orderInCategory="3"></item> |
||||
<item android:id="@+id/share" android:title="Share" android:titleCondensed="Share" android:orderInCategory="4"></item> |
||||
<item android:id="@+id/settings" android:title="Settings" android:titleCondensed="Settings" android:orderInCategory="6"></item> |
||||
<item android:id="@+id/incognito" android:title="Incognito Tab" android:orderInCategory="5" android:titleCondensed="Incognito Tab"></item> |
||||
<item android:id="@+id/history" android:title="@string/menu_history" android:titleCondensed="@string/menu_history" android:orderInCategory="1"></item> |
||||
<item android:id="@+id/bookmark" android:title="@string/menu_add" android:titleCondensed="@string/menu_add" android:orderInCategory="2"></item> |
||||
<item android:id="@+id/allBookmarks" android:titleCondensed="@string/menu_bookmarks" android:title="@string/menu_bookmarks" android:orderInCategory="3"></item> |
||||
<item android:id="@+id/share" android:title="@string/menu_share" android:titleCondensed="@string/menu_share" android:orderInCategory="4"></item> |
||||
<item android:id="@+id/settings" android:title="@string/menu_settings" android:titleCondensed="@string/menu_settings" android:orderInCategory="6"></item> |
||||
<item android:id="@+id/incognito" android:title="@string/menu_incognito" android:orderInCategory="5" android:titleCondensed="@string/menu_incognito"></item> |
||||
|
||||
|
||||
</menu> |
@ -1,9 +0,0 @@
@@ -1,9 +0,0 @@
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" > |
||||
|
||||
<item |
||||
android:id="@+id/action_settings" |
||||
android:orderInCategory="100" |
||||
android:showAsAction="never" |
||||
android:title="@string/action_settings"/> |
||||
|
||||
</menu> |
File diff suppressed because it is too large
Load Diff
@ -1,24 +0,0 @@
@@ -1,24 +0,0 @@
|
||||
package acr.browser.barebones.variables; |
||||
|
||||
public class BookmarkPageVariables { |
||||
public static final String Heading = "<!DOCTYPE html><html xmlns=\"http://www.w3.org/1999/xhtml\">" |
||||
+ "<head><meta content=\"en-us\" http-equiv=\"Content-Language\" /><meta content=\"text/html; charset=utf-8\" http-equiv=\"Content-Type\" />" |
||||
+ "<title>Bookmarks</title></head><style>" |
||||
+ "div.shadow{-moz-box-shadow: 0px 0px 6px #111;-webkit-box-shadow: 0px 0px 6px #111;box-shadow: 0px 0px 6px #111;}" |
||||
+ "body{color: gray;text-size: 10px}" |
||||
+ "div {vertical-align: middle;background-color: #ffffff;}" |
||||
+ "div.clickable {position:relative;}" |
||||
+ "p.font{font-size: 1em;font-family: \"Lucida Console\"}" |
||||
+ "div.clickable a {position:absolute;width:100%;height:100%;top:0;left:0;text-decoration:none; z-index:10; background-color:white;opacity: 0; filter: alpha(opacity=1);}" |
||||
+ "div.space {height: 0.7em;}" |
||||
+ "p{padding-top: 0.5em;padding-bottom: 0.5em;padding-right: 0.5em;padding-left: 0.5em;}" |
||||
+ "img{padding-left: 0em;padding-right: 0.5em;}" |
||||
+ "</style><body bgcolor = #f2f2f2>"; |
||||
public static final String Part1 = "<div class=\"clickable\">" |
||||
+ "<div class=\"shadow\">" + "<p class=\"font\">" + "<a href=\""; |
||||
public static final String Part2 = "\"></a>"+ |
||||
"<img height=\"15px\" width=\"15px\" src='https://www.google.com/s2/favicons?domain="; |
||||
public static final String Part3 = "'/>"; |
||||
public static final String Part4 = "</p></div></div>"; |
||||
public static final String End = "</body></html>"; |
||||
} |
@ -1,26 +0,0 @@
@@ -1,26 +0,0 @@
|
||||
package acr.browser.barebones.variables; |
||||
|
||||
import android.os.Environment; |
||||
|
||||
|
||||
public class FinalVariables { |
||||
|
||||
public static final int MAX_TABS = 5; |
||||
public static final int MAX_BOOKMARKS = 50; |
||||
public static final boolean PAID_VERSION = false; |
||||
public static final String DESKTOP_USER_AGENT = "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/20 Safari/537.17"; |
||||
public static final String MOBILE_USER_AGENT = "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7"; |
||||
public static final int API = android.os.Build.VERSION.SDK_INT; |
||||
public static final String YAHOO_SEARCH = "http://search.yahoo.com/search?p="; |
||||
public static final String GOOGLE_SEARCH = "https://www.google.com/search?client=lightning&q="; |
||||
public static final String BING_SEARCH = "http://www.bing.com/search?q="; |
||||
public static final String DUCK_SEARCH = "https://duckduckgo.com/?t=lightning&q="; |
||||
public static final String STARTPAGE_SEARCH = "https://startpage.com/do/metasearch.pl?language=english&cat=web&query="; |
||||
public static final String HOMEPAGE = "https://www.google.com/"; |
||||
public static final String SETTINGS_INTENT = "android.intent.action.SETTINGS"; |
||||
public static final String INCOGNITO_INTENT = "android.intent.action.BAREBONESINCOGNITO"; |
||||
public static final String DOWNLOAD_LOCATION = Environment.getExternalStorageDirectory().toString()+Environment.DIRECTORY_DOWNLOADS; |
||||
|
||||
|
||||
|
||||
} |
@ -1,19 +0,0 @@
@@ -1,19 +0,0 @@
|
||||
package acr.browser.barebones.variables; |
||||
|
||||
public class HistoryPageVariables { |
||||
public static final String Heading = "<!DOCTYPE html><html xmlns=\"http://www.w3.org/1999/xhtml\">" |
||||
+ "<head><meta content=\"en-us\" http-equiv=\"Content-Language\" /><meta content=\"text/html; charset=utf-8\" http-equiv=\"Content-Type\" /><title>History</title></head><style>" |
||||
+ "div.shadow {-moz-box-shadow: 0px 0px 6px #111;-webkit-box-shadow: 0px 0px 6px #111;box-shadow: 0px 0px 6px #111;}" |
||||
+ "body{color: gray;text-size: 10px}div.space {height: 0.7em;} div.extra{text-align: center;}div {vertical-align: middle;}" |
||||
+ "div {background-color: #ffffff;}div.clickable {position:relative;}p.black{color: black;font-size: 1em;font-family: \"Lucida Console\"}" |
||||
+ "p.font{font-size: 1em;font-family: \"Lucida Console\"}p.black{padding-left: 0.5em;padding-right: 0.5em;padding-top: 0.5em;padding-bottom: 0em;}" |
||||
+ "p.font{padding-left: 0.5em;padding-right: 0.5em;padding-top: 0em;padding-bottom: 0.5em;}" |
||||
+ "div.clickable a {position:absolute; width:100%;height:100%;top:0;left:0;text-decoration:none; z-index:10; background-color:white;opacity: 0;filter: alpha(opacity=1);}" |
||||
+ "</style><body bgcolor = #f2f2f2>"; |
||||
|
||||
public static final String Part1 = "<div class=\"clickable\"><div class=\"shadow\"><a href=\""; |
||||
public static final String Part2 = "\"></a><p class=\"black\">"; |
||||
public static final String Part3 = "</p><p class=\"font\">"; |
||||
public static final String Part4 = "</p></div></div>"; |
||||
public static final String End = "</body></html>"; |
||||
} |
@ -1,174 +0,0 @@
@@ -1,174 +0,0 @@
|
||||
package acr.browser.barebones.variables; |
||||
|
||||
import java.io.BufferedReader; |
||||
import java.io.BufferedWriter; |
||||
import java.io.File; |
||||
import java.io.FileNotFoundException; |
||||
import java.io.FileReader; |
||||
import java.io.FileWriter; |
||||
import java.io.IOException; |
||||
|
||||
import acr.browser.barebones.databases.DatabaseHandler; |
||||
import acr.browser.barebones.databases.HistoryItem; |
||||
import android.annotation.SuppressLint; |
||||
import android.annotation.TargetApi; |
||||
import android.app.AlertDialog; |
||||
import android.app.DownloadManager; |
||||
import android.content.ContentResolver; |
||||
import android.content.Context; |
||||
import android.content.DialogInterface; |
||||
import android.database.Cursor; |
||||
import android.database.DatabaseUtils; |
||||
import android.database.sqlite.SQLiteDatabase; |
||||
import android.database.sqlite.SQLiteException; |
||||
import android.net.Uri; |
||||
import android.os.Build; |
||||
import android.os.Environment; |
||||
import android.provider.Browser; |
||||
import android.util.Log; |
||||
import android.webkit.URLUtil; |
||||
import android.widget.Toast; |
||||
|
||||
public class Utils { |
||||
public static void createInformativeDialog(Context context, String title, |
||||
String message) { |
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context); |
||||
builder.setTitle(title); |
||||
builder.setMessage(message) |
||||
.setCancelable(true) |
||||
.setPositiveButton("Ok", |
||||
new DialogInterface.OnClickListener() { |
||||
@Override |
||||
public void onClick(DialogInterface dialog, int id) { |
||||
} |
||||
}); |
||||
AlertDialog alert = builder.create(); |
||||
alert.show(); |
||||
} |
||||
|
||||
public static void addBookmark(Context context, String title, String url) { |
||||
File book = new File(context.getFilesDir(), "bookmarks"); |
||||
File bookUrl = new File(context.getFilesDir(), "bookurl"); |
||||
try { |
||||
BufferedReader readUrlRead = new BufferedReader(new FileReader( |
||||
bookUrl)); |
||||
String u; |
||||
int n = 0; |
||||
while ((u = readUrlRead.readLine()) != null |
||||
&& n < FinalVariables.MAX_BOOKMARKS) { |
||||
if (u.contentEquals(url)) { |
||||
readUrlRead.close(); |
||||
return; |
||||
} |
||||
n++; |
||||
} |
||||
readUrlRead.close(); |
||||
|
||||
} catch (FileNotFoundException ignored) { |
||||
} catch (IOException ignored) { |
||||
} catch (NullPointerException ignored) { |
||||
} |
||||
try { |
||||
BufferedWriter bookWriter = new BufferedWriter(new FileWriter(book, |
||||
true)); |
||||
BufferedWriter urlWriter = new BufferedWriter(new FileWriter( |
||||
bookUrl, true)); |
||||
bookWriter.write(title); |
||||
urlWriter.write(url); |
||||
bookWriter.newLine(); |
||||
urlWriter.newLine(); |
||||
bookWriter.close(); |
||||
urlWriter.close(); |
||||
} catch (FileNotFoundException ignored) { |
||||
} catch (IOException ignored) { |
||||
} catch (NullPointerException ignored) { |
||||
} |
||||
} |
||||
|
||||
public static void updateHistory(final Context context, |
||||
final ContentResolver content, final boolean noStockBrowser, |
||||
final String url, final String title) { |
||||
Runnable update = new Runnable() { |
||||
@Override |
||||
public void run() { |
||||
if (!noStockBrowser) { |
||||
try { |
||||
Browser.updateVisitedHistory(content, url, true); |
||||
} catch (NullPointerException ignored) { |
||||
} |
||||
} |
||||
try { |
||||
StringBuilder sb = new StringBuilder("url" + " = "); |
||||
DatabaseUtils.appendEscapedSQLString(sb, url); |
||||
DatabaseHandler historyHandler = new DatabaseHandler( |
||||
context); |
||||
SQLiteDatabase history = historyHandler.getReadableDatabase(); |
||||
Cursor cursor = history.query("history", new String[] { "id", |
||||
"url", "title" }, sb.toString(), null, null, null, |
||||
null); |
||||
if (!cursor.moveToFirst()) { |
||||
historyHandler.addHistoryItem(new HistoryItem(url, |
||||
title)); |
||||
} else { |
||||
historyHandler.delete(url); |
||||
historyHandler.addHistoryItem(new HistoryItem(url, |
||||
title)); |
||||
} |
||||
historyHandler.close(); |
||||
cursor.close(); |
||||
history.close(); |
||||
} catch (IllegalStateException e) { |
||||
Log.e("Barebones", "IllegalStateException in updateHistory"); |
||||
} catch (NullPointerException e) { |
||||
Log.e("Barebones", "NullPointerException in updateHistory"); |
||||
} catch (SQLiteException e) { |
||||
Log.e("Barebones", "SQLiteException in updateHistory"); |
||||
} |
||||
} |
||||
}; |
||||
if (url != null) { |
||||
if (!url.startsWith("file://")) { |
||||
new Thread(update).start(); |
||||
} |
||||
} |
||||
} |
||||
|
||||
@TargetApi(Build.VERSION_CODES.GINGERBREAD) |
||||
public static void downloadFile(final Context context, final String url, final String contentDisposition, final String mimetype){ |
||||
try { |
||||
Thread downloader = new Thread(new Runnable() { |
||||
@SuppressLint("InlinedApi") |
||||
@Override |
||||
public void run() { |
||||
DownloadManager download = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE); |
||||
Uri nice = Uri.parse(url); |
||||
DownloadManager.Request it = new DownloadManager.Request( |
||||
nice); |
||||
String fileName = URLUtil.guessFileName(url, |
||||
contentDisposition, mimetype); |
||||
if (FinalVariables.API >= 11) { |
||||
it.allowScanningByMediaScanner(); |
||||
it.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED); |
||||
} |
||||
|
||||
it.setDestinationInExternalPublicDir( |
||||
Environment.DIRECTORY_DOWNLOADS, fileName); |
||||
Log.i("Barebones", "Downloading" + fileName); |
||||
download.enqueue(it); |
||||
} |
||||
}); |
||||
downloader.run(); |
||||
} catch (NullPointerException e) { |
||||
Log.e("Barebones", "Problem downloading"); |
||||
Toast.makeText(context, "Error Downloading File", |
||||
Toast.LENGTH_SHORT).show(); |
||||
} catch (IllegalArgumentException e) { |
||||
Log.e("Barebones", "Problem downloading"); |
||||
Toast.makeText(context, "Error Downloading File", |
||||
Toast.LENGTH_SHORT).show(); |
||||
} catch (SecurityException ignored) { |
||||
|
||||
} |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue