Leon Scroggins | 571b376 | 2010-05-26 10:25:01 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2010 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 | c7485ae | 2010-09-03 10:10:58 -0700 | [diff] [blame] | 19 | import com.android.browser.UrlInputView.UrlInputListener; |
| 20 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 21 | import android.app.Activity; |
Michael Kolb | fe25199 | 2010-07-08 15:41:55 -0700 | [diff] [blame] | 22 | import android.app.SearchManager; |
Leon Scroggins | 571b376 | 2010-05-26 10:25:01 -0400 | [diff] [blame] | 23 | import android.content.Context; |
Michael Kolb | fe25199 | 2010-07-08 15:41:55 -0700 | [diff] [blame] | 24 | import android.content.Intent; |
Leon Scroggins | 571b376 | 2010-05-26 10:25:01 -0400 | [diff] [blame] | 25 | import android.content.res.Resources; |
Michael Kolb | fe25199 | 2010-07-08 15:41:55 -0700 | [diff] [blame] | 26 | import android.graphics.Bitmap; |
Leon Scroggins | 571b376 | 2010-05-26 10:25:01 -0400 | [diff] [blame] | 27 | import android.graphics.drawable.Drawable; |
Michael Kolb | 257cc2c | 2010-12-09 09:45:52 -0800 | [diff] [blame^] | 28 | import android.os.Bundle; |
Michael Kolb | 1ce7813 | 2010-09-23 15:50:53 -0700 | [diff] [blame] | 29 | import android.text.TextUtils; |
Leon Scroggins | 4cd9779 | 2010-12-03 15:31:56 -0500 | [diff] [blame] | 30 | import android.util.AttributeSet; |
Leon Scroggins | 571b376 | 2010-05-26 10:25:01 -0400 | [diff] [blame] | 31 | import android.view.LayoutInflater; |
Leon Scroggins | 571b376 | 2010-05-26 10:25:01 -0400 | [diff] [blame] | 32 | import android.view.View; |
Michael Kolb | a2b2ba8 | 2010-08-04 17:54:03 -0700 | [diff] [blame] | 33 | import android.view.View.OnClickListener; |
Leon Scroggins | 4cd9779 | 2010-12-03 15:31:56 -0500 | [diff] [blame] | 34 | import android.widget.CheckBox; |
Leon Scroggins | 571b376 | 2010-05-26 10:25:01 -0400 | [diff] [blame] | 35 | import android.widget.ImageView; |
Michael Kolb | 513286f | 2010-09-09 12:55:12 -0700 | [diff] [blame] | 36 | import android.widget.TextView; |
Leon Scroggins | 571b376 | 2010-05-26 10:25:01 -0400 | [diff] [blame] | 37 | |
Leon Scroggins | 571b376 | 2010-05-26 10:25:01 -0400 | [diff] [blame] | 38 | /** |
Michael Kolb | fe25199 | 2010-07-08 15:41:55 -0700 | [diff] [blame] | 39 | * tabbed title bar for xlarge screen browser |
Leon Scroggins | 571b376 | 2010-05-26 10:25:01 -0400 | [diff] [blame] | 40 | */ |
Michael Kolb | fe25199 | 2010-07-08 15:41:55 -0700 | [diff] [blame] | 41 | public class TitleBarXLarge extends TitleBarBase |
Michael Kolb | ba99c5d | 2010-11-29 14:57:41 -0800 | [diff] [blame] | 42 | implements UrlInputListener, OnClickListener { |
Leon Scroggins | 571b376 | 2010-05-26 10:25:01 -0400 | [diff] [blame] | 43 | |
Michael Kolb | fe25199 | 2010-07-08 15:41:55 -0700 | [diff] [blame] | 44 | private static final int PROGRESS_MAX = 100; |
Leon Scroggins | 571b376 | 2010-05-26 10:25:01 -0400 | [diff] [blame] | 45 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 46 | private UiController mUiController; |
| 47 | |
Michael Kolb | a2b2ba8 | 2010-08-04 17:54:03 -0700 | [diff] [blame] | 48 | private Drawable mStopDrawable; |
| 49 | private Drawable mReloadDrawable; |
Michael Kolb | c7485ae | 2010-09-03 10:10:58 -0700 | [diff] [blame] | 50 | |
Michael Kolb | 3f65c38 | 2010-08-20 15:31:16 -0700 | [diff] [blame] | 51 | private View mContainer; |
Michael Kolb | a2b2ba8 | 2010-08-04 17:54:03 -0700 | [diff] [blame] | 52 | private View mBackButton; |
| 53 | private View mForwardButton; |
Leon Scroggins | 4cd9779 | 2010-12-03 15:31:56 -0500 | [diff] [blame] | 54 | private CheckBox mStar; |
Michael Kolb | a2b2ba8 | 2010-08-04 17:54:03 -0700 | [diff] [blame] | 55 | private View mSearchButton; |
Michael Kolb | 513286f | 2010-09-09 12:55:12 -0700 | [diff] [blame] | 56 | private View mFocusContainer; |
| 57 | private View mUnfocusContainer; |
| 58 | private View mGoButton; |
Michael Kolb | a2b2ba8 | 2010-08-04 17:54:03 -0700 | [diff] [blame] | 59 | private ImageView mStopButton; |
Michael Kolb | a2b2ba8 | 2010-08-04 17:54:03 -0700 | [diff] [blame] | 60 | private View mAllButton; |
Michael Kolb | b7b115e | 2010-09-25 16:59:37 -0700 | [diff] [blame] | 61 | private View mClearButton; |
Michael Kolb | c7485ae | 2010-09-03 10:10:58 -0700 | [diff] [blame] | 62 | private PageProgressView mProgressView; |
Michael Kolb | 513286f | 2010-09-09 12:55:12 -0700 | [diff] [blame] | 63 | private UrlInputView mUrlFocused; |
| 64 | private TextView mUrlUnfocused; |
Michael Kolb | a2b2ba8 | 2010-08-04 17:54:03 -0700 | [diff] [blame] | 65 | private boolean mInLoad; |
Michael Kolb | fe25199 | 2010-07-08 15:41:55 -0700 | [diff] [blame] | 66 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 67 | public TitleBarXLarge(Activity activity, UiController controller) { |
| 68 | super(activity); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 69 | mUiController = controller; |
| 70 | Resources resources = activity.getResources(); |
Michael Kolb | c7485ae | 2010-09-03 10:10:58 -0700 | [diff] [blame] | 71 | mStopDrawable = resources.getDrawable(R.drawable.ic_stop_normal); |
| 72 | mReloadDrawable = resources.getDrawable(R.drawable.ic_refresh_normal); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 73 | rebuildLayout(activity, true); |
Michael Kolb | fe25199 | 2010-07-08 15:41:55 -0700 | [diff] [blame] | 74 | } |
Leon Scroggins | 571b376 | 2010-05-26 10:25:01 -0400 | [diff] [blame] | 75 | |
Michael Kolb | fe25199 | 2010-07-08 15:41:55 -0700 | [diff] [blame] | 76 | private void rebuildLayout(Context context, boolean rebuildData) { |
Michael Kolb | fe25199 | 2010-07-08 15:41:55 -0700 | [diff] [blame] | 77 | LayoutInflater factory = LayoutInflater.from(context); |
Michael Kolb | a2b2ba8 | 2010-08-04 17:54:03 -0700 | [diff] [blame] | 78 | factory.inflate(R.layout.url_bar, this); |
Michael Kolb | fe25199 | 2010-07-08 15:41:55 -0700 | [diff] [blame] | 79 | |
Michael Kolb | 3f65c38 | 2010-08-20 15:31:16 -0700 | [diff] [blame] | 80 | mContainer = findViewById(R.id.taburlbar); |
Michael Kolb | 513286f | 2010-09-09 12:55:12 -0700 | [diff] [blame] | 81 | mUrlFocused = (UrlInputView) findViewById(R.id.url_focused); |
| 82 | mUrlUnfocused = (TextView) findViewById(R.id.url_unfocused); |
Michael Kolb | fe25199 | 2010-07-08 15:41:55 -0700 | [diff] [blame] | 83 | mAllButton = findViewById(R.id.all_btn); |
| 84 | // TODO: Change enabled states based on whether you can go |
Leon Scroggins | 571b376 | 2010-05-26 10:25:01 -0400 | [diff] [blame] | 85 | // back/forward. Probably should be done inside onPageStarted. |
| 86 | mBackButton = findViewById(R.id.back); |
| 87 | mForwardButton = findViewById(R.id.forward); |
Leon Scroggins | 4cd9779 | 2010-12-03 15:31:56 -0500 | [diff] [blame] | 88 | mStar = (CheckBox) findViewById(R.id.star); |
Michael Kolb | a2b2ba8 | 2010-08-04 17:54:03 -0700 | [diff] [blame] | 89 | mStopButton = (ImageView) findViewById(R.id.stop); |
| 90 | mSearchButton = findViewById(R.id.search); |
| 91 | mLockIcon = (ImageView) findViewById(R.id.lock); |
Michael Kolb | 513286f | 2010-09-09 12:55:12 -0700 | [diff] [blame] | 92 | mGoButton = findViewById(R.id.go); |
Michael Kolb | b7b115e | 2010-09-25 16:59:37 -0700 | [diff] [blame] | 93 | mClearButton = findViewById(R.id.clear); |
Michael Kolb | c7485ae | 2010-09-03 10:10:58 -0700 | [diff] [blame] | 94 | mProgressView = (PageProgressView) findViewById(R.id.progress); |
Michael Kolb | 513286f | 2010-09-09 12:55:12 -0700 | [diff] [blame] | 95 | mFocusContainer = findViewById(R.id.urlbar_focused); |
| 96 | mUnfocusContainer = findViewById(R.id.urlbar_unfocused); |
Michael Kolb | fe25199 | 2010-07-08 15:41:55 -0700 | [diff] [blame] | 97 | |
Michael Kolb | a2b2ba8 | 2010-08-04 17:54:03 -0700 | [diff] [blame] | 98 | mBackButton.setOnClickListener(this); |
| 99 | mForwardButton.setOnClickListener(this); |
| 100 | mStar.setOnClickListener(this); |
| 101 | mAllButton.setOnClickListener(this); |
| 102 | mStopButton.setOnClickListener(this); |
| 103 | mSearchButton.setOnClickListener(this); |
Michael Kolb | 513286f | 2010-09-09 12:55:12 -0700 | [diff] [blame] | 104 | mGoButton.setOnClickListener(this); |
Michael Kolb | b7b115e | 2010-09-25 16:59:37 -0700 | [diff] [blame] | 105 | mClearButton.setOnClickListener(this); |
Michael Kolb | 513286f | 2010-09-09 12:55:12 -0700 | [diff] [blame] | 106 | mUrlFocused.setUrlInputListener(this); |
Michael Kolb | 21ce4d2 | 2010-09-15 14:55:05 -0700 | [diff] [blame] | 107 | mUrlFocused.setContainer(mFocusContainer); |
Michael Kolb | ba99c5d | 2010-11-29 14:57:41 -0800 | [diff] [blame] | 108 | mUrlFocused.setController(mUiController); |
Michael Kolb | 0506f2d | 2010-10-14 16:20:16 -0700 | [diff] [blame] | 109 | mUnfocusContainer.setOnClickListener(this); |
Michael Kolb | c7485ae | 2010-09-03 10:10:58 -0700 | [diff] [blame] | 110 | } |
Michael Kolb | b7b115e | 2010-09-25 16:59:37 -0700 | [diff] [blame] | 111 | |
Leon Scroggins | 4cd9779 | 2010-12-03 15:31:56 -0500 | [diff] [blame] | 112 | public void setCurrentUrlIsBookmark(boolean isBookmark) { |
| 113 | mStar.setChecked(isBookmark); |
| 114 | } |
| 115 | |
Michael Kolb | a2b2ba8 | 2010-08-04 17:54:03 -0700 | [diff] [blame] | 116 | @Override |
| 117 | public void onClick(View v) { |
Michael Kolb | 0506f2d | 2010-10-14 16:20:16 -0700 | [diff] [blame] | 118 | if (mUnfocusContainer == v) { |
Michael Kolb | ba99c5d | 2010-11-29 14:57:41 -0800 | [diff] [blame] | 119 | setUrlMode(true); |
Michael Kolb | 0506f2d | 2010-10-14 16:20:16 -0700 | [diff] [blame] | 120 | } else if (mBackButton == v) { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 121 | mUiController.getCurrentTopWebView().goBack(); |
Michael Kolb | a2b2ba8 | 2010-08-04 17:54:03 -0700 | [diff] [blame] | 122 | } else if (mForwardButton == v) { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 123 | mUiController.getCurrentTopWebView().goForward(); |
Michael Kolb | a2b2ba8 | 2010-08-04 17:54:03 -0700 | [diff] [blame] | 124 | } else if (mStar == v) { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 125 | mUiController.bookmarkCurrentPage( |
Leon Scroggins | 88d0803 | 2010-10-21 15:17:10 -0400 | [diff] [blame] | 126 | AddBookmarkPage.DEFAULT_FOLDER_ID); |
Michael Kolb | a2b2ba8 | 2010-08-04 17:54:03 -0700 | [diff] [blame] | 127 | } else if (mAllButton == v) { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 128 | mUiController.bookmarksOrHistoryPicker(false); |
Michael Kolb | a2b2ba8 | 2010-08-04 17:54:03 -0700 | [diff] [blame] | 129 | } else if (mSearchButton == v) { |
| 130 | search(); |
| 131 | } else if (mStopButton == v) { |
| 132 | stopOrRefresh(); |
Michael Kolb | 513286f | 2010-09-09 12:55:12 -0700 | [diff] [blame] | 133 | } else if (mGoButton == v) { |
Michael Kolb | 1ce7813 | 2010-09-23 15:50:53 -0700 | [diff] [blame] | 134 | if (!TextUtils.isEmpty(mUrlFocused.getText())) { |
Michael Kolb | 257cc2c | 2010-12-09 09:45:52 -0800 | [diff] [blame^] | 135 | onAction(mUrlFocused.getText().toString(), null, |
| 136 | UrlInputView.TYPED); |
Michael Kolb | 1ce7813 | 2010-09-23 15:50:53 -0700 | [diff] [blame] | 137 | } |
Michael Kolb | b7b115e | 2010-09-25 16:59:37 -0700 | [diff] [blame] | 138 | } else if (mClearButton == v) { |
| 139 | mUrlFocused.setText(""); |
Michael Kolb | fe25199 | 2010-07-08 15:41:55 -0700 | [diff] [blame] | 140 | } |
| 141 | } |
| 142 | |
Michael Kolb | 3f65c38 | 2010-08-20 15:31:16 -0700 | [diff] [blame] | 143 | int getHeightWithoutProgress() { |
| 144 | return mContainer.getHeight(); |
| 145 | } |
| 146 | |
Michael Kolb | a2b2ba8 | 2010-08-04 17:54:03 -0700 | [diff] [blame] | 147 | @Override |
| 148 | void setFavicon(Bitmap icon) { } |
Michael Kolb | fe25199 | 2010-07-08 15:41:55 -0700 | [diff] [blame] | 149 | |
| 150 | // UrlInputListener implementation |
| 151 | |
| 152 | @Override |
Michael Kolb | 257cc2c | 2010-12-09 09:45:52 -0800 | [diff] [blame^] | 153 | public void onAction(String text, String extra, String source) { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 154 | mUiController.getCurrentTopWebView().requestFocus(); |
| 155 | ((BaseUi) mUiController.getUi()).hideFakeTitleBar(); |
Michael Kolb | fe25199 | 2010-07-08 15:41:55 -0700 | [diff] [blame] | 156 | Intent i = new Intent(); |
| 157 | i.setAction(Intent.ACTION_SEARCH); |
| 158 | i.putExtra(SearchManager.QUERY, text); |
John Reck | 40f720e | 2010-11-10 11:57:04 -0800 | [diff] [blame] | 159 | if (extra != null) { |
| 160 | i.putExtra(SearchManager.EXTRA_DATA_KEY, extra); |
| 161 | } |
Michael Kolb | 257cc2c | 2010-12-09 09:45:52 -0800 | [diff] [blame^] | 162 | if (source != null) { |
| 163 | Bundle appData = new Bundle(); |
| 164 | appData.putString(com.android.common.Search.SOURCE, source); |
| 165 | i.putExtra(SearchManager.APP_DATA, appData); |
| 166 | } |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 167 | mUiController.handleNewIntent(i); |
Michael Kolb | b7b115e | 2010-09-25 16:59:37 -0700 | [diff] [blame] | 168 | setUrlMode(false); |
Michael Kolb | 513286f | 2010-09-09 12:55:12 -0700 | [diff] [blame] | 169 | setDisplayTitle(text); |
Michael Kolb | fe25199 | 2010-07-08 15:41:55 -0700 | [diff] [blame] | 170 | } |
| 171 | |
| 172 | @Override |
| 173 | public void onDismiss() { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 174 | mUiController.getCurrentTopWebView().requestFocus(); |
| 175 | ((BaseUi) mUiController.getUi()).hideFakeTitleBar(); |
Michael Kolb | b7b115e | 2010-09-25 16:59:37 -0700 | [diff] [blame] | 176 | setUrlMode(false); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 177 | setDisplayTitle(mUiController.getCurrentWebView().getUrl()); |
Michael Kolb | 513286f | 2010-09-09 12:55:12 -0700 | [diff] [blame] | 178 | } |
| 179 | |
| 180 | @Override |
| 181 | public void onEdit(String text) { |
Michael Kolb | 7b20ddd | 2010-10-14 15:03:28 -0700 | [diff] [blame] | 182 | setDisplayTitle(text, true); |
Michael Kolb | 513286f | 2010-09-09 12:55:12 -0700 | [diff] [blame] | 183 | if (text != null) { |
| 184 | mUrlFocused.setSelection(text.length()); |
| 185 | } |
| 186 | } |
| 187 | |
Michael Kolb | b7b115e | 2010-09-25 16:59:37 -0700 | [diff] [blame] | 188 | private void setUrlMode(boolean focused) { |
| 189 | swapUrlContainer(focused); |
| 190 | if (focused) { |
Michael Kolb | ba99c5d | 2010-11-29 14:57:41 -0800 | [diff] [blame] | 191 | mUrlFocused.selectAll(); |
| 192 | mUrlFocused.requestFocus(); |
| 193 | mUrlFocused.setDropDownWidth(mUnfocusContainer.getWidth()); |
| 194 | mUrlFocused.setDropDownHorizontalOffset(-mUrlFocused.getLeft()); |
Michael Kolb | b7b115e | 2010-09-25 16:59:37 -0700 | [diff] [blame] | 195 | mSearchButton.setVisibility(View.GONE); |
| 196 | mGoButton.setVisibility(View.VISIBLE); |
| 197 | } else { |
| 198 | mSearchButton.setVisibility(View.VISIBLE); |
| 199 | mGoButton.setVisibility(View.GONE); |
| 200 | } |
| 201 | } |
| 202 | |
Michael Kolb | 513286f | 2010-09-09 12:55:12 -0700 | [diff] [blame] | 203 | private void swapUrlContainer(boolean focus) { |
| 204 | mUnfocusContainer.setVisibility(focus ? View.GONE : View.VISIBLE); |
| 205 | mFocusContainer.setVisibility(focus ? View.VISIBLE : View.GONE); |
Leon Scroggins | 571b376 | 2010-05-26 10:25:01 -0400 | [diff] [blame] | 206 | } |
| 207 | |
Michael Kolb | a2b2ba8 | 2010-08-04 17:54:03 -0700 | [diff] [blame] | 208 | private void search() { |
Michael Kolb | 513286f | 2010-09-09 12:55:12 -0700 | [diff] [blame] | 209 | setDisplayTitle(""); |
Michael Kolb | ffce12c | 2010-12-06 19:05:25 -0800 | [diff] [blame] | 210 | setUrlMode(true); |
Michael Kolb | fe25199 | 2010-07-08 15:41:55 -0700 | [diff] [blame] | 211 | } |
| 212 | |
Michael Kolb | a2b2ba8 | 2010-08-04 17:54:03 -0700 | [diff] [blame] | 213 | private void stopOrRefresh() { |
| 214 | if (mInLoad) { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 215 | mUiController.stopLoading(); |
Michael Kolb | a2b2ba8 | 2010-08-04 17:54:03 -0700 | [diff] [blame] | 216 | } else { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 217 | mUiController.getCurrentTopWebView().reload(); |
Michael Kolb | a2b2ba8 | 2010-08-04 17:54:03 -0700 | [diff] [blame] | 218 | } |
Leon Scroggins | 571b376 | 2010-05-26 10:25:01 -0400 | [diff] [blame] | 219 | } |
| 220 | |
| 221 | /** |
Michael Kolb | fe25199 | 2010-07-08 15:41:55 -0700 | [diff] [blame] | 222 | * Update the progress, from 0 to 100. |
Leon Scroggins | 571b376 | 2010-05-26 10:25:01 -0400 | [diff] [blame] | 223 | */ |
Michael Kolb | fe25199 | 2010-07-08 15:41:55 -0700 | [diff] [blame] | 224 | @Override |
Michael Kolb | a2b2ba8 | 2010-08-04 17:54:03 -0700 | [diff] [blame] | 225 | void setProgress(int newProgress) { |
| 226 | if (newProgress >= PROGRESS_MAX) { |
Michael Kolb | b7b115e | 2010-09-25 16:59:37 -0700 | [diff] [blame] | 227 | mProgressView.setProgress(PageProgressView.MAX_PROGRESS); |
Michael Kolb | a2b2ba8 | 2010-08-04 17:54:03 -0700 | [diff] [blame] | 228 | mProgressView.setVisibility(View.GONE); |
| 229 | mInLoad = false; |
| 230 | mStopButton.setImageDrawable(mReloadDrawable); |
| 231 | } else { |
| 232 | if (!mInLoad) { |
| 233 | mProgressView.setVisibility(View.VISIBLE); |
| 234 | mInLoad = true; |
| 235 | mStopButton.setImageDrawable(mStopDrawable); |
| 236 | } |
Michael Kolb | b7b115e | 2010-09-25 16:59:37 -0700 | [diff] [blame] | 237 | mProgressView.setProgress(newProgress * PageProgressView.MAX_PROGRESS |
| 238 | / PROGRESS_MAX); |
Michael Kolb | a2b2ba8 | 2010-08-04 17:54:03 -0700 | [diff] [blame] | 239 | } |
Michael Kolb | fe25199 | 2010-07-08 15:41:55 -0700 | [diff] [blame] | 240 | } |
| 241 | |
| 242 | @Override |
Leon Scroggins | 571b376 | 2010-05-26 10:25:01 -0400 | [diff] [blame] | 243 | /* package */ void setDisplayTitle(String title) { |
Michael Kolb | 21ce4d2 | 2010-09-15 14:55:05 -0700 | [diff] [blame] | 244 | mUrlFocused.setText(title, false); |
Michael Kolb | 513286f | 2010-09-09 12:55:12 -0700 | [diff] [blame] | 245 | mUrlUnfocused.setText(title); |
Leon Scroggins | 571b376 | 2010-05-26 10:25:01 -0400 | [diff] [blame] | 246 | } |
| 247 | |
Michael Kolb | 7b20ddd | 2010-10-14 15:03:28 -0700 | [diff] [blame] | 248 | void setDisplayTitle(String title, boolean filter) { |
| 249 | mUrlFocused.setText(title, filter); |
| 250 | mUrlUnfocused.setText(title); |
| 251 | } |
| 252 | |
Leon Scroggins | 4cd9779 | 2010-12-03 15:31:56 -0500 | [diff] [blame] | 253 | /** |
| 254 | * Custom CheckBox which does not toggle when pressed. Used by mStar. |
| 255 | */ |
| 256 | public static class CustomCheck extends CheckBox { |
| 257 | public CustomCheck(Context context) { |
| 258 | super(context); |
| 259 | } |
| 260 | |
| 261 | public CustomCheck(Context context, AttributeSet attrs) { |
| 262 | super(context, attrs); |
| 263 | } |
| 264 | |
| 265 | public CustomCheck(Context context, AttributeSet attrs, int defStyle) { |
| 266 | super(context, attrs, defStyle); |
| 267 | } |
| 268 | |
| 269 | @Override |
| 270 | public void toggle() { |
| 271 | // Do nothing |
| 272 | } |
| 273 | } |
Leon Scroggins | 571b376 | 2010-05-26 10:25:01 -0400 | [diff] [blame] | 274 | } |