blob: 035dc3488bc0df7b8709373c989d593ecfd6c040 [file] [log] [blame]
Leon Scroggins81db3662009-06-04 17:45:11 -04001/*
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
17package com.android.browser;
18
19import android.content.Context;
Leon Scroggins11e71b12010-01-25 10:40:38 -050020import android.content.Intent;
21import android.content.pm.PackageManager;
22import android.content.pm.ResolveInfo;
Leon Scroggins3bbb6ca2009-09-09 12:51:10 -040023import android.content.res.Resources;
Leon Scroggins62e8f942009-09-03 15:08:54 -040024import android.graphics.drawable.Animatable;
Leon Scroggins81db3662009-06-04 17:45:11 -040025import android.graphics.drawable.Drawable;
Leon Scrogginsc6fa1102009-09-21 10:40:01 -040026import android.os.Handler;
27import android.os.Message;
Leon Scroggins11e71b12010-01-25 10:40:38 -050028import android.speech.RecognizerIntent;
Leon Scrogginsf48d44e2010-02-05 16:41:49 -050029import android.text.SpannableString;
30import android.text.Spanned;
Leon Scroggins76e16862010-02-08 14:39:34 -050031import android.text.TextUtils;
Leon Scrogginsf48d44e2010-02-05 16:41:49 -050032import android.text.style.ImageSpan;
Leon Scroggins9535cee2010-03-15 20:37:16 -040033import android.util.DisplayMetrics;
Leon Scroggins3bbb6ca2009-09-09 12:51:10 -040034import android.util.TypedValue;
Leon Scrogginsc6fa1102009-09-21 10:40:01 -040035import android.view.ContextMenu;
Leon Scrogginse4b3bda2009-06-09 15:46:41 -040036import android.view.LayoutInflater;
Leon Scrogginsc6fa1102009-09-21 10:40:01 -040037import android.view.MenuInflater;
Leon Scroggins68579392009-09-15 15:31:54 -040038import android.view.MotionEvent;
Leon Scrogginse4b3bda2009-06-09 15:46:41 -040039import android.view.View;
Leon Scroggins68579392009-09-15 15:31:54 -040040import android.view.ViewConfiguration;
Leon Scroggins81db3662009-06-04 17:45:11 -040041import android.widget.ImageView;
Leon Scroggins81db3662009-06-04 17:45:11 -040042import android.widget.ProgressBar;
43import android.widget.TextView;
Leon Scroggins81db3662009-06-04 17:45:11 -040044
Leon Scroggins1fe13a52010-02-09 15:31:26 -050045import com.android.common.speech.LoggingEvents;
46
Leon Scroggins1f005d32009-08-10 17:36:42 -040047/**
48 * This class represents a title bar for a particular "tab" or "window" in the
49 * browser.
50 */
Leon Scroggins571b3762010-05-26 10:25:01 -040051public class TitleBar extends TitleBarBase {
Leon Scroggins81db3662009-06-04 17:45:11 -040052 private TextView mTitle;
Leon Scroggins1f005d32009-08-10 17:36:42 -040053 private ImageView mRtButton;
Leon Scroggins62e8f942009-09-03 15:08:54 -040054 private Drawable mCircularProgress;
Leon Scroggins81db3662009-06-04 17:45:11 -040055 private ProgressBar mHorizontalProgress;
Leon Scrogginsb3b04f72010-03-03 17:17:18 -050056 private ImageView mStopButton;
Leon Scrogginsa81a7642009-08-31 17:05:41 -040057 private Drawable mBookmarkDrawable;
Leon Scroggins11e71b12010-01-25 10:40:38 -050058 private Drawable mVoiceDrawable;
Leon Scroggins81db3662009-06-04 17:45:11 -040059 private boolean mInLoad;
Leon Scrogginsa81a7642009-08-31 17:05:41 -040060 private BrowserActivity mBrowserActivity;
Leon Scroggins68579392009-09-15 15:31:54 -040061 private View mTitleBg;
Leon Scrogginsc6fa1102009-09-21 10:40:01 -040062 private MyHandler mHandler;
Leon Scroggins11e71b12010-01-25 10:40:38 -050063 private Intent mVoiceSearchIntent;
64 private boolean mInVoiceMode;
Leon Scroggins58d56c62010-01-28 15:12:40 -050065 private Drawable mVoiceModeBackground;
66 private Drawable mNormalBackground;
Leon Scrogginsb3b04f72010-03-03 17:17:18 -050067 private Drawable mLoadingBackground;
Leon Scrogginsf48d44e2010-02-05 16:41:49 -050068 private ImageSpan mArcsSpan;
Leon Scrogginscd663ea2010-03-31 14:50:47 -040069 private int mLeftMargin;
70 private int mRightMargin;
Leon Scrogginsc6fa1102009-09-21 10:40:01 -040071
72 private static int LONG_PRESS = 1;
Leon Scroggins81db3662009-06-04 17:45:11 -040073
Leon Scroggins68579392009-09-15 15:31:54 -040074 public TitleBar(BrowserActivity context) {
Leon Scroggins571b3762010-05-26 10:25:01 -040075 super(context);
Leon Scrogginsc6fa1102009-09-21 10:40:01 -040076 mHandler = new MyHandler();
Leon Scroggins81db3662009-06-04 17:45:11 -040077 LayoutInflater factory = LayoutInflater.from(context);
78 factory.inflate(R.layout.title_bar, this);
Leon Scroggins3bbb6ca2009-09-09 12:51:10 -040079 mBrowserActivity = context;
Leon Scroggins81db3662009-06-04 17:45:11 -040080
81 mTitle = (TextView) findViewById(R.id.title);
Leon Scrogginsa81a7642009-08-31 17:05:41 -040082 mTitle.setCompoundDrawablePadding(5);
Leon Scroggins81db3662009-06-04 17:45:11 -040083
Leon Scroggins68579392009-09-15 15:31:54 -040084 mTitleBg = findViewById(R.id.title_bg);
Leon Scroggins62e8f942009-09-03 15:08:54 -040085 mLockIcon = (ImageView) findViewById(R.id.lock);
Leon Scrogginsf4bb18a2009-09-11 18:37:53 -040086 mFavicon = (ImageView) findViewById(R.id.favicon);
Leon Scrogginsb3b04f72010-03-03 17:17:18 -050087 mStopButton = (ImageView) findViewById(R.id.stop);
Leon Scroggins62e8f942009-09-03 15:08:54 -040088
Leon Scrogginsa81a7642009-08-31 17:05:41 -040089 mRtButton = (ImageView) findViewById(R.id.rt_btn);
Leon Scroggins3bbb6ca2009-09-09 12:51:10 -040090 Resources resources = context.getResources();
91 mCircularProgress = (Drawable) resources.getDrawable(
Leon Scroggins62e8f942009-09-03 15:08:54 -040092 com.android.internal.R.drawable.search_spinner);
Leon Scroggins9535cee2010-03-15 20:37:16 -040093 DisplayMetrics metrics = resources.getDisplayMetrics();
Leon Scrogginscd663ea2010-03-31 14:50:47 -040094 mLeftMargin = (int) TypedValue.applyDimension(
95 TypedValue.COMPLEX_UNIT_DIP, 8f, metrics);
96 mRightMargin = (int) TypedValue.applyDimension(
97 TypedValue.COMPLEX_UNIT_DIP, 6f, metrics);
Leon Scroggins571b3762010-05-26 10:25:01 -040098 int iconDimension = (int) TypedValue.applyDimension(
Leon Scroggins9535cee2010-03-15 20:37:16 -040099 TypedValue.COMPLEX_UNIT_DIP, 20f, metrics);
Leon Scroggins571b3762010-05-26 10:25:01 -0400100 mCircularProgress.setBounds(0, 0, iconDimension, iconDimension);
Leon Scroggins81db3662009-06-04 17:45:11 -0400101 mHorizontalProgress = (ProgressBar) findViewById(
102 R.id.progress_horizontal);
Leon Scroggins11e71b12010-01-25 10:40:38 -0500103 mVoiceSearchIntent = new Intent(RecognizerIntent.ACTION_WEB_SEARCH);
104 mVoiceSearchIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
105 RecognizerIntent.LANGUAGE_MODEL_WEB_SEARCH);
Mike LeBeau9f677bc2010-04-01 14:57:10 -0700106 // This extra tells voice search not to send the application id in its
107 // results intent - http://b/2546173
108 //
109 // TODO: Make a constant for this extra.
110 mVoiceSearchIntent.putExtra("android.speech.extras.SEND_APPLICATION_ID_EXTRA", false);
Leon Scroggins11e71b12010-01-25 10:40:38 -0500111 PackageManager pm = context.getPackageManager();
112 ResolveInfo ri = pm.resolveActivity(mVoiceSearchIntent,
113 PackageManager.MATCH_DEFAULT_ONLY);
114 if (ri == null) {
115 mVoiceSearchIntent = null;
116 } else {
117 mVoiceDrawable = resources.getDrawable(
118 android.R.drawable.ic_btn_speak_now);
119 }
Leon Scroggins11e71b12010-01-25 10:40:38 -0500120 mBookmarkDrawable = mRtButton.getDrawable();
Leon Scroggins58d56c62010-01-28 15:12:40 -0500121 mVoiceModeBackground = resources.getDrawable(
Leon Scrogginsf48d44e2010-02-05 16:41:49 -0500122 R.drawable.title_voice);
Leon Scroggins58d56c62010-01-28 15:12:40 -0500123 mNormalBackground = mTitleBg.getBackground();
Leon Scrogginsb3b04f72010-03-03 17:17:18 -0500124 mLoadingBackground = resources.getDrawable(R.drawable.title_loading);
Leon Scrogginsf48d44e2010-02-05 16:41:49 -0500125 mArcsSpan = new ImageSpan(context, R.drawable.arcs,
126 ImageSpan.ALIGN_BASELINE);
Leon Scrogginse4b3bda2009-06-09 15:46:41 -0400127 }
128
Leon Scrogginsc6fa1102009-09-21 10:40:01 -0400129 private class MyHandler extends Handler {
130 public void handleMessage(Message msg) {
131 if (msg.what == LONG_PRESS) {
132 // Prevent the normal action from happening by setting the title
133 // bar's state to false.
134 mTitleBg.setPressed(false);
135 // Need to call a special method on BrowserActivity for when the
136 // fake title bar is up, because its ViewGroup does not show a
137 // context menu.
138 mBrowserActivity.showTitleBarContextMenu();
139 }
140 }
141 };
142
143 @Override
Leon Scroggins4e9f89b2010-02-22 16:54:14 -0500144 public void createContextMenu(ContextMenu menu) {
Leon Scrogginsc6fa1102009-09-21 10:40:01 -0400145 MenuInflater inflater = mBrowserActivity.getMenuInflater();
146 inflater.inflate(R.menu.title_context, menu);
Leon Scroggins4e9f89b2010-02-22 16:54:14 -0500147 mBrowserActivity.onCreateContextMenu(menu, this, null);
Leon Scrogginsc6fa1102009-09-21 10:40:01 -0400148 }
149
Leon Scroggins68579392009-09-15 15:31:54 -0400150 @Override
151 public boolean onTouchEvent(MotionEvent event) {
Leon Scrogginsbf083d22010-03-22 10:54:04 -0400152 ImageView button = mInLoad ? mStopButton : mRtButton;
Leon Scroggins68579392009-09-15 15:31:54 -0400153 switch (event.getAction()) {
154 case MotionEvent.ACTION_DOWN:
155 // Make all touches hit either the textfield or the button,
156 // depending on which side of the right edge of the textfield
157 // they hit.
158 if ((int) event.getX() > mTitleBg.getRight()) {
Leon Scrogginsbf083d22010-03-22 10:54:04 -0400159 button.setPressed(true);
Leon Scroggins68579392009-09-15 15:31:54 -0400160 } else {
161 mTitleBg.setPressed(true);
Leon Scrogginsc6fa1102009-09-21 10:40:01 -0400162 mHandler.sendMessageDelayed(mHandler.obtainMessage(
163 LONG_PRESS),
164 ViewConfiguration.getLongPressTimeout());
Leon Scroggins68579392009-09-15 15:31:54 -0400165 }
166 break;
167 case MotionEvent.ACTION_MOVE:
168 int slop = ViewConfiguration.get(mBrowserActivity)
169 .getScaledTouchSlop();
170 if ((int) event.getY() > getHeight() + slop) {
171 // We only trigger the actions in ACTION_UP if one or the
172 // other is pressed. Since the user moved off the title
173 // bar, mark both as not pressed.
174 mTitleBg.setPressed(false);
Leon Scrogginsbf083d22010-03-22 10:54:04 -0400175 button.setPressed(false);
Leon Scrogginsc6fa1102009-09-21 10:40:01 -0400176 mHandler.removeMessages(LONG_PRESS);
Leon Scroggins68579392009-09-15 15:31:54 -0400177 break;
178 }
179 int x = (int) event.getX();
180 int titleRight = mTitleBg.getRight();
181 if (mTitleBg.isPressed() && x > titleRight + slop) {
182 mTitleBg.setPressed(false);
Leon Scrogginsc6fa1102009-09-21 10:40:01 -0400183 mHandler.removeMessages(LONG_PRESS);
Leon Scrogginsbf083d22010-03-22 10:54:04 -0400184 } else if (button.isPressed() && x < titleRight - slop) {
185 button.setPressed(false);
Leon Scroggins68579392009-09-15 15:31:54 -0400186 }
187 break;
188 case MotionEvent.ACTION_CANCEL:
Leon Scrogginsbf083d22010-03-22 10:54:04 -0400189 button.setPressed(false);
Leon Scroggins68579392009-09-15 15:31:54 -0400190 mTitleBg.setPressed(false);
Leon Scrogginsc6fa1102009-09-21 10:40:01 -0400191 mHandler.removeMessages(LONG_PRESS);
Leon Scroggins68579392009-09-15 15:31:54 -0400192 break;
193 case MotionEvent.ACTION_UP:
Leon Scrogginsbf083d22010-03-22 10:54:04 -0400194 if (button.isPressed()) {
Leon Scroggins11e71b12010-01-25 10:40:38 -0500195 if (mInVoiceMode) {
Leon Scroggins1fe13a52010-02-09 15:31:26 -0500196 if (mBrowserActivity.getTabControl().getCurrentTab()
197 .voiceSearchSourceIsGoogle()) {
198 Intent i = new Intent(
199 LoggingEvents.ACTION_LOG_EVENT);
200 i.putExtra(LoggingEvents.EXTRA_EVENT,
201 LoggingEvents.VoiceSearch.RETRY);
202 mBrowserActivity.sendBroadcast(i);
203 }
Leon Scroggins11e71b12010-01-25 10:40:38 -0500204 mBrowserActivity.startActivity(mVoiceSearchIntent);
205 } else if (mInLoad) {
Leon Scroggins68579392009-09-15 15:31:54 -0400206 mBrowserActivity.stopLoading();
207 } else {
Leon Scroggins88d08032010-10-21 15:17:10 -0400208 mBrowserActivity.bookmarkCurrentPage(
209 AddBookmarkPage.DEFAULT_FOLDER_ID);
Leon Scroggins68579392009-09-15 15:31:54 -0400210 }
Leon Scrogginsbf083d22010-03-22 10:54:04 -0400211 button.setPressed(false);
Leon Scroggins68579392009-09-15 15:31:54 -0400212 } else if (mTitleBg.isPressed()) {
Leon Scrogginsc6fa1102009-09-21 10:40:01 -0400213 mHandler.removeMessages(LONG_PRESS);
Leon Scroggins58d56c62010-01-28 15:12:40 -0500214 if (mInVoiceMode) {
Leon Scroggins1fe13a52010-02-09 15:31:26 -0500215 if (mBrowserActivity.getTabControl().getCurrentTab()
216 .voiceSearchSourceIsGoogle()) {
217 Intent i = new Intent(
218 LoggingEvents.ACTION_LOG_EVENT);
219 i.putExtra(LoggingEvents.EXTRA_EVENT,
220 LoggingEvents.VoiceSearch.N_BEST_REVEAL);
221 mBrowserActivity.sendBroadcast(i);
222 }
Leon Scroggins58d56c62010-01-28 15:12:40 -0500223 mBrowserActivity.showVoiceSearchResults(
Leon Scrogginsea754072010-02-08 14:08:30 -0500224 mTitle.getText().toString().trim());
Leon Scroggins58d56c62010-01-28 15:12:40 -0500225 } else {
Leon Scroggins8ad29922010-02-16 12:33:55 -0500226 mBrowserActivity.editUrl();
Leon Scroggins58d56c62010-01-28 15:12:40 -0500227 }
Leon Scroggins68579392009-09-15 15:31:54 -0400228 mTitleBg.setPressed(false);
229 }
230 break;
231 default:
232 break;
233 }
234 return true;
Leon Scroggins81db3662009-06-04 17:45:11 -0400235 }
236
Leon Scroggins1f005d32009-08-10 17:36:42 -0400237 /**
Leon Scroggins11e71b12010-01-25 10:40:38 -0500238 * Change the TitleBar to or from voice mode. If there is no package to
239 * handle voice search, the TitleBar cannot be set to voice mode.
240 */
241 /* package */ void setInVoiceMode(boolean inVoiceMode) {
242 if (mInVoiceMode == inVoiceMode) return;
243 mInVoiceMode = inVoiceMode && mVoiceSearchIntent != null;
Leon Scrogginsb3b04f72010-03-03 17:17:18 -0500244 Drawable titleDrawable;
Leon Scroggins11e71b12010-01-25 10:40:38 -0500245 if (mInVoiceMode) {
Leon Scrogginsb3b04f72010-03-03 17:17:18 -0500246 mRtButton.setImageDrawable(mVoiceDrawable);
Leon Scroggins58d56c62010-01-28 15:12:40 -0500247 titleDrawable = mVoiceModeBackground;
Leon Scroggins76e16862010-02-08 14:39:34 -0500248 mTitle.setEllipsize(null);
Leon Scrogginsb3b04f72010-03-03 17:17:18 -0500249 mRtButton.setVisibility(View.VISIBLE);
250 mStopButton.setVisibility(View.GONE);
Leon Scroggins III1644ff62010-04-08 10:34:14 -0400251 mTitleBg.setBackgroundDrawable(titleDrawable);
Leon Scroggins7fb1a352010-04-15 10:55:02 -0400252 mTitleBg.setPadding(mLeftMargin, mTitleBg.getPaddingTop(),
253 mRightMargin, mTitleBg.getPaddingBottom());
Leon Scroggins11e71b12010-01-25 10:40:38 -0500254 } else {
Leon Scroggins58d56c62010-01-28 15:12:40 -0500255 if (mInLoad) {
Leon Scrogginsb3b04f72010-03-03 17:17:18 -0500256 titleDrawable = mLoadingBackground;
257 mRtButton.setVisibility(View.GONE);
258 mStopButton.setVisibility(View.VISIBLE);
Leon Scroggins58d56c62010-01-28 15:12:40 -0500259 } else {
Leon Scrogginsb3b04f72010-03-03 17:17:18 -0500260 titleDrawable = mNormalBackground;
261 mRtButton.setVisibility(View.VISIBLE);
262 mStopButton.setVisibility(View.GONE);
263 mRtButton.setImageDrawable(mBookmarkDrawable);
Leon Scroggins58d56c62010-01-28 15:12:40 -0500264 }
Leon Scroggins76e16862010-02-08 14:39:34 -0500265 mTitle.setEllipsize(TextUtils.TruncateAt.END);
Leon Scroggins III1644ff62010-04-08 10:34:14 -0400266 mTitleBg.setBackgroundDrawable(titleDrawable);
267 mTitleBg.setPadding(mLeftMargin, 0, mRightMargin, 0);
Leon Scroggins11e71b12010-01-25 10:40:38 -0500268 }
Leon Scrogginsf48d44e2010-02-05 16:41:49 -0500269 mTitle.setSingleLine(!mInVoiceMode);
Leon Scroggins11e71b12010-01-25 10:40:38 -0500270 }
271
272 /**
Leon Scroggins1f005d32009-08-10 17:36:42 -0400273 * Update the progress, from 0 to 100.
274 */
Leon Scroggins81db3662009-06-04 17:45:11 -0400275 /* package */ void setProgress(int newProgress) {
Nicolas Roard1382b492009-09-16 21:50:06 +0100276 if (newProgress >= mHorizontalProgress.getMax()) {
Leon Scrogginsf4bb18a2009-09-11 18:37:53 -0400277 mTitle.setCompoundDrawables(null, null, null, null);
Leon Scroggins62e8f942009-09-03 15:08:54 -0400278 ((Animatable) mCircularProgress).stop();
279 mHorizontalProgress.setVisibility(View.INVISIBLE);
Leon Scroggins11e71b12010-01-25 10:40:38 -0500280 if (!mInVoiceMode) {
Leon Scrogginsa81a7642009-08-31 17:05:41 -0400281 mRtButton.setImageDrawable(mBookmarkDrawable);
Leon Scrogginsb3b04f72010-03-03 17:17:18 -0500282 mRtButton.setVisibility(View.VISIBLE);
283 mStopButton.setVisibility(View.GONE);
284 mTitleBg.setBackgroundDrawable(mNormalBackground);
Leon Scrogginscd663ea2010-03-31 14:50:47 -0400285 mTitleBg.setPadding(mLeftMargin, 0, mRightMargin, 0);
Leon Scroggins1f005d32009-08-10 17:36:42 -0400286 }
Leon Scroggins81db3662009-06-04 17:45:11 -0400287 mInLoad = false;
288 } else {
Leon Scroggins81db3662009-06-04 17:45:11 -0400289 mHorizontalProgress.setProgress(newProgress);
Nicolas Roard1382b492009-09-16 21:50:06 +0100290 if (!mInLoad && getWindowToken() != null) {
291 // checking the window token lets us be sure that we
292 // are attached to a window before starting the animation,
293 // preventing a potential race condition
294 // (fix for bug http://b/2115736)
Leon Scrogginsf4bb18a2009-09-11 18:37:53 -0400295 mTitle.setCompoundDrawables(null, null, mCircularProgress,
Leon Scroggins62e8f942009-09-03 15:08:54 -0400296 null);
297 ((Animatable) mCircularProgress).start();
298 mHorizontalProgress.setVisibility(View.VISIBLE);
Leon Scroggins11e71b12010-01-25 10:40:38 -0500299 if (!mInVoiceMode) {
Leon Scrogginsb3b04f72010-03-03 17:17:18 -0500300 mTitleBg.setBackgroundDrawable(mLoadingBackground);
Leon Scrogginscd663ea2010-03-31 14:50:47 -0400301 mTitleBg.setPadding(mLeftMargin, 0, mRightMargin, 0);
Leon Scrogginsb3b04f72010-03-03 17:17:18 -0500302 mRtButton.setVisibility(View.GONE);
303 mStopButton.setVisibility(View.VISIBLE);
Leon Scroggins62e8f942009-09-03 15:08:54 -0400304 }
305 mInLoad = true;
Leon Scrogginse4b3bda2009-06-09 15:46:41 -0400306 }
Leon Scroggins81db3662009-06-04 17:45:11 -0400307 }
308 }
309
Leon Scroggins1f005d32009-08-10 17:36:42 -0400310 /**
Leon Scroggins58d56c62010-01-28 15:12:40 -0500311 * Update the text displayed in the title bar.
312 * @param title String to display. If null, the loading string will be
313 * shown.
Leon Scroggins1f005d32009-08-10 17:36:42 -0400314 */
Leon Scroggins58d56c62010-01-28 15:12:40 -0500315 /* package */ void setDisplayTitle(String title) {
316 if (title == null) {
Leon Scrogginsa81a7642009-08-31 17:05:41 -0400317 mTitle.setText(R.string.title_bar_loading);
Leon Scrogginsd7c3dd52009-07-20 13:38:47 -0400318 } else {
Leon Scrogginsf48d44e2010-02-05 16:41:49 -0500319 if (mInVoiceMode) {
320 // Add two spaces. The second one will be replaced with an
321 // image, and the first one will put space between it and the
322 // text
323 SpannableString spannable = new SpannableString(title + " ");
324 int end = spannable.length();
325 spannable.setSpan(mArcsSpan, end - 1, end,
326 Spanned.SPAN_MARK_POINT);
327 mTitle.setText(spannable);
328 } else {
329 mTitle.setText(title);
330 }
Leon Scrogginsd7c3dd52009-07-20 13:38:47 -0400331 }
Leon Scroggins81db3662009-06-04 17:45:11 -0400332 }
Leon Scroggins81db3662009-06-04 17:45:11 -0400333}