diff options
author | John Reck <jreck@google.com> | 2011-07-29 11:19:45 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-07-29 11:19:45 -0700 |
commit | 96ca6a8bb8cf687a69120ddd8df21f0687d187d7 (patch) | |
tree | e454a29cb217781390f968304108e9d8f0b21e27 /src | |
parent | e7546245ff57d1b6e4b6eadfdf705d76815508a1 (diff) | |
parent | f26ff6306dec07a7fa34d0ad5c54b49aec268d18 (diff) | |
download | packages_apps_Browser-96ca6a8bb8cf687a69120ddd8df21f0687d187d7.zip packages_apps_Browser-96ca6a8bb8cf687a69120ddd8df21f0687d187d7.tar.gz packages_apps_Browser-96ca6a8bb8cf687a69120ddd8df21f0687d187d7.tar.bz2 |
Merge "Make snapshot go live a popup menu"
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/browser/SnapshotBar.java | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/com/android/browser/SnapshotBar.java b/src/com/android/browser/SnapshotBar.java index 9fb68cf..ba0bf98 100644 --- a/src/com/android/browser/SnapshotBar.java +++ b/src/com/android/browser/SnapshotBar.java @@ -23,16 +23,22 @@ 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.ViewConfiguration; import android.view.ViewPropertyAnimator; +import android.webkit.WebView; import android.widget.ImageView; import android.widget.LinearLayout; +import android.widget.PopupMenu; +import android.widget.PopupMenu.OnMenuItemClickListener; import android.widget.TextView; import java.text.DateFormat; import java.util.Date; -public class SnapshotBar extends LinearLayout implements OnClickListener { +public class SnapshotBar extends LinearLayout implements OnClickListener, + OnMenuItemClickListener { private static final int MSG_SHOW_TITLE = 1; private static final long DURATION_SHOW_DATE = BaseUi.HIDE_TITLEBAR_DELAY; @@ -171,7 +177,11 @@ public class SnapshotBar extends LinearLayout implements OnClickListener { if (mBookmarks == v) { mTitleBar.getUiController().bookmarksOrHistoryPicker(false); } else if (mGoLive == v) { - goLive(); + PopupMenu popup = new PopupMenu(mContext, mGoLive); + Menu menu = popup.getMenu(); + popup.getMenuInflater().inflate(R.menu.snapshot_go_live, menu); + popup.setOnMenuItemClickListener(this); + popup.show(); } else if (mTabSwitcher == v) { ((PhoneUi) mTitleBar.getUi()).toggleNavScreen(); } else if (mOverflowMenu == v) { @@ -188,6 +198,16 @@ public class SnapshotBar extends LinearLayout implements OnClickListener { } } + @Override + public boolean onMenuItemClick(MenuItem item) { + switch (item.getItemId()) { + case R.id.snapshot_go_live: + goLive(); + return true; + } + return false; + } + private void goLive() { Tab t = mTitleBar.getUi().getActiveTab(); t.loadUrl(t.getUrl(), null); |