Browse Source

Merge pull request #1 from anthonycr/master

base update
master
yuvalabou 12 years ago
parent
commit
665e0840bb
  1. 4
      AndroidManifest.xml
  2. BIN
      ic_launcher-web.png
  3. 12
      res/menu/menu.xml
  4. 185
      src/acr/browser/barebones/Barebones.java
  5. 25
      src/acr/browser/barebones/Bookmarks.java

4
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="23" android:versionCode="27"
android:versionName="2.3.0" > android:versionName="2.3.4" >
<uses-sdk <uses-sdk
android:minSdkVersion="8" android:minSdkVersion="8"

BIN
ic_launcher-web.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

12
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="Actualiser" android:titleCondensed="Actualiser" android:orderInCategory="1"></item> <item android:id="@+id/refresh" android:title="Refresh" android:titleCondensed="Refresh" 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="Add to bookmarks" android:titleCondensed="Add bookmark" 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="Bookmarks" android:title="Bookmarks" 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="Share" android:titleCondensed="Share" 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/settings" android:title="Settings" android:titleCondensed="Settings" android:orderInCategory="6"></item>
<item android:id="@+id/forward" android:title="Suivant" android:orderInCategory="5" android:titleCondensed="Suivant"></item> <item android:id="@+id/forward" android:title="Forward" android:orderInCategory="5" android:titleCondensed="Forward"></item>
</menu> </menu>

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

@ -23,8 +23,11 @@ import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.res.Configuration; import android.content.res.Configuration;
import android.database.Cursor; import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteException;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.BitmapFactory; import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Rect; import android.graphics.Rect;
import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
@ -66,6 +69,7 @@ import android.webkit.HttpAuthHandler;
import android.webkit.SslErrorHandler; import android.webkit.SslErrorHandler;
import android.webkit.ValueCallback; import android.webkit.ValueCallback;
import android.webkit.WebChromeClient; import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebChromeClient.CustomViewCallback; import android.webkit.WebChromeClient.CustomViewCallback;
import android.webkit.WebIconDatabase; import android.webkit.WebIconDatabase;
import android.webkit.WebSettings.LayoutAlgorithm; import android.webkit.WebSettings.LayoutAlgorithm;
@ -101,6 +105,7 @@ public class Barebones extends Activity implements OnLongClickListener,
static final boolean PAID_VERSION = false; static final boolean PAID_VERSION = false;
// variable declaration // variable declaration
static int crap;
static SimpleAdapter adapter; static SimpleAdapter adapter;
static MultiAutoCompleteTextView getUrl; static MultiAutoCompleteTextView getUrl;
static TextView[] urlTitle = new TextView[MAX_TABS]; static TextView[] urlTitle = new TextView[MAX_TABS];
@ -132,6 +137,7 @@ public class Barebones extends Activity implements OnLongClickListener,
static boolean urlBarShows = true, move = false; static boolean urlBarShows = true, move = false;
static boolean isBookmarkShowing = false; static boolean isBookmarkShowing = false;
static boolean uBarShows = true; static boolean uBarShows = true;
static boolean noStockBrowser = true;
static SharedPreferences settings; static SharedPreferences settings;
static SharedPreferences.Editor edit; static SharedPreferences.Editor edit;
static String desktop, mobile, user; static String desktop, mobile, user;
@ -160,6 +166,7 @@ public class Barebones extends Activity implements OnLongClickListener,
static Cursor managedCursor; static Cursor managedCursor;
static List<Map<String, String>> list; static List<Map<String, String>> list;
static Map<String, String> map; static Map<String, String> map;
static Handler handler;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
@ -416,7 +423,9 @@ public class Barebones extends Activity implements OnLongClickListener,
}); });
if (API == 17 && !showFullScreen) { if (API == 17 && !showFullScreen) {
pageIdIsVisible = true; pageIdIsVisible = true;
uiUpdate.start(); uiUpdate.setDaemon(true);
uiUpdate.setPriority(Thread.MIN_PRIORITY);
//uiUpdate.start();
} }
} }
@ -476,7 +485,7 @@ public class Barebones extends Activity implements OnLongClickListener,
getUrl = (MultiAutoCompleteTextView) findViewById(R.id.enterUrl); getUrl = (MultiAutoCompleteTextView) findViewById(R.id.enterUrl);
getUrl.setTextColor(getResources().getColor(android.R.color.black)); getUrl.setTextColor(getResources().getColor(android.R.color.black));
final Handler handler = new Handler() { handler = new Handler() {
@Override @Override
public void handleMessage(Message msg) { public void handleMessage(Message msg) {
@ -488,8 +497,9 @@ public class Barebones extends Activity implements OnLongClickListener,
R.id.url }); R.id.url });
getUrl.setAdapter(adapter); getUrl.setAdapter(adapter);
break;} break;}
default:{ case 2:{
break;
} }
} }
} }
@ -504,14 +514,30 @@ public class Barebones extends Activity implements OnLongClickListener,
bookmarks = Browser.BOOKMARKS_URI; bookmarks = Browser.BOOKMARKS_URI;
columns = new String[] { Browser.BookmarkColumns.URL, columns = new String[] { Browser.BookmarkColumns.URL,
Browser.BookmarkColumns.TITLE }; Browser.BookmarkColumns.TITLE };
managedCursor = getContentResolver().query(bookmarks, // URI of Context con = Barebones.this;
// resource try{
managedCursor = null;
managedCursor = con.getContentResolver().query(bookmarks, // URI of
columns, // Which columns to return columns, // Which columns to return
null, // Which rows to return (all rows) null, // Which rows to return (all rows)
null, // Selection arguments (none) null, // Selection arguments (none)
null); null);
Log.i("Lightning: ","SQLite success!!!");
handler.sendEmptyMessage(1);
}
catch(SQLiteException e){
handler.sendEmptyMessage(2);
Log.e("Lightning: ","SQLite Error!!! "+e);
}
list = new ArrayList<Map<String, String>>(); list = new ArrayList<Map<String, String>>();
noStockBrowser = true;
if(managedCursor!=null){
noStockBrowser = false;
if (managedCursor.moveToFirst()) { if (managedCursor.moveToFirst()) {
// Variable for holding the retrieved URL // Variable for holding the retrieved URL
urlColumn = managedCursor urlColumn = managedCursor
@ -528,9 +554,7 @@ public class Barebones extends Activity implements OnLongClickListener,
list.add(map); list.add(map);
} while (managedCursor.moveToNext()); } while (managedCursor.moveToNext());
} }
handler.sendEmptyMessage(1); }
} }
@ -551,9 +575,18 @@ public class Barebones extends Activity implements OnLongClickListener,
long arg3) { long arg3) {
txt = (TextView) arg1.findViewById(R.id.url); txt = (TextView) arg1.findViewById(R.id.url);
str = txt.getText().toString(); str = txt.getText().toString();
if(!pageIdIsVisible && isBookmarkShowing){
scrollBookmarks.startAnimation(fadeOut);
background.removeView(scrollBookmarks);
background.addView(main[pageId]);
pageIdIsVisible = true;
isBookmarkShowing = false;
}
main[pageId].loadUrl(str); main[pageId].loadUrl(str);
getUrl.setText(str); getUrl.setText(str);
main[pageId].requestFocus(); InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(getUrl.getWindowToken(), 0);
} }
}); });
@ -571,9 +604,9 @@ public class Barebones extends Activity implements OnLongClickListener,
scrollBookmarks.startAnimation(fadeOut); scrollBookmarks.startAnimation(fadeOut);
background.removeView(scrollBookmarks); background.removeView(scrollBookmarks);
uBar.bringToFront(); uBar.bringToFront();
pageIdIsVisible = true;
isBookmarkShowing = false; isBookmarkShowing = false;
} }
pageIdIsVisible = false;
homepage = settings.getString("home", "http://www.google.com"); homepage = settings.getString("home", "http://www.google.com");
allowLocation = settings.getBoolean("location", false); allowLocation = settings.getBoolean("location", false);
final LinearLayout tabLayout = (LinearLayout) findViewById(R.id.tabLayout); final LinearLayout tabLayout = (LinearLayout) findViewById(R.id.tabLayout);
@ -607,13 +640,14 @@ public class Barebones extends Activity implements OnLongClickListener,
main[num] = settings(main[num]); main[num] = settings(main[num]);
main[num].loadUrl(theUrl); main[num].loadUrl(theUrl);
pageId = num; pageId = num;
pageIdIsVisible = true;
isEmptyWebViewAvailable = true; isEmptyWebViewAvailable = true;
break; break;
} }
} }
if (isEmptyWebViewAvailable == false) { if (isEmptyWebViewAvailable == false) {
if (number < MAX_TABS) { if (number < MAX_TABS) {
pageIdIsVisible = false;
background.removeView(main[pageId]); background.removeView(main[pageId]);
if (number > 0) { if (number > 0) {
@ -832,6 +866,7 @@ public class Barebones extends Activity implements OnLongClickListener,
// main[pageToView].startAnimation(fadeIn); // main[pageToView].startAnimation(fadeIn);
if (lastVisibleWebView != pageToView) { if (lastVisibleWebView != pageToView) {
// main[lastVisibleWebView].startAnimation(fadeOut); // main[lastVisibleWebView].startAnimation(fadeOut);
pageIdIsVisible = false;
background.removeView(main[lastVisibleWebView]); background.removeView(main[lastVisibleWebView]);
} }
uBar.bringToFront(); uBar.bringToFront();
@ -863,8 +898,17 @@ public class Barebones extends Activity implements OnLongClickListener,
} }
@Override
protected void onDraw(Canvas canvas) {
if(!showFullScreen){
main[pageId].invalidate();
}
super.onDraw(canvas);
}
@Override @Override
public boolean onTouchEvent(MotionEvent event) { public boolean onTouchEvent(MotionEvent event) {
//final HitTestResult poop;
switch (event.getAction()) { switch (event.getAction()) {
case MotionEvent.ACTION_DOWN: { case MotionEvent.ACTION_DOWN: {
@ -879,8 +923,13 @@ public class Barebones extends Activity implements OnLongClickListener,
move = true; move = true;
} }
case MotionEvent.ACTION_UP: { case MotionEvent.ACTION_UP: {
try{
if (showFullScreen) { crap = getHitTestResult().getType();
}
catch(NullPointerException e){
Log.e("Lightning","Touch was invalid");
}
if (showFullScreen&&crap!=9) {
if (System.currentTimeMillis() - timeBetweenDownPress < 500 if (System.currentTimeMillis() - timeBetweenDownPress < 500
&& !move) { && !move) {
if (!uBarShows) { if (!uBarShows) {
@ -934,9 +983,8 @@ public class Barebones extends Activity implements OnLongClickListener,
public void onReceivedError(WebView view, int errorCode, public void onReceivedError(WebView view, int errorCode,
String description, String failingUrl) { String description, String failingUrl) {
Toast.makeText(Barebones.this, "Error: " + description, Log.e("Lightning: ","Error: " + description);
Toast.LENGTH_LONG).show();
Log.e("Lightning Browser:", description);
super.onReceivedError(view, errorCode, description, failingUrl); super.onReceivedError(view, errorCode, description, failingUrl);
} }
@ -962,8 +1010,12 @@ public class Barebones extends Activity implements OnLongClickListener,
@Override @Override
public void run() { public void run() {
if(!noStockBrowser){
Browser.updateVisitedHistory(getContentResolver(), url, Browser.updateVisitedHistory(getContentResolver(), url,
true); true);
}
} }
}); });
@ -1187,14 +1239,15 @@ public class Barebones extends Activity implements OnLongClickListener,
} }
private AnthonyWebView settings(AnthonyWebView view) { private AnthonyWebView settings(AnthonyWebView view) {
WebSettings webViewSettings = view.getSettings();
java = settings.getBoolean("java", true); java = settings.getBoolean("java", true);
if (java) { if (java) {
view.getSettings().setJavaScriptEnabled(true); webViewSettings.setJavaScriptEnabled(true);
view.getSettings().setJavaScriptCanOpenWindowsAutomatically(true); webViewSettings.setJavaScriptCanOpenWindowsAutomatically(true);
} }
view.getSettings().setAllowFileAccess(true); webViewSettings.setAllowFileAccess(true);
view.getSettings().setLightTouchEnabled(true); webViewSettings.setLightTouchEnabled(true);
view.setAnimationCacheEnabled(false); view.setAnimationCacheEnabled(false);
// view.setDrawingCacheEnabled(true); // view.setDrawingCacheEnabled(true);
view.setDrawingCacheBackgroundColor(getResources().getColor( view.setDrawingCacheBackgroundColor(getResources().getColor(
@ -1204,18 +1257,18 @@ public class Barebones extends Activity implements OnLongClickListener,
view.setFocusable(true); view.setFocusable(true);
view.setFocusableInTouchMode(true); view.setFocusableInTouchMode(true);
view.setSaveEnabled(true); view.setSaveEnabled(true);
view.getSettings().setDomStorageEnabled(true); webViewSettings.setDomStorageEnabled(true);
view.getSettings().setAppCacheEnabled(true); webViewSettings.setAppCacheEnabled(true);
view.getSettings().setAppCachePath( webViewSettings.setAppCachePath(
getApplicationContext().getFilesDir().getAbsolutePath() getApplicationContext().getFilesDir().getAbsolutePath()
+ "/cache"); + "/cache");
view.getSettings().setRenderPriority(RenderPriority.HIGH); webViewSettings.setRenderPriority(RenderPriority.HIGH);
view.getSettings().setGeolocationEnabled(true); webViewSettings.setGeolocationEnabled(true);
view.getSettings().setGeolocationDatabasePath( webViewSettings.setGeolocationDatabasePath(
getApplicationContext().getFilesDir().getAbsolutePath()); getApplicationContext().getFilesDir().getAbsolutePath());
view.getSettings().setDatabaseEnabled(true); webViewSettings.setDatabaseEnabled(true);
view.getSettings().setDatabasePath( webViewSettings.setDatabasePath(
getApplicationContext().getFilesDir().getAbsolutePath() getApplicationContext().getFilesDir().getAbsolutePath()
+ "/databases"); + "/databases");
enableFlash = settings.getInt("enableflash", 0); enableFlash = settings.getInt("enableflash", 0);
@ -1223,36 +1276,36 @@ public class Barebones extends Activity implements OnLongClickListener,
case 0: case 0:
break; break;
case 1: { case 1: {
view.getSettings().setPluginState(PluginState.ON_DEMAND); webViewSettings.setPluginState(PluginState.ON_DEMAND);
break; break;
} }
case 2: { case 2: {
view.getSettings().setPluginState(PluginState.ON); webViewSettings.setPluginState(PluginState.ON);
break; break;
} }
default: default:
break; break;
} }
view.getSettings().setUserAgentString(userAgent); webViewSettings.setUserAgentString(userAgent);
savePasswords = settings.getBoolean("passwords", false); savePasswords = settings.getBoolean("passwords", false);
if (savePasswords == true) { if (savePasswords == true) {
view.getSettings().setSavePassword(true); webViewSettings.setSavePassword(true);
} }
view.getSettings().setBuiltInZoomControls(true); webViewSettings.setBuiltInZoomControls(true);
view.getSettings().setSupportZoom(true); webViewSettings.setSupportZoom(true);
view.getSettings().setUseWideViewPort(true); webViewSettings.setUseWideViewPort(true);
view.getSettings().setLoadWithOverviewMode(true); // Seems to be causing webViewSettings.setLoadWithOverviewMode(true); // Seems to be causing
// the performance // the performance
// to drop // to drop
if (API >= 11) { if (API >= 11) {
view.getSettings().setDisplayZoomControls(false); webViewSettings.setDisplayZoomControls(false);
view.getSettings().setAllowContentAccess(true); webViewSettings.setAllowContentAccess(true);
} }
view.getSettings().setLayoutAlgorithm(LayoutAlgorithm.NARROW_COLUMNS); webViewSettings.setLayoutAlgorithm(LayoutAlgorithm.NARROW_COLUMNS);
view.getSettings().setLoadsImagesAutomatically(true); webViewSettings.setLoadsImagesAutomatically(true);
// view.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE); // webViewSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);
return view; return view;
} }
@ -1290,8 +1343,8 @@ public class Barebones extends Activity implements OnLongClickListener,
b.setHeight(height56); b.setHeight(height56);
b.setText(bTitle[n]); b.setText(bTitle[n]);
b.setCompoundDrawables(webpage, null, null, null); b.setCompoundDrawables(webpage, null, null, null);
b.setOnClickListener(new bookmarkListener()); b.setOnClickListener(new BookmarkListener());
b.setOnLongClickListener(new bookmarkLongClick()); b.setOnLongClickListener(new BookmarkLongClick());
b.setPadding(rightPad, 0, rightPad, 0); b.setPadding(rightPad, 0, rightPad, 0);
bookmarkLayout.addView(b); bookmarkLayout.addView(b);
} }
@ -1317,7 +1370,7 @@ public class Barebones extends Activity implements OnLongClickListener,
} }
class bookmarkLongClick implements OnLongClickListener { class BookmarkLongClick implements OnLongClickListener {
@Override @Override
public boolean onLongClick(final View arg0) { public boolean onLongClick(final View arg0) {
@ -1416,13 +1469,13 @@ public class Barebones extends Activity implements OnLongClickListener,
} }
static class bookmarkListener implements OnClickListener { static class BookmarkListener implements OnClickListener {
@Override @Override
public void onClick(View arg0) { public void onClick(View arg0) {
int number = arg0.getId(); int number = arg0.getId();
pageIdIsVisible = true;
background.addView(main[pageId]); background.addView(main[pageId]);
pageIdIsVisible = true;
main[pageId].startAnimation(fadeIn); main[pageId].startAnimation(fadeIn);
if (showFullScreen) { if (showFullScreen) {
background.addView(uBar); background.addView(uBar);
@ -1504,6 +1557,7 @@ public class Barebones extends Activity implements OnLongClickListener,
uBar.bringToFront(); uBar.bringToFront();
isBookmarkShowing = false; isBookmarkShowing = false;
} }
pageIdIsVisible = true;
deleteTab(id); deleteTab(id);
return true; return true;
@ -1514,7 +1568,7 @@ public class Barebones extends Activity implements OnLongClickListener,
int leftId = id; int leftId = id;
pageIdIsVisible = false; pageIdIsVisible = false;
boolean right = false, left = false; boolean right = false, left = false;
background.clearDisappearingChildren(); //background.clearDisappearingChildren();
if (API < 16) { if (API < 16) {
urlTitle[id].setBackgroundDrawable(getResources().getDrawable( urlTitle[id].setBackgroundDrawable(getResources().getDrawable(
R.drawable.bg_press)); R.drawable.bg_press));
@ -1535,7 +1589,6 @@ public class Barebones extends Activity implements OnLongClickListener,
// scrollBookmarks.startAnimation(fadeOut); // scrollBookmarks.startAnimation(fadeOut);
background.removeView(scrollBookmarks); background.removeView(scrollBookmarks);
uBar.bringToFront(); uBar.bringToFront();
pageIdIsVisible = true;
isBookmarkShowing = false; isBookmarkShowing = false;
} else if (main[id].isShown()) { } else if (main[id].isShown()) {
@ -1544,6 +1597,7 @@ public class Barebones extends Activity implements OnLongClickListener,
for (; id <= (number - 1); id++) { for (; id <= (number - 1); id++) {
if (urlTitle[id].isShown()) { if (urlTitle[id].isShown()) {
background.addView(main[id]); background.addView(main[id]);
main[id].setVisibility(View.VISIBLE);
uBar.bringToFront(); uBar.bringToFront();
if (API < 16) { if (API < 16) {
urlTitle[id].setBackgroundDrawable(getResources() urlTitle[id].setBackgroundDrawable(getResources()
@ -1565,7 +1619,8 @@ public class Barebones extends Activity implements OnLongClickListener,
if (urlTitle[leftId].isShown()) { if (urlTitle[leftId].isShown()) {
background.addView(main[leftId]); background.addView(main[leftId]);
uBar.bringToFront(); main[leftId].setVisibility(View.VISIBLE);
//uBar.bringToFront();
if (API < 16) { if (API < 16) {
urlTitle[leftId] urlTitle[leftId]
.setBackgroundDrawable(getResources() .setBackgroundDrawable(getResources()
@ -1585,11 +1640,17 @@ public class Barebones extends Activity implements OnLongClickListener,
} }
}
else{
right = left = true;
}
if (right == false && left == false) { if (right == false && left == false) {
finish(); finish();
} else { } else {
pageIdIsVisible = true; pageIdIsVisible = true;
} main[pageId].invalidate();
} }
} }
@ -1803,7 +1864,7 @@ public class Barebones extends Activity implements OnLongClickListener,
main[pageId].startAnimation(fadeIn); main[pageId].startAnimation(fadeIn);
uBar.bringToFront(); uBar.bringToFront();
isBookmarkShowing = false;
} }
pageIdIsVisible = true; pageIdIsVisible = true;
if(fixedQuery.contains("about:home")){ if(fixedQuery.contains("about:home")){
@ -1934,12 +1995,12 @@ public class Barebones extends Activity implements OnLongClickListener,
@Override @Override
protected void onDestroy() { protected void onDestroy() {
super.onDestroy();
try { try {
deleteHistory = settings.getBoolean("history", false); deleteHistory = settings.getBoolean("history", false);
if (deleteHistory == true) { if (deleteHistory == true) {
for (int num = 0; num <= pageId; num++) {
if(noStockBrowser){
Browser.clearHistory(getContentResolver()); Browser.clearHistory(getContentResolver());
} }
} }
@ -1948,7 +2009,7 @@ public class Barebones extends Activity implements OnLongClickListener,
e.printStackTrace(); e.printStackTrace();
} }
super.onDestroy();
} }
public static void trimCache(Context context) { public static void trimCache(Context context) {
@ -1979,7 +2040,6 @@ public class Barebones extends Activity implements OnLongClickListener,
@Override @Override
public boolean onTouch(View v, MotionEvent event) { public boolean onTouch(View v, MotionEvent event) {
final int number = pageId;
pageIdIsVisible = false; pageIdIsVisible = false;
final int id = v.getId(); final int id = v.getId();
boolean xPress = false; boolean xPress = false;
@ -2037,27 +2097,34 @@ public class Barebones extends Activity implements OnLongClickListener,
background.addView(main[id]); background.addView(main[id]);
main[id].startAnimation(fadeIn); main[id].startAnimation(fadeIn);
main[pageId].startAnimation(fadeOut); main[pageId].startAnimation(fadeOut);
pageIdIsVisible = false;
background.removeView(main[pageId]); background.removeView(main[pageId]);
uBar.bringToFront(); uBar.bringToFront();
} else if (API >= 12) { } else if (API >= 12) {
pageIdIsVisible = false;
main[id].setAlpha(0f); main[id].setAlpha(0f);
main[id].clearAnimation();
background.addView(main[id]); background.addView(main[id]);
main[id].animate().alpha(1f) main[id].animate().alpha(1f)
.setDuration(mShortAnimationDuration); .setDuration(mShortAnimationDuration);
main[pageId].clearAnimation(); main[pageId].clearAnimation();
main[pageId].animate().alpha(0f) // main[pageId].animate().alpha(0f)
.setDuration(mShortAnimationDuration); // .setDuration(mShortAnimationDuration);
// main[pageId].setAlpha(1f);
background.removeView(main[pageId]); background.removeView(main[pageId]);
pageIdIsVisible = true;
uBar.bringToFront(); uBar.bringToFront();
} else { } else {
pageIdIsVisible = false;
background.removeView(main[pageId]); background.removeView(main[pageId]);
background.addView(main[id]); background.addView(main[id]);
} }
uBar.bringToFront(); uBar.bringToFront();
} }
pageId = id; pageId = id;
pageIdIsVisible = true;
getUrl.setText(urlToLoad[pageId][0]); getUrl.setText(urlToLoad[pageId][0]);
} }
} }

25
src/acr/browser/barebones/Bookmarks.java

@ -1,25 +0,0 @@
package acr.browser.barebones;
import android.app.Activity;
import android.database.Cursor;
import android.provider.Browser;
import android.util.Log;
public class Bookmarks extends Activity{
public void GetBookmarks(){
String[] projection = new String[] {
Browser.BookmarkColumns.TITLE
, Browser.BookmarkColumns.URL
};
Cursor mCur = getContentResolver().query(android.provider.Browser.BOOKMARKS_URI, projection, null, null, null);
mCur.moveToFirst();
int titleIdx = mCur.getColumnIndex(Browser.BookmarkColumns.TITLE);
int urlIdx = mCur.getColumnIndex(Browser.BookmarkColumns.URL);
String[] android = (Browser.HISTORY_PROJECTION);
while (mCur.isAfterLast() == false) {
Log.i("Title", mCur.getString(titleIdx));
Log.i("Title",mCur.getString(urlIdx));
mCur.moveToNext();
}
}
}
Loading…
Cancel
Save