|
|
@ -147,13 +147,32 @@ public class LightningView { |
|
|
|
if (mWebView == null) { |
|
|
|
if (mWebView == null) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (mHomepage.startsWith("about:home")) { |
|
|
|
switch (mHomepage) { |
|
|
|
mWebView.loadUrl(StartPage.getHomepage(mActivity), mRequestHeaders); |
|
|
|
case "about:home": |
|
|
|
} else if (mHomepage.startsWith("about:bookmarks")) { |
|
|
|
loadStartpage(); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "about:bookmarks": |
|
|
|
loadBookmarkpage(); |
|
|
|
loadBookmarkpage(); |
|
|
|
} else { |
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
mWebView.loadUrl(mHomepage, mRequestHeaders); |
|
|
|
mWebView.loadUrl(mHomepage, mRequestHeaders); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void loadStartpage() { |
|
|
|
|
|
|
|
BrowserApp.getIOThread().execute(new Runnable() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void run() { |
|
|
|
|
|
|
|
final String homepage = StartPage.getHomepage(mActivity); |
|
|
|
|
|
|
|
mActivity.runOnUiThread(new Runnable() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void run() { |
|
|
|
|
|
|
|
mWebView.loadUrl(homepage, mRequestHeaders); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -162,6 +181,9 @@ public class LightningView { |
|
|
|
public void loadBookmarkpage() { |
|
|
|
public void loadBookmarkpage() { |
|
|
|
if (mWebView == null) |
|
|
|
if (mWebView == null) |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
BrowserApp.getIOThread().execute(new Runnable() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void run() { |
|
|
|
Bitmap folderIcon = ThemeUtils.getThemedBitmap(mActivity, R.drawable.ic_folder, false); |
|
|
|
Bitmap folderIcon = ThemeUtils.getThemedBitmap(mActivity, R.drawable.ic_folder, false); |
|
|
|
FileOutputStream outputStream = null; |
|
|
|
FileOutputStream outputStream = null; |
|
|
|
File image = new File(mActivity.getCacheDir(), "folder.png"); |
|
|
|
File image = new File(mActivity.getCacheDir(), "folder.png"); |
|
|
@ -174,11 +196,17 @@ public class LightningView { |
|
|
|
} finally { |
|
|
|
} finally { |
|
|
|
Utils.close(outputStream); |
|
|
|
Utils.close(outputStream); |
|
|
|
} |
|
|
|
} |
|
|
|
File bookmarkWebPage = new File(mActivity.getFilesDir(), BookmarkPage.FILENAME); |
|
|
|
final File bookmarkWebPage = new File(mActivity.getFilesDir(), BookmarkPage.FILENAME); |
|
|
|
|
|
|
|
|
|
|
|
BrowserApp.getBookmarkPage().buildBookmarkPage(null); |
|
|
|
BrowserApp.getBookmarkPage().buildBookmarkPage(null); |
|
|
|
|
|
|
|
mActivity.runOnUiThread(new Runnable() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void run() { |
|
|
|
mWebView.loadUrl(Constants.FILE + bookmarkWebPage, mRequestHeaders); |
|
|
|
mWebView.loadUrl(Constants.FILE + bookmarkWebPage, mRequestHeaders); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|