diff options
Diffstat (limited to 'src')
28 files changed, 158 insertions, 369 deletions
diff --git a/src/com/android/browser/AddBookmarkPage.java b/src/com/android/browser/AddBookmarkPage.java index 6f3779a..c4365e4 100644 --- a/src/com/android/browser/AddBookmarkPage.java +++ b/src/com/android/browser/AddBookmarkPage.java @@ -669,7 +669,7 @@ public class AddBookmarkPage extends Activity mCrumbs = (BreadCrumbView) findViewById(R.id.crumbs); mCrumbs.setUseBackButton(true); mCrumbs.setController(this); - mHeaderIcon = getResources().getDrawable(R.drawable.ic_folder_dark); + mHeaderIcon = getResources().getDrawable(R.drawable.ic_folder); mCrumbHolder = findViewById(R.id.crumb_holder); mCrumbs.setMaxVisible(MAX_CRUMBS_SHOWN); diff --git a/src/com/android/browser/BaseUi.java b/src/com/android/browser/BaseUi.java index 939874f..cdfc5a2 100644 --- a/src/com/android/browser/BaseUi.java +++ b/src/com/android/browser/BaseUi.java @@ -34,6 +34,7 @@ import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.text.TextUtils; +import android.view.GestureDetector; import android.view.Gravity; import android.view.LayoutInflater; import android.view.Menu; @@ -87,16 +88,13 @@ public abstract class BaseUi implements UI { protected Tab mActiveTab; private InputMethodManager mInputManager; - private Drawable mLockIconSecure; - private Drawable mLockIconMixed; - protected Drawable mGenericFavicon; - protected FrameLayout mContentView; protected FrameLayout mCustomViewContainer; protected FrameLayout mFullscreenContainer; private FrameLayout mFixedTitlebarContainer; private View mCustomView; + private View mDecorView; private WebChromeClient.CustomViewCallback mCustomViewCallback; private int mOriginalOrientation; @@ -125,8 +123,6 @@ public abstract class BaseUi implements UI { Resources res = mActivity.getResources(); mInputManager = (InputMethodManager) browser.getSystemService(Activity.INPUT_METHOD_SERVICE); - mLockIconSecure = res.getDrawable(R.drawable.ic_secure_dark); - mLockIconMixed = res.getDrawable(R.drawable.ic_secure_partial_dark); FrameLayout frameLayout = (FrameLayout) mActivity.getWindow() .getDecorView().findViewById(android.R.id.content); LayoutInflater.from(mActivity) @@ -139,9 +135,7 @@ public abstract class BaseUi implements UI { R.id.fullscreen_custom_content); mErrorConsoleContainer = (LinearLayout) frameLayout .findViewById(R.id.error_console); - setFullscreen(false); - mGenericFavicon = res.getDrawable( - R.drawable.app_web_browser_sm); + setImmersiveFullscreen(BrowserSettings.getInstance().useFullscreen()); mTitleBar = new TitleBar(mActivity, mUiController, this, mContentView); mTitleBar.setProgress(100); @@ -149,6 +143,8 @@ public abstract class BaseUi implements UI { mUrlBarAutoShowManager = new UrlBarAutoShowManager(this); } + + private void cancelStopToast() { if (mStopToast != null) { mStopToast.cancel(); @@ -223,8 +219,6 @@ public abstract class BaseUi implements UI { @Override public void onTabDataChanged(Tab tab) { setUrlTitle(tab); - setFavicon(tab); - updateLockIconToLatest(tab); updateNavigationState(tab); mTitleBar.onTabDataChanged(tab); mNavigationBar.onTabDataChanged(tab); @@ -603,31 +597,6 @@ public abstract class BaseUi implements UI { mTitleBar.updateAutoLogin(tab, animate); } - /** - * Update the lock icon to correspond to our latest state. - */ - protected void updateLockIconToLatest(Tab t) { - if (t != null && t.inForeground()) { - updateLockIconImage(t.getSecurityState()); - } - } - - /** - * Updates the lock-icon image in the title-bar. - */ - private void updateLockIconImage(SecurityState securityState) { - Drawable d = null; - if (securityState == SecurityState.SECURITY_STATE_SECURE) { - d = mLockIconSecure; - } else if (securityState == SecurityState.SECURITY_STATE_MIXED - || securityState == SecurityState.SECURITY_STATE_BAD_CERTIFICATE) { - // TODO: It would be good to have different icons for insecure vs mixed content. - // See http://b/5403800 - d = mLockIconMixed; - } - mNavigationBar.setLock(d); - } - protected void setUrlTitle(Tab tab) { String url = tab.getUrl(); String title = tab.getTitle(); @@ -639,14 +608,6 @@ public abstract class BaseUi implements UI { } } - // Set the favicon in the title bar. - protected void setFavicon(Tab tab) { - if (tab.inForeground()) { - Bitmap icon = tab.getFavicon(); - mNavigationBar.setFavicon(icon); - } - } - @Override public void onActionModeFinished(boolean inLoad) { } @@ -775,27 +736,19 @@ public abstract class BaseUi implements UI { } public void setFullscreen(boolean enabled) { - Window win = mActivity.getWindow(); - WindowManager.LayoutParams winParams = win.getAttributes(); - final int bits = WindowManager.LayoutParams.FLAG_FULLSCREEN; + FrameLayout decor = (FrameLayout) mActivity.getWindow().getDecorView(); + int systemUiVisibility = decor.getSystemUiVisibility(); + final int bits = View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION + | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN + | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION + | View.SYSTEM_UI_FLAG_FULLSCREEN + | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY; if (enabled) { - winParams.flags |= bits; + systemUiVisibility |= bits; } else { - winParams.flags &= ~bits; - if (mCustomView != null) { - mCustomView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE); - } else { - mContentView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE); - } + systemUiVisibility &= ~bits; } - win.setAttributes(winParams); - } - - public boolean isFullscreen() { - Window win = mActivity.getWindow(); - WindowManager.LayoutParams winParams = win.getAttributes(); - final int bits = WindowManager.LayoutParams.FLAG_FULLSCREEN; - return (winParams.flags & bits) == bits; + decor.setSystemUiVisibility(systemUiVisibility); } protected void setImmersiveFullscreen (boolean enabled) { @@ -814,22 +767,6 @@ public abstract class BaseUi implements UI { decor.setSystemUiVisibility(systemUiVisibility); } - public Drawable getFaviconDrawable(Bitmap icon) { - Drawable[] array = new Drawable[3]; - array[0] = new PaintDrawable(Color.BLACK); - PaintDrawable p = new PaintDrawable(Color.WHITE); - array[1] = p; - if (icon == null) { - array[2] = mGenericFavicon; - } else { - array[2] = new BitmapDrawable(icon); - } - LayerDrawable d = new LayerDrawable(array); - d.setLayerInset(1, 1, 1, 1, 1); - d.setLayerInset(2, 2, 2, 2, 2); - return d; - } - public boolean isLoading() { return mActiveTab != null ? mActiveTab.inPageLoad() : false; } diff --git a/src/com/android/browser/BreadCrumbView.java b/src/com/android/browser/BreadCrumbView.java index c8d0f2b..b6810d9 100644 --- a/src/com/android/browser/BreadCrumbView.java +++ b/src/com/android/browser/BreadCrumbView.java @@ -169,10 +169,10 @@ public class BreadCrumbView extends LinearLayout implements OnClickListener { private void addBackButton() { mBackButton = new ImageButton(mContext); - mBackButton.setImageResource(R.drawable.ic_back_hierarchy_dark); + mBackButton.setImageResource(R.drawable.ic_back_hierarchy); TypedValue outValue = new TypedValue(); getContext().getTheme().resolveAttribute( - android.R.attr.selectableItemBackground, outValue, true); + android.R.attr.selectableItemBackgroundBorderless, outValue, true); int resid = outValue.resourceId; mBackButton.setBackgroundResource(resid); mBackButton.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, diff --git a/src/com/android/browser/BrowserBookmarksPage.java b/src/com/android/browser/BrowserBookmarksPage.java index 3a0c65a..a83c00b 100644 --- a/src/com/android/browser/BrowserBookmarksPage.java +++ b/src/com/android/browser/BrowserBookmarksPage.java @@ -309,7 +309,7 @@ public class BrowserBookmarksPage extends Fragment implements View.OnCreateConte if (isFolder) { item.setUrl(null); Bitmap bitmap = - BitmapFactory.decodeResource(getResources(), R.drawable.ic_folder_dark); + BitmapFactory.decodeResource(getResources(), R.drawable.ic_folder); item.setFavicon(bitmap); new LookupBookmarkCount(getActivity(), item) .execute(cursor.getLong(BookmarksLoader.COLUMN_INDEX_ID)); diff --git a/src/com/android/browser/BrowserPreferencesPage.java b/src/com/android/browser/BrowserPreferencesPage.java index 323b9b8..75cee06 100644 --- a/src/com/android/browser/BrowserPreferencesPage.java +++ b/src/com/android/browser/BrowserPreferencesPage.java @@ -27,7 +27,7 @@ import com.android.browser.preferences.AdvancedPreferencesFragment; import com.android.browser.preferences.BandwidthPreferencesFragment; import com.android.browser.preferences.DebugPreferencesFragment; import com.android.browser.preferences.GeneralPreferencesFragment; -import com.android.browser.preferences.LabPreferencesFragment; +import com.android.browser.preferences.InterfacePreferencesFragment; import com.android.browser.preferences.PrivacySecurityPreferencesFragment; import com.android.browser.preferences.WebsiteSettingsFragment; @@ -111,7 +111,7 @@ public class BrowserPreferencesPage extends PreferenceActivity { BandwidthPreferencesFragment.class.getName().equals(fragmentName) || DebugPreferencesFragment.class.getName().equals(fragmentName) || GeneralPreferencesFragment.class.getName().equals(fragmentName) || - LabPreferencesFragment.class.getName().equals(fragmentName) || + InterfacePreferencesFragment.class.getName().equals(fragmentName) || PrivacySecurityPreferencesFragment.class.getName().equals(fragmentName) || WebsiteSettingsFragment.class.getName().equals(fragmentName); diff --git a/src/com/android/browser/BrowserSettings.java b/src/com/android/browser/BrowserSettings.java index 95b7706..e76fa5d 100644 --- a/src/com/android/browser/BrowserSettings.java +++ b/src/com/android/browser/BrowserSettings.java @@ -340,6 +340,10 @@ public class BrowserSettings implements OnSharedPreferenceChangeListener, syncManagedSettings(); if (PREF_SEARCH_ENGINE.equals(key)) { updateSearchEngine(false); + } else if (PREF_FULLSCREEN.equals(key)) { + if (mController != null && mController.getUi() != null) { + mController.getUi().setFullscreen(useFullscreen()); + } } else if (PREF_ENABLE_QUICK_CONTROLS.equals(key)) { if (mController != null && mController.getUi() != null) { mController.getUi().setUseQuickControls(sharedPreferences.getBoolean(key, false)); @@ -762,7 +766,7 @@ public class BrowserSettings implements OnSharedPreferenceChangeListener, } // ----------------------------- - // getter/setters for lab_preferences.xml + // getter/setters for interface.xml // ----------------------------- public boolean useQuickControls() { @@ -773,6 +777,10 @@ public class BrowserSettings implements OnSharedPreferenceChangeListener, return HomeProvider.MOST_VISITED.equals(getHomePage()); } + public boolean useFullscreen() { + return mPrefs.getBoolean(PREF_FULLSCREEN, false); + } + public boolean useInvertedRendering() { return mPrefs.getBoolean(PREF_INVERTED, false); } diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java index 8c77270..f006986 100644 --- a/src/com/android/browser/Controller.java +++ b/src/com/android/browser/Controller.java @@ -79,6 +79,8 @@ import android.webkit.WebChromeClient.FileChooserParams; import android.webkit.WebIconDatabase; import android.webkit.WebSettings; import android.webkit.WebView; +import android.widget.Button; +import android.widget.EditText; import android.widget.Toast; import com.android.browser.IntentHandler.UrlData; @@ -365,6 +367,7 @@ public class Controller && BrowserActivity.ACTION_SHOW_BOOKMARKS.equals(intent.getAction())) { bookmarksOrHistoryPicker(ComboViews.Bookmarks); } + } private static class PruneThumbnails implements Runnable { @@ -396,7 +399,6 @@ public class Controller cr.delete(Thumbnails.CONTENT_URI, where.toString(), null); } } - } @Override @@ -1586,9 +1588,6 @@ public class Controller final MenuItem uaSwitcher = menu.findItem(R.id.ua_desktop_menu_id); uaSwitcher.setChecked(isDesktopUa); - final MenuItem fullscreen = menu.findItem(R.id.fullscreen_menu_id); - fullscreen.setChecked(mUi.isFullscreen()); - menu.setGroupVisible(R.id.LIVE_MENU, isLive); menu.setGroupVisible(R.id.SNAPSHOT_MENU, !isLive); menu.setGroupVisible(R.id.COMBO_MENU, false); @@ -1652,7 +1651,7 @@ public class Controller case R.id.back_menu_id: getCurrentTab().goBack(); - break; + break; case R.id.forward_menu_id: getCurrentTab().goForward(); @@ -1716,9 +1715,6 @@ public class Controller toggleUserAgent(); break; - case R.id.fullscreen_menu_id: - toggleFullscreen(); - case R.id.window_one_menu_id: case R.id.window_two_menu_id: case R.id.window_three_menu_id: @@ -1756,11 +1752,6 @@ public class Controller } @Override - public void toggleFullscreen() { - mUi.setFullscreen(!mUi.isFullscreen()); - } - - @Override public void findOnPage() { getCurrentTopWebView().showFindDialog(null, true); } diff --git a/src/com/android/browser/NavScreen.java b/src/com/android/browser/NavScreen.java index f7b73df..887ffca 100644 --- a/src/com/android/browser/NavScreen.java +++ b/src/com/android/browser/NavScreen.java @@ -65,7 +65,6 @@ public class NavScreen extends RelativeLayout FrameLayout mHolder; TextView mTitle; - ImageView mFavicon; ImageButton mCloseTab; ImageView mNewTabFab; @@ -128,7 +127,6 @@ public class NavScreen extends RelativeLayout mNewTab = (ImageButton) findViewById(R.id.newtab); mMore = (ImageButton) findViewById(R.id.more); mBookmarks.setOnClickListener(this); - mHomeTab.setOnClickListener(this); mNewIncognitoTab.setOnClickListener(this); mNewTab.setOnClickListener(this); mMore.setOnClickListener(this); @@ -148,13 +146,19 @@ public class NavScreen extends RelativeLayout } }); mNewTabFab = (ImageView) findViewById(R.id.floating_action_button); - mNewTabFab.setOnClickListener( - new View.OnClickListener() { + mNewTabFab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { openNewTab(false); } }); + mNewTabFab.setOnLongClickListener(new View.OnLongClickListener() { + @Override + public boolean onLongClick(View v) { + openNewTab(true); + return true; + } + }); } @Override @@ -223,14 +227,14 @@ public class NavScreen extends RelativeLayout } } - private Tab findCenteredTab(){ + private Tab findCenteredTab() { View v = mScroller.findViewAt(mScroller.getWidth() / 2, mScroller.getHeight() / 2); - if( v != null && v instanceof NavTabView ){ - Long tabId = ((NavTabView)v).getWebViewId(); - if( tabId != null ){ + if (v != null && v instanceof NavTabView) { + long tabId = ((NavTabView)v).getWebViewId(); + if (tabId != -1) { List<Tab> tabs = mUiController.getTabs(); - for( int i=0; i<tabs.size(); i++ ){ - if( tabs.get(i).getId() == tabId.longValue() ) { + for (int i = 0; i < tabs.size(); i++) { + if (tabs.get(i).getId() == tabId) { return tabs.get(i); } } @@ -290,10 +294,7 @@ public class NavScreen extends RelativeLayout tabview.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { - if (tabview.isClose(v)) { - mScroller.animateOut(tabview); - mTabViews.remove(tab); - } else if (tabview.isTitle(v)) { + if (tabview.isTitle(v)) { switchToTab(tab); mUi.getTitleBar().setSkipTitleBarAnimations(true); close(position, false); diff --git a/src/com/android/browser/NavTabView.java b/src/com/android/browser/NavTabView.java index de50317..17b0425 100644 --- a/src/com/android/browser/NavTabView.java +++ b/src/com/android/browser/NavTabView.java @@ -31,7 +31,6 @@ public class NavTabView extends LinearLayout { private ViewGroup mContent; private Tab mTab; - private ImageView mClose; private TextView mTitle; private View mTitleBar; ImageView mImage; @@ -56,16 +55,11 @@ public class NavTabView extends LinearLayout { private void init() { LayoutInflater.from(mContext).inflate(R.layout.nav_tab_view, this); mContent = (ViewGroup) findViewById(R.id.main); - mClose = (ImageView) findViewById(R.id.closetab); - mTitle = (TextView) findViewById(R.id.title); mTitleBar = findViewById(R.id.titlebar); + mTitle = (TextView) findViewById(R.id.title); mImage = (ImageView) findViewById(R.id.tab_view); } - protected boolean isClose(View v) { - return v == mClose; - } - protected boolean isTitle(View v) { return v == mTitleBar; } @@ -85,31 +79,30 @@ public class NavTabView extends LinearLayout { } mTitle.setText(txt); } - if (mTab.isSnapshot()) { - setTitleIcon(R.drawable.ic_history_dark); - } else if (mTab.isPrivateBrowsingEnabled()) { - setTitleIcon(R.drawable.ic_incognito_dark); - } else { - setTitleIcon(0); + if (!mTab.isSnapshot()) { + setTitleIcon(); } } - private void setTitleIcon(int id) { - if (id == 0) { - mTitle.setPadding(mTitle.getCompoundDrawablePadding(), 0, 0, 0); - } else { - mTitle.setPadding(0, 0, 0, 0); - } - mTitle.setCompoundDrawablesWithIntrinsicBounds(id, 0, 0, 0); - } + private void setTitleIcon() { + mTitle.setPadding(mTitle.getCompoundDrawablePadding(), 0, 0, 0); + mTitle.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0); + } protected boolean isHighlighted() { return mHighlighted; } - protected Long getWebViewId(){ - if(mTab == null) return null; - return new Long(mTab.getId()); + protected long getWebViewId() { + return mTab != null ? mTab.getId() : -1; + } + + protected int getContentLeft() { + return getLeft() + mTitleBar.getLeft() + mImage.getLeft(); + } + + protected int getContentTop() { + return getTop() + mTitleBar.getTop() + mImage.getTop(); } protected void setWebView(Tab tab) { @@ -128,7 +121,6 @@ public class NavTabView extends LinearLayout { public void setOnClickListener(OnClickListener listener) { mClickListener = listener; mTitleBar.setOnClickListener(mClickListener); - mClose.setOnClickListener(mClickListener); if (mImage != null) { mImage.setOnClickListener(mClickListener); } diff --git a/src/com/android/browser/NavigationBarBase.java b/src/com/android/browser/NavigationBarBase.java index 7f100ff..00702e6 100644 --- a/src/com/android/browser/NavigationBarBase.java +++ b/src/com/android/browser/NavigationBarBase.java @@ -87,11 +87,6 @@ public class NavigationBarBase extends LinearLayout implements } } - public void setFavicon(Bitmap icon) { - if (mFavicon == null) return; - mFavicon.setImageDrawable(mBaseUi.getFaviconDrawable(icon)); - } - @Override public void onClick(View v) { } diff --git a/src/com/android/browser/NavigationBarPhone.java b/src/com/android/browser/NavigationBarPhone.java index cdf73c7..d1920e8 100644 --- a/src/com/android/browser/NavigationBarPhone.java +++ b/src/com/android/browser/NavigationBarPhone.java @@ -38,13 +38,11 @@ public class NavigationBarPhone extends NavigationBarBase implements private ImageView mStopButton; private ImageView mMagnify; private ImageView mClearButton; - private ImageView mVoiceButton; private Drawable mStopDrawable; private Drawable mRefreshDrawable; private String mStopDescription; private String mRefreshDescription; private View mTabSwitcher; - private View mComboIcon; private View mTitleContainer; private View mMore; private Drawable mTextfieldBgDrawable; @@ -71,20 +69,16 @@ public class NavigationBarPhone extends NavigationBarBase implements mStopButton.setOnClickListener(this); mClearButton = (ImageView) findViewById(R.id.clear); mClearButton.setOnClickListener(this); - mVoiceButton = (ImageView) findViewById(R.id.voice); - mVoiceButton.setOnClickListener(this); mMagnify = (ImageView) findViewById(R.id.magnify); mTabSwitcher = findViewById(R.id.tab_switcher); mTabSwitcher.setOnClickListener(this); mMore = findViewById(R.id.more); mMore.setOnClickListener(this); - mComboIcon = findViewById(R.id.iconcombo); - mComboIcon.setOnClickListener(this); mTitleContainer = findViewById(R.id.title_bg); setFocusState(false); Resources res = getContext().getResources(); - mStopDrawable = res.getDrawable(R.drawable.ic_stop_dark); - mRefreshDrawable = res.getDrawable(R.drawable.ic_refresh_dark); + mStopDrawable = res.getDrawable(R.drawable.ic_stop); + mRefreshDrawable = res.getDrawable(R.drawable.ic_refresh); mStopDescription = res.getString(R.string.accessibility_button_stop); mRefreshDescription = res.getString(R.string.accessibility_button_refresh); mTextfieldBgDrawable = res.getDrawable(R.drawable.textfield_active_holo_dark); @@ -100,7 +94,6 @@ public class NavigationBarPhone extends NavigationBarBase implements mStopButton.setImageDrawable(mStopDrawable); mStopButton.setContentDescription(mStopDescription); if (mStopButton.getVisibility() != View.VISIBLE) { - mComboIcon.setVisibility(View.GONE); mStopButton.setVisibility(View.VISIBLE); } } @@ -111,9 +104,6 @@ public class NavigationBarPhone extends NavigationBarBase implements super.onProgressStopped(); mStopButton.setImageDrawable(mRefreshDrawable); mStopButton.setContentDescription(mRefreshDescription); - if (!isEditingUrl()) { - mComboIcon.setVisibility(View.VISIBLE); - } onStateChanged(mUrlInput.getState()); } @@ -153,10 +143,6 @@ public class NavigationBarPhone extends NavigationBarBase implements showMenu(mMore); } else if (mClearButton == v) { mUrlInput.setText(""); - } else if (mComboIcon == v) { - mUiController.showPageInfo(); - } else if (mVoiceButton == v) { - mUiController.startVoiceRecognizer(); } else { super.onClick(v); } @@ -213,10 +199,8 @@ public class NavigationBarPhone extends NavigationBarBase implements @Override public void onStateChanged(int state) { - mVoiceButton.setVisibility(View.GONE); switch(state) { case StateListener.STATE_NORMAL: - mComboIcon.setVisibility(View.VISIBLE); mStopButton.setVisibility(View.GONE); mClearButton.setVisibility(View.GONE); mMagnify.setVisibility(View.GONE); @@ -225,19 +209,14 @@ public class NavigationBarPhone extends NavigationBarBase implements mMore.setVisibility(View.VISIBLE); break; case StateListener.STATE_HIGHLIGHTED: - mComboIcon.setVisibility(View.GONE); mStopButton.setVisibility(View.VISIBLE); mClearButton.setVisibility(View.GONE); - if ((mUiController != null) && mUiController.supportsVoice()) { - mVoiceButton.setVisibility(View.VISIBLE); - } mMagnify.setVisibility(View.GONE); mTabSwitcher.setVisibility(View.GONE); mMore.setVisibility(View.GONE); mTitleContainer.setBackgroundDrawable(mTextfieldBgDrawable); break; case StateListener.STATE_EDITED: - mComboIcon.setVisibility(View.GONE); mStopButton.setVisibility(View.GONE); mClearButton.setVisibility(View.VISIBLE); mMagnify.setVisibility(View.VISIBLE); diff --git a/src/com/android/browser/NavigationBarTablet.java b/src/com/android/browser/NavigationBarTablet.java index d66553f..5fce727 100644 --- a/src/com/android/browser/NavigationBarTablet.java +++ b/src/com/android/browser/NavigationBarTablet.java @@ -45,7 +45,6 @@ public class NavigationBarTablet extends NavigationBarBase implements StateListe private ImageButton mBackButton; private ImageButton mForwardButton; private ImageView mStar; - private ImageView mUrlIcon; private ImageView mSearchButton; private ImageView mStopButton; private View mAllButton; @@ -55,7 +54,6 @@ public class NavigationBarTablet extends NavigationBarBase implements StateListe private Drawable mFocusDrawable; private Drawable mUnfocusDrawable; private boolean mHideNavButtons; - private Drawable mFaviconDrawable; public NavigationBarTablet(Context context) { super(context); @@ -74,8 +72,8 @@ public class NavigationBarTablet extends NavigationBarBase implements StateListe private void init(Context context) { Resources resources = context.getResources(); - mStopDrawable = resources.getDrawable(R.drawable.ic_stop_dark); - mReloadDrawable = resources.getDrawable(R.drawable.ic_refresh_dark); + mStopDrawable = resources.getDrawable(R.drawable.ic_stop); + mReloadDrawable = resources.getDrawable(R.drawable.ic_refresh); mStopDescription = resources.getString(R.string.accessibility_button_stop); mRefreshDescription = resources.getString(R.string.accessibility_button_refresh); mFocusDrawable = resources.getDrawable( @@ -94,7 +92,6 @@ public class NavigationBarTablet extends NavigationBarBase implements StateListe mNavButtons = findViewById(R.id.navbuttons); mBackButton = (ImageButton) findViewById(R.id.back); mForwardButton = (ImageButton) findViewById(R.id.forward); - mUrlIcon = (ImageView) findViewById(R.id.url_icon); mStar = (ImageView) findViewById(R.id.star); mStopButton = (ImageView) findViewById(R.id.stop); mSearchButton = (ImageView) findViewById(R.id.search); @@ -140,13 +137,12 @@ public class NavigationBarTablet extends NavigationBarBase implements StateListe void updateNavigationState(Tab tab) { if (tab != null) { mBackButton.setImageResource(tab.canGoBack() - ? R.drawable.ic_back_dark - : R.drawable.ic_back_disabled_dark); + ? R.drawable.ic_back + : R.drawable.ic_back_disabled); mForwardButton.setImageResource(tab.canGoForward() - ? R.drawable.ic_forward_dark - : R.drawable.ic_forward_disabled_dark); + ? R.drawable.ic_forward + : R.drawable.ic_forward_disabled); } - updateUrlIcon(); } @Override @@ -197,23 +193,6 @@ public class NavigationBarTablet extends NavigationBarBase implements StateListe } @Override - public void setFavicon(Bitmap icon) { - mFaviconDrawable = mBaseUi.getFaviconDrawable(icon); - updateUrlIcon(); - } - - void updateUrlIcon() { - if (mUrlInput.hasFocus()) { - mUrlIcon.setImageResource(R.drawable.ic_search_dark); - } else { - if (mFaviconDrawable == null) { - mFaviconDrawable = mBaseUi.getFaviconDrawable(null); - } - mUrlIcon.setImageDrawable(mFaviconDrawable); - } - } - - @Override protected void setFocusState(boolean focus) { super.setFocusState(focus); if (focus) { @@ -222,7 +201,6 @@ public class NavigationBarTablet extends NavigationBarBase implements StateListe } mSearchButton.setVisibility(View.GONE); mStar.setVisibility(View.GONE); - mUrlIcon.setImageResource(R.drawable.ic_search_dark); } else { if (mHideNavButtons) { showNavButtons(); @@ -233,7 +211,6 @@ public class NavigationBarTablet extends NavigationBarBase implements StateListe } else { mSearchButton.setVisibility(View.VISIBLE); } - updateUrlIcon(); } mUrlContainer.setBackgroundDrawable(focus ? mFocusDrawable : mUnfocusDrawable); diff --git a/src/com/android/browser/PhoneUi.java b/src/com/android/browser/PhoneUi.java index 32bbc6b..6707134 100644 --- a/src/com/android/browser/PhoneUi.java +++ b/src/com/android/browser/PhoneUi.java @@ -25,6 +25,7 @@ import android.content.Context; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Matrix; +import android.graphics.drawable.Drawable; import android.os.Build; import android.os.Message; import android.util.Log; @@ -124,8 +125,8 @@ public class PhoneUi extends BaseUi { } if (mAnimScreen == null) { mAnimScreen = new AnimScreen(mActivity); - // initialize bitmaps - mAnimScreen.set(getTitleBar(), getWebView()); + // initialize bitmap + mAnimScreen.set(getWebView()); } } } @@ -158,7 +159,6 @@ public class PhoneUi extends BaseUi { } // update nav bar state mNavigationBar.onStateChanged(StateListener.STATE_NORMAL); - updateLockIconToLatest(tab); mTitleBar.setSkipTitleBarAnimations(false); } @@ -184,10 +184,10 @@ public class PhoneUi extends BaseUi { if (info != null) { info.setVisible(false); } - MenuItem newtab = menu.findItem(R.id.new_tab_menu_id); + MenuItem newtab = menu.findItem(R.id.new_tab_menu_id); if (newtab != null && !mUseQuickControls) { newtab.setVisible(false); - } + } MenuItem closeOthers = menu.findItem(R.id.close_other_tabs_id); if (closeOthers != null) { boolean isLastTab = true; @@ -196,10 +196,6 @@ public class PhoneUi extends BaseUi { } closeOthers.setEnabled(!isLastTab); } - MenuItem fullscreen = menu.findItem(R.id.fullscreen_menu_id); - if (fullscreen != null) { - fullscreen.setVisible(!showingNavScreen()); - } if (showingNavScreen()) { menu.setGroupVisible(R.id.LIVE_MENU, false); menu.setGroupVisible(R.id.SNAPSHOT_MENU, false); @@ -279,10 +275,9 @@ public class PhoneUi extends BaseUi { mAnimScreen = new AnimScreen(mActivity); } else { mAnimScreen.mMain.setAlpha(1f); - mAnimScreen.mTitle.setAlpha(1f); mAnimScreen.setScaleFactor(1f); } - mAnimScreen.set(getTitleBar(), getWebView()); + mAnimScreen.set(getWebView()); if (mAnimScreen.mMain.getParent() == null) { mCustomViewContainer.addView(mAnimScreen.mMain, COVER_SCREEN_PARAMS); } @@ -291,14 +286,14 @@ public class PhoneUi extends BaseUi { mAnimScreen.mMain.layout(0, 0, mContentView.getWidth(), mContentView.getHeight()); int fromLeft = 0; - int fromTop = getTitleBar().getHeight(); + int fromTop = 0; int fromRight = mContentView.getWidth(); int fromBottom = mContentView.getHeight(); int width = mActivity.getResources().getDimensionPixelSize(R.dimen.nav_tab_width); int height = mActivity.getResources().getDimensionPixelSize(R.dimen.nav_tab_height); int ntth = mActivity.getResources().getDimensionPixelSize(R.dimen.nav_tab_titleheight); int toLeft = (mContentView.getWidth() - width) / 2; - int toTop = ((fromBottom - (ntth + height)) / 2 + ntth); + int toTop = ((fromBottom - (ntth + height)) / 2); int toRight = toLeft + width; int toBottom = toTop + height; float scaleFactor = width / (float) mContentView.getWidth(); @@ -314,15 +309,13 @@ public class PhoneUi extends BaseUi { fromRight, toRight); ObjectAnimator tb = ObjectAnimator.ofInt(mAnimScreen.mContent, "bottom", fromBottom, toBottom); - ObjectAnimator title = ObjectAnimator.ofFloat(mAnimScreen.mTitle, "alpha", - 1f, 0f); ObjectAnimator sx = ObjectAnimator.ofFloat(mAnimScreen, "scaleFactor", 1f, scaleFactor); ObjectAnimator blend1 = ObjectAnimator.ofFloat(mAnimScreen.mMain, "alpha", 1f, 0f); blend1.setDuration(100); - inanim.playTogether(tx, ty, tr, tb, sx, title); + inanim.playTogether(tx, ty, tr, tb, sx); inanim.setDuration(200); set1.addListener(new AnimatorListenerAdapter() { @Override @@ -382,14 +375,14 @@ public class PhoneUi extends BaseUi { mAnimScreen.mMain.layout(0, 0, mContentView.getWidth(), mContentView.getHeight()); mNavScreen.mScroller.finishScroller(); - ImageView target = tabview.mImage; + Drawable contentDrawable = tabview.mImage.getDrawable(); int toLeft = 0; int toTop = (tab.getWebView() != null) ? tab.getWebView().getVisibleTitleHeight() : 0; int toRight = mContentView.getWidth(); - int width = target.getDrawable().getIntrinsicWidth(); - int height = target.getDrawable().getIntrinsicHeight(); - int fromLeft = tabview.getLeft() + target.getLeft() - mNavScreen.mScroller.getScrollX(); - int fromTop = tabview.getTop() + target.getTop() - mNavScreen.mScroller.getScrollY(); + int width = contentDrawable.getIntrinsicWidth(); + int height = contentDrawable.getIntrinsicHeight(); + int fromLeft = tabview.getContentLeft() - mNavScreen.mScroller.getScrollX(); + int fromTop = tabview.getContentTop() - mNavScreen.mScroller.getScrollY(); int fromRight = fromLeft + width; int fromBottom = fromTop + height; float scaleFactor = mContentView.getWidth() / (float) width; @@ -460,16 +453,13 @@ public class PhoneUi extends BaseUi { static class AnimScreen { private View mMain; - private ImageView mTitle; private ImageView mContent; private float mScale; - private Bitmap mTitleBarBitmap; private Bitmap mContentBitmap; public AnimScreen(Context ctx) { mMain = LayoutInflater.from(ctx).inflate(R.layout.anim_screen, null); - mTitle = (ImageView) mMain.findViewById(R.id.title); mContent = (ImageView) mMain.findViewById(R.id.content); mContent.setScaleType(ImageView.ScaleType.MATRIX); mContent.setImageMatrix(new Matrix()); @@ -477,28 +467,11 @@ public class PhoneUi extends BaseUi { setScaleFactor(getScaleFactor()); } - public void set(TitleBar tbar, WebView web) { - if (tbar == null || web == null) { + public void set(WebView web) { + if (web == null) { return; } - if (tbar.getWidth() > 0 && tbar.getEmbeddedHeight() > 0) { - if (mTitleBarBitmap == null - || mTitleBarBitmap.getWidth() != tbar.getWidth() - || mTitleBarBitmap.getHeight() != tbar.getEmbeddedHeight()) { - mTitleBarBitmap = safeCreateBitmap(tbar.getWidth(), - tbar.getEmbeddedHeight()); - } - if (mTitleBarBitmap != null) { - Canvas c = new Canvas(mTitleBarBitmap); - tbar.draw(c); - c.setBitmap(null); - } - } else { - mTitleBarBitmap = null; - } - mTitle.setImageBitmap(mTitleBarBitmap); - mTitle.setVisibility(View.VISIBLE); - int h = web.getHeight() - tbar.getEmbeddedHeight(); + int h = web.getHeight(); if (mContentBitmap == null || mContentBitmap.getWidth() != web.getWidth() || mContentBitmap.getHeight() != h) { @@ -506,9 +479,7 @@ public class PhoneUi extends BaseUi { } if (mContentBitmap != null) { Canvas c = new Canvas(mContentBitmap); - int tx = web.getScrollX(); - int ty = web.getScrollY(); - c.translate(-tx, -ty - tbar.getEmbeddedHeight()); + c.translate(-web.getScrollX(), -web.getScrollY()); web.draw(c); c.setBitmap(null); } @@ -525,7 +496,6 @@ public class PhoneUi extends BaseUi { } public void set(Bitmap image) { - mTitle.setVisibility(View.GONE); mContent.setImageBitmap(image); } diff --git a/src/com/android/browser/PieControl.java b/src/com/android/browser/PieControl.java index 18c348e..c7cfa29 100644 --- a/src/com/android/browser/PieControl.java +++ b/src/com/android/browser/PieControl.java @@ -43,7 +43,24 @@ import java.util.ArrayList; import java.util.List; /** - * Controller for Quick Controls pie menu + * Controller for OneHand pie menu + * + * "Swype" actions: + * (0~45)° = Opened tabs (swype up) + * (45~90)° = Open Tab (swype middle-up) + * (90~135)° = Back (swype middle-down) + * (135-180)°= URLBar (swype down) + * + * |-Switch - OpenedTabs + * |-AddTab - Incognito + * | - Close + * | - Reload + * |-Back - Forward + * | - Home + * | - Share + * |-Url - History + * | - Desktop/Mobile + * | - Bookmarks */ public class PieControl implements PieMenu.PieController, OnClickListener { @@ -65,8 +82,6 @@ public class PieControl implements PieMenu.PieController, OnClickListener { private PieItem mIncognito; private PieItem mClose; private PieItem mShowTabs; - private PieItem mInfo; - private PieItem mFind; private PieItem mShare; private PieItem mRDS; private TabAdapter mTabAdapter; @@ -125,30 +140,28 @@ public class PieControl implements PieMenu.PieController, OnClickListener { if (mUiController.getSettings().hasDesktopUseragent(view)) { icon.setImageResource(R.drawable.ic_mobile); } else { - icon.setImageResource(R.drawable.ic_desktop_dark); + icon.setImageResource(R.drawable.ic_desktop); } } return true; } protected void populateMenu() { - mBack = makeItem(R.drawable.ic_back_dark, 1); - mUrl = makeItem(R.drawable.ic_web_dark, 1); - mBookmarks = makeItem(R.drawable.ic_bookmarks_dark, 1); - mHistory = makeItem(R.drawable.ic_history_dark, 1); - mAddBookmark = makeItem(R.drawable.ic_bookmark_on_dark, 1); - mRefresh = makeItem(R.drawable.ic_refresh_dark, 1); - mForward = makeItem(R.drawable.ic_forward_dark, 1); - mNewTab = makeItem(R.drawable.ic_new_window_dark, 1); - mIncognito = makeItem(R.drawable.ic_new_incognito_dark, 1); - mClose = makeItem(R.drawable.ic_close_window_dark, 1); - mInfo = makeItem(android.R.drawable.ic_menu_info_details, 1); - mFind = makeItem(R.drawable.ic_search_dark, 1); - mShare = makeItem(R.drawable.ic_share_dark, 1); + mBack = makeItem(R.drawable.ic_back, 1); + mUrl = makeItem(R.drawable.ic_web, 1); + mBookmarks = makeItem(R.drawable.ic_bookmarks, 1); + mHistory = makeItem(R.drawable.ic_history, 1); + mAddBookmark = makeItem(R.drawable.ic_bookmark_on, 1); + mRefresh = makeItem(R.drawable.ic_refresh, 1); + mForward = makeItem(R.drawable.ic_forward, 1); + mNewTab = makeItem(R.drawable.ic_new_window, 1); + mIncognito = makeItem(R.drawable.ic_incognito, 1); + mClose = makeItem(R.drawable.ic_close_window, 1); + mShare = makeItem(R.drawable.ic_share, 1); View tabs = makeTabsView(); mShowTabs = new PieItem(tabs, 1); - mOptions = makeItem(R.drawable.ic_settings_dark, 1); - mRDS = makeItem(R.drawable.ic_desktop_dark, 1); + mOptions = makeItem(R.drawable.ic_settings, 1); + mRDS = makeItem(R.drawable.ic_desktop, 1); mTabAdapter = new TabAdapter(mActivity, mUiController); PieStackView stack = new PieStackView(mActivity); stack.setLayoutListener(new OnLayoutListener() { @@ -160,43 +173,30 @@ public class PieControl implements PieMenu.PieController, OnClickListener { stack.setOnCurrentListener(mTabAdapter); stack.setAdapter(mTabAdapter); mShowTabs.setPieView(stack); - setClickListener(this, mBack, mRefresh, mForward, mUrl, mFind, mInfo, + setClickListener(this, mBack, mRefresh, mForward, mUrl, mShare, mBookmarks, mNewTab, mIncognito, mClose, mHistory, mAddBookmark, mOptions, mRDS); if (!BrowserActivity.isTablet(mActivity)) { mShowTabs.getView().setOnClickListener(this); } - // level 1 - mPie.addItem(mOptions); - mOptions.addItem(mRDS); - mOptions.addItem(makeFiller()); - mOptions.addItem(makeFiller()); - mOptions.addItem(makeFiller()); + // 0-45: up + mPie.addItem(mShowTabs); + // 45-90: middle-up + mPie.addItem(mNewTab); + mNewTab.addItem(mIncognito); + mNewTab.addItem(mClose); + mNewTab.addItem(mRefresh); + // 90-135: middle-down mPie.addItem(mBack); - mBack.addItem(mRefresh); - mBack.addItem(mForward); - mBack.addItem(makeFiller()); mBack.addItem(makeFiller()); + mBack.addItem(mForward); + mBack.addItem(mShare); + // 135-180: down mPie.addItem(mUrl); - mUrl.addItem(mFind); - mUrl.addItem(mShare); - mUrl.addItem(makeFiller()); - mUrl.addItem(makeFiller()); - mPie.addItem(mShowTabs); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { - mShowTabs.addItem(makeFiller()); - mShowTabs.addItem(mClose); - } else { - mShowTabs.addItem(mClose); - mShowTabs.addItem(mIncognito); - } - mShowTabs.addItem(mNewTab); - mShowTabs.addItem(makeFiller()); - mPie.addItem(mBookmarks); - mBookmarks.addItem(makeFiller()); - mBookmarks.addItem(makeFiller()); - mBookmarks.addItem(mAddBookmark); - mBookmarks.addItem(mHistory); + mUrl.addItem(mOptions); + mUrl.addItem(mRDS); + mUrl.addItem(mBookmarks); + mUrl.addItem(mHistory); } @Override @@ -233,10 +233,6 @@ public class PieControl implements PieMenu.PieController, OnClickListener { mUiController.openPreferences(); } else if (mShare.getView() == v) { mUiController.shareCurrentPage(); - } else if (mInfo.getView() == v) { - mUiController.showPageInfo(); - } else if (mFind.getView() == v) { - mUiController.findOnPage(); } else if (mRDS.getView() == v) { mUiController.toggleUserAgent(); } else if (mShowTabs.getView() == v) { @@ -267,12 +263,13 @@ public class PieControl implements PieMenu.PieController, OnClickListener { return new PieItem(null, 1); } + protected View makeTabsView() { View v = mActivity.getLayoutInflater().inflate(R.layout.qc_tabs_view, null); mTabsCount = (TextView) v.findViewById(R.id.label); mTabsCount.setText("1"); ImageView image = (ImageView) v.findViewById(R.id.icon); - image.setImageResource(R.drawable.ic_windows_dark); + image.setImageResource(R.drawable.ic_windows); image.setScaleType(ScaleType.CENTER); LayoutParams lp = new LayoutParams(mItemSize, mItemSize); v.setLayoutParams(lp); diff --git a/src/com/android/browser/PreferenceKeys.java b/src/com/android/browser/PreferenceKeys.java index 1828032..3bb2438 100644 --- a/src/com/android/browser/PreferenceKeys.java +++ b/src/com/android/browser/PreferenceKeys.java @@ -62,6 +62,7 @@ public interface PreferenceKeys { static final String PREF_AUTOFILL_PROFILE = "autofill_profile"; static final String PREF_HOMEPAGE = "homepage"; static final String PREF_SYNC_WITH_CHROME = "sync_with_chrome"; + static final String PREF_FULL_SCREEN = "full_screen"; // ---------------------- // Keys for hidden_debug_preferences.xml diff --git a/src/com/android/browser/SuggestionsAdapter.java b/src/com/android/browser/SuggestionsAdapter.java index 9f66e3c..62fa0bc 100644 --- a/src/com/android/browser/SuggestionsAdapter.java +++ b/src/com/android/browser/SuggestionsAdapter.java @@ -161,7 +161,6 @@ public class SuggestionsAdapter extends BaseAdapter implements Filterable, TextView tv2 = (TextView) view.findViewById(android.R.id.text2); ImageView ic1 = (ImageView) view.findViewById(R.id.icon1); View ic2 = view.findViewById(R.id.icon2); - View div = view.findViewById(R.id.divider); tv1.setText(Html.fromHtml(item.title)); if (TextUtils.isEmpty(item.url)) { tv2.setVisibility(View.GONE); @@ -195,7 +194,6 @@ public class SuggestionsAdapter extends BaseAdapter implements Filterable, ic2.setVisibility(((TYPE_SUGGEST == item.type) || (TYPE_SEARCH == item.type)) ? View.VISIBLE : View.GONE); - div.setVisibility(ic2.getVisibility()); ic2.setOnClickListener(this); view.findViewById(R.id.suggestion).setOnClickListener(this); } diff --git a/src/com/android/browser/TabBar.java b/src/com/android/browser/TabBar.java index d6c02f9..c8e068a 100644 --- a/src/com/android/browser/TabBar.java +++ b/src/com/android/browser/TabBar.java @@ -95,7 +95,7 @@ public class TabBar extends LinearLayout implements OnClickListener { Resources res = activity.getResources(); mTabWidth = (int) res.getDimension(R.dimen.tab_width); mActiveDrawable = res.getDrawable(R.drawable.bg_urlbar); - mInactiveDrawable = res.getDrawable(R.drawable.browsertab_inactive); + mInactiveDrawable = res.getDrawable(R.color.primary); mTabMap = new HashMap<Tab, TabView>(); LayoutInflater factory = LayoutInflater.from(activity); @@ -244,7 +244,6 @@ public class TabBar extends LinearLayout implements OnClickListener { Tab mTab; View mTabContent; TextView mTitle; - View mIncognito; View mSnapshot; ImageView mIconView; ImageView mLock; @@ -274,7 +273,6 @@ public class TabBar extends LinearLayout implements OnClickListener { mLock = (ImageView) mTabContent.findViewById(R.id.lock); mClose = (ImageView) mTabContent.findViewById(R.id.close); mClose.setOnClickListener(this); - mIncognito = mTabContent.findViewById(R.id.incognito); mSnapshot = mTabContent.findViewById(R.id.snapshot); mSelected = false; // update the status @@ -294,16 +292,10 @@ public class TabBar extends LinearLayout implements OnClickListener { displayTitle = mTab.getUrl(); } setDisplayTitle(displayTitle); - if (mTab.getFavicon() != null) { - setFavicon(mUi.getFaviconDrawable(mTab.getFavicon())); - } updateTabIcons(); } private void updateTabIcons() { - mIncognito.setVisibility( - mTab.isPrivateBrowsingEnabled() ? - View.VISIBLE : View.GONE); mSnapshot.setVisibility(mTab.isSnapshot() ? View.VISIBLE : View.GONE); } @@ -333,10 +325,6 @@ public class TabBar extends LinearLayout implements OnClickListener { mTitle.setText(title); } - void setFavicon(Drawable d) { - mIconView.setImageDrawable(d); - } - void setLock(Drawable d) { if (null == d) { mLock.setVisibility(View.GONE); @@ -491,13 +479,6 @@ public class TabBar extends LinearLayout implements OnClickListener { mTabs.setSelectedTab(mTabControl.getTabPosition(tab)); } - public void onFavicon(Tab tab, Bitmap favicon) { - TabView tv = mTabMap.get(tab); - if (tv != null) { - tv.setFavicon(mUi.getFaviconDrawable(favicon)); - } - } - public void onNewTab(Tab tab) { TabView tv = buildTabView(tab); animateTabIn(tab, tv); diff --git a/src/com/android/browser/UI.java b/src/com/android/browser/UI.java index d9bb3bc..677c3d3 100644 --- a/src/com/android/browser/UI.java +++ b/src/com/android/browser/UI.java @@ -142,8 +142,6 @@ public interface UI { void setFullscreen(boolean enabled); - boolean isFullscreen(); - void setUseQuickControls(boolean enabled); public boolean shouldCaptureThumbnails(); diff --git a/src/com/android/browser/UiController.java b/src/com/android/browser/UiController.java index 643fb40..f00f1a2 100644 --- a/src/com/android/browser/UiController.java +++ b/src/com/android/browser/UiController.java @@ -105,8 +105,6 @@ public interface UiController { void toggleUserAgent(); - void toggleFullscreen(); - BrowserSettings getSettings(); boolean supportsVoice(); diff --git a/src/com/android/browser/XLargeUi.java b/src/com/android/browser/XLargeUi.java index 0d9b00e..f031c8c 100644 --- a/src/com/android/browser/XLargeUi.java +++ b/src/com/android/browser/XLargeUi.java @@ -152,7 +152,6 @@ public class XLargeUi extends BaseUi { return; } mTabBar.onSetActiveTab(tab); - updateLockIconToLatest(tab); mTitleBar.setSkipTitleBarAnimations(false); } @@ -224,13 +223,6 @@ public class XLargeUi extends BaseUi { mTabBar.onUrlAndTitle(tab, tab.getUrl(), tab.getTitle()); } - // Set the favicon in the title bar. - @Override - public void setFavicon(Tab tab) { - super.setFavicon(tab); - mTabBar.onFavicon(tab, tab.getFavicon()); - } - @Override public void onHideCustomView() { super.onHideCustomView(); @@ -274,30 +266,4 @@ public class XLargeUi extends BaseUi { return mUseQuickControls; } - private Drawable getFaviconBackground() { - if (mFaviconBackground == null) { - mFaviconBackground = new PaintDrawable(); - Resources res = mActivity.getResources(); - mFaviconBackground.getPaint().setColor( - res.getColor(R.color.tabFaviconBackground)); - mFaviconBackground.setCornerRadius( - res.getDimension(R.dimen.tab_favicon_corner_radius)); - } - return mFaviconBackground; - } - - @Override - public Drawable getFaviconDrawable(Bitmap icon) { - Drawable[] array = new Drawable[2]; - array[0] = getFaviconBackground(); - if (icon == null) { - array[1] = mGenericFavicon; - } else { - array[1] = new BitmapDrawable(mActivity.getResources(), icon); - } - LayerDrawable d = new LayerDrawable(array); - d.setLayerInset(1, 2, 2, 2, 2); - return d; - } - } diff --git a/src/com/android/browser/addbookmark/FolderSpinnerAdapter.java b/src/com/android/browser/addbookmark/FolderSpinnerAdapter.java index 1cad1dd..4ae417b 100644 --- a/src/com/android/browser/addbookmark/FolderSpinnerAdapter.java +++ b/src/com/android/browser/addbookmark/FolderSpinnerAdapter.java @@ -69,17 +69,17 @@ public class FolderSpinnerAdapter extends BaseAdapter { switch (position) { case HOME_SCREEN: labelResource = R.string.add_to_homescreen_menu_option; - drawableResource = R.drawable.ic_home_dark; + drawableResource = R.drawable.ic_home; break; case ROOT_FOLDER: labelResource = R.string.add_to_bookmarks_menu_option; - drawableResource = R.drawable.ic_bookmarks_dark; + drawableResource = R.drawable.ic_bookmarks; break; case RECENT_FOLDER: // Fall through and use the same icon resource case OTHER_FOLDER: labelResource = R.string.add_to_other_folder_menu_option; - drawableResource = R.drawable.ic_folder_dark; + drawableResource = R.drawable.ic_folder; break; default: labelResource = 0; diff --git a/src/com/android/browser/preferences/GeneralPreferencesFragment.java b/src/com/android/browser/preferences/GeneralPreferencesFragment.java index 26fb05f..2e1fdb4 100644 --- a/src/com/android/browser/preferences/GeneralPreferencesFragment.java +++ b/src/com/android/browser/preferences/GeneralPreferencesFragment.java @@ -17,6 +17,8 @@ package com.android.browser.preferences; import android.app.AlertDialog; +import android.app.Dialog; +import android.app.DialogFragment; import android.content.DialogInterface; import android.content.DialogInterface.OnClickListener; import android.content.res.Resources; diff --git a/src/com/android/browser/preferences/LabPreferencesFragment.java b/src/com/android/browser/preferences/InterfacePreferencesFragment.java index 222b5fa..474f03a 100644 --- a/src/com/android/browser/preferences/LabPreferencesFragment.java +++ b/src/com/android/browser/preferences/InterfacePreferencesFragment.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 The Android Open Source Project + * Copyright (C) 2015 The CyanogenMod Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,12 +25,12 @@ import com.android.browser.PreferenceKeys; import com.android.browser.R; import com.android.browser.search.SearchEngine; -public class LabPreferencesFragment extends PreferenceFragment { +public class InterfacePreferencesFragment extends PreferenceFragment { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Load the XML preferences file - addPreferencesFromResource(R.xml.lab_preferences); + addPreferencesFromResource(R.xml.interface_preferences); } } diff --git a/src/com/android/browser/preferences/WebsiteSettingsFragment.java b/src/com/android/browser/preferences/WebsiteSettingsFragment.java index be38f3e..d1a3cc8 100644 --- a/src/com/android/browser/preferences/WebsiteSettingsFragment.java +++ b/src/com/android/browser/preferences/WebsiteSettingsFragment.java @@ -219,9 +219,9 @@ public class WebsiteSettingsFragment extends ListFragment implements OnClickList mUsageHighIcon = BitmapFactory.decodeResource(getResources(), R.drawable.ic_list_data_large); mLocationAllowedIcon = BitmapFactory.decodeResource(getResources(), - R.drawable.ic_gps_on_dark); + R.drawable.ic_gps_on); mLocationDisallowedIcon = BitmapFactory.decodeResource(getResources(), - R.drawable.ic_gps_denied_dark); + R.drawable.ic_gps_denied); mCurrentSite = site; if (mCurrentSite == null) { askForOrigins(); diff --git a/src/com/android/browser/provider/BrowserProvider2.java b/src/com/android/browser/provider/BrowserProvider2.java index e791a98..44fd8e9 100644 --- a/src/com/android/browser/provider/BrowserProvider2.java +++ b/src/com/android/browser/provider/BrowserProvider2.java @@ -129,8 +129,8 @@ public class BrowserProvider2 extends SQLiteContentProvider { qualifyColumn(TABLE_HISTORY, History.URL), bookmarkOrHistoryColumn(Combined.TITLE), bookmarkOrHistoryLiteral(Combined.URL, - Integer.toString(R.drawable.ic_bookmark_off_dark), - Integer.toString(R.drawable.ic_history_dark)), + Integer.toString(R.drawable.ic_bookmark_off), + Integer.toString(R.drawable.ic_history)), qualifyColumn(TABLE_HISTORY, History.DATE_LAST_VISITED)}; private static final String SUGGEST_SELECTION = diff --git a/src/com/android/browser/view/PieMenu.java b/src/com/android/browser/view/PieMenu.java index 1699c27..cb8f9da 100644 --- a/src/com/android/browser/view/PieMenu.java +++ b/src/com/android/browser/view/PieMenu.java @@ -45,7 +45,7 @@ import java.util.List; public class PieMenu extends FrameLayout { private static final int MAX_LEVELS = 5; - private static final long ANIMATION = 80; + private static final long ANIMATION = 40; public interface PieController { /** diff --git a/src/com/android/browser/view/StopProgressView.java b/src/com/android/browser/view/StopProgressView.java index 5da3e15..05d86b4 100644 --- a/src/com/android/browser/view/StopProgressView.java +++ b/src/com/android/browser/view/StopProgressView.java @@ -58,7 +58,7 @@ public class StopProgressView extends ProgressBar { private void init(AttributeSet attrs) { mProgressDrawable = getIndeterminateDrawable(); setImageDrawable(mContext.getResources() - .getDrawable(R.drawable.ic_stop_dark)); + .getDrawable(R.drawable.ic_stop)); } public void hideProgress() { diff --git a/src/com/android/browser/widget/BookmarkThumbnailWidgetService.java b/src/com/android/browser/widget/BookmarkThumbnailWidgetService.java index 3c40645..8168c3b 100644 --- a/src/com/android/browser/widget/BookmarkThumbnailWidgetService.java +++ b/src/com/android/browser/widget/BookmarkThumbnailWidgetService.java @@ -246,8 +246,6 @@ public class BookmarkThumbnailWidgetService extends RemoteViewsService { } else { views.setImageViewResource(R.id.thumb, R.drawable.thumb_bookmark_widget_folder_holo); } - views.setImageViewResource(R.id.favicon, R.drawable.ic_bookmark_widget_bookmark_dark); - views.setDrawableParameters(R.id.thumb, true, 0, -1, null, -1); } else { // RemoteViews require a valid bitmap config Options options = new Options(); |