diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/browser/BaseUi.java | 1 | ||||
-rw-r--r-- | src/com/android/browser/NavigationBarBase.java | 3 | ||||
-rw-r--r-- | src/com/android/browser/NavigationBarPhone.java | 10 | ||||
-rw-r--r-- | src/com/android/browser/SnapshotBar.java | 17 |
4 files changed, 21 insertions, 10 deletions
diff --git a/src/com/android/browser/BaseUi.java b/src/com/android/browser/BaseUi.java index b5497d5..6f87463 100644 --- a/src/com/android/browser/BaseUi.java +++ b/src/com/android/browser/BaseUi.java @@ -194,6 +194,7 @@ public abstract class BaseUi implements UI { updateLockIconToLatest(tab); updateNavigationState(tab); mTitleBar.onTabDataChanged(tab); + mNavigationBar.onTabDataChanged(tab); } @Override diff --git a/src/com/android/browser/NavigationBarBase.java b/src/com/android/browser/NavigationBarBase.java index 94d6530..cbf6eba 100644 --- a/src/com/android/browser/NavigationBarBase.java +++ b/src/com/android/browser/NavigationBarBase.java @@ -353,4 +353,7 @@ public class NavigationBarBase extends LinearLayout implements OnClickListener, return mUaSwitcherShowing; } + public void onTabDataChanged(Tab tab) { + } + } diff --git a/src/com/android/browser/NavigationBarPhone.java b/src/com/android/browser/NavigationBarPhone.java index 0cb0764..ff7dc7c 100644 --- a/src/com/android/browser/NavigationBarPhone.java +++ b/src/com/android/browser/NavigationBarPhone.java @@ -47,6 +47,7 @@ public class NavigationBarPhone extends NavigationBarBase implements private PopupMenu mPopupMenu; private boolean mOverflowMenuShowing; private boolean mNeedsMenu; + private View mIncognitoIcon; public NavigationBarPhone(Context context) { super(context); @@ -84,6 +85,7 @@ public class NavigationBarPhone extends NavigationBarBase implements mUrlInput.setContainer(this); mUrlInput.setStateListener(this); mNeedsMenu = !ViewConfiguration.get(getContext()).hasPermanentMenuKey(); + mIncognitoIcon = findViewById(R.id.incognito_icon); } @Override @@ -240,4 +242,12 @@ public class NavigationBarPhone extends NavigationBarBase implements break; } } + + @Override + public void onTabDataChanged(Tab tab) { + super.onTabDataChanged(tab); + mIncognitoIcon.setVisibility(tab.isPrivateBrowsingEnabled() + ? View.VISIBLE : View.GONE); + } + } diff --git a/src/com/android/browser/SnapshotBar.java b/src/com/android/browser/SnapshotBar.java index ba0bf98..039afcf 100644 --- a/src/com/android/browser/SnapshotBar.java +++ b/src/com/android/browser/SnapshotBar.java @@ -21,13 +21,12 @@ import android.os.Handler; import android.os.Message; import android.text.TextUtils; import android.util.AttributeSet; -import android.view.View; -import android.view.View.OnClickListener; import android.view.Menu; import android.view.MenuItem; +import android.view.View; +import android.view.View.OnClickListener; import android.view.ViewConfiguration; import android.view.ViewPropertyAnimator; -import android.webkit.WebView; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.PopupMenu; @@ -55,7 +54,6 @@ public class SnapshotBar extends LinearLayout implements OnClickListener, private boolean mIsAnimating; private ViewPropertyAnimator mTitleAnimator, mDateAnimator; private float mAnimRadius = 20f; - private View mDateContainer; public SnapshotBar(Context context) { super(context); @@ -98,7 +96,6 @@ public class SnapshotBar extends LinearLayout implements OnClickListener, mTabSwitcher = findViewById(R.id.tab_switcher); mOverflowMenu = findViewById(R.id.more); mToggleContainer = findViewById(R.id.toggle_container); - mDateContainer = findViewById(R.id.date_container); if (mBookmarks != null) { mBookmarks.setOnClickListener(this); @@ -145,9 +142,9 @@ public class SnapshotBar extends LinearLayout implements OnClickListener, mTitle.setAlpha(1f); mTitle.setTranslationY(0f); mTitle.setRotationX(0f); - mDateContainer.setAlpha(0f); - mDateContainer.setTranslationY(-mAnimRadius); - mDateContainer.setRotationX(90f); + mDate.setAlpha(0f); + mDate.setTranslationY(-mAnimRadius); + mDate.setRotationX(90f); } private void showDate() { @@ -155,7 +152,7 @@ public class SnapshotBar extends LinearLayout implements OnClickListener, .alpha(0f) .translationY(mAnimRadius) .rotationX(-90f); - mDateAnimator = mDateContainer.animate() + mDateAnimator = mDate.animate() .alpha(1f) .translationY(0f) .rotationX(0f); @@ -166,7 +163,7 @@ public class SnapshotBar extends LinearLayout implements OnClickListener, .alpha(1f) .translationY(0f) .rotationX(0f); - mDateAnimator = mDateContainer.animate() + mDateAnimator = mDate.animate() .alpha(0f) .translationY(-mAnimRadius) .rotationX(90f); |