Leon Scroggins | 81db366 | 2009-06-04 17:45:11 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2009 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package com.android.browser; |
| 18 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 19 | import android.app.Activity; |
Leon Scroggins | 11e71b1 | 2010-01-25 10:40:38 -0500 | [diff] [blame] | 20 | import android.content.Intent; |
| 21 | import android.content.pm.PackageManager; |
| 22 | import android.content.pm.ResolveInfo; |
Leon Scroggins | 3bbb6ca | 2009-09-09 12:51:10 -0400 | [diff] [blame] | 23 | import android.content.res.Resources; |
Leon Scroggins | 62e8f94 | 2009-09-03 15:08:54 -0400 | [diff] [blame] | 24 | import android.graphics.drawable.Animatable; |
Leon Scroggins | 81db366 | 2009-06-04 17:45:11 -0400 | [diff] [blame] | 25 | import android.graphics.drawable.Drawable; |
Leon Scroggins | 11e71b1 | 2010-01-25 10:40:38 -0500 | [diff] [blame] | 26 | import android.speech.RecognizerIntent; |
Leon Scroggins | f48d44e | 2010-02-05 16:41:49 -0500 | [diff] [blame] | 27 | import android.text.SpannableString; |
| 28 | import android.text.Spanned; |
Leon Scroggins | 76e1686 | 2010-02-08 14:39:34 -0500 | [diff] [blame] | 29 | import android.text.TextUtils; |
Leon Scroggins | f48d44e | 2010-02-05 16:41:49 -0500 | [diff] [blame] | 30 | import android.text.style.ImageSpan; |
Leon Scroggins | 9535cee | 2010-03-15 20:37:16 -0400 | [diff] [blame] | 31 | import android.util.DisplayMetrics; |
Leon Scroggins | 3bbb6ca | 2009-09-09 12:51:10 -0400 | [diff] [blame] | 32 | import android.util.TypedValue; |
Leon Scroggins | c6fa110 | 2009-09-21 10:40:01 -0400 | [diff] [blame] | 33 | import android.view.ContextMenu; |
Leon Scroggins | e4b3bda | 2009-06-09 15:46:41 -0400 | [diff] [blame] | 34 | import android.view.LayoutInflater; |
Leon Scroggins | c6fa110 | 2009-09-21 10:40:01 -0400 | [diff] [blame] | 35 | import android.view.MenuInflater; |
Leon Scroggins | e4b3bda | 2009-06-09 15:46:41 -0400 | [diff] [blame] | 36 | import android.view.View; |
John Reck | 9202673 | 2011-02-15 10:12:30 -0800 | [diff] [blame] | 37 | import android.view.View.OnFocusChangeListener; |
| 38 | import android.widget.ImageButton; |
Leon Scroggins | 81db366 | 2009-06-04 17:45:11 -0400 | [diff] [blame] | 39 | import android.widget.ImageView; |
Leon Scroggins | 81db366 | 2009-06-04 17:45:11 -0400 | [diff] [blame] | 40 | import android.widget.ProgressBar; |
Leon Scroggins | 81db366 | 2009-06-04 17:45:11 -0400 | [diff] [blame] | 41 | |
Leon Scroggins | 1f005d3 | 2009-08-10 17:36:42 -0400 | [diff] [blame] | 42 | /** |
| 43 | * This class represents a title bar for a particular "tab" or "window" in the |
| 44 | * browser. |
| 45 | */ |
John Reck | 9202673 | 2011-02-15 10:12:30 -0800 | [diff] [blame] | 46 | public class TitleBar extends TitleBarBase implements OnFocusChangeListener { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 47 | |
| 48 | private Activity mActivity; |
John Reck | 9202673 | 2011-02-15 10:12:30 -0800 | [diff] [blame] | 49 | private ImageButton mRtButton; |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 50 | private Drawable mCircularProgress; |
| 51 | private ProgressBar mHorizontalProgress; |
| 52 | private ImageView mStopButton; |
| 53 | private Drawable mBookmarkDrawable; |
| 54 | private Drawable mVoiceDrawable; |
| 55 | private boolean mInLoad; |
| 56 | private View mTitleBg; |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 57 | private Intent mVoiceSearchIntent; |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 58 | private Drawable mVoiceModeBackground; |
| 59 | private Drawable mNormalBackground; |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 60 | private ImageSpan mArcsSpan; |
| 61 | private int mLeftMargin; |
| 62 | private int mRightMargin; |
Leon Scroggins | c6fa110 | 2009-09-21 10:40:01 -0400 | [diff] [blame] | 63 | |
John Reck | 9202673 | 2011-02-15 10:12:30 -0800 | [diff] [blame] | 64 | public TitleBar(Activity activity, UiController controller, PhoneUi ui) { |
| 65 | super(activity, controller, ui); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 66 | LayoutInflater factory = LayoutInflater.from(activity); |
Leon Scroggins | 81db366 | 2009-06-04 17:45:11 -0400 | [diff] [blame] | 67 | factory.inflate(R.layout.title_bar, this); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 68 | mActivity = activity; |
Leon Scroggins | 81db366 | 2009-06-04 17:45:11 -0400 | [diff] [blame] | 69 | |
John Reck | 9202673 | 2011-02-15 10:12:30 -0800 | [diff] [blame] | 70 | mUrlInput = (UrlInputView) findViewById(R.id.url_input); |
| 71 | mUrlInput.setCompoundDrawablePadding(5); |
| 72 | mUrlInput.setContainer(this); |
| 73 | mUrlInput.setSelectAllOnFocus(true); |
| 74 | mUrlInput.setController(mUiController); |
| 75 | mUrlInput.setUrlInputListener(this); |
| 76 | mUrlInput.setOnFocusChangeListener(this); |
Leon Scroggins | 81db366 | 2009-06-04 17:45:11 -0400 | [diff] [blame] | 77 | |
Leon Scroggins | 6857939 | 2009-09-15 15:31:54 -0400 | [diff] [blame] | 78 | mTitleBg = findViewById(R.id.title_bg); |
Leon Scroggins | 62e8f94 | 2009-09-03 15:08:54 -0400 | [diff] [blame] | 79 | mLockIcon = (ImageView) findViewById(R.id.lock); |
Leon Scroggins | f4bb18a | 2009-09-11 18:37:53 -0400 | [diff] [blame] | 80 | mFavicon = (ImageView) findViewById(R.id.favicon); |
Leon Scroggins | b3b04f7 | 2010-03-03 17:17:18 -0500 | [diff] [blame] | 81 | mStopButton = (ImageView) findViewById(R.id.stop); |
Leon Scroggins | 62e8f94 | 2009-09-03 15:08:54 -0400 | [diff] [blame] | 82 | |
John Reck | 9202673 | 2011-02-15 10:12:30 -0800 | [diff] [blame] | 83 | mRtButton = (ImageButton) findViewById(R.id.rt_btn); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 84 | Resources resources = activity.getResources(); |
| 85 | mCircularProgress = resources.getDrawable( |
Leon Scroggins | 62e8f94 | 2009-09-03 15:08:54 -0400 | [diff] [blame] | 86 | com.android.internal.R.drawable.search_spinner); |
Leon Scroggins | 9535cee | 2010-03-15 20:37:16 -0400 | [diff] [blame] | 87 | DisplayMetrics metrics = resources.getDisplayMetrics(); |
Leon Scroggins | cd663ea | 2010-03-31 14:50:47 -0400 | [diff] [blame] | 88 | mLeftMargin = (int) TypedValue.applyDimension( |
| 89 | TypedValue.COMPLEX_UNIT_DIP, 8f, metrics); |
| 90 | mRightMargin = (int) TypedValue.applyDimension( |
| 91 | TypedValue.COMPLEX_UNIT_DIP, 6f, metrics); |
Leon Scroggins | 571b376 | 2010-05-26 10:25:01 -0400 | [diff] [blame] | 92 | int iconDimension = (int) TypedValue.applyDimension( |
Leon Scroggins | 9535cee | 2010-03-15 20:37:16 -0400 | [diff] [blame] | 93 | TypedValue.COMPLEX_UNIT_DIP, 20f, metrics); |
Leon Scroggins | 571b376 | 2010-05-26 10:25:01 -0400 | [diff] [blame] | 94 | mCircularProgress.setBounds(0, 0, iconDimension, iconDimension); |
Leon Scroggins | 81db366 | 2009-06-04 17:45:11 -0400 | [diff] [blame] | 95 | mHorizontalProgress = (ProgressBar) findViewById( |
| 96 | R.id.progress_horizontal); |
Leon Scroggins | 11e71b1 | 2010-01-25 10:40:38 -0500 | [diff] [blame] | 97 | mVoiceSearchIntent = new Intent(RecognizerIntent.ACTION_WEB_SEARCH); |
| 98 | mVoiceSearchIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, |
| 99 | RecognizerIntent.LANGUAGE_MODEL_WEB_SEARCH); |
Mike LeBeau | 9f677bc | 2010-04-01 14:57:10 -0700 | [diff] [blame] | 100 | // This extra tells voice search not to send the application id in its |
| 101 | // results intent - http://b/2546173 |
| 102 | // |
| 103 | // TODO: Make a constant for this extra. |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 104 | mVoiceSearchIntent.putExtra("android.speech.extras.SEND_APPLICATION_ID_EXTRA", |
| 105 | false); |
| 106 | PackageManager pm = activity.getPackageManager(); |
Leon Scroggins | 11e71b1 | 2010-01-25 10:40:38 -0500 | [diff] [blame] | 107 | ResolveInfo ri = pm.resolveActivity(mVoiceSearchIntent, |
| 108 | PackageManager.MATCH_DEFAULT_ONLY); |
| 109 | if (ri == null) { |
| 110 | mVoiceSearchIntent = null; |
| 111 | } else { |
| 112 | mVoiceDrawable = resources.getDrawable( |
| 113 | android.R.drawable.ic_btn_speak_now); |
| 114 | } |
Leon Scroggins | 11e71b1 | 2010-01-25 10:40:38 -0500 | [diff] [blame] | 115 | mBookmarkDrawable = mRtButton.getDrawable(); |
Leon Scroggins | 58d56c6 | 2010-01-28 15:12:40 -0500 | [diff] [blame] | 116 | mVoiceModeBackground = resources.getDrawable( |
Leon Scroggins | f48d44e | 2010-02-05 16:41:49 -0500 | [diff] [blame] | 117 | R.drawable.title_voice); |
Leon Scroggins | 58d56c6 | 2010-01-28 15:12:40 -0500 | [diff] [blame] | 118 | mNormalBackground = mTitleBg.getBackground(); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 119 | mArcsSpan = new ImageSpan(activity, R.drawable.arcs, |
Leon Scroggins | f48d44e | 2010-02-05 16:41:49 -0500 | [diff] [blame] | 120 | ImageSpan.ALIGN_BASELINE); |
Leon Scroggins | e4b3bda | 2009-06-09 15:46:41 -0400 | [diff] [blame] | 121 | } |
| 122 | |
Leon Scroggins | c6fa110 | 2009-09-21 10:40:01 -0400 | [diff] [blame] | 123 | @Override |
Leon Scroggins | 4e9f89b | 2010-02-22 16:54:14 -0500 | [diff] [blame] | 124 | public void createContextMenu(ContextMenu menu) { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 125 | MenuInflater inflater = mActivity.getMenuInflater(); |
Leon Scroggins | c6fa110 | 2009-09-21 10:40:01 -0400 | [diff] [blame] | 126 | inflater.inflate(R.menu.title_context, menu); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 127 | mActivity.onCreateContextMenu(menu, this, null); |
Leon Scroggins | c6fa110 | 2009-09-21 10:40:01 -0400 | [diff] [blame] | 128 | } |
| 129 | |
Leon Scroggins | 1f005d3 | 2009-08-10 17:36:42 -0400 | [diff] [blame] | 130 | /** |
Leon Scroggins | 11e71b1 | 2010-01-25 10:40:38 -0500 | [diff] [blame] | 131 | * Change the TitleBar to or from voice mode. If there is no package to |
| 132 | * handle voice search, the TitleBar cannot be set to voice mode. |
| 133 | */ |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 134 | @Override |
| 135 | void setInVoiceMode(boolean inVoiceMode) { |
Leon Scroggins | 11e71b1 | 2010-01-25 10:40:38 -0500 | [diff] [blame] | 136 | if (mInVoiceMode == inVoiceMode) return; |
| 137 | mInVoiceMode = inVoiceMode && mVoiceSearchIntent != null; |
Leon Scroggins | b3b04f7 | 2010-03-03 17:17:18 -0500 | [diff] [blame] | 138 | Drawable titleDrawable; |
Leon Scroggins | 11e71b1 | 2010-01-25 10:40:38 -0500 | [diff] [blame] | 139 | if (mInVoiceMode) { |
Leon Scroggins | b3b04f7 | 2010-03-03 17:17:18 -0500 | [diff] [blame] | 140 | mRtButton.setImageDrawable(mVoiceDrawable); |
Leon Scroggins | 58d56c6 | 2010-01-28 15:12:40 -0500 | [diff] [blame] | 141 | titleDrawable = mVoiceModeBackground; |
John Reck | 9202673 | 2011-02-15 10:12:30 -0800 | [diff] [blame] | 142 | mUrlInput.setEllipsize(null); |
Leon Scroggins | b3b04f7 | 2010-03-03 17:17:18 -0500 | [diff] [blame] | 143 | mRtButton.setVisibility(View.VISIBLE); |
| 144 | mStopButton.setVisibility(View.GONE); |
Leon Scroggins III | 1644ff6 | 2010-04-08 10:34:14 -0400 | [diff] [blame] | 145 | mTitleBg.setBackgroundDrawable(titleDrawable); |
Leon Scroggins | 7fb1a35 | 2010-04-15 10:55:02 -0400 | [diff] [blame] | 146 | mTitleBg.setPadding(mLeftMargin, mTitleBg.getPaddingTop(), |
| 147 | mRightMargin, mTitleBg.getPaddingBottom()); |
Leon Scroggins | 11e71b1 | 2010-01-25 10:40:38 -0500 | [diff] [blame] | 148 | } else { |
Leon Scroggins | 58d56c6 | 2010-01-28 15:12:40 -0500 | [diff] [blame] | 149 | if (mInLoad) { |
Leon Scroggins | b3b04f7 | 2010-03-03 17:17:18 -0500 | [diff] [blame] | 150 | mRtButton.setVisibility(View.GONE); |
| 151 | mStopButton.setVisibility(View.VISIBLE); |
Leon Scroggins | 58d56c6 | 2010-01-28 15:12:40 -0500 | [diff] [blame] | 152 | } else { |
Leon Scroggins | b3b04f7 | 2010-03-03 17:17:18 -0500 | [diff] [blame] | 153 | mRtButton.setVisibility(View.VISIBLE); |
| 154 | mStopButton.setVisibility(View.GONE); |
| 155 | mRtButton.setImageDrawable(mBookmarkDrawable); |
Leon Scroggins | 58d56c6 | 2010-01-28 15:12:40 -0500 | [diff] [blame] | 156 | } |
John Reck | 9202673 | 2011-02-15 10:12:30 -0800 | [diff] [blame] | 157 | mUrlInput.setEllipsize(TextUtils.TruncateAt.END); |
Leon Scroggins III | 1644ff6 | 2010-04-08 10:34:14 -0400 | [diff] [blame] | 158 | mTitleBg.setPadding(mLeftMargin, 0, mRightMargin, 0); |
Leon Scroggins | 11e71b1 | 2010-01-25 10:40:38 -0500 | [diff] [blame] | 159 | } |
John Reck | 9202673 | 2011-02-15 10:12:30 -0800 | [diff] [blame] | 160 | mUrlInput.setSingleLine(!mInVoiceMode); |
Leon Scroggins | 11e71b1 | 2010-01-25 10:40:38 -0500 | [diff] [blame] | 161 | } |
| 162 | |
| 163 | /** |
Leon Scroggins | 1f005d3 | 2009-08-10 17:36:42 -0400 | [diff] [blame] | 164 | * Update the progress, from 0 to 100. |
| 165 | */ |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 166 | @Override |
| 167 | void setProgress(int newProgress) { |
Nicolas Roard | 1382b49 | 2009-09-16 21:50:06 +0100 | [diff] [blame] | 168 | if (newProgress >= mHorizontalProgress.getMax()) { |
John Reck | 9202673 | 2011-02-15 10:12:30 -0800 | [diff] [blame] | 169 | mUrlInput.setCompoundDrawables(null, null, null, null); |
Leon Scroggins | 62e8f94 | 2009-09-03 15:08:54 -0400 | [diff] [blame] | 170 | ((Animatable) mCircularProgress).stop(); |
| 171 | mHorizontalProgress.setVisibility(View.INVISIBLE); |
Leon Scroggins | 11e71b1 | 2010-01-25 10:40:38 -0500 | [diff] [blame] | 172 | if (!mInVoiceMode) { |
Leon Scroggins | a81a764 | 2009-08-31 17:05:41 -0400 | [diff] [blame] | 173 | mRtButton.setImageDrawable(mBookmarkDrawable); |
Leon Scroggins | b3b04f7 | 2010-03-03 17:17:18 -0500 | [diff] [blame] | 174 | mRtButton.setVisibility(View.VISIBLE); |
| 175 | mStopButton.setVisibility(View.GONE); |
| 176 | mTitleBg.setBackgroundDrawable(mNormalBackground); |
Leon Scroggins | cd663ea | 2010-03-31 14:50:47 -0400 | [diff] [blame] | 177 | mTitleBg.setPadding(mLeftMargin, 0, mRightMargin, 0); |
Leon Scroggins | 1f005d3 | 2009-08-10 17:36:42 -0400 | [diff] [blame] | 178 | } |
Leon Scroggins | 81db366 | 2009-06-04 17:45:11 -0400 | [diff] [blame] | 179 | mInLoad = false; |
| 180 | } else { |
Leon Scroggins | 81db366 | 2009-06-04 17:45:11 -0400 | [diff] [blame] | 181 | mHorizontalProgress.setProgress(newProgress); |
Nicolas Roard | 1382b49 | 2009-09-16 21:50:06 +0100 | [diff] [blame] | 182 | if (!mInLoad && getWindowToken() != null) { |
| 183 | // checking the window token lets us be sure that we |
| 184 | // are attached to a window before starting the animation, |
| 185 | // preventing a potential race condition |
| 186 | // (fix for bug http://b/2115736) |
John Reck | 9202673 | 2011-02-15 10:12:30 -0800 | [diff] [blame] | 187 | mUrlInput.setCompoundDrawables(null, null, mCircularProgress, |
Leon Scroggins | 62e8f94 | 2009-09-03 15:08:54 -0400 | [diff] [blame] | 188 | null); |
| 189 | ((Animatable) mCircularProgress).start(); |
| 190 | mHorizontalProgress.setVisibility(View.VISIBLE); |
Leon Scroggins | 11e71b1 | 2010-01-25 10:40:38 -0500 | [diff] [blame] | 191 | if (!mInVoiceMode) { |
Leon Scroggins | cd663ea | 2010-03-31 14:50:47 -0400 | [diff] [blame] | 192 | mTitleBg.setPadding(mLeftMargin, 0, mRightMargin, 0); |
Leon Scroggins | b3b04f7 | 2010-03-03 17:17:18 -0500 | [diff] [blame] | 193 | mRtButton.setVisibility(View.GONE); |
| 194 | mStopButton.setVisibility(View.VISIBLE); |
Leon Scroggins | 62e8f94 | 2009-09-03 15:08:54 -0400 | [diff] [blame] | 195 | } |
| 196 | mInLoad = true; |
Leon Scroggins | e4b3bda | 2009-06-09 15:46:41 -0400 | [diff] [blame] | 197 | } |
Leon Scroggins | 81db366 | 2009-06-04 17:45:11 -0400 | [diff] [blame] | 198 | } |
| 199 | } |
| 200 | |
Leon Scroggins | 1f005d3 | 2009-08-10 17:36:42 -0400 | [diff] [blame] | 201 | /** |
Leon Scroggins | 58d56c6 | 2010-01-28 15:12:40 -0500 | [diff] [blame] | 202 | * Update the text displayed in the title bar. |
John Reck | ef07426 | 2010-12-02 16:09:14 -0800 | [diff] [blame] | 203 | * @param title String to display. If null, the new tab string will be |
Leon Scroggins | 58d56c6 | 2010-01-28 15:12:40 -0500 | [diff] [blame] | 204 | * shown. |
Leon Scroggins | 1f005d3 | 2009-08-10 17:36:42 -0400 | [diff] [blame] | 205 | */ |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 206 | @Override |
| 207 | void setDisplayTitle(String title) { |
Leon Scroggins | 58d56c6 | 2010-01-28 15:12:40 -0500 | [diff] [blame] | 208 | if (title == null) { |
John Reck | 9202673 | 2011-02-15 10:12:30 -0800 | [diff] [blame] | 209 | mUrlInput.setText(R.string.new_tab); |
Leon Scroggins | d7c3dd5 | 2009-07-20 13:38:47 -0400 | [diff] [blame] | 210 | } else { |
Leon Scroggins | f48d44e | 2010-02-05 16:41:49 -0500 | [diff] [blame] | 211 | if (mInVoiceMode) { |
| 212 | // Add two spaces. The second one will be replaced with an |
| 213 | // image, and the first one will put space between it and the |
| 214 | // text |
| 215 | SpannableString spannable = new SpannableString(title + " "); |
| 216 | int end = spannable.length(); |
| 217 | spannable.setSpan(mArcsSpan, end - 1, end, |
| 218 | Spanned.SPAN_MARK_POINT); |
John Reck | 9202673 | 2011-02-15 10:12:30 -0800 | [diff] [blame] | 219 | mUrlInput.setText(spannable); |
Leon Scroggins | f48d44e | 2010-02-05 16:41:49 -0500 | [diff] [blame] | 220 | } else { |
John Reck | 9202673 | 2011-02-15 10:12:30 -0800 | [diff] [blame] | 221 | mUrlInput.setText(title); |
Leon Scroggins | f48d44e | 2010-02-05 16:41:49 -0500 | [diff] [blame] | 222 | } |
Leon Scroggins | d7c3dd5 | 2009-07-20 13:38:47 -0400 | [diff] [blame] | 223 | } |
Leon Scroggins | 81db366 | 2009-06-04 17:45:11 -0400 | [diff] [blame] | 224 | } |
John Reck | 9202673 | 2011-02-15 10:12:30 -0800 | [diff] [blame] | 225 | |
| 226 | @Override |
| 227 | public void onFocusChange(View v, boolean hasFocus) { |
| 228 | if (v == mUrlInput && hasFocus) { |
| 229 | mActivity.closeOptionsMenu(); |
| 230 | } |
| 231 | } |
Leon Scroggins | 81db366 | 2009-06-04 17:45:11 -0400 | [diff] [blame] | 232 | } |