OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.chrome.browser.bookmarks; | 5 package org.chromium.chrome.browser.bookmarks; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.util.AttributeSet; | 8 import android.util.AttributeSet; |
9 import android.view.View; | 9 import android.view.View; |
10 import android.view.ViewGroup; | 10 import android.view.ViewGroup; |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 mMoreIcon.setVisibility(VISIBLE); | 183 mMoreIcon.setVisibility(VISIBLE); |
184 mMoreIcon.setOnClickListener(new OnClickListener() { | 184 mMoreIcon.setOnClickListener(new OnClickListener() { |
185 @Override | 185 @Override |
186 public void onClick(View view) { | 186 public void onClick(View view) { |
187 showMenu(view); | 187 showMenu(view); |
188 } | 188 } |
189 }); | 189 }); |
190 } | 190 } |
191 | 191 |
192 // TODO(twellington): remove this after the bookmarks 720dp layout is re
styled | 192 // TODO(twellington): remove this after the bookmarks 720dp layout is re
styled |
193 // to match the < 720dp style and BookmarkSearchView
is refactored. | 193 // to match the < 720dp style. |
194 // Currently BookmarkSearchRow extends BookmarkRow bu
t is not selectable. | 194 mShouldUseListItemBackground = !DeviceFormFactor.isLargeTablet(getContex
t()); |
195 mShouldUseListItemBackground = | |
196 isSelectable() && !DeviceFormFactor.isLargeTablet(getContext()); | |
197 | 195 |
198 // TODO(twellington): Replace this with a MarginResizer after the bookma
rks layout is width | 196 // TODO(twellington): Replace this with a MarginResizer after the bookma
rks layout is width |
199 // constrained to 600dp. | 197 // constrained to 600dp. |
200 if (mShouldUseListItemBackground) { | 198 if (mShouldUseListItemBackground) { |
201 setLateralMarginsForDefaultDisplay(findViewById(R.id.bookmark_row)); | 199 setLateralMarginsForDefaultDisplay(findViewById(R.id.bookmark_row)); |
202 } | 200 } |
203 } | 201 } |
204 | 202 |
205 @Override | 203 @Override |
206 protected void onAttachedToWindow() { | 204 protected void onAttachedToWindow() { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 mDelegate = delegate; | 254 mDelegate = delegate; |
257 if (mIsAttachedToWindow) initialize(); | 255 if (mIsAttachedToWindow) initialize(); |
258 } | 256 } |
259 | 257 |
260 @Override | 258 @Override |
261 public void onDestroy() { | 259 public void onDestroy() { |
262 cleanup(); | 260 cleanup(); |
263 } | 261 } |
264 | 262 |
265 @Override | 263 @Override |
266 public void onFolderStateSet(BookmarkId folder) { | 264 public void onFolderStateSet(BookmarkId folder) {} |
267 } | 265 |
| 266 @Override |
| 267 public void onSearchStateSet() {} |
268 | 268 |
269 @Override | 269 @Override |
270 public void setBackgroundResourceForGroupPosition( | 270 public void setBackgroundResourceForGroupPosition( |
271 boolean isFirstInGroup, boolean isLastInGroup) { | 271 boolean isFirstInGroup, boolean isLastInGroup) { |
272 if (!mShouldUseListItemBackground) return; | 272 if (!mShouldUseListItemBackground) return; |
273 super.setBackgroundResourceForGroupPosition(isFirstInGroup, isLastInGrou
p); | 273 super.setBackgroundResourceForGroupPosition(isFirstInGroup, isLastInGrou
p); |
274 } | 274 } |
275 } | 275 } |
OLD | NEW |