From 1f5a0952599285350be6b1351110518086047fd1 Mon Sep 17 00:00:00 2001 From: Enrico Ros Date: Tue, 18 Nov 2014 20:15:48 -0800 Subject: Clean visual style: move to Light, add Material support, change Drawables (progress, icons). This code alters the visual style moving the APP to a Light theme. Parents of the theme are either Theme.Holo.Light or Theme.Material.Light depending on which API we start the APK from. Needs SDK 21 to build. Other than the visual changes, this commit changes: - name of the APP to 'Browser' - animations and sequencing of the Tab switcher in {nav/anim}_screen - removal of the warning icon from the Exit dialog - change of the favicon appearance (removal of the double border) Vast amount of unused resources are removed from the APK. Just XHDPI drawables have been synthesized for now, and the Primary color was used for the icons and is accessible in R.color.Primary. Change-Id: If75cc051c5d4015383e96066cdb6507484e625d8 --- src/com/android/browser/NavigationBarTablet.java | 26 +++++++----------------- 1 file changed, 7 insertions(+), 19 deletions(-) (limited to 'src/com/android/browser/NavigationBarTablet.java') diff --git a/src/com/android/browser/NavigationBarTablet.java b/src/com/android/browser/NavigationBarTablet.java index a965e0a7..17f7398e 100644 --- a/src/com/android/browser/NavigationBarTablet.java +++ b/src/com/android/browser/NavigationBarTablet.java @@ -31,7 +31,6 @@ import android.view.View; import android.widget.ImageButton; import android.widget.ImageView; -import com.android.browser.R; import com.android.browser.UI.ComboViews; import com.android.browser.UrlInputView.StateListener; @@ -53,8 +52,6 @@ public class NavigationBarTablet extends NavigationBarBase implements StateListe private View mClearButton; private View mVoiceButton; private View mNavButtons; - private Drawable mFocusDrawable; - private Drawable mUnfocusDrawable; private boolean mHideNavButtons; private Drawable mFaviconDrawable; @@ -75,14 +72,10 @@ public class NavigationBarTablet extends NavigationBarBase implements StateListe private void init(Context context) { Resources resources = context.getResources(); - mStopDrawable = resources.getDrawable(R.drawable.ic_stop_holo_dark); - mReloadDrawable = resources.getDrawable(R.drawable.ic_refresh_holo_dark); + mStopDrawable = resources.getDrawable(R.drawable.ic_action_stop); + mReloadDrawable = resources.getDrawable(R.drawable.ic_action_reload); mStopDescription = resources.getString(R.string.accessibility_button_stop); mRefreshDescription = resources.getString(R.string.accessibility_button_refresh); - mFocusDrawable = resources.getDrawable( - R.drawable.textfield_active_holo_dark); - mUnfocusDrawable = resources.getDrawable( - R.drawable.textfield_default_holo_dark); mHideNavButtons = resources.getBoolean(R.bool.hide_nav_buttons); } @@ -140,12 +133,8 @@ public class NavigationBarTablet extends NavigationBarBase implements StateListe void updateNavigationState(Tab tab) { if (tab != null) { - mBackButton.setImageResource(tab.canGoBack() - ? R.drawable.ic_back_holo_dark - : R.drawable.ic_back_disabled_holo_dark); - mForwardButton.setImageResource(tab.canGoForward() - ? R.drawable.ic_forward_holo_dark - : R.drawable.ic_forward_disabled_holo_dark); + mBackButton.setEnabled(tab.canGoBack()); + mForwardButton.setEnabled(tab.canGoBack()); } updateUrlIcon(); } @@ -205,7 +194,7 @@ public class NavigationBarTablet extends NavigationBarBase implements StateListe void updateUrlIcon() { if (mUrlInput.hasFocus()) { - mUrlIcon.setImageResource(R.drawable.ic_search_holo_dark); + mUrlIcon.setImageResource(R.drawable.ic_action_search_normal); } else { if (mFaviconDrawable == null) { mFaviconDrawable = mBaseUi.getFaviconDrawable(null); @@ -223,7 +212,7 @@ public class NavigationBarTablet extends NavigationBarBase implements StateListe } mSearchButton.setVisibility(View.GONE); mStar.setVisibility(View.GONE); - mUrlIcon.setImageResource(R.drawable.ic_search_holo_dark); + mUrlIcon.setImageResource(R.drawable.ic_action_search_normal); } else { if (mHideNavButtons) { showNavButtons(); @@ -232,8 +221,6 @@ public class NavigationBarTablet extends NavigationBarBase implements StateListe mSearchButton.setVisibility(View.VISIBLE); updateUrlIcon(); } - mUrlContainer.setBackgroundDrawable(focus - ? mFocusDrawable : mUnfocusDrawable); } private void stopOrRefresh() { @@ -324,6 +311,7 @@ public class NavigationBarTablet extends NavigationBarBase implements StateListe @Override public void onStateChanged(int state) { + super.onStateChanged(state); mVoiceButton.setVisibility(View.GONE); switch(state) { case STATE_NORMAL: -- cgit v1.2.3