Skip to content

Commit

Permalink
Merge branch 'Smart_Keys_With_External_Keyboard'
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Cabanero committed Jan 17, 2017
2 parents f10ec6b + 1a35528 commit c60b063
Show file tree
Hide file tree
Showing 11 changed files with 173 additions and 3 deletions.
6 changes: 6 additions & 0 deletions Blink.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
B7B3FC401DF5E99200B3D37C /* BKTouchIDAuthManager.m in Sources */ = {isa = PBXBuildFile; fileRef = B7B3FC3F1DF5E99200B3D37C /* BKTouchIDAuthManager.m */; };
B7D450361DD3A87200CE0DBE /* BKiCloudSyncHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = B7D450351DD3A87200CE0DBE /* BKiCloudSyncHandler.m */; };
B7D4503C1DD4706000CE0DBE /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = B7D4503B1DD4706000CE0DBE /* Reachability.m */; };
B7D6A6291E2D43A800EDF7B0 /* BKSmartKeysConfigViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B7D6A6281E2D43A800EDF7B0 /* BKSmartKeysConfigViewController.m */; };
C94437571D8311960096F84E /* BKResource.m in Sources */ = {isa = PBXBuildFile; fileRef = C94437561D8311960096F84E /* BKResource.m */; };
C94437601D831CD30096F84E /* Themes in Resources */ = {isa = PBXBuildFile; fileRef = C944375F1D831CD30096F84E /* Themes */; };
C94437651D838ABF0096F84E /* Fonts in Resources */ = {isa = PBXBuildFile; fileRef = C94437641D838ABF0096F84E /* Fonts */; };
Expand Down Expand Up @@ -388,6 +389,8 @@
B7D450351DD3A87200CE0DBE /* BKiCloudSyncHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BKiCloudSyncHandler.m; sourceTree = "<group>"; };
B7D4503A1DD4706000CE0DBE /* Reachability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Reachability.h; sourceTree = "<group>"; };
B7D4503B1DD4706000CE0DBE /* Reachability.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Reachability.m; sourceTree = "<group>"; };
B7D6A6271E2D43A800EDF7B0 /* BKSmartKeysConfigViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BKSmartKeysConfigViewController.h; sourceTree = "<group>"; };
B7D6A6281E2D43A800EDF7B0 /* BKSmartKeysConfigViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BKSmartKeysConfigViewController.m; sourceTree = "<group>"; };
C94437551D8311960096F84E /* BKResource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BKResource.h; sourceTree = "<group>"; };
C94437561D8311960096F84E /* BKResource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BKResource.m; sourceTree = "<group>"; };
C944375F1D831CD30096F84E /* Themes */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Themes; sourceTree = "<group>"; };
Expand Down Expand Up @@ -722,6 +725,8 @@
B75112C71DE4A7680040C693 /* UserConfiguration */ = {
isa = PBXGroup;
children = (
B7D6A6271E2D43A800EDF7B0 /* BKSmartKeysConfigViewController.h */,
B7D6A6281E2D43A800EDF7B0 /* BKSmartKeysConfigViewController.m */,
B752EE291DFEF19D00E305C8 /* BKUserConfigurationManager.h */,
B752EE2A1DFEF19D00E305C8 /* BKUserConfigurationManager.m */,
B75112CB1DE4A7B10040C693 /* BKiCloudConfigurationViewController.h */,
Expand Down Expand Up @@ -1201,6 +1206,7 @@
0716B5721CFFAB9300268B5B /* AppDelegate.m in Sources */,
07F670731D05EEE200C0A53C /* MoshSession.m in Sources */,
07F670721D05EEE200C0A53C /* MCPSession.m in Sources */,
B7D6A6291E2D43A800EDF7B0 /* BKSmartKeysConfigViewController.m in Sources */,
07AA06531E08B12E008310B7 /* PasscodeLockConfigurationType.swift in Sources */,
073D26BE1DC4137000965AB2 /* SKNonModifierButton.m in Sources */,
07AA06541E08B12E008310B7 /* PasscodeLockStateType.swift in Sources */,
Expand Down
7 changes: 6 additions & 1 deletion Blink/TermView.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#import "SmartKeysController.h"
#import "SmartKeysView.h"
#import "TermView.h"
#import "BKUserConfigurationManager.h"

static NSDictionary *CTRLCodes = nil;
static NSDictionary *FModifiers = nil;
Expand Down Expand Up @@ -412,7 +413,11 @@ - (void)keyboardWillShow:(NSNotification *)sender

// If the intersection is only the accesoryView, we have a external keyboard
if (intersection.size.height == [iaView frame].size.height) {
iaView.hidden = YES;
if ([BKUserConfigurationManager userSettingsValueForKey:BKUserConfigShowSmartKeysWithXKeyBoard]) {
iaView.hidden = NO;
} else {
iaView.hidden = YES;
}
} else {
//_capsMapped = NO;
iaView.hidden = NO;
Expand Down
23 changes: 23 additions & 0 deletions Media.xcassets/Settings/skeys.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
91 changes: 89 additions & 2 deletions Settings/Base.lproj/Settings.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,36 @@
<segue destination="Man-FB-xZk" kind="show" id="8ad-JV-a3b"/>
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="Cell" textLabel="Rpb-8b-gde" imageView="w21-JA-Sq1" style="IBUITableViewCellStyleDefault" id="P2B-tA-NvL">
<rect key="frame" x="0.0" y="395.5" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="P2B-tA-NvL" id="EEi-in-Cc0">
<frame key="frameInset" width="342" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Smart Keys" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Rpb-8b-gde">
<frame key="frameInset" minX="52" width="288" height="43"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" image="skeys" id="w21-JA-Sq1">
<rect key="frame" x="15" y="10" width="22" height="22"/>
<autoresizingMask key="autoresizingMask"/>
</imageView>
</subviews>
</tableViewCellContentView>
<connections>
<segue destination="Wbf-Ab-aSe" kind="show" id="eq4-72-MJM"/>
</connections>
</tableViewCell>
</cells>
</tableViewSection>
<tableViewSection headerTitle="CONFIGURATION" id="iQy-iK-Gcf">
<cells>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="Cell" textLabel="HXd-yD-QBy" detailTextLabel="Z6a-cl-7ZU" imageView="jwU-DJ-SQQ" style="IBUITableViewCellStyleValue1" id="Rwq-Ry-O0K">
<rect key="frame" x="0.0" y="390" width="375" height="44"/>
<rect key="frame" x="0.0" y="434" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Rwq-Ry-O0K" id="leh-JK-0e3">
<rect key="frame" x="0.0" y="0.0" width="342" height="43"/>
Expand Down Expand Up @@ -187,7 +211,7 @@
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="Cell" textLabel="i83-1S-4Ub" detailTextLabel="5tg-aa-ELS" imageView="2J7-Y2-fhV" style="IBUITableViewCellStyleValue1" id="IRS-ev-TBi">
<rect key="frame" x="0.0" y="434" width="375" height="44"/>
<rect key="frame" x="0.0" y="478" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="IRS-ev-TBi" id="Pfv-Vu-5kK">
<rect key="frame" x="0.0" y="0.0" width="342" height="43"/>
Expand Down Expand Up @@ -1457,6 +1481,68 @@
</objects>
<point key="canvasLocation" x="2645" y="1189"/>
</scene>
<!--Smart Keys-->
<scene sceneID="8pc-5F-4GF">
<objects>
<tableViewController id="Wbf-Ab-aSe" customClass="BKSmartKeysConfigViewController" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="static" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="18" sectionFooterHeight="18" id="53q-iv-p0Q">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
<sections>
<tableViewSection id="4LL-aT-m70">
<cells>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" rowHeight="44" id="Pas-GB-VuG">
<rect key="frame" x="0.0" y="99" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" tableViewCell="Pas-GB-VuG" id="MJS-q5-cvs">
<frame key="frameInset" width="375" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Show with external keyboard" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="WhV-7c-H8e">
<constraints>
<constraint firstAttribute="height" constant="21" id="0PJ-VB-dWm"/>
<constraint firstAttribute="width" constant="220" id="Vut-s4-JlC"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Xgm-hH-Hby">
<constraints>
<constraint firstAttribute="height" constant="31" id="9Fj-rs-ZA5"/>
<constraint firstAttribute="width" constant="49" id="LbU-ap-VgC"/>
</constraints>
<connections>
<action selector="didToggleSwitch:" destination="Wbf-Ab-aSe" eventType="valueChanged" id="ftQ-mM-hbb"/>
</connections>
</switch>
</subviews>
<constraints>
<constraint firstAttribute="leadingMargin" secondItem="WhV-7c-H8e" secondAttribute="leading" id="6RJ-Ez-PtJ"/>
<constraint firstItem="WhV-7c-H8e" firstAttribute="centerY" secondItem="MJS-q5-cvs" secondAttribute="centerY" id="MYf-LQ-nJN"/>
<constraint firstItem="Xgm-hH-Hby" firstAttribute="centerY" secondItem="MJS-q5-cvs" secondAttribute="centerY" id="voP-hE-ubP"/>
<constraint firstAttribute="trailingMargin" secondItem="Xgm-hH-Hby" secondAttribute="trailing" constant="5" id="wAO-yU-otf"/>
</constraints>
</tableViewCellContentView>
</tableViewCell>
</cells>
</tableViewSection>
</sections>
<connections>
<outlet property="dataSource" destination="Wbf-Ab-aSe" id="Lnj-Fs-lkI"/>
<outlet property="delegate" destination="Wbf-Ab-aSe" id="hzF-KS-JEg"/>
</connections>
</tableView>
<navigationItem key="navigationItem" title="Smart Keys" id="8ez-BY-Ioa"/>
<connections>
<outlet property="showWithExternalKeyboard" destination="Xgm-hH-Hby" id="lWd-6w-1CG"/>
</connections>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="L9c-NE-27G" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-292" y="973.76311844077964"/>
</scene>
<!--Add a new theme-->
<scene sceneID="EMy-fs-l8I">
<objects>
Expand Down Expand Up @@ -2196,6 +2282,7 @@
<image name="host" width="22" height="22"/>
<image name="key" width="22" height="22"/>
<image name="keyboard" width="22" height="22"/>
<image name="skeys" width="22" height="22"/>
<image name="user" width="22" height="22"/>
</resources>
<inferredMetricsTieBreakers>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// BKSmartKeysConfigViewController.h
// Blink
//
// Created by Atul M on 16/01/17.
// Copyright © 2017 Carlos Cabañero Projects SL. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface BKSmartKeysConfigViewController : UITableViewController

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//
// BKSmartKeysConfigViewController.m
// Blink
//
// Created by Atul M on 16/01/17.
// Copyright © 2017 Carlos Cabañero Projects SL. All rights reserved.
//

#import "BKSmartKeysConfigViewController.h"
#import "BKUserConfigurationManager.h"
@interface BKSmartKeysConfigViewController ()

@property (nonatomic, weak) IBOutlet UISwitch *showWithExternalKeyboard;

@end

@implementation BKSmartKeysConfigViewController

- (void)viewDidLoad {
[super viewDidLoad];
[self setupUI];
}

- (void)setupUI
{
[_showWithExternalKeyboard setOn:[BKUserConfigurationManager userSettingsValueForKey:BKUserConfigShowSmartKeysWithXKeyBoard]];
}

- (IBAction)didToggleSwitch:(id)sender
{
UISwitch *toggleSwitch = (UISwitch *)sender;
[BKUserConfigurationManager setUserSettingsValue:toggleSwitch.isOn forKey:BKUserConfigShowSmartKeysWithXKeyBoard];
}
@end
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
extern NSString *const BKUserConfigiCloud;
extern NSString *const BKUserConfigiCloudKeys;
extern NSString *const BKUserConfigAutoLock;
extern NSString *const BKUserConfigShowSmartKeysWithXKeyBoard;

@interface BKUserConfigurationManager : NSObject

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
NSString *const BKUserConfigiCloud = @"iCloudSync";
NSString *const BKUserConfigiCloudKeys = @"iCloudKeysSync";
NSString *const BKUserConfigAutoLock = @"autoLock";
NSString *const BKUserConfigShowSmartKeysWithXKeyBoard = @"ShowSmartKeysWithXKeyBoard";

@implementation BKUserConfigurationManager

Expand Down

0 comments on commit c60b063

Please sign in to comment.