| 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.enhancedbookmarks; | 5 package org.chromium.chrome.browser.enhancedbookmarks; |
| 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.widget.RelativeLayout; | 10 import android.widget.RelativeLayout; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 emptyView.setText(OfflinePageBridge.isEnabled() | 48 emptyView.setText(OfflinePageBridge.isEnabled() |
| 49 ? R.string.offline_pages_folder_empty : R.string.bookmarks_folde
r_empty); | 49 ? R.string.offline_pages_folder_empty : R.string.bookmarks_folde
r_empty); |
| 50 mItemsContainer.setEmptyView(emptyView); | 50 mItemsContainer.setEmptyView(emptyView); |
| 51 mActionBar = (EnhancedBookmarkActionBar) findViewById(R.id.eb_action_bar
); | 51 mActionBar = (EnhancedBookmarkActionBar) findViewById(R.id.eb_action_bar
); |
| 52 mLoadingView = (LoadingView) findViewById(R.id.eb_initial_loading_view); | 52 mLoadingView = (LoadingView) findViewById(R.id.eb_initial_loading_view); |
| 53 FadingShadowView shadow = (FadingShadowView) findViewById(R.id.shadow); | 53 FadingShadowView shadow = (FadingShadowView) findViewById(R.id.shadow); |
| 54 if (DeviceFormFactor.isLargeTablet(getContext())) { | 54 if (DeviceFormFactor.isLargeTablet(getContext())) { |
| 55 shadow.setVisibility(View.GONE); | 55 shadow.setVisibility(View.GONE); |
| 56 } else { | 56 } else { |
| 57 shadow.init(ApiCompatibilityUtils.getColor(getResources(), | 57 shadow.init(ApiCompatibilityUtils.getColor(getResources(), |
| 58 R.color.enhanced_bookmark_app_bar_shadow_color), | 58 R.color.enhanced_bookmark_app_bar_shadow_color), FadingShado
w.POSITION_TOP); |
| 59 FadingShadow.POSITION_TOP); | |
| 60 shadow.setStrength(1.0f); | |
| 61 } | 59 } |
| 62 } | 60 } |
| 63 | 61 |
| 64 /** | 62 /** |
| 65 * Handles the event when user clicks back button and the UI is in selection
mode. | 63 * Handles the event when user clicks back button and the UI is in selection
mode. |
| 66 * @return True if there are selected bookmarks, and the back button is proc
essed by this | 64 * @return True if there are selected bookmarks, and the back button is proc
essed by this |
| 67 * method. False otherwise. | 65 * method. False otherwise. |
| 68 */ | 66 */ |
| 69 boolean onBackPressed() { | 67 boolean onBackPressed() { |
| 70 if (mDelegate != null && mDelegate.isSelectionEnabled()) { | 68 if (mDelegate != null && mDelegate.isSelectionEnabled()) { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 104 |
| 107 @Override | 105 @Override |
| 108 public void onFilterStateSet(EnhancedBookmarkFilter filter) { | 106 public void onFilterStateSet(EnhancedBookmarkFilter filter) { |
| 109 mLoadingView.hideLoadingUI(); | 107 mLoadingView.hideLoadingUI(); |
| 110 } | 108 } |
| 111 | 109 |
| 112 @Override | 110 @Override |
| 113 public void onSelectionStateChange(List<BookmarkId> selectedBookmarks) { | 111 public void onSelectionStateChange(List<BookmarkId> selectedBookmarks) { |
| 114 } | 112 } |
| 115 } | 113 } |
| OLD | NEW |