Commit f7768058 authored by harrisonsean's avatar harrisonsean Committed by Commit Bot

Safety Check iOS: Modify settings_password_check_cell for safety check

The custom cell for password check is similar to the one needed for
safety check.  It is being renamed to settings_check_cell for more
general use.

The main difference is the whether or not an image is used on the
leading side of the cell. This CL adds an optional image to the leading
side of the cell for compatibility with both checks.

Bug: 1078782
Change-Id: I825bdcb53f624ce2e567a68dc900bddc310dc270
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2273162
Commit-Queue: Sean Harrison <harrisonsean@chromium.org>
Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Reviewed-by: default avatarJavier Ernesto Flores Robles <javierrobles@chromium.org>
Cr-Commit-Position: refs/heads/master@{#785836}
parent a7d2baf4
......@@ -14,16 +14,16 @@ source_set("cells") {
"passphrase_error_item.mm",
"search_engine_item.h",
"search_engine_item.mm",
"settings_check_cell.h",
"settings_check_cell.mm",
"settings_check_item.h",
"settings_check_item.mm",
"settings_image_detail_text_cell.h",
"settings_image_detail_text_cell.mm",
"settings_image_detail_text_item.h",
"settings_image_detail_text_item.mm",
"settings_multiline_detail_item.h",
"settings_multiline_detail_item.mm",
"settings_password_check_cell.h",
"settings_password_check_cell.mm",
"settings_password_check_item.h",
"settings_password_check_item.mm",
"settings_switch_cell.h",
"settings_switch_cell.mm",
"settings_switch_item.h",
......@@ -85,8 +85,8 @@ source_set("unit_tests") {
"copied_to_chrome_item_unittest.mm",
"passphrase_error_item_unittest.mm",
"search_engine_item_unittest.mm",
"settings_check_item_unittest.mm",
"settings_multiline_detail_item_unittest.mm",
"settings_password_check_item_unittest.mm",
"version_item_unittest.mm",
]
......
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_CHROME_BROWSER_UI_SETTINGS_CELLS_SETTINGS_CHECK_CELL_H_
#define IOS_CHROME_BROWSER_UI_SETTINGS_CELLS_SETTINGS_CHECK_CELL_H_
#import <UIKit/UIKit.h>
#import "ios/chrome/browser/ui/table_view/cells/table_view_cell.h"
// Cell representation for SettingsCheckItem.
// +---------------------------------------------------------+
// | +--------+ |
// | +--------+ |trailing| |
// | | leading| One line title |image or| |
// | | image | Multiline detail text |spinner | |
// | +--------+ +--------+ |
// +---------------------------------------------------------+
@interface SettingsCheckCell : TableViewCell
// Shows |activityIndicator| and starts animation. It will hide |imageView| if
// it was shown.
- (void)showActivityIndicator;
// Hides |activityIndicator| and stops animation.
- (void)hideActivityIndicator;
// Sets the |trailingImage| and tint |trailingColor| for it that should be
// displayed at the trailing edge of the cell. If set to nil, |trailingImage|
// will be hidden, otherwise |imageView| will be shown and |activityIndicator|
// will be hidden.
- (void)setTrailingImage:(UIImage*)trailingImage
withTintColor:(UIColor*)tintColor;
// Sets the [leadingImage] and tint [leadingColor] for it that should be
// displayed at the leading edge of the cell. If set to nil, the image is
// hidden.
- (void)setLeadingImage:(UIImage*)leadingImage
withTintColor:(UIColor*)tintColor;
@end
#endif // IOS_CHROME_BROWSER_UI_SETTINGS_CELLS_SETTINGS_CHECK_CELL_H_
......@@ -2,15 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_CHROME_BROWSER_UI_SETTINGS_CELLS_SETTINGS_PASSWORD_CHECK_ITEM_H_
#define IOS_CHROME_BROWSER_UI_SETTINGS_CELLS_SETTINGS_PASSWORD_CHECK_ITEM_H_
#ifndef IOS_CHROME_BROWSER_UI_SETTINGS_CELLS_SETTINGS_CHECK_ITEM_H_
#define IOS_CHROME_BROWSER_UI_SETTINGS_CELLS_SETTINGS_CHECK_ITEM_H_
#import <UIKit/UIKit.h>
#import "ios/chrome/browser/ui/table_view/cells/table_view_item.h"
// SettingsSwitchItem is a model class that uses SettingsSwitchCell.
@interface SettingsPasswordCheckItem : TableViewItem
@interface SettingsCheckItem : TableViewItem
// The text to display.
@property(nonatomic, copy) NSString* text;
......@@ -18,14 +18,23 @@
// The detail text string.
@property(nonatomic, copy) NSString* detailText;
// The image to display (required). If this image should be tinted to match the
// text color (e.g. in dark mode), the provided image should have rendering mode
// UIImageRenderingModeAlwaysTemplate. Don't set image with |isIndicatorHidden|
// as only either image or |activityIndicator| will be shown.
@property(nonatomic, strong) UIImage* image;
// The image to display on the leading side of |text| (optional). If this image
// should be tinted to match the text color (e.g. in dark mode), the provided
// image should have rendering mode UIImageRenderingModeAlwaysTemplate.
@property(nonatomic, strong) UIImage* leadingImage;
// Tint color for an image.
@property(nonatomic, copy) UIColor* tintColor;
// Tint color for |leadingImage|.
@property(nonatomic, copy) UIColor* leadingImageTintColor;
// The image to display on the trailing side of |text| (required). If this image
// should be tinted to match the text color (e.g. in dark mode), the provided
// image should have rendering mode UIImageRenderingModeAlwaysTemplate. Don't
// set image with |isIndicatorHidden| as only either image or
// |activityIndicator| will be shown.
@property(nonatomic, strong) UIImage* trailingImage;
// Tint color for |trailingImage|.
@property(nonatomic, copy) UIColor* trailingImageTintColor;
// Controls visibility of |activityIndicator|, if set true |imageView| will be
// hidden and activity indicator will be shown. In case both image is provided
......@@ -33,9 +42,9 @@
@property(nonatomic, assign, getter=isIndicatorHidden) BOOL indicatorHidden;
// Disabled cell are automatically drawn with dimmed text and without
// |imageView| or |activityIndicator|.
// |trailingImage| or |activityIndicator|.
@property(nonatomic, assign, getter=isEnabled) BOOL enabled;
@end
#endif // IOS_CHROME_BROWSER_UI_SETTINGS_CELLS_SETTINGS_PASSWORD_CHECK_ITEM_H_
#endif // IOS_CHROME_BROWSER_UI_SETTINGS_CELLS_SETTINGS_CHECK_ITEM_H_
......@@ -2,9 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import "ios/chrome/browser/ui/settings/cells/settings_password_check_item.h"
#import "ios/chrome/browser/ui/settings/cells/settings_check_item.h"
#import "ios/chrome/browser/ui/settings/cells/settings_password_check_cell.h"
#import "ios/chrome/browser/ui/settings/cells/settings_check_cell.h"
#import "ios/chrome/common/ui/colors/UIColor+cr_semantic_colors.h"
#import "ios/chrome/common/ui/colors/semantic_color_names.h"
......@@ -12,32 +12,37 @@
#error "This file requires ARC support."
#endif
@implementation SettingsPasswordCheckItem
@implementation SettingsCheckItem
- (instancetype)initWithType:(NSInteger)type {
self = [super initWithType:type];
if (self) {
self.cellClass = [SettingsPasswordCheckCell class];
self.cellClass = [SettingsCheckCell class];
}
return self;
}
#pragma mark TableViewItem
- (void)configureCell:(SettingsPasswordCheckCell*)cell
- (void)configureCell:(SettingsCheckCell*)cell
withStyler:(ChromeTableViewStyler*)styler {
[super configureCell:cell withStyler:styler];
cell.textLabel.text = self.text;
cell.detailTextLabel.text = self.detailText;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (self.enabled) {
[cell setIconImage:self.image withTintColor:self.tintColor];
[cell setLeadingImage:self.leadingImage
withTintColor:self.leadingImageTintColor];
[cell setTrailingImage:self.trailingImage
withTintColor:self.trailingImageTintColor];
self.indicatorHidden ? [cell hideActivityIndicator]
: [cell showActivityIndicator];
cell.textLabel.textColor = UIColor.cr_labelColor;
cell.accessibilityTraits &= ~UIAccessibilityTraitNotEnabled;
} else {
[cell setIconImage:nil withTintColor:nil];
[cell setLeadingImage:self.leadingImage
withTintColor:UIColor.cr_secondaryLabelColor];
[cell setTrailingImage:nil withTintColor:nil];
[cell hideActivityIndicator];
cell.textLabel.textColor = UIColor.cr_secondaryLabelColor;
cell.accessibilityTraits |= UIAccessibilityTraitNotEnabled;
......
......@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import "ios/chrome/browser/ui/settings/cells/settings_password_check_item.h"
#import "ios/chrome/browser/ui/settings/cells/settings_check_item.h"
#import "base/mac/foundation_util.h"
#import "ios/chrome/browser/ui/settings/cells/settings_password_check_cell.h"
#import "ios/chrome/browser/ui/settings/cells/settings_check_cell.h"
#import "ios/chrome/browser/ui/table_view/chrome_table_view_styler.h"
#include "testing/gtest/include/gtest/gtest.h"
#import "testing/gtest_mac.h"
......@@ -17,13 +17,12 @@
namespace {
using SettingsPasswordCheckItemTest = PlatformTest;
using SettingsCheckItemTest = PlatformTest;
// Tests that the text and detail text are honoured after a call to
// |configureCell:|.
TEST_F(SettingsPasswordCheckItemTest, ConfigureCell) {
SettingsPasswordCheckItem* item =
[[SettingsPasswordCheckItem alloc] initWithType:0];
TEST_F(SettingsCheckItemTest, ConfigureCell) {
SettingsCheckItem* item = [[SettingsCheckItem alloc] initWithType:0];
NSString* text = @"Test Text";
NSString* detailText = @"Test Detail Text that can span multiple lines. For "
@"example, this line probably fits on three or four "
......@@ -33,16 +32,16 @@ TEST_F(SettingsPasswordCheckItemTest, ConfigureCell) {
item.detailText = detailText;
id cell = [[[item cellClass] alloc] init];
ASSERT_TRUE([cell isMemberOfClass:[SettingsPasswordCheckCell class]]);
ASSERT_TRUE([cell isMemberOfClass:[SettingsCheckCell class]]);
SettingsPasswordCheckCell* passwordCheckCell =
base::mac::ObjCCastStrict<SettingsPasswordCheckCell>(cell);
EXPECT_FALSE(passwordCheckCell.textLabel.text);
EXPECT_FALSE(passwordCheckCell.detailTextLabel.text);
SettingsCheckCell* CheckCell =
base::mac::ObjCCastStrict<SettingsCheckCell>(cell);
EXPECT_FALSE(CheckCell.textLabel.text);
EXPECT_FALSE(CheckCell.detailTextLabel.text);
[item configureCell:cell withStyler:[[ChromeTableViewStyler alloc] init]];
EXPECT_NSEQ(text, passwordCheckCell.textLabel.text);
EXPECT_NSEQ(detailText, passwordCheckCell.detailTextLabel.text);
EXPECT_NSEQ(text, CheckCell.textLabel.text);
EXPECT_NSEQ(detailText, CheckCell.detailTextLabel.text);
}
} // namespace
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_CHROME_BROWSER_UI_SETTINGS_CELLS_SETTINGS_PASSWORD_CHECK_CELL_H_
#define IOS_CHROME_BROWSER_UI_SETTINGS_CELLS_SETTINGS_PASSWORD_CHECK_CELL_H_
#import <UIKit/UIKit.h>
#import "ios/chrome/browser/ui/table_view/cells/table_view_cell.h"
// Cell representation for SettingsPasswordCheckItem.
// +----------------------------------------------+
// | +-------+ |
// | One line title |icon or| |
// | Multiline detail text |spinner| |
// | +-------+ |
// +----------------------------------------------+
@interface SettingsPasswordCheckCell : TableViewCell
// Shows |activityIndicator| and starts animation. It will hide |imageView| if
// it was shown.
- (void)showActivityIndicator;
// Hides |activityIndicator| and stops animation.
- (void)hideActivityIndicator;
// Sets the icon |image| and tint |color| for it that should be displayed at the
// trailing edge of the cell. If set to nil, the icon will be hidden, otherwise
// |imageView| will be shown and |activityIndicator| will be hidden.
- (void)setIconImage:(UIImage*)image withTintColor:(UIColor*)color;
@end
#endif // IOS_CHROME_BROWSER_UI_SETTINGS_CELLS_SETTINGS_PASSWORD_CHECK_CELL_H_
......@@ -41,8 +41,8 @@
#import "ios/chrome/browser/signin/chrome_identity_service_observer_bridge.h"
#include "ios/chrome/browser/system_flags.h"
#import "ios/chrome/browser/ui/settings/cells/settings_cells_constants.h"
#import "ios/chrome/browser/ui/settings/cells/settings_password_check_cell.h"
#import "ios/chrome/browser/ui/settings/cells/settings_password_check_item.h"
#import "ios/chrome/browser/ui/settings/cells/settings_check_cell.h"
#import "ios/chrome/browser/ui/settings/cells/settings_check_item.h"
#import "ios/chrome/browser/ui/settings/cells/settings_switch_cell.h"
#import "ios/chrome/browser/ui/settings/cells/settings_switch_item.h"
#import "ios/chrome/browser/ui/settings/elements/enterprise_info_popover_view_controller.h"
......@@ -190,7 +190,7 @@ std::vector<std::unique_ptr<autofill::PasswordForm>> CopyOf(
// The item related to the enterprise managed save password setting.
TableViewInfoButtonItem* _managedSavePasswordItem;
// The item related to the password check status.
SettingsPasswordCheckItem* _passwordProblemsItem;
SettingsCheckItem* _passwordProblemsItem;
// The button to start password check.
TableViewTextItem* _checkForProblemsItem;
// The item related to the button for exporting passwords.
......@@ -521,10 +521,9 @@ std::vector<std::unique_ptr<autofill::PasswordForm>> CopyOf(
return managedSavePasswordItem;
}
- (SettingsPasswordCheckItem*)passwordProblemsItem {
SettingsPasswordCheckItem* passwordProblemsItem =
[[SettingsPasswordCheckItem alloc]
initWithType:ItemTypePasswordCheckStatus];
- (SettingsCheckItem*)passwordProblemsItem {
SettingsCheckItem* passwordProblemsItem =
[[SettingsCheckItem alloc] initWithType:ItemTypePasswordCheckStatus];
passwordProblemsItem.enabled = NO;
passwordProblemsItem.text = l10n_util::GetNSString(IDS_IOS_CHECK_PASSWORDS);
passwordProblemsItem.detailText =
......@@ -914,7 +913,7 @@ std::vector<std::unique_ptr<autofill::PasswordForm>> CopyOf(
if (!_passwordProblemsItem)
return;
_passwordProblemsItem.image = nil;
_passwordProblemsItem.trailingImage = nil;
_passwordProblemsItem.enabled = YES;
_passwordProblemsItem.indicatorHidden = YES;
_passwordProblemsItem.accessoryType = UITableViewCellAccessoryNone;
......@@ -923,7 +922,7 @@ std::vector<std::unique_ptr<autofill::PasswordForm>> CopyOf(
switch (state) {
case PasswordCheckStateRunning: {
_passwordProblemsItem.image = nil;
_passwordProblemsItem.trailingImage = nil;
_passwordProblemsItem.indicatorHidden = NO;
break;
}
......@@ -936,8 +935,9 @@ std::vector<std::unique_ptr<autofill::PasswordForm>> CopyOf(
l10n_util::GetNSString(IDS_IOS_CHECK_PASSWORDS_UNSAFE_STATE);
UIImage* unSafeIconImage = [[UIImage imageNamed:@"settings_unsafe_state"]
imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
_passwordProblemsItem.image = unSafeIconImage;
_passwordProblemsItem.tintColor = [UIColor colorNamed:kRedColor];
_passwordProblemsItem.trailingImage = unSafeIconImage;
_passwordProblemsItem.trailingImageTintColor =
[UIColor colorNamed:kRedColor];
_passwordProblemsItem.accessoryType =
UITableViewCellAccessoryDisclosureIndicator;
break;
......@@ -947,8 +947,9 @@ std::vector<std::unique_ptr<autofill::PasswordForm>> CopyOf(
imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
_passwordProblemsItem.detailText =
l10n_util::GetNSString(IDS_IOS_CHECK_PASSWORDS_SAFE_STATE);
_passwordProblemsItem.image = safeIconImage;
_passwordProblemsItem.tintColor = [UIColor colorNamed:kGreenColor];
_passwordProblemsItem.trailingImage = safeIconImage;
_passwordProblemsItem.trailingImageTintColor =
[UIColor colorNamed:kGreenColor];
break;
}
case PasswordCheckStateDefault: {
......
......@@ -22,7 +22,7 @@
#include "ios/chrome/browser/passwords/ios_chrome_password_store_factory.h"
#include "ios/chrome/browser/passwords/password_check_observer_bridge.h"
#include "ios/chrome/browser/passwords/save_passwords_consumer.h"
#import "ios/chrome/browser/ui/settings/cells/settings_password_check_item.h"
#import "ios/chrome/browser/ui/settings/cells/settings_check_item.h"
#import "ios/chrome/browser/ui/settings/password/password_details_table_view_controller.h"
#import "ios/chrome/browser/ui/settings/password/passwords_consumer.h"
#import "ios/chrome/browser/ui/table_view/cells/table_view_cells_constants.h"
......@@ -545,11 +545,11 @@ TEST_P(PasswordsTableViewControllerTest, PasswordCheckStateDisabled) {
CheckDetailItemTextWithIds(IDS_IOS_CHECK_PASSWORDS,
IDS_IOS_CHECK_PASSWORDS_DESCRIPTION,
GetSectionIndex(PasswordCheck), 0);
SettingsPasswordCheckItem* checkPassword =
SettingsCheckItem* checkPassword =
GetTableViewItem(GetSectionIndex(PasswordCheck), 0);
EXPECT_FALSE(checkPassword.enabled);
EXPECT_TRUE(checkPassword.indicatorHidden);
EXPECT_FALSE(checkPassword.image);
EXPECT_FALSE(checkPassword.trailingImage);
}
// Test verifies default state of password check cell.
......@@ -564,11 +564,11 @@ TEST_P(PasswordsTableViewControllerTest, PasswordCheckStateDefault) {
CheckDetailItemTextWithIds(IDS_IOS_CHECK_PASSWORDS,
IDS_IOS_CHECK_PASSWORDS_DESCRIPTION,
GetSectionIndex(PasswordCheck), 0);
SettingsPasswordCheckItem* checkPassword =
SettingsCheckItem* checkPassword =
GetTableViewItem(GetSectionIndex(PasswordCheck), 0);
EXPECT_TRUE(checkPassword.enabled);
EXPECT_TRUE(checkPassword.indicatorHidden);
EXPECT_FALSE(checkPassword.image);
EXPECT_FALSE(checkPassword.trailingImage);
}
// Test verifies running state of password check cell.
......@@ -583,11 +583,11 @@ TEST_P(PasswordsTableViewControllerTest, PasswordCheckStateRunning) {
CheckDetailItemTextWithIds(IDS_IOS_CHECK_PASSWORDS,
IDS_IOS_CHECK_PASSWORDS_DESCRIPTION,
GetSectionIndex(PasswordCheck), 0);
SettingsPasswordCheckItem* checkPassword =
SettingsCheckItem* checkPassword =
GetTableViewItem(GetSectionIndex(PasswordCheck), 0);
EXPECT_TRUE(checkPassword.enabled);
EXPECT_FALSE(checkPassword.indicatorHidden);
EXPECT_FALSE(checkPassword.image);
EXPECT_FALSE(checkPassword.trailingImage);
}
// Test verifies tapping start with no saved passwords has no effect.
......
......@@ -12,8 +12,8 @@
#import "ios/chrome/browser/ui/icons/chrome_icon.h"
#import "ios/chrome/browser/ui/settings/cells/account_sign_in_item.h"
#import "ios/chrome/browser/ui/settings/cells/copied_to_chrome_item.h"
#import "ios/chrome/browser/ui/settings/cells/settings_check_item.h"
#import "ios/chrome/browser/ui/settings/cells/settings_image_detail_text_item.h"
#import "ios/chrome/browser/ui/settings/cells/settings_password_check_item.h"
#import "ios/chrome/browser/ui/settings/cells/settings_switch_item.h"
#import "ios/chrome/browser/ui/settings/cells/sync_switch_item.h"
#import "ios/chrome/browser/ui/settings/elements/enterprise_info_popover_view_controller.h"
......@@ -79,9 +79,11 @@ typedef NS_ENUM(NSInteger, ItemType) {
ItemTypeSettingsSyncError,
ItemTypeAutofillData,
ItemTypeAccount,
ItemTypePasswordCheck1,
ItemTypePasswordCheck2,
ItemTypePasswordCheck3,
ItemTypeCheck1,
ItemTypeCheck2,
ItemTypeCheck3,
ItemTypeCheck4,
ItemTypeCheck5,
};
}
......@@ -391,38 +393,65 @@ typedef NS_ENUM(NSInteger, ItemType) {
[model addItem:imageDetailTextItem
toSectionWithIdentifier:SectionIdentifierSettings];
SettingsPasswordCheckItem* checkPasswordsInProcess =
[[SettingsPasswordCheckItem alloc] initWithType:ItemTypePasswordCheck1];
checkPasswordsInProcess.text = @"This is running password check item";
checkPasswordsInProcess.detailText =
@"This is very long description of password check item. Another line of "
SettingsCheckItem* checkInProcess =
[[SettingsCheckItem alloc] initWithType:ItemTypeCheck1];
checkInProcess.text = @"This is running check item";
checkInProcess.detailText =
@"This is very long description of check item. Another line of "
@"description.";
checkPasswordsInProcess.enabled = YES;
checkPasswordsInProcess.indicatorHidden = NO;
[model addItem:checkPasswordsInProcess
checkInProcess.enabled = YES;
checkInProcess.indicatorHidden = NO;
[model addItem:checkInProcess
toSectionWithIdentifier:SectionIdentifierSettings];
SettingsPasswordCheckItem* checkPasswordsFinished =
[[SettingsPasswordCheckItem alloc] initWithType:ItemTypePasswordCheck2];
checkPasswordsFinished.text = @"This is finished password check item";
checkPasswordsFinished.detailText =
@"This is very long description of password check item. Another line of "
SettingsCheckItem* checkFinished =
[[SettingsCheckItem alloc] initWithType:ItemTypeCheck2];
checkFinished.text = @"This is finished check item";
checkFinished.detailText =
@"This is very long description of check item. Another line of "
@"description.";
checkPasswordsFinished.enabled = YES;
checkPasswordsFinished.indicatorHidden = YES;
checkPasswordsFinished.image = [[ChromeIcon infoIcon]
checkFinished.enabled = YES;
checkFinished.indicatorHidden = YES;
checkFinished.trailingImage = [[ChromeIcon infoIcon]
imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[model addItem:checkPasswordsFinished
[model addItem:checkFinished
toSectionWithIdentifier:SectionIdentifierSettings];
SettingsPasswordCheckItem* checkPasswordsDisabled =
[[SettingsPasswordCheckItem alloc] initWithType:ItemTypePasswordCheck3];
checkPasswordsDisabled.text = @"This is disabled password check item";
checkPasswordsDisabled.detailText =
@"This is very long description of password check item. Another line of "
SettingsCheckItem* checkFinishedWithLeadingImage =
[[SettingsCheckItem alloc] initWithType:ItemTypeCheck3];
checkFinishedWithLeadingImage.text = @"Check item leading image";
checkFinishedWithLeadingImage.detailText =
@"This is very long description of check item. Another line of "
@"description.";
checkPasswordsDisabled.enabled = NO;
[model addItem:checkPasswordsDisabled
checkFinishedWithLeadingImage.leadingImage = [[ChromeIcon infoIcon]
imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
checkFinishedWithLeadingImage.enabled = YES;
checkFinishedWithLeadingImage.indicatorHidden = NO;
checkFinishedWithLeadingImage.trailingImage = [[ChromeIcon infoIcon]
imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[model addItem:checkFinishedWithLeadingImage
toSectionWithIdentifier:SectionIdentifierSettings];
SettingsCheckItem* checkDisabled =
[[SettingsCheckItem alloc] initWithType:ItemTypeCheck4];
checkDisabled.text = @"This is disabled check item";
checkDisabled.detailText =
@"This is very long description of check item. Another line of "
@"description.";
checkDisabled.enabled = NO;
[model addItem:checkDisabled
toSectionWithIdentifier:SectionIdentifierSettings];
SettingsCheckItem* checkDisabledWithLeadingImage =
[[SettingsCheckItem alloc] initWithType:ItemTypeCheck5];
checkDisabledWithLeadingImage.text = @"Disabled check item leading image";
checkDisabledWithLeadingImage.detailText =
@"This is very long description of check item. Another line of "
@"description.";
checkDisabledWithLeadingImage.leadingImage = [[ChromeIcon infoIcon]
imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
checkDisabledWithLeadingImage.enabled = NO;
[model addItem:checkDisabledWithLeadingImage
toSectionWithIdentifier:SectionIdentifierSettings];
TableViewLinkHeaderFooterItem* linkFooter =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment