disclosureIndicator in same color as Section titles, blue
This commit is contained in:
parent
ecf0235778
commit
6896902f1d
|
@ -252,6 +252,7 @@
|
|||
F870D3EE2513B786008967B0 /* Trace.swift in Sources */ = {isa = PBXBuildFile; fileRef = F870D3ED2513B786008967B0 /* Trace.swift */; };
|
||||
F8797CEA255B43960033956B /* GlucoseData+Smoothable.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8797CE9255B43960033956B /* GlucoseData+Smoothable.swift */; };
|
||||
F889CB6F236D84AC00A81068 /* M5StackView.strings in Resources */ = {isa = PBXBuildFile; fileRef = F889CB71236D84AC00A81068 /* M5StackView.strings */; };
|
||||
F88EC27025FEB8B900DF0EAF /* DTCustomColoredAccessory.m in Sources */ = {isa = PBXBuildFile; fileRef = F88EC26E25FEB8B800DF0EAF /* DTCustomColoredAccessory.m */; };
|
||||
F890E07A247687AE008FB2EC /* URL.swift in Sources */ = {isa = PBXBuildFile; fileRef = F890E079247687AE008FB2EC /* URL.swift */; };
|
||||
F897AAF92200F2D200CDDD10 /* CBPeripheralState.swift in Sources */ = {isa = PBXBuildFile; fileRef = F897AAF82200F2D200CDDD10 /* CBPeripheralState.swift */; };
|
||||
F897AAFB2201018800CDDD10 /* String.swift in Sources */ = {isa = PBXBuildFile; fileRef = F897AAFA2201018800CDDD10 /* String.swift */; };
|
||||
|
@ -989,6 +990,8 @@
|
|||
F88EC12325F6CFB200DF0EAF /* sl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sl; path = sl.lproj/SettingsViews.strings; sourceTree = "<group>"; };
|
||||
F88EC12425F6CFC200DF0EAF /* fi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fi; path = fi.lproj/WatlaaView.strings; sourceTree = "<group>"; };
|
||||
F88EC12525F6CFC500DF0EAF /* sl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sl; path = sl.lproj/WatlaaView.strings; sourceTree = "<group>"; };
|
||||
F88EC26E25FEB8B800DF0EAF /* DTCustomColoredAccessory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DTCustomColoredAccessory.m; sourceTree = "<group>"; };
|
||||
F88EC26F25FEB8B800DF0EAF /* DTCustomColoredAccessory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DTCustomColoredAccessory.h; sourceTree = "<group>"; };
|
||||
F890E079247687AE008FB2EC /* URL.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URL.swift; sourceTree = "<group>"; };
|
||||
F897AAF82200F2D200CDDD10 /* CBPeripheralState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CBPeripheralState.swift; sourceTree = "<group>"; };
|
||||
F897AAFA2201018800CDDD10 /* String.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = String.swift; sourceTree = "<group>"; };
|
||||
|
@ -1823,6 +1826,15 @@
|
|||
path = Texts;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F88EC26D25FEB7F900DF0EAF /* CustomColoredDisclosureIndicator */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F88EC26F25FEB8B800DF0EAF /* DTCustomColoredAccessory.h */,
|
||||
F88EC26E25FEB8B800DF0EAF /* DTCustomColoredAccessory.m */,
|
||||
);
|
||||
path = CustomColoredDisclosureIndicator;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F8A2BBFB25D9D36C001D1E78 /* Atom */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
|
@ -2364,6 +2376,7 @@
|
|||
F8EA6C8021B723A80082976B /* Utilities */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F88EC26D25FEB7F900DF0EAF /* CustomColoredDisclosureIndicator */,
|
||||
F8AF11F624B1E6D700AE5BA2 /* Errors */,
|
||||
F85FF38F25288860004E6FF1 /* HouseKeeping */,
|
||||
F8F7B8EE259A84A300C47B04 /* KalmanFilter */,
|
||||
|
@ -3366,6 +3379,7 @@
|
|||
F8A389E7232ECE7E0010F405 /* SettingsViewUtilities.swift in Sources */,
|
||||
F8A2BC3125DB0D6D001D1E78 /* BluetoothPeripheralManager+M5StackBluetoothTransmitterDelegate.swift in Sources */,
|
||||
F8A2BC2D25DB0D6D001D1E78 /* BluetoothPeripheralManager+CGMG5TransmitterDelegate.swift in Sources */,
|
||||
F88EC27025FEB8B900DF0EAF /* DTCustomColoredAccessory.m in Sources */,
|
||||
F8B3A7DF226E48C1004BA588 /* SoundPlayer.swift in Sources */,
|
||||
F816E12C2439DFBA009EE65B /* DexcomG4+CoreDataProperties.swift in Sources */,
|
||||
F8A2BC3425DB0D6D001D1E78 /* BluetoothPeripheralManager+WatlaaBluetoothTransmitterDelegate.swift in Sources */,
|
||||
|
|
|
@ -9,4 +9,7 @@ enum ConstantsUI {
|
|||
/// color to use as background when a row is selected
|
||||
static let tableRowSelectedBackGroundColor = UIColor.systemBlue
|
||||
|
||||
/// color to use for disclosure indicator in settings views
|
||||
static let disclosureIndicatorColor = UIColor.systemBlue
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,110 @@
|
|||
//
|
||||
// DTCustomColoredAccessory.h
|
||||
// DTFoundation
|
||||
//
|
||||
// Created by Oliver Drobnik on 2/10/12.
|
||||
// Copyright (c) 2012 Cocoanetics. All rights reserved.
|
||||
//
|
||||
//https://github.com/Cocoanetics/DTFoundation
|
||||
|
||||
#import <Availability.h>
|
||||
#import <TargetConditionals.h>
|
||||
|
||||
#if TARGET_OS_IPHONE && !TARGET_OS_WATCH
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
/**
|
||||
Constant used by DTCustomColoredAccessory to specify the type of accessory.
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, DTCustomColoredAccessoryType)
|
||||
{
|
||||
/**
|
||||
An accessoring pointing to the right side
|
||||
*/
|
||||
DTCustomColoredAccessoryTypeRight = 0,
|
||||
|
||||
/**
|
||||
An accessoring pointing to the left side
|
||||
*/
|
||||
DTCustomColoredAccessoryTypeLeft,
|
||||
|
||||
/**
|
||||
An accessoring pointing upwards
|
||||
*/
|
||||
DTCustomColoredAccessoryTypeUp,
|
||||
|
||||
/**
|
||||
An accessoring pointing downwards
|
||||
*/
|
||||
DTCustomColoredAccessoryTypeDown,
|
||||
|
||||
/**
|
||||
A front square drawn on top of a back square with the back square offset up and to the right
|
||||
*/
|
||||
DTCustomColoredAccessoryTypeSquare
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
An accessory control that can be used instead of the standard disclosure indicator in a `UITableView`. See the DTCustomColoredAccessoryType for supported styles.
|
||||
*/
|
||||
|
||||
@interface DTCustomColoredAccessory : UIControl
|
||||
|
||||
/**-------------------------------------------------------------------------------------
|
||||
@name Creating A Custom-Colored Accessory
|
||||
---------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
Creates a custom-colored right disclosure indicator accessory with a given color
|
||||
@param color The color to use
|
||||
*/
|
||||
+ (DTCustomColoredAccessory *)accessoryWithColor:(UIColor *)color;
|
||||
|
||||
/**
|
||||
Creates a custom-colored accessory with a given color and type
|
||||
@param color The color to use
|
||||
@param type The DTCustomColoredAccessoryType to use
|
||||
*/
|
||||
+ (DTCustomColoredAccessory *)accessoryWithColor:(UIColor *)color type:(DTCustomColoredAccessoryType)type;
|
||||
|
||||
/**
|
||||
Creates a custom-colored square on top of a square with offset
|
||||
@param color The color to use
|
||||
@param backgroundColor The backgroundColor to use
|
||||
*/
|
||||
+ (DTCustomColoredAccessory *)squareAccessoryWithColor:(UIColor *)color backgroundColor:(UIColor *)backgroundColor;
|
||||
|
||||
/**-------------------------------------------------------------------------------------
|
||||
@name Properties
|
||||
---------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
The color to draw the accessory in
|
||||
*/
|
||||
@property (nonatomic, retain) UIColor *accessoryColor;
|
||||
|
||||
/**
|
||||
The color to draw the accessory in while highlighted
|
||||
*/
|
||||
@property (nonatomic, retain) UIColor *highlightedColor;
|
||||
/**
|
||||
The color to draw the front square of the square accessory in while not highlighted
|
||||
*/
|
||||
@property (nonatomic, retain) UIColor *frontSquareAccessoryColor;
|
||||
/**
|
||||
The color to draw the back square of the square accessory in while not highlighted
|
||||
*/
|
||||
@property (nonatomic, retain) UIColor *backSquareAccessoryColor;
|
||||
|
||||
/**
|
||||
The DTCustomColoredAccessoryType of the accessory.
|
||||
*/
|
||||
@property (nonatomic, assign) DTCustomColoredAccessoryType type;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
|
@ -0,0 +1,243 @@
|
|||
//
|
||||
// DTCustomColoredAccessory.m
|
||||
// DTFoundation
|
||||
//
|
||||
// Created by Oliver Drobnik on 2/10/12.
|
||||
// Copyright (c) 2012 Cocoanetics. All rights reserved.
|
||||
//
|
||||
//https://github.com/Cocoanetics/DTFoundation
|
||||
|
||||
#import "DTCustomColoredAccessory.h"
|
||||
|
||||
#if TARGET_OS_IPHONE && !TARGET_OS_WATCH
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@implementation DTCustomColoredAccessory
|
||||
{
|
||||
UIColor *_accessoryColor;
|
||||
UIColor *_highlightedColor;
|
||||
|
||||
DTCustomColoredAccessoryType _type;
|
||||
}
|
||||
|
||||
#pragma mark - Creating A Custom-Colored Accessory
|
||||
|
||||
+ (DTCustomColoredAccessory *)accessoryWithColor:(UIColor *)color
|
||||
{
|
||||
return [self accessoryWithColor:color type:DTCustomColoredAccessoryTypeRight];
|
||||
}
|
||||
|
||||
+ (DTCustomColoredAccessory *)accessoryWithColor:(UIColor *)color type:(DTCustomColoredAccessoryType)type
|
||||
{
|
||||
DTCustomColoredAccessory *ret = [[DTCustomColoredAccessory alloc] initWithFrame:CGRectMake(0, 0, 15.0, 15.0)];
|
||||
ret.accessoryColor = color;
|
||||
ret.frontSquareAccessoryColor = color;
|
||||
ret.type = type;
|
||||
ret.backSquareAccessoryColor = color == [UIColor blackColor] ? [UIColor whiteColor] : [UIColor blackColor];
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
+ (DTCustomColoredAccessory *)squareAccessoryWithColor:(UIColor *)color backgroundColor:(UIColor *)backgroundColor
|
||||
{
|
||||
DTCustomColoredAccessory *ret = [[DTCustomColoredAccessory alloc] initWithFrame:CGRectMake(0, 0, 15.0, 15.0)];
|
||||
ret.accessoryColor = color;
|
||||
ret.frontSquareAccessoryColor = color;
|
||||
ret.type = DTCustomColoredAccessoryTypeSquare;
|
||||
ret.backSquareAccessoryColor = backgroundColor;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#pragma mark - Internal Methods
|
||||
|
||||
- (id)initWithFrame:(CGRect)frame
|
||||
{
|
||||
if ((self = [super initWithFrame:frame]))
|
||||
{
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)drawRect:(CGRect)rect
|
||||
{
|
||||
CGContextRef ctxt = UIGraphicsGetCurrentContext();
|
||||
|
||||
const CGFloat R = 4.5;
|
||||
|
||||
BOOL doFinal = true;
|
||||
|
||||
switch (_type)
|
||||
{
|
||||
case DTCustomColoredAccessoryTypeRight:
|
||||
{
|
||||
// (x,y) is the tip of the arrow
|
||||
CGFloat x = CGRectGetMaxX(self.bounds)-3.0;;
|
||||
CGFloat y = CGRectGetMidY(self.bounds);
|
||||
|
||||
CGContextMoveToPoint(ctxt, x-R, y-R);
|
||||
CGContextAddLineToPoint(ctxt, x, y);
|
||||
CGContextAddLineToPoint(ctxt, x-R, y+R);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case DTCustomColoredAccessoryTypeLeft:
|
||||
{
|
||||
// (x,y) is the tip of the arrow
|
||||
CGFloat x = CGRectGetMaxX(self.bounds)-10.0;;
|
||||
CGFloat y = CGRectGetMidY(self.bounds);
|
||||
|
||||
CGContextMoveToPoint(ctxt, x+R, y+R);
|
||||
CGContextAddLineToPoint(ctxt, x, y);
|
||||
CGContextAddLineToPoint(ctxt, x+R, y-R);
|
||||
break;
|
||||
}
|
||||
|
||||
case DTCustomColoredAccessoryTypeUp:
|
||||
{
|
||||
// (x,y) is the tip of the arrow
|
||||
CGFloat x = CGRectGetMaxX(self.bounds)-7.0;;
|
||||
CGFloat y = CGRectGetMinY(self.bounds)+5.0;
|
||||
|
||||
CGContextMoveToPoint(ctxt, x-R, y+R);
|
||||
CGContextAddLineToPoint(ctxt, x, y);
|
||||
CGContextAddLineToPoint(ctxt, x+R, y+R);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case DTCustomColoredAccessoryTypeDown:
|
||||
{
|
||||
// (x,y) is the tip of the arrow
|
||||
CGFloat x = CGRectGetMaxX(self.bounds)-7.0;;
|
||||
CGFloat y = CGRectGetMaxY(self.bounds)-5.0;
|
||||
|
||||
CGContextMoveToPoint(ctxt, x-R, y-R);
|
||||
CGContextAddLineToPoint(ctxt, x, y);
|
||||
CGContextAddLineToPoint(ctxt, x+R, y-R);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case DTCustomColoredAccessoryTypeSquare:
|
||||
{
|
||||
doFinal = false;
|
||||
|
||||
// (x,y) is the tip of the arrow
|
||||
CGFloat x = CGRectGetMinX(self.bounds)+5.0;
|
||||
CGFloat y = CGRectGetMinY(self.bounds)+1.0;
|
||||
|
||||
CGFloat s = 9.0;
|
||||
|
||||
CGContextMoveToPoint(ctxt, x, y);
|
||||
CGContextAddLineToPoint(ctxt, x+s, y);
|
||||
CGContextAddLineToPoint(ctxt, x+s, y+s);
|
||||
CGContextAddLineToPoint(ctxt, x, y+s);
|
||||
CGContextClosePath(ctxt);
|
||||
|
||||
CGContextSetLineCap(ctxt, kCGLineCapSquare);
|
||||
CGContextSetLineJoin(ctxt, kCGLineJoinMiter);
|
||||
CGContextSetLineWidth(ctxt, 3);
|
||||
|
||||
if (self.highlighted)
|
||||
{
|
||||
[self.highlightedColor setStroke];
|
||||
}
|
||||
else
|
||||
{
|
||||
_accessoryColor = self.backSquareAccessoryColor;
|
||||
[self.accessoryColor setStroke];
|
||||
}
|
||||
|
||||
CGContextStrokePath(ctxt);
|
||||
|
||||
x = CGRectGetMinX(self.bounds)+3.0;
|
||||
y = CGRectGetMinY(self.bounds)+3.0;
|
||||
|
||||
CGContextMoveToPoint(ctxt, x, y);
|
||||
CGContextAddLineToPoint(ctxt, x+s, y);
|
||||
CGContextAddLineToPoint(ctxt, x+s, y+s);
|
||||
CGContextAddLineToPoint(ctxt, x, y+s);
|
||||
CGContextClosePath(ctxt);
|
||||
|
||||
CGContextSetLineCap(ctxt, kCGLineCapSquare);
|
||||
CGContextSetLineJoin(ctxt, kCGLineJoinMiter);
|
||||
CGContextSetLineWidth(ctxt, 3);
|
||||
|
||||
if (self.highlighted)
|
||||
{
|
||||
[self.highlightedColor setStroke];
|
||||
}
|
||||
else
|
||||
{
|
||||
_accessoryColor = self.frontSquareAccessoryColor;
|
||||
[self.accessoryColor setStroke];
|
||||
}
|
||||
|
||||
CGContextStrokePath(ctxt);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (doFinal)
|
||||
{
|
||||
CGContextSetLineCap(ctxt, kCGLineCapSquare);
|
||||
CGContextSetLineJoin(ctxt, kCGLineJoinMiter);
|
||||
CGContextSetLineWidth(ctxt, 3);
|
||||
|
||||
if (self.highlighted)
|
||||
{
|
||||
[self.highlightedColor setStroke];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self.accessoryColor setStroke];
|
||||
}
|
||||
|
||||
CGContextStrokePath(ctxt);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Properties
|
||||
|
||||
- (void)setHighlighted:(BOOL)highlighted
|
||||
{
|
||||
[super setHighlighted:highlighted];
|
||||
|
||||
[self setNeedsDisplay];
|
||||
}
|
||||
|
||||
- (UIColor *)accessoryColor
|
||||
{
|
||||
if (!_accessoryColor)
|
||||
{
|
||||
return [UIColor blackColor];
|
||||
}
|
||||
|
||||
return _accessoryColor;
|
||||
}
|
||||
|
||||
- (UIColor *)highlightedColor
|
||||
{
|
||||
if (!_highlightedColor)
|
||||
{
|
||||
return [UIColor whiteColor];
|
||||
}
|
||||
|
||||
return _highlightedColor;
|
||||
}
|
||||
|
||||
@synthesize accessoryColor = _accessoryColor;
|
||||
@synthesize highlightedColor = _highlightedColor;
|
||||
@synthesize type = _type;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
|
@ -832,6 +832,10 @@ extension BluetoothPeripheralViewController: UITableViewDataSource, UITableViewD
|
|||
// default value for accessoryView is nil
|
||||
cell.accessoryView = nil
|
||||
|
||||
// create disclosureIndicator in color ConstantsUI.disclosureIndicatorColor
|
||||
// will be used whenever accessoryType is to be set to disclosureIndicator
|
||||
let disclosureAaccessoryView = DTCustomColoredAccessory(color: ConstantsUI.disclosureIndicatorColor)
|
||||
|
||||
//it's a Setting defined here in BluetoothPeripheralViewController
|
||||
// is it a bluetooth setting or web oop setting ?
|
||||
|
||||
|
@ -858,6 +862,7 @@ extension BluetoothPeripheralViewController: UITableViewDataSource, UITableViewD
|
|||
cell.accessoryType = .none
|
||||
} else {
|
||||
cell.accessoryType = .disclosureIndicator
|
||||
cell.accessoryView = disclosureAaccessoryView
|
||||
}
|
||||
|
||||
case .connectionStatus:
|
||||
|
@ -874,6 +879,7 @@ extension BluetoothPeripheralViewController: UITableViewDataSource, UITableViewD
|
|||
cell.accessoryType = .none
|
||||
} else {
|
||||
cell.accessoryType = .disclosureIndicator
|
||||
cell.accessoryView = disclosureAaccessoryView
|
||||
}
|
||||
|
||||
case .transmitterId:
|
||||
|
@ -883,6 +889,9 @@ extension BluetoothPeripheralViewController: UITableViewDataSource, UITableViewD
|
|||
|
||||
// if transmitterId already has a value, then it can't be changed anymore. To change it, user must delete the transmitter and recreate one.
|
||||
cell.accessoryType = transmitterIdTempValue == nil ? .disclosureIndicator : .none
|
||||
if (transmitterIdTempValue == nil) {
|
||||
cell.accessoryView = disclosureAaccessoryView
|
||||
}
|
||||
|
||||
case .connectOrDisconnectTimeStamp:
|
||||
|
||||
|
|
|
@ -119,6 +119,10 @@ extension AtomBluetoothPeripheralViewModel: BluetoothPeripheralViewModel {
|
|||
// default value for accessoryView is nil
|
||||
cell.accessoryView = nil
|
||||
|
||||
// create disclosureIndicator in color ConstantsUI.disclosureIndicatorColor
|
||||
// will be used whenever accessoryType is to be set to disclosureIndicator
|
||||
let disclosureAaccessoryView = DTCustomColoredAccessory(color: ConstantsUI.disclosureIndicatorColor)
|
||||
|
||||
guard let setting = Settings(rawValue: rawValue) else { fatalError("AtomBluetoothPeripheralViewModel update, unexpected setting") }
|
||||
|
||||
switch setting {
|
||||
|
@ -161,18 +165,21 @@ extension AtomBluetoothPeripheralViewModel: BluetoothPeripheralViewModel {
|
|||
cell.textLabel?.text = Texts_Common.firmware
|
||||
cell.detailTextLabel?.text = atom.firmware
|
||||
cell.accessoryType = .disclosureIndicator
|
||||
cell.accessoryView = disclosureAaccessoryView
|
||||
|
||||
case .hardWare:
|
||||
|
||||
cell.textLabel?.text = Texts_Common.hardware
|
||||
cell.detailTextLabel?.text = atom.hardware
|
||||
cell.accessoryType = .disclosureIndicator
|
||||
cell.accessoryView = disclosureAaccessoryView
|
||||
|
||||
case .sensorSerialNumber:
|
||||
|
||||
cell.textLabel?.text = Texts_BluetoothPeripheralView.sensorSerialNumber
|
||||
cell.detailTextLabel?.text = atom.blePeripheral.sensorSerialNumber
|
||||
cell.accessoryType = .disclosureIndicator
|
||||
cell.accessoryView = disclosureAaccessoryView
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -107,6 +107,10 @@ extension BluconBluetoothPeripheralViewModel: BluetoothPeripheralViewModel {
|
|||
// default value for accessoryView is nil
|
||||
cell.accessoryView = nil
|
||||
|
||||
// create disclosureIndicator in color ConstantsUI.disclosureIndicatorColor
|
||||
// will be used whenever accessoryType is to be set to disclosureIndicator
|
||||
let disclosureAaccessoryView = DTCustomColoredAccessory(color: ConstantsUI.disclosureIndicatorColor)
|
||||
|
||||
guard let setting = Settings(rawValue: rawValue) else { fatalError("BluconBluetoothPeripheralViewModel update, unexpected setting") }
|
||||
|
||||
switch setting {
|
||||
|
@ -126,6 +130,7 @@ extension BluconBluetoothPeripheralViewModel: BluetoothPeripheralViewModel {
|
|||
cell.textLabel?.text = Texts_BluetoothPeripheralView.sensorSerialNumber
|
||||
cell.detailTextLabel?.text = blucon.blePeripheral.sensorSerialNumber
|
||||
cell.accessoryType = .disclosureIndicator
|
||||
cell.accessoryView = disclosureAaccessoryView
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -119,6 +119,10 @@ extension BubbleBluetoothPeripheralViewModel: BluetoothPeripheralViewModel {
|
|||
// default value for accessoryView is nil
|
||||
cell.accessoryView = nil
|
||||
|
||||
// create disclosureIndicator in color ConstantsUI.disclosureIndicatorColor
|
||||
// will be used whenever accessoryType is to be set to disclosureIndicator
|
||||
let disclosureAaccessoryView = DTCustomColoredAccessory(color: ConstantsUI.disclosureIndicatorColor)
|
||||
|
||||
guard let setting = Settings(rawValue: rawValue) else { fatalError("BubbleBluetoothPeripheralViewModel update, unexpected setting") }
|
||||
|
||||
switch setting {
|
||||
|
@ -138,12 +142,14 @@ extension BubbleBluetoothPeripheralViewModel: BluetoothPeripheralViewModel {
|
|||
cell.textLabel?.text = Texts_Common.firmware
|
||||
cell.detailTextLabel?.text = bubble.firmware
|
||||
cell.accessoryType = .disclosureIndicator
|
||||
cell.accessoryView = disclosureAaccessoryView
|
||||
|
||||
case .hardWare:
|
||||
|
||||
cell.textLabel?.text = Texts_Common.hardware
|
||||
cell.detailTextLabel?.text = bubble.hardware
|
||||
cell.accessoryType = .disclosureIndicator
|
||||
cell.accessoryView = disclosureAaccessoryView
|
||||
|
||||
case .sensorSerialNumber:
|
||||
|
||||
|
@ -152,6 +158,7 @@ extension BubbleBluetoothPeripheralViewModel: BluetoothPeripheralViewModel {
|
|||
|
||||
cell.detailTextLabel?.text = sensorSerialNumber
|
||||
cell.accessoryType = .disclosureIndicator
|
||||
cell.accessoryView = disclosureAaccessoryView
|
||||
|
||||
} else {
|
||||
|
||||
|
|
|
@ -110,6 +110,10 @@ extension GNSEntryBluetoothPeripheralViewModel: BluetoothPeripheralViewModel {
|
|||
// default value for accessoryView is nil
|
||||
cell.accessoryView = nil
|
||||
|
||||
// create disclosureIndicator in color ConstantsUI.disclosureIndicatorColor
|
||||
// will be used whenever accessoryType is to be set to disclosureIndicator
|
||||
let disclosureAaccessoryView = DTCustomColoredAccessory(color: ConstantsUI.disclosureIndicatorColor)
|
||||
|
||||
guard let setting = Settings(rawValue: rawValue) else { fatalError("GNSEntryBluetoothPeripheralViewModel update, unexpected setting") }
|
||||
|
||||
switch setting {
|
||||
|
@ -124,12 +128,14 @@ extension GNSEntryBluetoothPeripheralViewModel: BluetoothPeripheralViewModel {
|
|||
cell.textLabel?.text = Texts_Common.firmware
|
||||
cell.detailTextLabel?.text = gNSEntry.firmwareVersion
|
||||
cell.accessoryType = .disclosureIndicator
|
||||
cell.accessoryView = disclosureAaccessoryView
|
||||
|
||||
case .serialNumber:
|
||||
|
||||
cell.textLabel?.text = Texts_BluetoothPeripheralView.serialNumber
|
||||
cell.detailTextLabel?.text = gNSEntry.serialNumber
|
||||
cell.accessoryType = .disclosureIndicator
|
||||
cell.accessoryView = disclosureAaccessoryView
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -111,6 +111,10 @@ extension Libre2BluetoothPeripheralViewModel: BluetoothPeripheralViewModel {
|
|||
// default value for accessoryView is nil
|
||||
cell.accessoryView = nil
|
||||
|
||||
// create disclosureIndicator in color ConstantsUI.disclosureIndicatorColor
|
||||
// will be used whenever accessoryType is to be set to disclosureIndicator
|
||||
let disclosureAaccessoryView = DTCustomColoredAccessory(color: ConstantsUI.disclosureIndicatorColor)
|
||||
|
||||
guard let setting = Settings(rawValue: rawValue) else { fatalError("Libre2BluetoothPeripheralViewModel update, unexpected setting") }
|
||||
|
||||
switch setting {
|
||||
|
@ -120,6 +124,7 @@ extension Libre2BluetoothPeripheralViewModel: BluetoothPeripheralViewModel {
|
|||
cell.textLabel?.text = Texts_BluetoothPeripheralView.sensorSerialNumber
|
||||
cell.detailTextLabel?.text = libre2.blePeripheral.sensorSerialNumber
|
||||
cell.accessoryType = .disclosureIndicator
|
||||
cell.accessoryView = disclosureAaccessoryView
|
||||
|
||||
case .sensorStartTime:
|
||||
|
||||
|
|
|
@ -119,6 +119,10 @@ extension MiaoMiaoBluetoothPeripheralViewModel: BluetoothPeripheralViewModel {
|
|||
// default value for accessoryView is nil
|
||||
cell.accessoryView = nil
|
||||
|
||||
// create disclosureIndicator in color ConstantsUI.disclosureIndicatorColor
|
||||
// will be used whenever accessoryType is to be set to disclosureIndicator
|
||||
let disclosureAaccessoryView = DTCustomColoredAccessory(color: ConstantsUI.disclosureIndicatorColor)
|
||||
|
||||
guard let setting = Settings(rawValue: rawValue) else { fatalError("MiaoMiaoBluetoothPeripheralViewModel update, unexpected setting") }
|
||||
|
||||
switch setting {
|
||||
|
@ -161,18 +165,21 @@ extension MiaoMiaoBluetoothPeripheralViewModel: BluetoothPeripheralViewModel {
|
|||
cell.textLabel?.text = Texts_Common.firmware
|
||||
cell.detailTextLabel?.text = miaoMiao.firmware
|
||||
cell.accessoryType = .disclosureIndicator
|
||||
cell.accessoryView = disclosureAaccessoryView
|
||||
|
||||
case .hardWare:
|
||||
|
||||
cell.textLabel?.text = Texts_Common.hardware
|
||||
cell.detailTextLabel?.text = miaoMiao.hardware
|
||||
cell.accessoryType = .disclosureIndicator
|
||||
cell.accessoryView = disclosureAaccessoryView
|
||||
|
||||
case .sensorSerialNumber:
|
||||
|
||||
cell.textLabel?.text = Texts_BluetoothPeripheralView.sensorSerialNumber
|
||||
cell.detailTextLabel?.text = miaoMiao.blePeripheral.sensorSerialNumber
|
||||
cell.accessoryType = .disclosureIndicator
|
||||
cell.accessoryView = disclosureAaccessoryView
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -313,6 +313,10 @@ class M5StackBluetoothPeripheralViewModel {
|
|||
// default value for accessoryView is nil
|
||||
cell.accessoryView = nil
|
||||
|
||||
// create disclosureIndicator in color ConstantsUI.disclosureIndicatorColor
|
||||
// will be used whenever accessoryType is to be set to disclosureIndicator
|
||||
let disclosureAaccessoryView = DTCustomColoredAccessory(color: ConstantsUI.disclosureIndicatorColor)
|
||||
|
||||
switch section {
|
||||
case 1:
|
||||
// this is the section with settings common to M5Stack and M5StickC
|
||||
|
@ -349,6 +353,7 @@ class M5StackBluetoothPeripheralViewModel {
|
|||
cell.textLabel?.text = Texts_M5StackView.m5StackSoftWhereHelpCellText
|
||||
cell.detailTextLabel?.text = nil
|
||||
cell.accessoryType = .disclosureIndicator
|
||||
cell.accessoryView = disclosureAaccessoryView
|
||||
|
||||
case .blePassword:
|
||||
cell.textLabel?.text = Texts_Common.password
|
||||
|
@ -369,6 +374,7 @@ class M5StackBluetoothPeripheralViewModel {
|
|||
}
|
||||
|
||||
cell.accessoryType = .disclosureIndicator
|
||||
cell.accessoryView = disclosureAaccessoryView
|
||||
|
||||
case .backGroundColor:
|
||||
cell.textLabel?.text = Texts_SettingsView.m5StackbackGroundColor
|
||||
|
@ -380,11 +386,13 @@ class M5StackBluetoothPeripheralViewModel {
|
|||
}
|
||||
|
||||
cell.accessoryType = .disclosureIndicator
|
||||
cell.accessoryView = disclosureAaccessoryView
|
||||
|
||||
case .rotation:
|
||||
cell.textLabel?.text = Texts_SettingsView.m5StackRotation
|
||||
cell.detailTextLabel?.text = rotationStrings[Int(m5Stack.rotation)]
|
||||
cell.accessoryType = .disclosureIndicator
|
||||
cell.accessoryView = disclosureAaccessoryView
|
||||
|
||||
}
|
||||
|
||||
|
@ -402,6 +410,7 @@ class M5StackBluetoothPeripheralViewModel {
|
|||
cell.textLabel?.text = Texts_SettingsView.m5StackBrightness
|
||||
cell.detailTextLabel?.text = brightnessStrings[Int(m5Stack.brightness/10)]
|
||||
cell.accessoryType = .disclosureIndicator
|
||||
cell.accessoryView = disclosureAaccessoryView
|
||||
|
||||
case .batteryLevel:
|
||||
cell.textLabel?.text = Texts_BluetoothPeripheralsView.batteryLevel
|
||||
|
@ -416,6 +425,7 @@ class M5StackBluetoothPeripheralViewModel {
|
|||
cell.textLabel?.text = Texts_M5StackView.powerOff
|
||||
cell.accessoryType = .disclosureIndicator
|
||||
cell.detailTextLabel?.text = nil
|
||||
cell.accessoryView = disclosureAaccessoryView
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -327,8 +327,9 @@ extension BluetoothPeripheralsViewController: UITableViewDataSource, UITableView
|
|||
// detail is the connection status
|
||||
cell.detailTextLabel?.text = BluetoothPeripheralViewController.setConnectButtonLabelTextAndGetStatusDetailedText(bluetoothPeripheral: bluetoothPeripheral, isScanning: false, connectButtonOutlet: nil, expectedBluetoothPeripheralType: bluetoothPeripheral.bluetoothPeripheralType(), transmitterId: nil, bluetoothPeripheralManager: bluetoothPeripheralManager as! BluetoothPeripheralManager)
|
||||
|
||||
// clicking the cell will always open a new screen which allows the user to edit the alert type
|
||||
cell.accessoryType = .disclosureIndicator
|
||||
// clicking the cell will always open a new screen which allows the user to edit the alert type - add disclosureIndicator
|
||||
// set color of disclosureIndicator to ConstantsUI.disclosureIndicatorColor
|
||||
cell.accessoryView = DTCustomColoredAccessory(color: ConstantsUI.disclosureIndicatorColor)
|
||||
|
||||
return cell
|
||||
|
||||
|
|
|
@ -222,6 +222,10 @@ extension AlertTypeSettingsViewController: UITableViewDataSource, UITableViewDel
|
|||
// default value for accessoryView is nil
|
||||
cell.accessoryView = nil
|
||||
|
||||
// create disclosureIndicator in color ConstantsUI.disclosureIndicatorColor
|
||||
// will be used whenever accessoryType is to be set to disclosureIndicator
|
||||
let disclosureAaccessoryView = DTCustomColoredAccessory(color: ConstantsUI.disclosureIndicatorColor)
|
||||
|
||||
// configure the cell depending on setting
|
||||
switch setting {
|
||||
|
||||
|
@ -229,6 +233,8 @@ extension AlertTypeSettingsViewController: UITableViewDataSource, UITableViewDel
|
|||
cell.textLabel?.text = Texts_AlertTypeSettingsView.alertTypeName
|
||||
cell.detailTextLabel?.text = name
|
||||
cell.accessoryType = UITableViewCell.AccessoryType.disclosureIndicator
|
||||
cell.accessoryView = disclosureAaccessoryView
|
||||
|
||||
case .enabled:
|
||||
cell.textLabel?.text = Texts_AlertTypeSettingsView.alertTypeEnabled
|
||||
cell.detailTextLabel?.text = nil
|
||||
|
@ -260,10 +266,14 @@ extension AlertTypeSettingsViewController: UITableViewDataSource, UITableViewDel
|
|||
cell.textLabel?.text = Texts_AlertTypeSettingsView.alertTypeDefaultSnoozePeriod
|
||||
cell.detailTextLabel?.text = snoozePeriod.description
|
||||
cell.accessoryType = UITableViewCell.AccessoryType.disclosureIndicator
|
||||
cell.accessoryView = disclosureAaccessoryView
|
||||
|
||||
case .soundName:
|
||||
cell.textLabel?.text = Texts_AlertTypeSettingsView.alertTypeSound
|
||||
cell.detailTextLabel?.text = soundName != nil ? soundName! == "" ? Texts_AlertTypeSettingsView.alertTypeNoSound : soundName! : Texts_AlertTypeSettingsView.alertTypeDefaultIOSSound
|
||||
cell.accessoryType = UITableViewCell.AccessoryType.disclosureIndicator
|
||||
cell.accessoryView = disclosureAaccessoryView
|
||||
|
||||
case .overridemute:
|
||||
cell.textLabel?.text = Texts_AlertTypeSettingsView.alertTypeOverrideMute
|
||||
cell.detailTextLabel?.text = nil
|
||||
|
|
|
@ -152,6 +152,8 @@ extension AlertSettingsViewControllerData {
|
|||
cell.accessoryType = UITableViewCell.AccessoryType.none
|
||||
} else {
|
||||
cell.accessoryType = UITableViewCell.AccessoryType.disclosureIndicator
|
||||
// set color of disclosureIndicator to ConstantsUI.disclosureIndicatorColor
|
||||
cell.accessoryView = DTCustomColoredAccessory(color: ConstantsUI.disclosureIndicatorColor)
|
||||
}
|
||||
case .value:
|
||||
// note that value will not be shown if alerttype not enabled or alertkind doesn't need a value, means if that's the case, setting will never be .value
|
||||
|
@ -162,10 +164,15 @@ extension AlertSettingsViewControllerData {
|
|||
cell.detailTextLabel?.text = value.description
|
||||
}
|
||||
cell.accessoryType = UITableViewCell.AccessoryType.disclosureIndicator
|
||||
// set color of disclosureIndicator to ConstantsUI.disclosureIndicatorColor
|
||||
cell.accessoryView = DTCustomColoredAccessory(color: ConstantsUI.disclosureIndicatorColor)
|
||||
|
||||
case .alertType:
|
||||
cell.textLabel?.text = Texts_Alerts.alerttype
|
||||
cell.detailTextLabel?.text = AlertSettingsViewControllerData.getAlertType(alertType: alertType).name
|
||||
cell.accessoryType = UITableViewCell.AccessoryType.disclosureIndicator
|
||||
// set color of disclosureIndicator to ConstantsUI.disclosureIndicatorColor
|
||||
cell.accessoryView = DTCustomColoredAccessory(color: ConstantsUI.disclosureIndicatorColor)
|
||||
}
|
||||
|
||||
return cell
|
||||
|
|
|
@ -192,6 +192,9 @@ extension AlertsSettingsViewController:UITableViewDataSource, UITableViewDelegat
|
|||
// clicking the cell will always open a new screen which allows the user to edit the alert type
|
||||
cell.accessoryType = .disclosureIndicator
|
||||
|
||||
// set color of disclosureIndicator to ConstantsUI.disclosureIndicatorColor
|
||||
cell.accessoryView = DTCustomColoredAccessory(color: ConstantsUI.disclosureIndicatorColor)
|
||||
|
||||
return cell
|
||||
}
|
||||
|
||||
|
|
|
@ -18,20 +18,17 @@ class SettingsViewUtilities {
|
|||
// if not enabled, then no need to adding anything else
|
||||
if viewModel.isEnabled(index: rowIndex) {
|
||||
|
||||
// get accessoryView
|
||||
cell.accessoryView = viewModel.uiView(index: rowIndex)
|
||||
|
||||
// setting enabled, get accessory type and accessory view
|
||||
cell.accessoryType = viewModel.accessoryType(index: rowIndex)
|
||||
|
||||
switch cell.accessoryType {
|
||||
case .checkmark, .detailButton, .detailDisclosureButton, .disclosureIndicator:
|
||||
cell.selectionStyle = .gray
|
||||
case .none:
|
||||
cell.selectionStyle = .none
|
||||
@unknown default:
|
||||
cell.selectionStyle = .none
|
||||
//if accessoryType = disclosure indicator then use custom disclosureIndicator in ConstantsUI.disclosureIndicatorColor
|
||||
if cell.accessoryType == .disclosureIndicator {
|
||||
cell.accessoryView = DTCustomColoredAccessory(color: ConstantsUI.disclosureIndicatorColor)
|
||||
}
|
||||
|
||||
cell.accessoryView = viewModel.uiView(index: rowIndex)
|
||||
|
||||
// if uiview is an uiswitch then a reload must be initiated whenever the switch changes, either complete view or just the section
|
||||
if let view = cell.accessoryView as? UISwitch {
|
||||
view.addTarget(self, action: {
|
||||
|
|
|
@ -186,6 +186,7 @@ extension TimeScheduleViewController: UITableViewDataSource {
|
|||
cell.accessoryType = .none
|
||||
} else {
|
||||
cell.accessoryType = .disclosureIndicator
|
||||
cell.accessoryView = DTCustomColoredAccessory(color: ConstantsUI.disclosureIndicatorColor)
|
||||
}
|
||||
|
||||
return cell
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
#import "BluetoothTransmitter/CGM/Dexcom/G5/G5Messages/AESCrypt.h"
|
||||
|
||||
#import "Utilities/CustomColoredDisclosureIndicator/DTCustomColoredAccessory.h"
|
||||
|
||||
|
|
Loading…
Reference in New Issue