diff options
author | Enrico Ros <eros@codeaurora.org> | 2014-11-18 20:15:48 -0800 |
---|---|---|
committer | WebTech Code Review <code-review@localhost> | 2014-12-01 09:53:43 -0800 |
commit | 1f5a0952599285350be6b1351110518086047fd1 (patch) | |
tree | 6af2ffdb24ad21ad6cb567efb415e635de937daf /src/com/android/browser/NavScreen.java | |
parent | 49b7925ec66faf5015fdd1862eada2978ddd5fde (diff) | |
download | android_packages_apps_Gello-1f5a0952599285350be6b1351110518086047fd1.tar.gz android_packages_apps_Gello-1f5a0952599285350be6b1351110518086047fd1.tar.bz2 android_packages_apps_Gello-1f5a0952599285350be6b1351110518086047fd1.zip |
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
Diffstat (limited to 'src/com/android/browser/NavScreen.java')
-rw-r--r-- | src/com/android/browser/NavScreen.java | 44 |
1 files changed, 20 insertions, 24 deletions
diff --git a/src/com/android/browser/NavScreen.java b/src/com/android/browser/NavScreen.java index 64243e32..0962449f 100644 --- a/src/com/android/browser/NavScreen.java +++ b/src/com/android/browser/NavScreen.java @@ -27,20 +27,14 @@ import android.view.View.OnClickListener; import android.view.ViewConfiguration; import android.view.ViewGroup; import android.widget.BaseAdapter; -import android.widget.FrameLayout; import android.widget.ImageButton; -import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.PopupMenu; import android.widget.PopupMenu.OnMenuItemClickListener; import android.widget.RelativeLayout; -import android.widget.TextView; -import com.android.browser.R; -import com.android.browser.NavTabScroller.OnLayoutListener; import com.android.browser.NavTabScroller.OnRemoveListener; import com.android.browser.TabControl.OnThumbnailUpdatedListener; -import com.android.browser.UI.ComboViews; import java.util.HashMap; @@ -50,19 +44,12 @@ public class NavScreen extends RelativeLayout UiController mUiController; PhoneUi mUi; - Tab mTab; Activity mActivity; - ImageButton mRefresh; - ImageButton mForward; - ImageButton mBookmarks; + View mToolbarLayout; ImageButton mMore; ImageButton mNewTab; - FrameLayout mHolder; - - TextView mTitle; - ImageView mFavicon; - ImageButton mCloseTab; + ImageButton mNewIncognitoTab; NavTabScroller mScroller; TabAdapter mAdapter; @@ -94,10 +81,6 @@ public class NavScreen extends RelativeLayout return mUiController.onOptionsItemSelected(item); } - protected float getToolbarHeight() { - return mActivity.getResources().getDimension(R.dimen.toolbar_height); - } - @Override protected void onConfigurationChanged(Configuration newconfig) { if (newconfig.orientation != mOrientation) { @@ -119,10 +102,11 @@ public class NavScreen extends RelativeLayout LayoutInflater.from(getContext()).inflate(R.layout.nav_screen, this); setContentDescription(getContext().getResources().getString( R.string.accessibility_transition_navscreen)); - mBookmarks = (ImageButton) findViewById(R.id.bookmarks); + mToolbarLayout = findViewById(R.id.nav_toolbar_animate); + mNewIncognitoTab = (ImageButton) findViewById(R.id.newincognitotab); mNewTab = (ImageButton) findViewById(R.id.newtab); mMore = (ImageButton) findViewById(R.id.more); - mBookmarks.setOnClickListener(this); + mNewIncognitoTab.setOnClickListener(this); mNewTab.setOnClickListener(this); mMore.setOnClickListener(this); mScroller = (NavTabScroller) findViewById(R.id.scroller); @@ -148,10 +132,10 @@ public class NavScreen extends RelativeLayout @Override public void onClick(View v) { - if (mBookmarks == v) { - mUiController.bookmarksOrHistoryPicker(ComboViews.Bookmarks); - } else if (mNewTab == v) { + if (mNewTab == v) { openNewTab(); + } else if (mNewIncognitoTab == v) { + openNewIncognitoTab(); } else if (mMore == v) { showMenu(); } @@ -168,6 +152,18 @@ public class NavScreen extends RelativeLayout } } + private void openNewIncognitoTab() { + final Tab tab = mUiController.openIncognitoTab(); + if (tab != null) { + mUiController.setBlockEvents(true); + final int tix = mUi.mTabControl.getTabPosition(tab); + switchToTab(tab); + mUi.hideNavScreen(tix, true); + mScroller.handleDataChanged(tix); + mUiController.setBlockEvents(false); + } + } + private void openNewTab() { // need to call openTab explicitely with setactive false final Tab tab = mUiController.openTab(BrowserSettings.getInstance().getHomePage(), |