OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef IOS_CHROME_BROWSER_UI_COLLECTION_VIEW_CELLS_COLLECTION_VIEW_SWITCH_ITEM_
H_ |
| 6 #define IOS_CHROME_BROWSER_UI_COLLECTION_VIEW_CELLS_COLLECTION_VIEW_SWITCH_ITEM_
H_ |
| 7 |
| 8 #import <UIKit/UIKit.h> |
| 9 |
| 10 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h" |
| 11 #import "ios/third_party/material_components_ios/src/components/CollectionCells/
src/MaterialCollectionCells.h" |
| 12 |
| 13 // CollectionViewSwitchItem is the model class corresponding to |
| 14 // CollectionViewSwitchCell. |
| 15 @interface CollectionViewSwitchItem : CollectionViewItem |
| 16 |
| 17 // The text to display. |
| 18 @property(nonatomic, copy) NSString* text; |
| 19 |
| 20 // The current state of the switch. |
| 21 @property(nonatomic, assign, getter=isOn) BOOL on; |
| 22 |
| 23 // Whether or not the switch is enabled. Disabled switches are automatically |
| 24 // drawn as in the "off" state, with dimmed text. |
| 25 @property(nonatomic, assign, getter=isEnabled) BOOL enabled; |
| 26 |
| 27 @end |
| 28 |
| 29 // CollectionViewSwitchCell implements a UICollectionViewCell subclass |
| 30 // containing a text label and a switch. |
| 31 @interface CollectionViewSwitchCell : MDCCollectionViewCell |
| 32 |
| 33 // UILabel corresponding to |text| from the item. |
| 34 @property(nonatomic, readonly, strong) UILabel* textLabel; |
| 35 |
| 36 // The switch view. |
| 37 @property(nonatomic, readonly, strong) UISwitch* switchView; |
| 38 |
| 39 // Returns the default text color used for the given |state|. |
| 40 + (UIColor*)defaultTextColorForState:(UIControlState)state; |
| 41 |
| 42 @end |
| 43 |
| 44 #endif // IOS_CHROME_BROWSER_UI_COLLECTION_VIEW_CELLS_COLLECTION_VIEW_SWITCH_IT
EM_H_ |
OLD | NEW |