summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/com/android/browser/BrowserBookmarksAdapter.java11
-rw-r--r--src/com/android/browser/BrowserBookmarksPage.java8
-rw-r--r--src/com/android/browser/CombinedBookmarkHistoryActivity.java32
3 files changed, 25 insertions, 26 deletions
diff --git a/src/com/android/browser/BrowserBookmarksAdapter.java b/src/com/android/browser/BrowserBookmarksAdapter.java
index 75be45b..764daea 100644
--- a/src/com/android/browser/BrowserBookmarksAdapter.java
+++ b/src/com/android/browser/BrowserBookmarksAdapter.java
@@ -368,13 +368,11 @@ class BrowserBookmarksAdapter extends BaseAdapter {
}
View holder = convertView.findViewById(R.id.holder);
ImageView thumb = (ImageView) convertView.findViewById(R.id.thumb);
- ImageView fav = (ImageView) convertView.findViewById(R.id.fav);
TextView tv = (TextView) convertView.findViewById(R.id.label);
if (0 == position && !mCreateShortcut) {
// This is to create a bookmark for the current page.
holder.setVisibility(View.VISIBLE);
- fav.setVisibility(View.GONE);
tv.setText(mCurrentTitle);
// FIXME: Want to show the screenshot of the current page
thumb.setImageResource(R.drawable.blank);
@@ -393,15 +391,6 @@ class BrowserBookmarksAdapter extends BaseAdapter {
thumb.setImageBitmap(
BitmapFactory.decodeByteArray(data, 0, data.length));
}
- // Now show the favicon
- data = mCursor.getBlob(Browser.HISTORY_PROJECTION_FAVICON_INDEX);
- if (data == null) {
- fav.setVisibility(View.GONE);
- } else {
- fav.setVisibility(View.VISIBLE);
- fav.setImageBitmap(
- BitmapFactory.decodeByteArray(data, 0, data.length));
- }
return convertView;
diff --git a/src/com/android/browser/BrowserBookmarksPage.java b/src/com/android/browser/BrowserBookmarksPage.java
index 428aa92..5abdbb3 100644
--- a/src/com/android/browser/BrowserBookmarksPage.java
+++ b/src/com/android/browser/BrowserBookmarksPage.java
@@ -344,6 +344,14 @@ public class BrowserBookmarksPage extends Activity implements
}
@Override
+ public boolean onPrepareOptionsMenu(Menu menu) {
+ menu.findItem(R.id.switch_mode_menu_id).setTitle(
+ mGridMode ? R.string.switch_to_list
+ : R.string.switch_to_thumbnails);
+ return true;
+ }
+
+ @Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.new_context_menu_id:
diff --git a/src/com/android/browser/CombinedBookmarkHistoryActivity.java b/src/com/android/browser/CombinedBookmarkHistoryActivity.java
index 963f179..26fd1ee 100644
--- a/src/com/android/browser/CombinedBookmarkHistoryActivity.java
+++ b/src/com/android/browser/CombinedBookmarkHistoryActivity.java
@@ -27,6 +27,9 @@ import android.provider.Browser;
import android.webkit.WebIconDatabase.IconListener;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;
+import android.widget.TextView;
+import android.view.LayoutInflater;
+import android.view.View;
import android.view.Window;
import java.util.HashMap;
@@ -77,40 +80,39 @@ public class CombinedBookmarkHistoryActivity extends TabActivity
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.tabs);
- TabHost tabHost = getTabHost();
- tabHost.setOnTabChangedListener(this);
+ getTabHost().setOnTabChangedListener(this);
Bundle extras = getIntent().getExtras();
Resources resources = getResources();
getIconListenerSet(getContentResolver());
+
Intent bookmarksIntent = new Intent(this, BrowserBookmarksPage.class);
bookmarksIntent.putExtras(extras);
- tabHost.addTab(tabHost.newTabSpec(BOOKMARKS_TAB)
- .setIndicator(resources.getString(R.string.tab_bookmarks),
- resources.getDrawable(R.drawable.browser_bookmark_tab))
- .setContent(bookmarksIntent));
+ createTab(bookmarksIntent, R.string.tab_bookmarks, BOOKMARKS_TAB);
Intent visitedIntent = new Intent(this, MostVisitedActivity.class);
visitedIntent.putExtras(extras);
- tabHost.addTab(tabHost.newTabSpec(VISITED_TAB)
- .setIndicator(resources.getString(R.string.tab_most_visited),
- resources.getDrawable(R.drawable.browser_visited_tab))
- .setContent(visitedIntent));
+ createTab(visitedIntent, R.string.tab_most_visited, VISITED_TAB);
Intent historyIntent = new Intent(this, BrowserHistoryPage.class);
historyIntent.putExtras(extras);
- tabHost.addTab(tabHost.newTabSpec(HISTORY_TAB)
- .setIndicator(resources.getString(R.string.tab_history),
- resources.getDrawable(R.drawable.
- browser_history_tab)).setContent(historyIntent));
+ createTab(historyIntent, R.string.tab_history, HISTORY_TAB);
String defaultTab = extras.getString(STARTING_TAB);
if (defaultTab != null) {
- tabHost.setCurrentTab(2);
+ getTabHost().setCurrentTab(2);
}
}
+ private void createTab(Intent intent, int labelResId, String tab) {
+ LayoutInflater factory = LayoutInflater.from(this);
+ View tabHeader = factory.inflate(R.layout.tab_header, null);
+ TextView textView = (TextView) tabHeader.findViewById(R.id.tab_label);
+ textView.setText(labelResId);
+ TabHost tabHost = getTabHost();
+ tabHost.addTab(tabHost.newTabSpec(tab).setIndicator(tabHeader).setContent(intent));
+ }
// Copied from DialTacts Activity
/** {@inheritDoc} */
public void onTabChanged(String tabId) {