This repository has been archived by the owner on Jun 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
690 additions
and
373 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>en</string> | ||
<key>CFBundleDisplayName</key> | ||
<string>ChameleonExtension-ObjC</string> | ||
<key>CFBundleExecutable</key> | ||
<string>$(EXECUTABLE_NAME)</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundleName</key> | ||
<string>$(PRODUCT_NAME)</string> | ||
<key>CFBundlePackageType</key> | ||
<string>XPC!</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>2.2.0</string> | ||
<key>CFBundleVersion</key> | ||
<string>1</string> | ||
<key>NSExtension</key> | ||
<dict> | ||
<key>NSExtensionAttributes</key> | ||
<dict> | ||
<key>IsASCIICapable</key> | ||
<false/> | ||
<key>PrefersRightToLeft</key> | ||
<false/> | ||
<key>PrimaryLanguage</key> | ||
<string>en-US</string> | ||
<key>RequestsOpenAccess</key> | ||
<false/> | ||
</dict> | ||
<key>NSExtensionPointIdentifier</key> | ||
<string>com.apple.keyboard-service</string> | ||
<key>NSExtensionPrincipalClass</key> | ||
<string>KeyboardViewController</string> | ||
</dict> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// KeyboardViewController.h | ||
// ChameleonExtension-ObjC | ||
// | ||
// Created by Vicc Alexander on 9/17/16. | ||
// Copyright © 2016 Vicc Alexander. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
@import Chameleon; | ||
|
||
@interface KeyboardViewController : UIInputViewController | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// | ||
// KeyboardViewController.m | ||
// ChameleonExtension-ObjC | ||
// | ||
// Created by Vicc Alexander on 9/17/16. | ||
// Copyright © 2016 Vicc Alexander. All rights reserved. | ||
// | ||
|
||
#import "KeyboardViewController.h" | ||
|
||
@interface KeyboardViewController () | ||
@property (nonatomic, strong) UIButton *nextKeyboardButton; | ||
@end | ||
|
||
@implementation KeyboardViewController | ||
|
||
- (void)updateViewConstraints { | ||
[super updateViewConstraints]; | ||
|
||
// Add custom view sizing constraints here | ||
} | ||
|
||
- (void)viewDidLoad { | ||
[super viewDidLoad]; | ||
|
||
// Perform custom UI setup here | ||
self.nextKeyboardButton = [UIButton buttonWithType:UIButtonTypeSystem]; | ||
|
||
[self.nextKeyboardButton setTitle:NSLocalizedString(@"Next Keyboard", @"Title for 'Next Keyboard' button") forState:UIControlStateNormal]; | ||
[self.nextKeyboardButton sizeToFit]; | ||
self.nextKeyboardButton.translatesAutoresizingMaskIntoConstraints = NO; | ||
|
||
[self.nextKeyboardButton addTarget:self action:@selector(handleInputModeListFromView:withEvent:) forControlEvents:UIControlEventAllTouchEvents]; | ||
|
||
[self.view addSubview:self.nextKeyboardButton]; | ||
|
||
[self.nextKeyboardButton.leftAnchor constraintEqualToAnchor:self.view.leftAnchor].active = YES; | ||
[self.nextKeyboardButton.bottomAnchor constraintEqualToAnchor:self.view.bottomAnchor].active = YES; | ||
|
||
//Set Background Color | ||
self.inputView.backgroundColor = FlatRed; | ||
} | ||
|
||
- (void)didReceiveMemoryWarning { | ||
[super didReceiveMemoryWarning]; | ||
// Dispose of any resources that can be recreated | ||
} | ||
|
||
- (void)textWillChange:(id<UITextInput>)textInput { | ||
// The app is about to change the document's contents. Perform any preparation here. | ||
} | ||
|
||
- (void)textDidChange:(id<UITextInput>)textInput { | ||
// The app has just changed the document's contents, the document context has been updated. | ||
|
||
UIColor *textColor = nil; | ||
if (self.textDocumentProxy.keyboardAppearance == UIKeyboardAppearanceDark) { | ||
textColor = [UIColor whiteColor]; | ||
} else { | ||
textColor = [UIColor blackColor]; | ||
} | ||
[self.nextKeyboardButton setTitleColor:textColor forState:UIControlStateNormal]; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>en</string> | ||
<key>CFBundleDisplayName</key> | ||
<string>ChameleonExtension</string> | ||
<key>CFBundleExecutable</key> | ||
<string>$(EXECUTABLE_NAME)</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundleName</key> | ||
<string>$(PRODUCT_NAME)</string> | ||
<key>CFBundlePackageType</key> | ||
<string>XPC!</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>1.0</string> | ||
<key>CFBundleVersion</key> | ||
<string>1</string> | ||
<key>NSExtension</key> | ||
<dict> | ||
<key>NSExtensionAttributes</key> | ||
<dict> | ||
<key>IsASCIICapable</key> | ||
<false/> | ||
<key>PrefersRightToLeft</key> | ||
<false/> | ||
<key>PrimaryLanguage</key> | ||
<string>en-US</string> | ||
<key>RequestsOpenAccess</key> | ||
<false/> | ||
</dict> | ||
<key>NSExtensionPointIdentifier</key> | ||
<string>com.apple.keyboard-service</string> | ||
<key>NSExtensionPrincipalClass</key> | ||
<string>$(PRODUCT_MODULE_NAME).KeyboardViewController</string> | ||
</dict> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// | ||
// KeyboardViewController.swift | ||
// ChameleonExtension | ||
// | ||
// Created by Vicc Alexander on 9/17/16. | ||
// Copyright © 2016 Vicc Alexander. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
import Chameleon | ||
|
||
class KeyboardViewController: UIInputViewController { | ||
|
||
@IBOutlet var nextKeyboardButton: UIButton! | ||
|
||
override func updateViewConstraints() { | ||
super.updateViewConstraints() | ||
|
||
// Add custom view sizing constraints here | ||
} | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
// Perform custom UI setup here | ||
self.nextKeyboardButton = UIButton(type: .system) | ||
|
||
self.nextKeyboardButton.setTitle(NSLocalizedString("Next Keyboard", comment: "Title for 'Next Keyboard' button"), for: []) | ||
self.nextKeyboardButton.sizeToFit() | ||
self.nextKeyboardButton.translatesAutoresizingMaskIntoConstraints = false | ||
|
||
self.nextKeyboardButton.addTarget(self, action: #selector(handleInputModeList(from:with:)), for: .allTouchEvents) | ||
|
||
self.view.addSubview(self.nextKeyboardButton) | ||
|
||
self.nextKeyboardButton.leftAnchor.constraint(equalTo: self.view.leftAnchor).isActive = true | ||
self.nextKeyboardButton.bottomAnchor.constraint(equalTo: self.view.bottomAnchor).isActive = true | ||
|
||
inputView?.backgroundColor = .flatGreen() | ||
} | ||
|
||
override func didReceiveMemoryWarning() { | ||
super.didReceiveMemoryWarning() | ||
// Dispose of any resources that can be recreated | ||
} | ||
|
||
override func textWillChange(_ textInput: UITextInput?) { | ||
// The app is about to change the document's contents. Perform any preparation here. | ||
} | ||
|
||
override func textDidChange(_ textInput: UITextInput?) { | ||
// The app has just changed the document's contents, the document context has been updated. | ||
|
||
var textColor: UIColor | ||
let proxy = self.textDocumentProxy | ||
if proxy.keyboardAppearance == UIKeyboardAppearance.dark { | ||
textColor = UIColor.white | ||
} else { | ||
textColor = UIColor.black | ||
} | ||
self.nextKeyboardButton.setTitleColor(textColor, for: []) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Oops, something went wrong.