|
|
@ -17,12 +17,16 @@ import android.app.AlertDialog; |
|
|
|
import android.app.DownloadManager; |
|
|
|
import android.app.DownloadManager; |
|
|
|
import android.content.ClipData; |
|
|
|
import android.content.ClipData; |
|
|
|
import android.content.ClipboardManager; |
|
|
|
import android.content.ClipboardManager; |
|
|
|
|
|
|
|
import android.content.ContentResolver; |
|
|
|
|
|
|
|
import android.content.ContentUris; |
|
|
|
|
|
|
|
import android.content.ContentValues; |
|
|
|
import android.content.Context; |
|
|
|
import android.content.Context; |
|
|
|
import android.content.DialogInterface; |
|
|
|
import android.content.DialogInterface; |
|
|
|
import android.content.Intent; |
|
|
|
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.DatabaseUtils; |
|
|
|
import android.database.sqlite.SQLiteDatabase; |
|
|
|
import android.database.sqlite.SQLiteDatabase; |
|
|
|
import android.database.sqlite.SQLiteException; |
|
|
|
import android.database.sqlite.SQLiteException; |
|
|
|
import android.graphics.Bitmap; |
|
|
|
import android.graphics.Bitmap; |
|
|
@ -39,11 +43,13 @@ import android.os.Handler; |
|
|
|
import android.os.Looper; |
|
|
|
import android.os.Looper; |
|
|
|
import android.os.Message; |
|
|
|
import android.os.Message; |
|
|
|
import android.provider.Browser; |
|
|
|
import android.provider.Browser; |
|
|
|
|
|
|
|
import android.provider.Browser.BookmarkColumns; |
|
|
|
import android.text.SpannableString; |
|
|
|
import android.text.SpannableString; |
|
|
|
import android.text.Spanned; |
|
|
|
import android.text.Spanned; |
|
|
|
import android.text.TextUtils; |
|
|
|
import android.text.TextUtils; |
|
|
|
import android.util.DisplayMetrics; |
|
|
|
import android.util.DisplayMetrics; |
|
|
|
import android.util.Log; |
|
|
|
import android.util.Log; |
|
|
|
|
|
|
|
import android.view.Display; |
|
|
|
import android.view.Gravity; |
|
|
|
import android.view.Gravity; |
|
|
|
import android.view.KeyEvent; |
|
|
|
import android.view.KeyEvent; |
|
|
|
import android.view.LayoutInflater; |
|
|
|
import android.view.LayoutInflater; |
|
|
@ -88,6 +94,7 @@ import android.widget.LinearLayout; |
|
|
|
import android.widget.MultiAutoCompleteTextView.Tokenizer; |
|
|
|
import android.widget.MultiAutoCompleteTextView.Tokenizer; |
|
|
|
import android.widget.PopupMenu; |
|
|
|
import android.widget.PopupMenu; |
|
|
|
import android.widget.PopupMenu.OnMenuItemClickListener; |
|
|
|
import android.widget.PopupMenu.OnMenuItemClickListener; |
|
|
|
|
|
|
|
import android.widget.PopupWindow; |
|
|
|
import android.widget.ProgressBar; |
|
|
|
import android.widget.ProgressBar; |
|
|
|
import android.widget.RelativeLayout; |
|
|
|
import android.widget.RelativeLayout; |
|
|
|
import android.widget.ScrollView; |
|
|
|
import android.widget.ScrollView; |
|
|
@ -105,7 +112,8 @@ 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 Rect edge; |
|
|
|
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]; |
|
|
@ -127,9 +135,12 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
static int height, width, pixels, leftPad, rightPad, pixelHeight; |
|
|
|
static int height, width, pixels, leftPad, rightPad, pixelHeight; |
|
|
|
static int bookHeight, API; |
|
|
|
static int bookHeight, API; |
|
|
|
static int mShortAnimationDuration; |
|
|
|
static int mShortAnimationDuration; |
|
|
|
|
|
|
|
static int id, tenPad; |
|
|
|
|
|
|
|
static int hitTest; |
|
|
|
static int urlColumn, titleColumn; |
|
|
|
static int urlColumn, titleColumn; |
|
|
|
static View mCustomView = null; |
|
|
|
static View mCustomView = null; |
|
|
|
static CustomViewCallback mCustomViewCallback; |
|
|
|
static CustomViewCallback mCustomViewCallback; |
|
|
|
|
|
|
|
static boolean xPress; |
|
|
|
static boolean tabsAreDisplayed = true, isPhone = false; |
|
|
|
static boolean tabsAreDisplayed = true, isPhone = false; |
|
|
|
static boolean pageIsLoading = false, java; |
|
|
|
static boolean pageIsLoading = false, java; |
|
|
|
static boolean allowLocation, savePasswords, deleteHistory; |
|
|
|
static boolean allowLocation, savePasswords, deleteHistory; |
|
|
@ -219,11 +230,8 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
public void init() { |
|
|
|
public void init() { |
|
|
|
DisplayMetrics metrics = new DisplayMetrics(); |
|
|
|
DisplayMetrics metrics = new DisplayMetrics(); |
|
|
|
getWindowManager().getDefaultDisplay().getMetrics(metrics); |
|
|
|
getWindowManager().getDefaultDisplay().getMetrics(metrics); |
|
|
|
if (isPhone) { |
|
|
|
|
|
|
|
showFullScreen = settings.getBoolean("fullscreen", true); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
showFullScreen = settings.getBoolean("fullscreen", false); |
|
|
|
showFullScreen = settings.getBoolean("fullscreen", false); |
|
|
|
} |
|
|
|
|
|
|
|
uBar = (RelativeLayout) findViewById(R.id.urlBar); |
|
|
|
uBar = (RelativeLayout) findViewById(R.id.urlBar); |
|
|
|
bg = (RelativeLayout) findViewById(R.id.background); |
|
|
|
bg = (RelativeLayout) findViewById(R.id.background); |
|
|
|
slideUp = AnimationUtils.loadAnimation(this, R.anim.slide_up); |
|
|
|
slideUp = AnimationUtils.loadAnimation(this, R.anim.slide_up); |
|
|
@ -349,9 +357,10 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
pixelHeight = (int) (36 * scale + 0.5f); |
|
|
|
pixelHeight = (int) (36 * scale + 0.5f); |
|
|
|
bookHeight = (int) (48 * scale + 0.5f); |
|
|
|
bookHeight = (int) (48 * scale + 0.5f); |
|
|
|
height56 = (int) (56 * scale + 0.5f); |
|
|
|
height56 = (int) (56 * scale + 0.5f); |
|
|
|
leftPad = (int) (10 * scale + 0.5f); |
|
|
|
leftPad = (int) (17 * scale + 0.5f); |
|
|
|
rightPad = (int) (10 * scale + 0.5f); |
|
|
|
rightPad = (int) (15 * scale + 0.5f); |
|
|
|
height32 = (int) (32 * scale + 0.5f); |
|
|
|
height32 = (int) (32 * scale + 0.5f); |
|
|
|
|
|
|
|
tenPad = (int) (10 * scale + 0.5f); |
|
|
|
statusBar = (int) (25 * scale + 0.5f); |
|
|
|
statusBar = (int) (25 * scale + 0.5f); |
|
|
|
number = 0; |
|
|
|
number = 0; |
|
|
|
loading = getResources().getDrawable(R.drawable.loading); |
|
|
|
loading = getResources().getDrawable(R.drawable.loading); |
|
|
@ -361,7 +370,7 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
webpage.setBounds(0, 0, width * 2 / 3, height * 2 / 3); |
|
|
|
webpage.setBounds(0, 0, width * 2 / 3, height * 2 / 3); |
|
|
|
webpageOther.setBounds(0, 0, width * 1 / 2, height * 1 / 2); |
|
|
|
webpageOther.setBounds(0, 0, width * 1 / 2, height * 1 / 2); |
|
|
|
exitTab.setBounds(0, 0, width * 2 / 3, height * 2 / 3); |
|
|
|
exitTab.setBounds(0, 0, width * 2 / 3, height * 2 / 3); |
|
|
|
Intent url = getIntent().addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); |
|
|
|
Intent url = getIntent(); |
|
|
|
String URL = null; // that opens the browser
|
|
|
|
String URL = null; // that opens the browser
|
|
|
|
// gets the string passed into the browser
|
|
|
|
// gets the string passed into the browser
|
|
|
|
URL = url.getDataString(); |
|
|
|
URL = url.getDataString(); |
|
|
@ -406,7 +415,7 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void updateUI(){ |
|
|
|
public static void updateUI() { |
|
|
|
clock = System.currentTimeMillis(); |
|
|
|
clock = System.currentTimeMillis(); |
|
|
|
|
|
|
|
|
|
|
|
Thread uiUpdate = new Thread(new Runnable() { |
|
|
|
Thread uiUpdate = new Thread(new Runnable() { |
|
|
@ -414,7 +423,8 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
public void run() { |
|
|
|
public void run() { |
|
|
|
long clock = System.currentTimeMillis(); |
|
|
|
long clock = System.currentTimeMillis(); |
|
|
|
while (true) { |
|
|
|
while (true) { |
|
|
|
while (!(System.currentTimeMillis() - clock > 20 && pageIdIsVisible)); |
|
|
|
while (!(System.currentTimeMillis() - clock > 20 && pageIdIsVisible)) |
|
|
|
|
|
|
|
; |
|
|
|
main[pageId].postInvalidate(); |
|
|
|
main[pageId].postInvalidate(); |
|
|
|
clock = System.currentTimeMillis(); |
|
|
|
clock = System.currentTimeMillis(); |
|
|
|
|
|
|
|
|
|
|
@ -425,7 +435,7 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
pageIdIsVisible = true; |
|
|
|
pageIdIsVisible = true; |
|
|
|
uiUpdate.setDaemon(true); |
|
|
|
uiUpdate.setDaemon(true); |
|
|
|
uiUpdate.setPriority(Thread.MIN_PRIORITY); |
|
|
|
uiUpdate.setPriority(Thread.MIN_PRIORITY); |
|
|
|
//uiUpdate.start();
|
|
|
|
// uiUpdate.start();
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -481,23 +491,28 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void enterUrl(){ |
|
|
|
void enterUrl() { |
|
|
|
getUrl = (MultiAutoCompleteTextView) findViewById(R.id.enterUrl); |
|
|
|
getUrl = (MultiAutoCompleteTextView) findViewById(R.id.enterUrl); |
|
|
|
|
|
|
|
getUrl.setPadding(tenPad, 0, tenPad, 0); |
|
|
|
getUrl.setTextColor(getResources().getColor(android.R.color.black)); |
|
|
|
getUrl.setTextColor(getResources().getColor(android.R.color.black)); |
|
|
|
|
|
|
|
getUrl.setPadding(tenPad, 0, tenPad, 0); |
|
|
|
|
|
|
|
getUrl.setBackgroundResource(R.drawable.book); |
|
|
|
|
|
|
|
getUrl.setPadding(tenPad, 0, tenPad, 0); |
|
|
|
handler = new Handler() { |
|
|
|
handler = new Handler() { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void handleMessage(Message msg) { |
|
|
|
public void handleMessage(Message msg) { |
|
|
|
switch (msg.what) { |
|
|
|
switch (msg.what) { |
|
|
|
case 1:{ |
|
|
|
case 1: { |
|
|
|
adapter = new SimpleAdapter(Barebones.this, list, |
|
|
|
adapter = new SimpleAdapter(Barebones.this, list, |
|
|
|
R.layout.two_line_autocomplete, |
|
|
|
R.layout.two_line_autocomplete, new String[] { |
|
|
|
new String[] { "title", "url" }, new int[] { R.id.title, |
|
|
|
"title", "url" }, new int[] { R.id.title, |
|
|
|
R.id.url }); |
|
|
|
R.id.url }); |
|
|
|
getUrl.setAdapter(adapter); |
|
|
|
getUrl.setAdapter(adapter); |
|
|
|
break;} |
|
|
|
|
|
|
|
case 2:{ |
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
case 2: { |
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
@ -510,30 +525,32 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
public void run() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 }; |
|
|
|
Context con = Barebones.this; |
|
|
|
|
|
|
|
try{ |
|
|
|
try { |
|
|
|
|
|
|
|
|
|
|
|
managedCursor = null; |
|
|
|
managedCursor = null; |
|
|
|
managedCursor = con.getContentResolver().query(bookmarks, // URI of
|
|
|
|
managedCursor = 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!!!"); |
|
|
|
Log.i("Barebones: ", "SQLite success!!!"); |
|
|
|
handler.sendEmptyMessage(1); |
|
|
|
handler.sendEmptyMessage(1); |
|
|
|
|
|
|
|
Log.i("Barebones: ", "SQLite success!!!"); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} catch (SQLiteException e) { |
|
|
|
catch(SQLiteException e){ |
|
|
|
|
|
|
|
handler.sendEmptyMessage(2); |
|
|
|
handler.sendEmptyMessage(2); |
|
|
|
Log.e("Lightning: ","SQLite Error!!! "+e); |
|
|
|
Log.e("Barebones: ", "SQLite Error!!! " + e); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
list = new ArrayList<Map<String, String>>(); |
|
|
|
list = new ArrayList<Map<String, String>>(); |
|
|
|
noStockBrowser = true; |
|
|
|
noStockBrowser = true; |
|
|
|
if(managedCursor!=null){ |
|
|
|
if (managedCursor != null) { |
|
|
|
noStockBrowser = false; |
|
|
|
noStockBrowser = false; |
|
|
|
|
|
|
|
|
|
|
|
if (managedCursor.moveToFirst()) { |
|
|
|
if (managedCursor.moveToFirst()) { |
|
|
@ -556,13 +573,10 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
updateAutoComplete.start(); |
|
|
|
updateAutoComplete.start(); |
|
|
|
|
|
|
|
|
|
|
|
getUrl.setThreshold(2); |
|
|
|
getUrl.setThreshold(2); |
|
|
@ -573,9 +587,10 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, |
|
|
|
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, |
|
|
|
long arg3) { |
|
|
|
long arg3) { |
|
|
|
|
|
|
|
try{ |
|
|
|
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){ |
|
|
|
if (!pageIdIsVisible && isBookmarkShowing) { |
|
|
|
scrollBookmarks.startAnimation(fadeOut); |
|
|
|
scrollBookmarks.startAnimation(fadeOut); |
|
|
|
background.removeView(scrollBookmarks); |
|
|
|
background.removeView(scrollBookmarks); |
|
|
|
background.addView(main[pageId]); |
|
|
|
background.addView(main[pageId]); |
|
|
@ -584,9 +599,14 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
} |
|
|
|
} |
|
|
|
main[pageId].loadUrl(str); |
|
|
|
main[pageId].loadUrl(str); |
|
|
|
getUrl.setText(str); |
|
|
|
getUrl.setText(str); |
|
|
|
|
|
|
|
getUrl.setPadding(tenPad, 0, tenPad, 0); |
|
|
|
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); |
|
|
|
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); |
|
|
|
imm.hideSoftInputFromWindow(getUrl.getWindowToken(), 0); |
|
|
|
imm.hideSoftInputFromWindow(getUrl.getWindowToken(), 0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
catch(NullPointerException e){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Log.e("Barebones Error: ","NullPointerException on item click"); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
@ -632,7 +652,6 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
R.drawable.bg_inactive)); |
|
|
|
R.drawable.bg_inactive)); |
|
|
|
} |
|
|
|
} |
|
|
|
urlTitle[pageId].setPadding(leftPad, 0, rightPad, 0); |
|
|
|
urlTitle[pageId].setPadding(leftPad, 0, rightPad, 0); |
|
|
|
|
|
|
|
|
|
|
|
background.addView(main[num]); |
|
|
|
background.addView(main[num]); |
|
|
|
background.removeView(main[pageId]); |
|
|
|
background.removeView(main[pageId]); |
|
|
|
|
|
|
|
|
|
|
@ -681,6 +700,75 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
Drawable[] drawables = title.getCompoundDrawables(); |
|
|
|
Drawable[] drawables = title.getCompoundDrawables(); |
|
|
|
bounds[number] = drawables[2].getBounds(); |
|
|
|
bounds[number] = drawables[2].getBounds(); |
|
|
|
title.setOnLongClickListener(Barebones.this); |
|
|
|
title.setOnLongClickListener(Barebones.this); |
|
|
|
|
|
|
|
title.setOnClickListener(new OnClickListener() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void onClick(View arg0) { |
|
|
|
|
|
|
|
id = arg0.getId(); |
|
|
|
|
|
|
|
if (API < 16) { |
|
|
|
|
|
|
|
urlTitle[pageId] |
|
|
|
|
|
|
|
.setBackgroundDrawable(getResources() |
|
|
|
|
|
|
|
.getDrawable(R.drawable.bg_inactive)); |
|
|
|
|
|
|
|
} else if (API > 15) { |
|
|
|
|
|
|
|
urlTitle[pageId].setBackground(getResources() |
|
|
|
|
|
|
|
.getDrawable(R.drawable.bg_inactive)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
urlTitle[pageId].setPadding(leftPad, 0, rightPad, 0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (isBookmarkShowing) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
background.addView(main[id]); |
|
|
|
|
|
|
|
main[id].startAnimation(fadeIn); |
|
|
|
|
|
|
|
scrollBookmarks.startAnimation(fadeOut); |
|
|
|
|
|
|
|
background.removeView(scrollBookmarks); |
|
|
|
|
|
|
|
isBookmarkShowing = false; |
|
|
|
|
|
|
|
uBar.bringToFront(); |
|
|
|
|
|
|
|
} else if (!isBookmarkShowing) { |
|
|
|
|
|
|
|
if (!showFullScreen) { |
|
|
|
|
|
|
|
background.addView(main[id]); |
|
|
|
|
|
|
|
main[id].startAnimation(fadeIn); |
|
|
|
|
|
|
|
main[pageId].startAnimation(fadeOut); |
|
|
|
|
|
|
|
pageIdIsVisible = false; |
|
|
|
|
|
|
|
background.removeView(main[pageId]); |
|
|
|
|
|
|
|
uBar.bringToFront(); |
|
|
|
|
|
|
|
} else if (API >= 12) { |
|
|
|
|
|
|
|
pageIdIsVisible = false; |
|
|
|
|
|
|
|
main[id].setAlpha(0f); |
|
|
|
|
|
|
|
main[id].clearAnimation(); |
|
|
|
|
|
|
|
background.addView(main[id]); |
|
|
|
|
|
|
|
main[id].animate().alpha(1f) |
|
|
|
|
|
|
|
.setDuration(mShortAnimationDuration); |
|
|
|
|
|
|
|
main[pageId].clearAnimation(); |
|
|
|
|
|
|
|
// main[pageId].animate().alpha(0f)
|
|
|
|
|
|
|
|
// .setDuration(mShortAnimationDuration);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// main[pageId].setAlpha(1f);
|
|
|
|
|
|
|
|
background.removeView(main[pageId]); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uBar.bringToFront(); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
pageIdIsVisible = false; |
|
|
|
|
|
|
|
background.removeView(main[pageId]); |
|
|
|
|
|
|
|
background.addView(main[id]); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
uBar.bringToFront(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
pageId = id; |
|
|
|
|
|
|
|
pageIdIsVisible = true; |
|
|
|
|
|
|
|
getUrl.setText(urlToLoad[pageId][0]); |
|
|
|
|
|
|
|
getUrl.setPadding(tenPad, 0, tenPad, 0); |
|
|
|
|
|
|
|
if (API < 16) { |
|
|
|
|
|
|
|
urlTitle[pageId] |
|
|
|
|
|
|
|
.setBackgroundDrawable(getResources() |
|
|
|
|
|
|
|
.getDrawable(R.drawable.bg_press)); |
|
|
|
|
|
|
|
} else if (API > 15) { |
|
|
|
|
|
|
|
urlTitle[pageId].setBackground(getResources() |
|
|
|
|
|
|
|
.getDrawable(R.drawable.bg_press)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
urlTitle[pageId].setPadding(leftPad, 0, rightPad, 0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
title.setOnTouchListener(Barebones.this); |
|
|
|
title.setOnTouchListener(Barebones.this); |
|
|
|
tabLayout.addView(title); |
|
|
|
tabLayout.addView(title); |
|
|
|
urlTitle[number] = title; |
|
|
|
urlTitle[number] = title; |
|
|
@ -698,7 +786,6 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
Toast.LENGTH_SHORT).show(); |
|
|
|
Toast.LENGTH_SHORT).show(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -850,16 +937,16 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
switch (agentPicker) { |
|
|
|
switch (agentPicker) { |
|
|
|
case 1: |
|
|
|
case 1: |
|
|
|
main[pageToView].getSettings().setUserAgentString(mobile); |
|
|
|
main[pageToView].getSettings().setUserAgentString(mobile); |
|
|
|
Log.i("lightning", mobile); |
|
|
|
Log.i("barebones", mobile); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 2: |
|
|
|
case 2: |
|
|
|
main[pageToView].getSettings().setUserAgentString(desktop); |
|
|
|
main[pageToView].getSettings().setUserAgentString(desktop); |
|
|
|
Log.i("lightning", desktop); |
|
|
|
Log.i("barebones", desktop); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 3: |
|
|
|
case 3: |
|
|
|
userAgent = settings.getString("agent", user); |
|
|
|
userAgent = settings.getString("agent", user); |
|
|
|
main[pageToView].getSettings().setUserAgentString(userAgent); |
|
|
|
main[pageToView].getSettings().setUserAgentString(userAgent); |
|
|
|
Log.i("lightning", userAgent); |
|
|
|
Log.i("barebones", userAgent); |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
background.addView(main[pageToView]); |
|
|
|
background.addView(main[pageToView]); |
|
|
@ -870,16 +957,14 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
background.removeView(main[lastVisibleWebView]); |
|
|
|
background.removeView(main[lastVisibleWebView]); |
|
|
|
} |
|
|
|
} |
|
|
|
uBar.bringToFront(); |
|
|
|
uBar.bringToFront(); |
|
|
|
if(Url.contains("about:home")&&!showFullScreen){ |
|
|
|
if (Url.contains("about:home") && !showFullScreen) { |
|
|
|
pageIdIsVisible = false; |
|
|
|
pageIdIsVisible = false; |
|
|
|
goBookmarks(); |
|
|
|
goBookmarks(); |
|
|
|
} |
|
|
|
} else if (Url.contains("about:home")) { |
|
|
|
else if (Url.contains("about:home")) { |
|
|
|
|
|
|
|
pageIdIsVisible = true; |
|
|
|
pageIdIsVisible = true; |
|
|
|
main[pageToView].loadUrl("about:blank"); |
|
|
|
main[pageToView].loadUrl("about:blank"); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} else if (Url.contains("about:blank")) { |
|
|
|
else if (Url.contains("about:blank")) { |
|
|
|
|
|
|
|
pageIdIsVisible = true; |
|
|
|
pageIdIsVisible = true; |
|
|
|
main[pageToView].loadUrl("about:blank"); |
|
|
|
main[pageToView].loadUrl("about:blank"); |
|
|
|
|
|
|
|
|
|
|
@ -900,7 +985,7 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected void onDraw(Canvas canvas) { |
|
|
|
protected void onDraw(Canvas canvas) { |
|
|
|
if(!showFullScreen){ |
|
|
|
if (!showFullScreen) { |
|
|
|
main[pageId].invalidate(); |
|
|
|
main[pageId].invalidate(); |
|
|
|
} |
|
|
|
} |
|
|
|
super.onDraw(canvas); |
|
|
|
super.onDraw(canvas); |
|
|
@ -908,7 +993,7 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public boolean onTouchEvent(MotionEvent event) { |
|
|
|
public boolean onTouchEvent(MotionEvent event) { |
|
|
|
//final HitTestResult poop;
|
|
|
|
// final HitTestResult poop;
|
|
|
|
|
|
|
|
|
|
|
|
switch (event.getAction()) { |
|
|
|
switch (event.getAction()) { |
|
|
|
case MotionEvent.ACTION_DOWN: { |
|
|
|
case MotionEvent.ACTION_DOWN: { |
|
|
@ -923,13 +1008,11 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
move = true; |
|
|
|
move = true; |
|
|
|
} |
|
|
|
} |
|
|
|
case MotionEvent.ACTION_UP: { |
|
|
|
case MotionEvent.ACTION_UP: { |
|
|
|
try{ |
|
|
|
try { |
|
|
|
crap = getHitTestResult().getType(); |
|
|
|
hitTest = getHitTestResult().getType(); |
|
|
|
} |
|
|
|
} catch (NullPointerException e) { |
|
|
|
catch(NullPointerException e){ |
|
|
|
|
|
|
|
Log.e("Lightning","Touch was invalid"); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
if (showFullScreen&&crap!=9) { |
|
|
|
if (showFullScreen && hitTest != 9) { |
|
|
|
if (System.currentTimeMillis() - timeBetweenDownPress < 500 |
|
|
|
if (System.currentTimeMillis() - timeBetweenDownPress < 500 |
|
|
|
&& !move) { |
|
|
|
&& !move) { |
|
|
|
if (!uBarShows) { |
|
|
|
if (!uBarShows) { |
|
|
@ -964,6 +1047,13 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
|
|
|
|
|
|
|
|
private class AnthonyWebViewClient extends WebViewClient { |
|
|
|
private class AnthonyWebViewClient extends WebViewClient { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void doUpdateVisitedHistory(WebView view, String url, |
|
|
|
|
|
|
|
boolean isReload) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public boolean shouldOverrideUrlLoading(WebView view, String url) { |
|
|
|
public boolean shouldOverrideUrlLoading(WebView view, String url) { |
|
|
|
|
|
|
|
|
|
|
@ -983,7 +1073,7 @@ 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) { |
|
|
|
|
|
|
|
|
|
|
|
Log.e("Lightning: ","Error: " + description); |
|
|
|
Log.e("Barebones: ", "Error: " + description); |
|
|
|
|
|
|
|
|
|
|
|
super.onReceivedError(view, errorCode, description, failingUrl); |
|
|
|
super.onReceivedError(view, errorCode, description, failingUrl); |
|
|
|
} |
|
|
|
} |
|
|
@ -1004,25 +1094,13 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void onPageStarted(WebView view, final String url, Bitmap favicon) { |
|
|
|
public void onPageStarted(WebView view, String url, Bitmap favicon) { |
|
|
|
int num = view.getId(); |
|
|
|
int num = view.getId(); |
|
|
|
Thread hist = new Thread(new Runnable() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void run() { |
|
|
|
|
|
|
|
if(!noStockBrowser){ |
|
|
|
|
|
|
|
Browser.updateVisitedHistory(getContentResolver(), url, |
|
|
|
|
|
|
|
true); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
hist.start(); |
|
|
|
|
|
|
|
pageIsLoading = true; |
|
|
|
pageIsLoading = true; |
|
|
|
refresh.startAnimation(anim); |
|
|
|
refresh.startAnimation(anim); |
|
|
|
getUrl.setText(url); |
|
|
|
getUrl.setText(url); |
|
|
|
|
|
|
|
getUrl.setPadding(tenPad, 0, tenPad, 0); |
|
|
|
urlToLoad[num][0] = url; |
|
|
|
urlToLoad[num][0] = url; |
|
|
|
urlTitle[num].setCompoundDrawables(webpageOther, null, exitTab, |
|
|
|
urlTitle[num].setCompoundDrawables(webpageOther, null, exitTab, |
|
|
|
null); |
|
|
|
null); |
|
|
@ -1034,8 +1112,19 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void onPageFinished(WebView view, String url) { |
|
|
|
public void onPageFinished(WebView view, final String url) { |
|
|
|
|
|
|
|
if (!noStockBrowser) { |
|
|
|
|
|
|
|
Thread history = new Thread(new Runnable() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void run() { |
|
|
|
|
|
|
|
Browser.updateVisitedHistory(getContentResolver(), url, |
|
|
|
|
|
|
|
true); |
|
|
|
|
|
|
|
// Log.i("Barebones",view.getTitle()+" "+url);
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
history.start(); |
|
|
|
|
|
|
|
} |
|
|
|
pageIsLoading = false; |
|
|
|
pageIsLoading = false; |
|
|
|
anim.cancel(); |
|
|
|
anim.cancel(); |
|
|
|
anim.reset(); |
|
|
|
anim.reset(); |
|
|
@ -1135,7 +1224,7 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
if (allowLocation == true) { |
|
|
|
if (allowLocation == true) { |
|
|
|
callback.invoke(origin, true, false); |
|
|
|
callback.invoke(origin, true, false); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
Log.i("Lightning: ", "onGeolocationPermissionsShowPrompt()"); |
|
|
|
Log.i("Barebones: ", "onGeolocationPermissionsShowPrompt()"); |
|
|
|
|
|
|
|
|
|
|
|
final boolean remember = true; |
|
|
|
final boolean remember = true; |
|
|
|
AlertDialog.Builder builder = new AlertDialog.Builder( |
|
|
|
AlertDialog.Builder builder = new AlertDialog.Builder( |
|
|
@ -1176,7 +1265,6 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
super.onReceivedTitle(view, title); |
|
|
|
super.onReceivedTitle(view, title); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void onShowCustomView(View view, |
|
|
|
public void onShowCustomView(View view, |
|
|
|
WebChromeClient.CustomViewCallback callback) { |
|
|
|
WebChromeClient.CustomViewCallback callback) { |
|
|
@ -1259,18 +1347,16 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
view.setSaveEnabled(true); |
|
|
|
view.setSaveEnabled(true); |
|
|
|
webViewSettings.setDomStorageEnabled(true); |
|
|
|
webViewSettings.setDomStorageEnabled(true); |
|
|
|
webViewSettings.setAppCacheEnabled(true); |
|
|
|
webViewSettings.setAppCacheEnabled(true); |
|
|
|
webViewSettings.setAppCachePath( |
|
|
|
webViewSettings.setAppCachePath(getApplicationContext().getFilesDir() |
|
|
|
getApplicationContext().getFilesDir().getAbsolutePath() |
|
|
|
.getAbsolutePath() + "/cache"); |
|
|
|
+ "/cache"); |
|
|
|
|
|
|
|
webViewSettings.setRenderPriority(RenderPriority.HIGH); |
|
|
|
webViewSettings.setRenderPriority(RenderPriority.HIGH); |
|
|
|
webViewSettings.setGeolocationEnabled(true); |
|
|
|
webViewSettings.setGeolocationEnabled(true); |
|
|
|
webViewSettings.setGeolocationDatabasePath( |
|
|
|
webViewSettings.setGeolocationDatabasePath(getApplicationContext() |
|
|
|
getApplicationContext().getFilesDir().getAbsolutePath()); |
|
|
|
.getFilesDir().getAbsolutePath()); |
|
|
|
|
|
|
|
|
|
|
|
webViewSettings.setDatabaseEnabled(true); |
|
|
|
webViewSettings.setDatabaseEnabled(true); |
|
|
|
webViewSettings.setDatabasePath( |
|
|
|
webViewSettings.setDatabasePath(getApplicationContext().getFilesDir() |
|
|
|
getApplicationContext().getFilesDir().getAbsolutePath() |
|
|
|
.getAbsolutePath() + "/databases"); |
|
|
|
+ "/databases"); |
|
|
|
|
|
|
|
enableFlash = settings.getInt("enableflash", 0); |
|
|
|
enableFlash = settings.getInt("enableflash", 0); |
|
|
|
switch (enableFlash) { |
|
|
|
switch (enableFlash) { |
|
|
|
case 0: |
|
|
|
case 0: |
|
|
@ -1323,9 +1409,9 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
bookmarkLayout.setOrientation(LinearLayout.VERTICAL); |
|
|
|
bookmarkLayout.setOrientation(LinearLayout.VERTICAL); |
|
|
|
TextView description = new TextView(Barebones.this); |
|
|
|
TextView description = new TextView(Barebones.this); |
|
|
|
description.setHeight(height56); |
|
|
|
description.setHeight(height56); |
|
|
|
description.setBackgroundColor(0xff0099cc); |
|
|
|
description.setBackgroundColor(0xff33b5e5); |
|
|
|
description.setTextColor(0xffffffff); |
|
|
|
description.setTextColor(0xffffffff); |
|
|
|
description.setText("Bookmarks (long-press to remove)"); |
|
|
|
description.setText("Bookmarks"); |
|
|
|
description.setGravity(Gravity.CENTER_VERTICAL |
|
|
|
description.setGravity(Gravity.CENTER_VERTICAL |
|
|
|
| Gravity.CENTER_HORIZONTAL); |
|
|
|
| Gravity.CENTER_HORIZONTAL); |
|
|
|
description.setTextSize(bookHeight / 3); |
|
|
|
description.setTextSize(bookHeight / 3); |
|
|
@ -1354,13 +1440,14 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
if (uBar.isShown()) { |
|
|
|
if (uBar.isShown()) { |
|
|
|
urlTitle[pageId].setText("Bookmarks"); |
|
|
|
urlTitle[pageId].setText("Bookmarks"); |
|
|
|
getUrl.setText("Bookmarks"); |
|
|
|
getUrl.setText("Bookmarks"); |
|
|
|
|
|
|
|
getUrl.setPadding(tenPad, 0, tenPad, 0); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//main[pageId].startAnimation(fadeOut);
|
|
|
|
// main[pageId].startAnimation(fadeOut);
|
|
|
|
background.removeView(main[pageId]); |
|
|
|
background.removeView(main[pageId]); |
|
|
|
|
|
|
|
|
|
|
|
if (showFullScreen) { |
|
|
|
if (showFullScreen) { |
|
|
|
//uBar.startAnimation(fadeOut);
|
|
|
|
// uBar.startAnimation(fadeOut);
|
|
|
|
background.removeView(uBar); |
|
|
|
background.removeView(uBar); |
|
|
|
} |
|
|
|
} |
|
|
|
scrollBookmarks.addView(bookmarkLayout); |
|
|
|
scrollBookmarks.addView(bookmarkLayout); |
|
|
@ -1390,9 +1477,9 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
new FileWriter(book)); |
|
|
|
new FileWriter(book)); |
|
|
|
BufferedWriter urlWriter = new BufferedWriter( |
|
|
|
BufferedWriter urlWriter = new BufferedWriter( |
|
|
|
new FileWriter(bookUrl)); |
|
|
|
new FileWriter(bookUrl)); |
|
|
|
Log.i("lightning", "makes to here"); |
|
|
|
Log.i("barebones", "makes to here"); |
|
|
|
while (bUrl[n] != null && n < (MAX_BOOKMARKS - 1)) { |
|
|
|
while (bUrl[n] != null && n < (MAX_BOOKMARKS - 1)) { |
|
|
|
Log.i("lightning", "makes to here " + n); |
|
|
|
Log.i("barebones", "makes to here " + n); |
|
|
|
if (delete != n) { |
|
|
|
if (delete != n) { |
|
|
|
bookWriter.write(bTitle[n]); |
|
|
|
bookWriter.write(bTitle[n]); |
|
|
|
urlWriter.write(bUrl[n]); |
|
|
|
urlWriter.write(bUrl[n]); |
|
|
@ -1400,7 +1487,7 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
urlWriter.newLine(); |
|
|
|
urlWriter.newLine(); |
|
|
|
} |
|
|
|
} |
|
|
|
n++; |
|
|
|
n++; |
|
|
|
Log.i("lightning", "makes to here " + n); |
|
|
|
Log.i("barebones", "makes to here " + n); |
|
|
|
} |
|
|
|
} |
|
|
|
bookWriter.close(); |
|
|
|
bookWriter.close(); |
|
|
|
urlWriter.close(); |
|
|
|
urlWriter.close(); |
|
|
@ -1510,6 +1597,8 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
e.printStackTrace(); |
|
|
|
e.printStackTrace(); |
|
|
|
} catch (IOException e) { |
|
|
|
} catch (IOException e) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
e.printStackTrace(); |
|
|
|
|
|
|
|
} catch (NullPointerException e){ |
|
|
|
e.printStackTrace(); |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -1567,8 +1656,10 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
public void deleteTab(int id) { |
|
|
|
public void deleteTab(int id) { |
|
|
|
int leftId = id; |
|
|
|
int leftId = id; |
|
|
|
pageIdIsVisible = false; |
|
|
|
pageIdIsVisible = false; |
|
|
|
|
|
|
|
main[id].stopLoading(); |
|
|
|
|
|
|
|
main[id].clearView(); |
|
|
|
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)); |
|
|
@ -1609,6 +1700,7 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
urlTitle[id].setPadding(leftPad, 0, rightPad, 0); |
|
|
|
urlTitle[id].setPadding(leftPad, 0, rightPad, 0); |
|
|
|
pageId = id; |
|
|
|
pageId = id; |
|
|
|
getUrl.setText(urlToLoad[pageId][0]); |
|
|
|
getUrl.setText(urlToLoad[pageId][0]); |
|
|
|
|
|
|
|
getUrl.setPadding(tenPad, 0, tenPad, 0); |
|
|
|
right = true; |
|
|
|
right = true; |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
@ -1620,7 +1712,7 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
if (urlTitle[leftId].isShown()) { |
|
|
|
if (urlTitle[leftId].isShown()) { |
|
|
|
background.addView(main[leftId]); |
|
|
|
background.addView(main[leftId]); |
|
|
|
main[leftId].setVisibility(View.VISIBLE); |
|
|
|
main[leftId].setVisibility(View.VISIBLE); |
|
|
|
//uBar.bringToFront();
|
|
|
|
// uBar.bringToFront();
|
|
|
|
if (API < 16) { |
|
|
|
if (API < 16) { |
|
|
|
urlTitle[leftId] |
|
|
|
urlTitle[leftId] |
|
|
|
.setBackgroundDrawable(getResources() |
|
|
|
.setBackgroundDrawable(getResources() |
|
|
@ -1632,6 +1724,7 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
urlTitle[leftId].setPadding(leftPad, 0, rightPad, 0); |
|
|
|
urlTitle[leftId].setPadding(leftPad, 0, rightPad, 0); |
|
|
|
pageId = leftId; |
|
|
|
pageId = leftId; |
|
|
|
getUrl.setText(urlToLoad[pageId][0]); |
|
|
|
getUrl.setText(urlToLoad[pageId][0]); |
|
|
|
|
|
|
|
getUrl.setPadding(tenPad, 0, tenPad, 0); |
|
|
|
left = true; |
|
|
|
left = true; |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
@ -1640,9 +1733,7 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
} |
|
|
|
|
|
|
|
else{ |
|
|
|
|
|
|
|
right = left = true; |
|
|
|
right = left = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1794,6 +1885,21 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
}); |
|
|
|
}); |
|
|
|
menu.show(); |
|
|
|
menu.show(); |
|
|
|
} else if (API < 11) { |
|
|
|
} else if (API < 11) { |
|
|
|
|
|
|
|
/* |
|
|
|
|
|
|
|
LayoutInflater inflater=(LayoutInflater)Barebones.this.getSystemService(Context.LAYOUT_INFLATER_SERVICE); |
|
|
|
|
|
|
|
Display display=getWindowManager().getDefaultDisplay(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int width=display.getWidth()/2; |
|
|
|
|
|
|
|
int height=display.getHeight()/2; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
View pop = inflater.inflate(R.layout.menu,null,false); |
|
|
|
|
|
|
|
pop.measure(View.MeasureSpec.UNSPECIFIED,View.MeasureSpec.UNSPECIFIED); |
|
|
|
|
|
|
|
height=pop.getMeasuredHeight(); |
|
|
|
|
|
|
|
width=pop.getMeasuredWidth(); |
|
|
|
|
|
|
|
PopupWindow pu = new PopupWindow(pop,width,height,true); |
|
|
|
|
|
|
|
pu.showAtLocation(findViewById(v.getId()),Gravity.NO_GRAVITY,v.getRight(),v.getBottom()+80); |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
openOptionsMenu(); |
|
|
|
openOptionsMenu(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -1857,20 +1963,19 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
String fixedQuery = query.trim(); |
|
|
|
String fixedQuery = query.trim(); |
|
|
|
boolean period = fixedQuery.contains("."); |
|
|
|
boolean period = fixedQuery.contains("."); |
|
|
|
if (isBookmarkShowing) { |
|
|
|
if (isBookmarkShowing) { |
|
|
|
Log.i("Lightning", " is executing"); |
|
|
|
Log.i("Barebones", " is executing"); |
|
|
|
scrollBookmarks.startAnimation(fadeOut); |
|
|
|
scrollBookmarks.startAnimation(fadeOut); |
|
|
|
background.removeView(scrollBookmarks); |
|
|
|
background.removeView(scrollBookmarks); |
|
|
|
|
|
|
|
isBookmarkShowing = false; |
|
|
|
background.addView(main[pageId]); |
|
|
|
background.addView(main[pageId]); |
|
|
|
main[pageId].startAnimation(fadeIn); |
|
|
|
main[pageId].startAnimation(fadeIn); |
|
|
|
uBar.bringToFront(); |
|
|
|
uBar.bringToFront(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
pageIdIsVisible = true; |
|
|
|
pageIdIsVisible = true; |
|
|
|
if(fixedQuery.contains("about:home")){ |
|
|
|
if (fixedQuery.contains("about:home")) { |
|
|
|
goBookmarks(); |
|
|
|
goBookmarks(); |
|
|
|
} |
|
|
|
} else if (fixedQuery.contains(" ") || period == false) { |
|
|
|
else if (fixedQuery.contains(" ") || period == false) { |
|
|
|
|
|
|
|
fixedQuery.replaceAll(" ", "+"); |
|
|
|
fixedQuery.replaceAll(" ", "+"); |
|
|
|
main[pageId] |
|
|
|
main[pageId] |
|
|
|
.loadUrl("http://www.google.com/search?q=" + fixedQuery); |
|
|
|
.loadUrl("http://www.google.com/search?q=" + fixedQuery); |
|
|
@ -1906,6 +2011,7 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
uBar.bringToFront(); |
|
|
|
uBar.bringToFront(); |
|
|
|
urlTitle[pageId].setText(urlToLoad[pageId][1]); |
|
|
|
urlTitle[pageId].setText(urlToLoad[pageId][1]); |
|
|
|
getUrl.setText(urlToLoad[pageId][0]); |
|
|
|
getUrl.setText(urlToLoad[pageId][0]); |
|
|
|
|
|
|
|
getUrl.setPadding(tenPad, 0, tenPad, 0); |
|
|
|
pageIdIsVisible = true; |
|
|
|
pageIdIsVisible = true; |
|
|
|
isBookmarkShowing = false; |
|
|
|
isBookmarkShowing = false; |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -1966,6 +2072,7 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
background.removeView(scrollBookmarks); |
|
|
|
background.removeView(scrollBookmarks); |
|
|
|
urlTitle[pageId].setText(urlToLoad[pageId][1]); |
|
|
|
urlTitle[pageId].setText(urlToLoad[pageId][1]); |
|
|
|
getUrl.setText(urlToLoad[pageId][0]); |
|
|
|
getUrl.setText(urlToLoad[pageId][0]); |
|
|
|
|
|
|
|
getUrl.setPadding(tenPad, 0, tenPad, 0); |
|
|
|
pageIdIsVisible = true; |
|
|
|
pageIdIsVisible = true; |
|
|
|
isBookmarkShowing = false; |
|
|
|
isBookmarkShowing = false; |
|
|
|
uBar.bringToFront(); |
|
|
|
uBar.bringToFront(); |
|
|
@ -1973,6 +2080,7 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
main[pageId].goBack(); |
|
|
|
main[pageId].goBack(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
deleteTab(pageId); |
|
|
|
deleteTab(pageId); |
|
|
|
|
|
|
|
uBar.bringToFront(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
@ -1990,6 +2098,7 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void finish() { |
|
|
|
public void finish() { |
|
|
|
pageIdIsVisible = false; |
|
|
|
pageIdIsVisible = false; |
|
|
|
|
|
|
|
this.onPause(); |
|
|
|
super.finish(); |
|
|
|
super.finish(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1999,8 +2108,7 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
|
|
|
|
|
|
|
|
deleteHistory = settings.getBoolean("history", false); |
|
|
|
deleteHistory = settings.getBoolean("history", false); |
|
|
|
if (deleteHistory == true) { |
|
|
|
if (deleteHistory == true) { |
|
|
|
|
|
|
|
if (!noStockBrowser) { |
|
|
|
if(noStockBrowser){ |
|
|
|
|
|
|
|
Browser.clearHistory(getContentResolver()); |
|
|
|
Browser.clearHistory(getContentResolver()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -2041,11 +2149,11 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public boolean onTouch(View v, MotionEvent event) { |
|
|
|
public boolean onTouch(View v, MotionEvent event) { |
|
|
|
pageIdIsVisible = false; |
|
|
|
pageIdIsVisible = false; |
|
|
|
final int id = v.getId(); |
|
|
|
id = v.getId(); |
|
|
|
boolean xPress = false; |
|
|
|
xPress = false; |
|
|
|
x = (int) event.getX(); |
|
|
|
x = (int) event.getX(); |
|
|
|
y = (int) event.getY(); |
|
|
|
y = (int) event.getY(); |
|
|
|
final Rect edge = new Rect(); |
|
|
|
edge = new Rect(); |
|
|
|
v.getLocalVisibleRect(edge); |
|
|
|
v.getLocalVisibleRect(edge); |
|
|
|
|
|
|
|
|
|
|
|
if (x >= (edge.right - bounds[id].width() - fuzz) |
|
|
|
if (x >= (edge.right - bounds[id].width() - fuzz) |
|
|
@ -2114,7 +2222,6 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
// main[pageId].setAlpha(1f);
|
|
|
|
// main[pageId].setAlpha(1f);
|
|
|
|
background.removeView(main[pageId]); |
|
|
|
background.removeView(main[pageId]); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uBar.bringToFront(); |
|
|
|
uBar.bringToFront(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
pageIdIsVisible = false; |
|
|
|
pageIdIsVisible = false; |
|
|
@ -2126,6 +2233,7 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
pageId = id; |
|
|
|
pageId = id; |
|
|
|
pageIdIsVisible = true; |
|
|
|
pageIdIsVisible = true; |
|
|
|
getUrl.setText(urlToLoad[pageId][0]); |
|
|
|
getUrl.setText(urlToLoad[pageId][0]); |
|
|
|
|
|
|
|
getUrl.setPadding(tenPad, 0, tenPad, 0); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -2144,4 +2252,34 @@ public class Barebones extends Activity implements OnLongClickListener, |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
protected void onPause() { |
|
|
|
|
|
|
|
if (API >= 11) { |
|
|
|
|
|
|
|
main[pageId].onPause(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
main[pageId].pauseTimers(); |
|
|
|
|
|
|
|
super.onPause(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
protected void onResume() { |
|
|
|
|
|
|
|
if (API >= 11) { |
|
|
|
|
|
|
|
main[pageId].onResume(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
main[pageId].resumeTimers(); |
|
|
|
|
|
|
|
super.onResume(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
protected void onNewIntent(Intent intent) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String url = null; |
|
|
|
|
|
|
|
url = intent.getDataString(); |
|
|
|
|
|
|
|
if (url != null) { |
|
|
|
|
|
|
|
newTab(number, url); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
super.onNewIntent(intent); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|