Browse Source

2.5.0.0

pre-release push of code to github. not guaranteed to work the way you
want. This is what is fixed to far:

- added History viewer
- added better bookmarks (fixed bug in fullscreen mode)
- better full screen URL bar handling
- added some more animations
- incognito mode
-notify user of SSL errors
-popup tabs now work
-fixed bug where certain sites wouldn’t display until touched
master
Anthony Restaino 12 years ago
parent
commit
0cd7d6d74a
  1. 17
      AndroidManifest.xml
  2. BIN
      Barebones.apk
  3. BIN
      ic_launcher-web.png
  4. BIN
      ic_launcher.png
  5. BIN
      lightning_final.png
  6. 8
      res/anim/down.xml
  7. 8
      res/anim/up.xml
  8. BIN
      res/drawable-hdpi/ic_launcher.png
  9. BIN
      res/drawable-mdpi/ic_launcher.png
  10. BIN
      res/drawable-xhdpi/ic_launcher.png
  11. BIN
      res/drawable-xhdpi/incognito.png
  12. 4
      res/layout/activity_main.xml
  13. 2
      res/layout/settings.xml
  14. 2
      res/menu-de/menu.xml
  15. 2
      res/menu-es/menu.xml
  16. 2
      res/menu-fr/menu.xml
  17. 2
      res/menu-it/menu.xml
  18. 2
      res/menu-zh-rCN/menu.xml
  19. 2
      res/menu-zh-rTW/menu.xml
  20. 8
      res/menu/incognito_menu.xml
  21. 4
      res/menu/menu.xml
  22. 1534
      src/acr/browser/barebones/Barebones.java
  23. 24
      src/acr/browser/barebones/BookmarkPage.java
  24. 55
      src/acr/browser/barebones/CustomWebView.java
  25. 8
      src/acr/browser/barebones/DatabaseHandler.java
  26. 14
      src/acr/browser/barebones/FinalVars.java
  27. 8
      src/acr/browser/barebones/HistoryItem.java
  28. 18
      src/acr/browser/barebones/HistoryPage.java
  29. 2067
      src/acr/browser/barebones/IncognitoMode.java
  30. 56
      src/acr/browser/barebones/Settings.java
  31. 61
      src/acr/browser/barebones/SpaceTokenizer.java

17
AndroidManifest.xml

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="acr.browser.barebones" package="acr.browser.barebones"
android:versionCode="42" android:versionCode="43"
android:versionName="2.4.3" > android:versionName="2.5.0.0" >
<uses-sdk <uses-sdk
android:minSdkVersion="8" android:minSdkVersion="8"
@ -75,6 +75,19 @@
<data android:scheme="https" /> <data android:scheme="https" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity
android:name="acr.browser.barebones.IncognitoMode"
android:label="@string/app_name"
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
android:alwaysRetainTaskState="true"
android:launchMode="singleTask"
android:hardwareAccelerated="true">
<intent-filter>
<action android:name="android.intent.action.BAREBONESINCOGNITO" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity <activity
android:name="acr.browser.barebones.Settings" android:name="acr.browser.barebones.Settings"
android:configChanges="orientation|screenSize|keyboard" android:configChanges="orientation|screenSize|keyboard"

BIN
Barebones.apk

Binary file not shown.

BIN
ic_launcher-web.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

BIN
ic_launcher.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

BIN
lightning_final.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

8
res/anim/down.xml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromYDelta="0%p"
android:interpolator="@android:anim/linear_interpolator"
android:toYDelta="100%p" android:duration="150" />
</set>

8
res/anim/up.xml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromYDelta="100%p"
android:interpolator="@android:anim/linear_interpolator"
android:toYDelta="0%p" android:duration="250" />
</set>

BIN
res/drawable-hdpi/ic_launcher.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

BIN
res/drawable-mdpi/ic_launcher.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
res/drawable-xhdpi/ic_launcher.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

BIN
res/drawable-xhdpi/incognito.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 486 B

4
res/layout/activity_main.xml

@ -33,7 +33,8 @@
<LinearLayout <LinearLayout
android:id="@+id/tabLayout" android:id="@+id/tabLayout"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" > android:layout_height="match_parent"
android:orientation="horizontal">
</LinearLayout> </LinearLayout>
@ -103,7 +104,6 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:layout_toRightOf="@+id/forward"
android:paddingBottom="10dp" android:paddingBottom="10dp"
android:paddingLeft="10dp" android:paddingLeft="10dp"
android:paddingRight="10dp" android:paddingRight="10dp"

2
res/layout/settings.xml

@ -27,7 +27,7 @@
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<TextView android:id="@+id/textView4" android:layout_width="match_parent" <TextView android:id="@+id/textView4" android:layout_width="match_parent"
android:layout_height="56dp" android:layout_below="@+id/relativeLayout1" android:layout_height="56dp"
android:layout_centerHorizontal="true" android:background="#ff0099cc" android:layout_centerHorizontal="true" android:background="#ff0099cc"
android:gravity="center_vertical|center_horizontal" android:text="@string/settingshelp" android:gravity="center_vertical|center_horizontal" android:text="@string/settingshelp"
android:textAppearance="?android:attr/textAppearanceLarge" android:textAppearance="?android:attr/textAppearanceLarge"

2
res/menu-de/menu.xml

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" > <menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:id="@+id/refresh" android:title="Aktualisieren" android:titleCondensed="Aktualisieren" android:orderInCategory="1"></item> <item android:id="@+id/history" android:title="History" android:titleCondensed="History" 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/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/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/share" android:title="Teilen" android:titleCondensed="Teilen" android:orderInCategory="4"></item>

2
res/menu-es/menu.xml

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<menu <menu
xmlns:android="http://schemas.android.com/apk/res/android"> xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@id/refresh" android:orderInCategory="1" android:title="Actualizar" android:titleCondensed="Actualizar" /> <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/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/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/share" android:orderInCategory="4" android:title="Compartir" android:titleCondensed="Compartir" />

2
res/menu-fr/menu.xml

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" > <menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:id="@+id/refresh" android:title="Actualiser" android:titleCondensed="Actualiser" android:orderInCategory="1"></item> <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/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/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/share" android:title="Partager..." android:titleCondensed="Partager" android:orderInCategory="4"></item>

2
res/menu-it/menu.xml

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" > <menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:id="@+id/refresh" android:title="Rinfrescare" android:titleCondensed="Rinfrescare" android:orderInCategory="1"></item> <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/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/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/share" android:title="Azione" android:titleCondensed="Azione" android:orderInCategory="4"></item>

2
res/menu-zh-rCN/menu.xml

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" > <menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:id="@+id/refresh" android:titleCondensed="刷新页面" android:title="刷新" android:orderInCategory="1"></item> <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/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/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/share" android:titleCondensed="分享页面" android:title="分享" android:orderInCategory="4"></item>

2
res/menu-zh-rTW/menu.xml

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<menu <menu
xmlns:android="http://schemas.android.com/apk/res/android"> xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@id/refresh" android:orderInCategory="1" android:title="重新載入" android:titleCondensed="重新載入頁面" /> <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/bookmark" android:orderInCategory="2" android:title="加入到書簽" android:titleCondensed="加入書簽" />
<item android:id="@id/allBookmarks" android:orderInCategory="3" 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/share" android:orderInCategory="4" android:title="分享頁面" android:titleCondensed="分享頁面" />

8
res/menu/incognito_menu.xml

@ -0,0 +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>
</menu>

4
res/menu/menu.xml

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" > <menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:id="@+id/refresh" android:title="Refresh" android:titleCondensed="Refresh" android:orderInCategory="1"></item> <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/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/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/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/settings" android:title="Settings" android:titleCondensed="Settings" android:orderInCategory="6"></item>
<item android:id="@+id/forward" android:title="Forward" android:orderInCategory="5" android:titleCondensed="Forward"></item> <item android:id="@+id/incognito" android:title="Incognito Tab" android:orderInCategory="5" android:titleCondensed="Incognito Tab"></item>
</menu> </menu>

1534
src/acr/browser/barebones/Barebones.java

File diff suppressed because it is too large Load Diff

24
src/acr/browser/barebones/BookmarkPage.java

@ -0,0 +1,24 @@
package acr.browser.barebones;
class BookmarkPage {
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;}"
+ "div {vertical-align: middle;background-color: #ffffff;}"
+ "div.clickable {position:relative;}"
+ "p.font{font-size: 60px;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: 10px;}"
+ "p{padding-top: 3mm;padding-bottom: 3mm;padding-right: 2mm;padding-left: 2mm;}"
+ "img{padding-left: 2mm;padding-right: 2mm;}"
+ "</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=\"32\" width=\"32\" src='http://getfavicon.appspot.com/";
public static final String Part3 = "'/>";
public static final String Part4 = "</p></div></div>";
public static final String End = "</body></html>";
}

55
src/acr/browser/barebones/CustomWebView.java

@ -0,0 +1,55 @@
package acr.browser.barebones;
import android.content.Context;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.animation.Animation;
import android.webkit.WebView;
public final class CustomWebView extends WebView {
private final int API = FinalVars.API;
private int hitTest;
private final boolean showFullScreen = Barebones.showFullScreen;
private final View uBar = Barebones.uBar;
private final Animation slideUp = Barebones.slideUp;
private final Animation slideDown = Barebones.slideDown;
public CustomWebView(Context context) {
super(context);
}
@Override
public boolean onTouchEvent(MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN: {
hitTest = 0;
try {
hitTest = getHitTestResult().getType();
} catch (NullPointerException ignored) {
}
if (API <= 10 && !this.hasFocus()) {
this.requestFocus();
}
if (showFullScreen) {
if (uBar.isShown()) {
uBar.startAnimation(slideUp);
} else if (this.getScrollY() <= 5
&& !uBar.isShown() && hitTest != 9) {
uBar.startAnimation(slideDown);
}
}
break;
}
default:
break;
}
return super.onTouchEvent(event);
}
}

8
src/acr/browser/barebones/DatabaseHandler.java

@ -9,7 +9,7 @@ import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper; import android.database.sqlite.SQLiteOpenHelper;
public class DatabaseHandler extends SQLiteOpenHelper { class DatabaseHandler extends SQLiteOpenHelper {
// All Static variables // All Static variables
// Database Version // Database Version
@ -75,10 +75,10 @@ public class DatabaseHandler extends SQLiteOpenHelper {
if (cursor != null) if (cursor != null)
cursor.moveToFirst(); cursor.moveToFirst();
HistoryItem item = new HistoryItem(Integer.parseInt(cursor.getString(0)),
cursor.getString(1), cursor.getString(2));
// return item // return item
return item; return new HistoryItem(Integer.parseInt(cursor.getString(0)),
cursor.getString(1), cursor.getString(2));
} }
// Getting All HistoryItems // Getting All HistoryItems

14
src/acr/browser/barebones/FinalVars.java

@ -1,17 +1,21 @@
package acr.browser.barebones; package acr.browser.barebones;
public class FinalVars { class FinalVars {
public static final int MAX_TABS = 5; public static final int MAX_TABS = 5;
public static final int MAX_BOOKMARKS = 5; public static final int MAX_BOOKMARKS = 5;
public static final boolean PAID_VERSION = false; public static final boolean PAID_VERSION = false;
public static final int API = Integer.valueOf(android.os.Build.VERSION.SDK_INT); 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 YAHOO_SEARCH = "https://search.yahoo.com/search?p="; public static final int API = android.os.Build.VERSION.SDK_INT;
public static final String GOOGLE_SEARCH = "https://www.google.com/search?q="; public static final String YAHOO_SEARCH = "search.yahoo.com/search?p=";
public static final String BING_SEARCH = "https://www.bing.com/search?q="; public static final String GOOGLE_SEARCH = "https://www.google.com/search?client=lightning&q=";
public static final String BING_SEARCH = "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 HOMEPAGE = "https://www.google.com/";
public static final String SETTINGS_INTENT = "android.intent.action.BAREBONESSETTINGS"; public static final String SETTINGS_INTENT = "android.intent.action.BAREBONESSETTINGS";
public static final String INCOGNITO_INTENT = "android.intent.action.BAREBONESINCOGNITO";

8
src/acr/browser/barebones/HistoryItem.java

@ -1,12 +1,12 @@
package acr.browser.barebones; package acr.browser.barebones;
public class HistoryItem { class HistoryItem {
//private variables //private variables
int _id; private int _id;
String _url; private String _url;
String _title; private String _title;
// Empty constructor // Empty constructor
public HistoryItem(){ public HistoryItem(){

18
src/acr/browser/barebones/HistoryPage.java

@ -0,0 +1,18 @@
package acr.browser.barebones;
public class HistoryPage {
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;}div.space {height: 10px;} div.extra{text-align: center;}div {vertical-align: middle;}"
+ "div {background-color: #ffffff;}div.clickable {position:relative;}p.black{color: black;font-size: 40px;font-family: \"Lucida Console\"}"
+ "p.font{font-size: 25px;font-family: \"Lucida Console\"}p{padding-left: 1mm;padding-right: 1mm;padding-top: 1mm;padding-bottom: 1mm;}"
+ "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>";
}

2067
src/acr/browser/barebones/IncognitoMode.java

File diff suppressed because it is too large Load Diff

56
src/acr/browser/barebones/Settings.java

@ -25,14 +25,20 @@ import android.widget.TextView;
import android.widget.TextView.OnEditorActionListener; import android.widget.TextView.OnEditorActionListener;
public class Settings extends Activity { public class Settings extends Activity {
public static final String preferences = "settings"; private static final String preferences = "settings";
static boolean allowLocation, deleteHistory; private static boolean allowLocation;
static int enableFlash; private static boolean deleteHistory;
static boolean savePasswords, fullScreen, java, saveTabs; private static int enableFlash;
static String userAgent, homepage; private static boolean savePasswords;
static EditText agent,h; private static boolean fullScreen;
static SharedPreferences.Editor edit; private static boolean java;
static int agentPicker; private static boolean saveTabs;
private static String userAgent;
private static String homepage;
private static EditText agent;
private static EditText h;
private static SharedPreferences.Editor edit;
private static int agentPicker;
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
@ -132,7 +138,7 @@ public class Settings extends Activity {
java(); java();
} }
public void saveTabs(){ void saveTabs(){
final CheckBox tab = (CheckBox)findViewById(R.id.saveTabs); final CheckBox tab = (CheckBox)findViewById(R.id.saveTabs);
if(saveTabs){ if(saveTabs){
tab.setChecked(true); tab.setChecked(true);
@ -157,7 +163,7 @@ public class Settings extends Activity {
}); });
} }
public void getHome() { void getHome() {
h = (EditText) findViewById(R.id.homePage); h = (EditText) findViewById(R.id.homePage);
TextView t = (TextView) findViewById(R.id.textView3); TextView t = (TextView) findViewById(R.id.textView3);
@ -177,7 +183,7 @@ public class Settings extends Activity {
String home; String home;
home = h.getText().toString(); home = h.getText().toString();
if(!home.contains("about:blank")&&!home.contains("about:home")){ if(!home.contains("about:blank")&&!home.contains("about:home")){
if(home.contains("http://")==false&&home.contains("https://")==false){ if(!home.contains("http://") && !home.contains("https://")){
home = "http://"+home; home = "http://"+home;
}} }}
edit.putString("home", home); edit.putString("home", home);
@ -201,7 +207,7 @@ public class Settings extends Activity {
|| actionId == EditorInfo.IME_ACTION_SEND||actionId==EditorInfo.IME_ACTION_SEARCH||event.getAction()==KeyEvent.KEYCODE_ENTER) { || actionId == EditorInfo.IME_ACTION_SEND||actionId==EditorInfo.IME_ACTION_SEARCH||event.getAction()==KeyEvent.KEYCODE_ENTER) {
String home = h.getText().toString(); String home = h.getText().toString();
if(!h.getText().toString().contains("about:blank")&&!h.getText().toString().contains("about:home")){ if(!h.getText().toString().contains("about:blank")&&!h.getText().toString().contains("about:home")){
if(h.getText().toString().contains("http://")==false&&h.getText().toString().contains("https://")==false){ if(!h.getText().toString().contains("http://") && !h.getText().toString().contains("https://")){
home = "http://"+h.getText().toString(); home = "http://"+h.getText().toString();
}} }}
edit.putString("home", home); edit.putString("home", home);
@ -245,7 +251,7 @@ public class Settings extends Activity {
} }
public void back() { void back() {
ImageView back = (ImageView) findViewById(R.id.back); ImageView back = (ImageView) findViewById(R.id.back);
back.setBackgroundResource(R.drawable.button); back.setBackgroundResource(R.drawable.button);
back.setOnClickListener(new OnClickListener() { back.setOnClickListener(new OnClickListener() {
@ -260,7 +266,7 @@ public class Settings extends Activity {
} }
String home = h.getText().toString(); String home = h.getText().toString();
if(!h.getText().toString().contains("about:blank")&&!h.getText().toString().contains("about:home")){ if(!h.getText().toString().contains("about:blank")&&!h.getText().toString().contains("about:home")){
if(h.getText().toString().contains("http://")==false&&h.getText().toString().contains("https://")==false){ if(!h.getText().toString().contains("http://") && !h.getText().toString().contains("https://")){
home = "http://"+h.getText().toString(); home = "http://"+h.getText().toString();
}} }}
edit.putString("home", home); edit.putString("home", home);
@ -270,7 +276,7 @@ public class Settings extends Activity {
}); });
} }
public void java(){ void java(){
final CheckBox full = (CheckBox)findViewById(R.id.java); final CheckBox full = (CheckBox)findViewById(R.id.java);
if(java){ if(java){
full.setChecked(true); full.setChecked(true);
@ -294,7 +300,7 @@ public class Settings extends Activity {
}); });
} }
public void full(){ void full(){
final CheckBox full = (CheckBox)findViewById(R.id.fullScreen); final CheckBox full = (CheckBox)findViewById(R.id.fullScreen);
if(fullScreen){ if(fullScreen){
full.setChecked(true); full.setChecked(true);
@ -318,7 +324,7 @@ public void full(){
}); });
} }
public void flash() { void flash() {
final CheckBox fla = (CheckBox) findViewById(R.id.flash); final CheckBox fla = (CheckBox) findViewById(R.id.flash);
if (enableFlash == 1||enableFlash==2) { if (enableFlash == 1||enableFlash==2) {
fla.setChecked(true); fla.setChecked(true);
@ -384,9 +390,9 @@ public void full(){
}); });
} }
public void location() { void location() {
CheckBox loc = (CheckBox) findViewById(R.id.location); CheckBox loc = (CheckBox) findViewById(R.id.location);
if (allowLocation == true) { if (allowLocation) {
loc.setChecked(true); loc.setChecked(true);
} else { } else {
loc.setChecked(false); loc.setChecked(false);
@ -409,7 +415,7 @@ public void full(){
} }
public void getText() { void getText() {
agent.setOnKeyListener(new OnKeyListener(){ agent.setOnKeyListener(new OnKeyListener(){
@Override @Override
@ -452,9 +458,9 @@ public void full(){
}); });
} }
public void passwords() { void passwords() {
CheckBox pass = (CheckBox) findViewById(R.id.password); CheckBox pass = (CheckBox) findViewById(R.id.password);
if (savePasswords == true) { if (savePasswords) {
pass.setChecked(true); pass.setChecked(true);
} else { } else {
pass.setChecked(false); pass.setChecked(false);
@ -476,9 +482,9 @@ public void full(){
}); });
} }
public void clearHistory() { void clearHistory() {
CheckBox clearHist = (CheckBox) findViewById(R.id.historyClear); CheckBox clearHist = (CheckBox) findViewById(R.id.historyClear);
if (deleteHistory == true) { if (deleteHistory) {
clearHist.setChecked(true); clearHist.setChecked(true);
} else { } else {
clearHist.setChecked(false); clearHist.setChecked(false);
@ -511,7 +517,7 @@ public void full(){
} }
String home = h.getText().toString(); String home = h.getText().toString();
if(!h.getText().toString().contains("about:blank")&&!h.getText().toString().contains("about:home")){ if(!h.getText().toString().contains("about:blank")&&!h.getText().toString().contains("about:home")){
if(h.getText().toString().contains("http://")==false&&h.getText().toString().contains("https://")==false){ if(!h.getText().toString().contains("http://") && !h.getText().toString().contains("https://")){
home = "http://"+h.getText().toString(); home = "http://"+h.getText().toString();
}} }}
edit.putString("home", home); edit.putString("home", home);

61
src/acr/browser/barebones/SpaceTokenizer.java

@ -0,0 +1,61 @@
package acr.browser.barebones;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.TextUtils;
import android.widget.MultiAutoCompleteTextView.Tokenizer;
public class SpaceTokenizer implements Tokenizer {
@Override
public int findTokenEnd(CharSequence text, int cursor) {
int i = cursor;
int len = text.length();
while (i < len) {
if (text.charAt(i) == ' ') {
return i;
} else {
i++;
}
}
return len;
}
@Override
public int findTokenStart(CharSequence text, int cursor) {
int i = cursor;
while (i > 0 && text.charAt(i - 1) != ' ') {
i--;
}
while (i < cursor && text.charAt(i) == ' ') {
i++;
}
return i;
}
@Override
public CharSequence terminateToken(CharSequence text) {
int i = text.length();
while (i > 0 && text.charAt(i - 1) == ' ') {
i--;
}
if (i > 0 && text.charAt(i - 1) == ' ') {
return text;
} else {
if (text instanceof Spanned) {
SpannableString sp = new SpannableString(text + " ");
TextUtils.copySpansFrom((Spanned) text, 0, text.length(),
Object.class, sp, 0);
return sp;
} else {
return text + " ";
}
}
}
}
Loading…
Cancel
Save