summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/browser/BaseUi.java3
-rw-r--r--src/com/android/browser/BrowserActivity.java2
-rw-r--r--src/com/android/browser/BrowserBookmarksAdapter.java2
-rw-r--r--src/com/android/browser/BrowserBookmarksPage.java3
-rw-r--r--src/com/android/browser/BrowserHistoryPage.java4
-rw-r--r--src/com/android/browser/CombinedBookmarkHistoryView.java1
-rw-r--r--src/com/android/browser/Controller.java11
-rw-r--r--src/com/android/browser/IntentHandler.java8
-rw-r--r--src/com/android/browser/widget/BookmarkListWidgetProvider.java11
-rw-r--r--src/com/android/browser/widget/BookmarkListWidgetService.java4
10 files changed, 31 insertions, 18 deletions
diff --git a/src/com/android/browser/BaseUi.java b/src/com/android/browser/BaseUi.java
index 28a144d..95e795c 100644
--- a/src/com/android/browser/BaseUi.java
+++ b/src/com/android/browser/BaseUi.java
@@ -448,6 +448,9 @@ public abstract class BaseUi implements UI, WebViewFactory {
@Override
public void showComboView(boolean startWithHistory, Bundle extras) {
+ if (mComboView != null) {
+ return;
+ }
mComboView = new CombinedBookmarkHistoryView(mActivity,
mUiController,
startWithHistory ?
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java
index 8282eb0..ba5ba29 100644
--- a/src/com/android/browser/BrowserActivity.java
+++ b/src/com/android/browser/BrowserActivity.java
@@ -39,6 +39,8 @@ import android.view.accessibility.AccessibilityManager;
public class BrowserActivity extends Activity {
+ public static final String ACTION_SHOW_BOOKMARKS = "show_bookmarks";
+ public static final String ACTION_SHOW_BROWSER = "show_browser";
public static final String ACTION_RESTART = "--restart--";
private static final String EXTRA_STATE = "state";
diff --git a/src/com/android/browser/BrowserBookmarksAdapter.java b/src/com/android/browser/BrowserBookmarksAdapter.java
index f587f01..c680a88 100644
--- a/src/com/android/browser/BrowserBookmarksAdapter.java
+++ b/src/com/android/browser/BrowserBookmarksAdapter.java
@@ -81,7 +81,7 @@ class BrowserBookmarksAdapter extends CursorAdapter {
tv.setText(cursor.getString(BookmarksLoader.COLUMN_INDEX_TITLE));
if (cursor.getInt(BookmarksLoader.COLUMN_INDEX_IS_FOLDER) != 0) {
// folder
- favicon.setImageResource(R.drawable.ic_folder);
+ favicon.setImageResource(R.drawable.ic_folder_bookmark_widget_holo_dark);
} else {
byte[] faviconData = cursor.getBlob(BookmarksLoader.COLUMN_INDEX_FAVICON);
Bitmap faviconBitmap = null;
diff --git a/src/com/android/browser/BrowserBookmarksPage.java b/src/com/android/browser/BrowserBookmarksPage.java
index c030915..c39218c 100644
--- a/src/com/android/browser/BrowserBookmarksPage.java
+++ b/src/com/android/browser/BrowserBookmarksPage.java
@@ -369,7 +369,7 @@ public class BrowserBookmarksPage extends Fragment implements View.OnCreateConte
if (isFolder) {
item.setUrl(null);
Bitmap bitmap =
- BitmapFactory.decodeResource(getResources(), R.drawable.ic_folder);
+ BitmapFactory.decodeResource(getResources(), R.drawable.ic_folder_bookmark_widget_holo_dark);
item.setFavicon(bitmap);
new LookupBookmarkCount(getActivity(), item)
.execute(cursor.getLong(BookmarksLoader.COLUMN_INDEX_ID));
@@ -472,6 +472,7 @@ public class BrowserBookmarksPage extends Fragment implements View.OnCreateConte
}
mCrumbs.setController(null);
mCrumbs = null;
+ getLoaderManager().stopLoader(LOADER_BOOKMARKS);
}
@Override
diff --git a/src/com/android/browser/BrowserHistoryPage.java b/src/com/android/browser/BrowserHistoryPage.java
index 18feee9..c623012 100644
--- a/src/com/android/browser/BrowserHistoryPage.java
+++ b/src/com/android/browser/BrowserHistoryPage.java
@@ -209,8 +209,8 @@ public class BrowserHistoryPage extends Fragment
mEmptyView = root.findViewById(android.R.id.empty);
// Start the loader
- getLoaderManager().initLoader(LOADER_HISTORY, null, this);
- getLoaderManager().initLoader(LOADER_MOST_VISITED, null, this);
+ getLoaderManager().restartLoader(LOADER_HISTORY, null, this);
+ getLoaderManager().restartLoader(LOADER_MOST_VISITED, null, this);
// Register to receive icons in case they haven't all been loaded.
CombinedBookmarkHistoryView.getIconListenerSet().addListener(mIconReceiver);
diff --git a/src/com/android/browser/CombinedBookmarkHistoryView.java b/src/com/android/browser/CombinedBookmarkHistoryView.java
index e63d126..cc56489 100644
--- a/src/com/android/browser/CombinedBookmarkHistoryView.java
+++ b/src/com/android/browser/CombinedBookmarkHistoryView.java
@@ -43,7 +43,6 @@ import java.util.Vector;
interface BookmarksHistoryCallbacks {
public void onUrlSelected(String url, boolean newWindow);
public void onRemoveParentChildRelationships();
- public void onComboCanceled();
}
public class CombinedBookmarkHistoryView extends LinearLayout
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java
index d49a778..11b6bd7 100644
--- a/src/com/android/browser/Controller.java
+++ b/src/com/android/browser/Controller.java
@@ -318,6 +318,9 @@ public class Controller
if (jsFlags.trim().length() != 0) {
getCurrentWebView().setJsFlags(jsFlags);
}
+ if (BrowserActivity.ACTION_SHOW_BOOKMARKS.equals(intent.getAction())) {
+ bookmarksOrHistoryPicker(false);
+ }
}
void setWebViewFactory(WebViewFactory factory) {
@@ -1131,14 +1134,6 @@ public class Controller
}
/**
- * callback from ComboPage when dismissed
- */
- @Override
- public void onComboCanceled() {
- removeComboView();
- }
-
- /**
* dismiss the ComboPage
*/
@Override
diff --git a/src/com/android/browser/IntentHandler.java b/src/com/android/browser/IntentHandler.java
index cbbc482..bd5595f 100644
--- a/src/com/android/browser/IntentHandler.java
+++ b/src/com/android/browser/IntentHandler.java
@@ -84,6 +84,14 @@ public class IntentHandler {
// just resume the browser
return;
}
+ if (BrowserActivity.ACTION_SHOW_BOOKMARKS.equals(action)) {
+ mController.bookmarksOrHistoryPicker(false);
+ return;
+ }
+ if (BrowserActivity.ACTION_SHOW_BROWSER.equals(action)) {
+ mController.removeComboView();
+ return;
+ }
// In case the SearchDialog is open.
((SearchManager) mActivity.getSystemService(Context.SEARCH_SERVICE))
.stopSearch();
diff --git a/src/com/android/browser/widget/BookmarkListWidgetProvider.java b/src/com/android/browser/widget/BookmarkListWidgetProvider.java
index 2196ae0..99daaa1 100644
--- a/src/com/android/browser/widget/BookmarkListWidgetProvider.java
+++ b/src/com/android/browser/widget/BookmarkListWidgetProvider.java
@@ -79,6 +79,10 @@ public class BookmarkListWidgetProvider extends AppWidgetProvider {
private void performUpdate(Context context,
AppWidgetManager appWidgetManager, int[] appWidgetIds) {
+ Intent launchBrowser = new Intent(BrowserActivity.ACTION_SHOW_BROWSER,
+ null, context, BrowserActivity.class);
+ Intent launchBookmarks = new Intent(BrowserActivity.ACTION_SHOW_BOOKMARKS,
+ null, context, BrowserActivity.class);
// Update the widgets
for (int appWidgetId : appWidgetIds) {
Intent updateIntent = new Intent(context, BookmarkListWidgetService.class);
@@ -92,9 +96,10 @@ public class BookmarkListWidgetProvider extends AppWidgetProvider {
views.setPendingIntentTemplate(R.id.bookmarks_list,
PendingIntent.getService(context, 0, ic,
PendingIntent.FLAG_UPDATE_CURRENT));
- Intent launch = new Intent(context, BrowserActivity.class);
- views.setOnClickPendingIntent(R.id.header, PendingIntent
- .getActivity(context, 0, launch, PendingIntent.FLAG_CANCEL_CURRENT));
+ views.setOnClickPendingIntent(R.id.header_browser, PendingIntent
+ .getActivity(context, 0, launchBrowser, PendingIntent.FLAG_CANCEL_CURRENT));
+ views.setOnClickPendingIntent(R.id.header_bookmarks, PendingIntent
+ .getActivity(context, 0, launchBookmarks, PendingIntent.FLAG_CANCEL_CURRENT));
appWidgetManager.updateAppWidget(appWidgetId, views);
}
}
diff --git a/src/com/android/browser/widget/BookmarkListWidgetService.java b/src/com/android/browser/widget/BookmarkListWidgetService.java
index 8fbe807..8cf63a3 100644
--- a/src/com/android/browser/widget/BookmarkListWidgetService.java
+++ b/src/com/android/browser/widget/BookmarkListWidgetService.java
@@ -240,10 +240,10 @@ public class BookmarkListWidgetService extends RemoteViewsService {
views.setDrawableParameters(R.id.list_item, true, 0, -1, null, -1);
if (res.mIsFolder) {
if (folder != null && res.mId == folder.mId) {
+ views.setImageViewResource(R.id.thumb, R.drawable.btn_ic_back_bookmark_widget_holo_dark);
views.setDrawableParameters(R.id.list_item, true, 255, -1, null, -1);
- views.setImageViewResource(R.id.thumb, R.drawable.ic_back_normal);
} else {
- views.setImageViewResource(R.id.thumb, R.drawable.ic_folder);
+ views.setImageViewResource(R.id.thumb, R.drawable.ic_folder_bookmark_widget_holo_dark);
}
} else {
if (res.mBitmap != null) {