Merge remote-tracking branch 'origin/beta' into android-file-provider

This commit is contained in:
Darcy Wong 2019-09-06 09:59:31 +07:00
commit 0f121c1990
8 changed files with 76 additions and 24 deletions

View file

@ -55,9 +55,6 @@ export default class LexicalModelCompiler {
function getWordBreakerSpec() {
if (modelSource.wordBreaker) {
return modelSource.wordBreaker;
} else if (modelSource.wordBreaking) {
compiler.logError('`wordBreaking` will be deleted; please use `wordBreaker` instead!');
return modelSource.wordBreaking;
} else {
return null;
}

View file

@ -39,18 +39,10 @@ interface LexicalModelSource extends LexicalModel {
* Boundary Specification, which works well for *most* languages.
* - 'ascii' -- a very simple word breaker, for demonstration purposes only.
* - word breaking function -- provide your own function that breaks words.
* - class-based word-breaker - may be supported in the future.
*/
readonly wordBreaker?: 'default' | 'ascii' | WordBreakingFunction;
readonly wordBreaker?: 'default' | 'ascii' | WordBreakingFunction | ClassBasedWordBreaker;
/**
* ****** TODO: DELETE ME******
*
* This used to be the way that word breaking was specified, but
* this should be deleted once keymanapp/lexical-models#54 is merged.
*
* https://github.com/keymanapp/lexical-models/pull/54
*/
readonly wordBreaking?: 'default' | 'ascii' | 'placeholder' | WordBreakingFunction | ClassBasedWordBreaker;
/**
* How to simplify words, to convert them into simplifired search keys
* This often involves removing accents, lowercasing, etc.

View file

@ -22,6 +22,8 @@
C05B14221FD8F2B10082A316 /* XCGLogger.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C07705E61FD8F21500D2F3C7 /* XCGLogger.framework */; };
C05B14231FD8F2B10082A316 /* XCGLogger.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C07705E61FD8F21500D2F3C7 /* XCGLogger.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
C05B14251FD8F2B10082A316 /* Zip.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C07705E41FD8F21500D2F3C7 /* Zip.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
CEBEFB9C231FB94200F8F67C /* Reachability.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CEBEFB89231F9CC600F8F67C /* Reachability.framework */; };
CEBEFB9D231FB96400F8F67C /* Reachability.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = CEBEFB89231F9CC600F8F67C /* Reachability.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
@ -31,6 +33,7 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
CEBEFB9D231FB96400F8F67C /* Reachability.framework in Embed Frameworks */,
C05B14251FD8F2B10082A316 /* Zip.framework in Embed Frameworks */,
C05B14211FD8F2B10082A316 /* ObjcExceptionBridging.framework in Embed Frameworks */,
C01AB59C1F8345CB009B37D3 /* KeymanEngine.framework in Embed Frameworks */,
@ -55,6 +58,7 @@
C07705E41FD8F21500D2F3C7 /* Zip.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Zip.framework; path = ../../Carthage/Build/iOS/Zip.framework; sourceTree = "<group>"; };
C07705E51FD8F21500D2F3C7 /* ObjcExceptionBridging.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ObjcExceptionBridging.framework; path = ../../Carthage/Build/iOS/ObjcExceptionBridging.framework; sourceTree = "<group>"; };
C07705E61FD8F21500D2F3C7 /* XCGLogger.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCGLogger.framework; path = ../../Carthage/Build/iOS/XCGLogger.framework; sourceTree = "<group>"; };
CEBEFB89231F9CC600F8F67C /* Reachability.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Reachability.framework; path = ../../Carthage/Build/iOS/Reachability.framework; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -64,6 +68,7 @@
files = (
C01AB59A1F8345C5009B37D3 /* KeymanEngine.framework in Frameworks */,
C05B14201FD8F2B10082A316 /* ObjcExceptionBridging.framework in Frameworks */,
CEBEFB9C231FB94200F8F67C /* Reachability.framework in Frameworks */,
C05B14221FD8F2B10082A316 /* XCGLogger.framework in Frameworks */,
C059FCB61FD9245300BD1A64 /* Zip.framework in Frameworks */,
);
@ -114,6 +119,7 @@
98ABFD171AD391B0005534F0 /* Frameworks */ = {
isa = PBXGroup;
children = (
CEBEFB89231F9CC600F8F67C /* Reachability.framework */,
C01AB5991F8345C5009B37D3 /* KeymanEngine.framework */,
C07705E51FD8F21500D2F3C7 /* ObjcExceptionBridging.framework */,
C07705E61FD8F21500D2F3C7 /* XCGLogger.framework */,
@ -181,6 +187,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
@ -221,7 +228,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if which swiftlint >/dev/null; then\n swiftlint --config ../../.swiftlint.yml\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi";
shellScript = "if which swiftlint >/dev/null; then\n swiftlint --config ../../.swiftlint.yml\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
};
/* End PBXShellScriptBuildPhase section */
@ -370,6 +377,7 @@
"$(SRCROOT)/../../Carthage/Build/iOS/",
);
INFOPLIST_FILE = KMSample1/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = org.sil.Keyman.ios.Sample1;
@ -392,6 +400,7 @@
"$(SRCROOT)/../../Carthage/Build/iOS/",
);
INFOPLIST_FILE = KMSample1/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = org.sil.Keyman.ios.Sample1;

View file

@ -28,6 +28,11 @@
C05B142E1FD8F45E0082A316 /* XCGLogger.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C05B14281FD8F4510082A316 /* XCGLogger.framework */; };
C05B142F1FD8F45E0082A316 /* XCGLogger.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C05B14281FD8F4510082A316 /* XCGLogger.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
C05B14311FD8F45E0082A316 /* Zip.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C05B14261FD8F4510082A316 /* Zip.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
CEBEFB94231FB4E000F8F67C /* banner-portrait-text.png in Resources */ = {isa = PBXBuildFile; fileRef = CEBEFB92231FB4DF00F8F67C /* banner-portrait-text.png */; };
CEBEFB95231FB4E000F8F67C /* banner-landscape-text.png in Resources */ = {isa = PBXBuildFile; fileRef = CEBEFB93231FB4DF00F8F67C /* banner-landscape-text.png */; };
CEBEFB98231FB6BD00F8F67C /* Reachability.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CEBEFB8D231F9FEE00F8F67C /* Reachability.framework */; };
CEBEFB99231FB6BE00F8F67C /* Reachability.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CEBEFB8D231F9FEE00F8F67C /* Reachability.framework */; };
CEBEFB9B231FB7DE00F8F67C /* Reachability.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = CEBEFB8D231F9FEE00F8F67C /* Reachability.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@ -58,6 +63,7 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
CEBEFB9B231FB7DE00F8F67C /* Reachability.framework in Embed Frameworks */,
C05B14311FD8F45E0082A316 /* Zip.framework in Embed Frameworks */,
C05B142D1FD8F45E0082A316 /* ObjcExceptionBridging.framework in Embed Frameworks */,
C01AB5A11F834706009B37D3 /* KeymanEngine.framework in Embed Frameworks */,
@ -87,6 +93,9 @@
C05B14261FD8F4510082A316 /* Zip.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Zip.framework; path = ../../Carthage/Build/iOS/Zip.framework; sourceTree = "<group>"; };
C05B14271FD8F4510082A316 /* ObjcExceptionBridging.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ObjcExceptionBridging.framework; path = ../../Carthage/Build/iOS/ObjcExceptionBridging.framework; sourceTree = "<group>"; };
C05B14281FD8F4510082A316 /* XCGLogger.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCGLogger.framework; path = ../../Carthage/Build/iOS/XCGLogger.framework; sourceTree = "<group>"; };
CEBEFB8D231F9FEE00F8F67C /* Reachability.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Reachability.framework; path = ../../Carthage/Build/iOS/Reachability.framework; sourceTree = "<group>"; };
CEBEFB92231FB4DF00F8F67C /* banner-portrait-text.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "banner-portrait-text.png"; sourceTree = "<group>"; };
CEBEFB93231FB4DF00F8F67C /* banner-landscape-text.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "banner-landscape-text.png"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -96,6 +105,7 @@
files = (
C01AB5A01F834706009B37D3 /* KeymanEngine.framework in Frameworks */,
C05B142C1FD8F45E0082A316 /* ObjcExceptionBridging.framework in Frameworks */,
CEBEFB98231FB6BD00F8F67C /* Reachability.framework in Frameworks */,
C05B142E1FD8F45E0082A316 /* XCGLogger.framework in Frameworks */,
C059FCB51FD923E900BD1A64 /* Zip.framework in Frameworks */,
);
@ -105,6 +115,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
CEBEFB99231FB6BE00F8F67C /* Reachability.framework in Frameworks */,
C01AB59F1F8346FC009B37D3 /* KeymanEngine.framework in Frameworks */,
C059FCB21FD9231D00BD1A64 /* ObjcExceptionBridging.framework in Frameworks */,
C059FCB31FD9231D00BD1A64 /* XCGLogger.framework in Frameworks */,
@ -160,6 +171,7 @@
98ABFD601AD3A087005534F0 /* Frameworks */ = {
isa = PBXGroup;
children = (
CEBEFB8D231F9FEE00F8F67C /* Reachability.framework */,
C05B14271FD8F4510082A316 /* ObjcExceptionBridging.framework */,
C05B14281FD8F4510082A316 /* XCGLogger.framework */,
C05B14261FD8F4510082A316 /* Zip.framework */,
@ -188,6 +200,7 @@
98ABFD8D1AD3A232005534F0 /* SWKeyboard */ = {
isa = PBXGroup;
children = (
CEBEFB91231FB49A00F8F67C /* Sample Banner Images */,
98ABFDA41AD3A363005534F0 /* SWKeyboard.entitlements */,
C045148C1F85E33300D88416 /* KeyboardViewController.swift */,
98ABFD8E1AD3A232005534F0 /* Supporting Files */,
@ -203,6 +216,15 @@
name = "Supporting Files";
sourceTree = "<group>";
};
CEBEFB91231FB49A00F8F67C /* Sample Banner Images */ = {
isa = PBXGroup;
children = (
CEBEFB93231FB4DF00F8F67C /* banner-landscape-text.png */,
CEBEFB92231FB4DF00F8F67C /* banner-portrait-text.png */,
);
path = "Sample Banner Images";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@ -256,7 +278,6 @@
TargetAttributes = {
98ABFD361AD3A047005534F0 = {
CreatedOnToolsVersion = 6.2;
DevelopmentTeam = N4M8L6CCXN;
LastSwiftMigration = 0900;
SystemCapabilities = {
com.apple.ApplicationGroups.iOS = {
@ -266,7 +287,6 @@
};
98ABFD8B1AD3A232005534F0 = {
CreatedOnToolsVersion = 6.2;
DevelopmentTeam = N4M8L6CCXN;
LastSwiftMigration = 0900;
SystemCapabilities = {
com.apple.ApplicationGroups.iOS = {
@ -281,6 +301,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
@ -312,6 +333,8 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
CEBEFB95231FB4E000F8F67C /* banner-landscape-text.png in Resources */,
CEBEFB94231FB4E000F8F67C /* banner-portrait-text.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -514,6 +537,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
INFOPLIST_FILE = KMSample2/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = "$(inherited)";
OTHER_LDFLAGS = "";
@ -535,6 +559,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
INFOPLIST_FILE = KMSample2/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = "$(inherited)";
OTHER_LDFLAGS = "";
@ -558,6 +583,7 @@
"$(inherited)",
);
INFOPLIST_FILE = SWKeyboard/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
LIBRARY_SEARCH_PATHS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = org.sil.Keyman.ios.Sample2.SystemKeyboard;
@ -579,6 +605,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
INFOPLIST_FILE = SWKeyboard/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
LIBRARY_SEARCH_PATHS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = org.sil.Keyman.ios.Sample2.SystemKeyboard;

View file

@ -25,14 +25,41 @@ class KeyboardViewController: InputViewController {
fatalError("init(coder:) has not been implemented")
}
override func updateViewConstraints() {
super.updateViewConstraints()
if view.frame.size.width == 0 || self.view.frame.size.height == 0 {
return
}
setupTopBarImage(isPortrait: InputViewController.isPortrait)
}
override func viewDidLoad() {
super.viewDidLoad()
setupTopBarImage(isPortrait: InputViewController.isPortrait)
}
topBarImageView?.backgroundColor = UIColor(red: 1.0, green: 96.0 / 255.0, blue: 0.0, alpha: 1.0)
let label = UILabel(frame: CGRect.zero)
label.text = " \(Bundle.main.object(forInfoDictionaryKey: "CFBundleDisplayName")!)"
label.sizeToFit()
label.textColor = UIColor.white
topBarImageView?.addSubview(label)
override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
super.viewWillTransition(to: size, with: coordinator)
setupTopBarImage(isPortrait: UIDevice.current.orientation.isPortrait)
}
func getTopBarImage(isPortrait: Bool) -> String? {
if isPortrait {
return Bundle.main.path(forResource: "banner-portrait-text", ofType: "png")
} else {
return Bundle.main.path(forResource: "banner-landscape-text", ofType: "png")
}
}
func setupTopBarImage(isPortrait: Bool) {
let imgPath = getTopBarImage(isPortrait: isPortrait)
guard let path = imgPath else {
log.error("No image specified for the image banner!")
return
}
self.setBannerImage(to: path)
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

4
ios/samples/build_common.sh Normal file → Executable file
View file

@ -104,7 +104,7 @@ if [ $DO_UPDATE = true ]; then
base_dir="$(pwd)"
cd $KMEI_BUILD_DIR
./build.sh -only-framework $KMEI_FLAGS
./kmbuild.sh -only-framework $KMEI_FLAGS
cd $base_dir
fi
@ -122,7 +122,7 @@ fi
if [ $CODE_SIGN = true ]; then
xcodebuild -quiet -target "$TARGET" -config "$CONFIG"
else
xcodebuild -quiet CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -target "$TARGET" -config "$CONFIG"
xcodebuild -quiet CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED="NO" CODE_SIGNING_ENTITLEMENTS="" -target "$TARGET" -config "$CONFIG"
fi
if [ $? = 0 ]; then