[Libreoffice-commits] core.git: 2 commits - ios/LibreOfficeLight
jan Iversen
jani at libreoffice.org
Sun Oct 29 09:47:33 UTC 2017
ios/LibreOfficeLight/LibreOfficeLight/AppDelegate.swift | 10 -
ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift | 77 +++++++---
ios/LibreOfficeLight/LibreOfficeLight/en.lproj/Main.storyboard | 48 ++++--
3 files changed, 99 insertions(+), 36 deletions(-)
New commits:
commit 82cd9f8efd8cc8fd8e5bafbdaf39c94efda6a030
Author: jan Iversen <jani at libreoffice.org>
Date: Sun Oct 29 10:45:46 2017 +0100
iOS, document handle sidebar
Change-Id: I4df15312f1174009d7d34b02241c129abc27c0b7
diff --git a/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift b/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift
index 0190ad946666..39a49d2a01eb 100755
--- a/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift
+++ b/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift
@@ -15,14 +15,24 @@ import UIKit
// It is a delegate class to recieve Menu events as well as file handling events
class DocumentController: UIViewController, MenuDelegate, UIDocumentBrowserViewControllerDelegate
{
- // Show sidemenu (part of documentcontroller)
+ // handling of PropertiesController
+ // The PropertiesController is a left sidebar, that will scroll in when activated
+ // The Controller handles manipulation of properties in the document
+
+ // Activate/Deactivate PropertiesController (from navigationController, see storyboard)
@IBAction func doProperties(_ sender: UIBarButtonItem)
{
+ // Check if deactivation
if (sender.tag == 99) {
+ // Deactivate
+
+ // Mark it as deactivated (it stays loaded)
sender.tag = 0;
+ // get handle of PropertiesController
let viewMenuBack : UIView = view.subviews.last!
+ // Blend out sidebar
UIView.animate(withDuration: 0.3, animations: { () -> Void in
var frameMenu : CGRect = viewMenuBack.frame
frameMenu.origin.x = -1 * UIScreen.main.bounds.size.width
@@ -32,27 +42,39 @@ class DocumentController: UIViewController, MenuDelegate, UIDocumentBrowserViewC
}, completion: { (finished) -> Void in
viewMenuBack.removeFromSuperview()
})
- return
}
-
- sender.isEnabled = false
- sender.tag = 99
-
- let properties : PropertiesController = self.storyboard!.instantiateViewController(withIdentifier: "PropertiesController") as! PropertiesController
- view.addSubview(properties.view)
- addChildViewController(properties)
- properties.view.layoutIfNeeded()
-
- properties.view.frame=CGRect(x: 0 - UIScreen.main.bounds.size.width, y: 0, width: UIScreen.main.bounds.size.width, height: UIScreen.main.bounds.size.height);
-
- UIView.animate(withDuration: 0.3, animations: { () -> Void in
- properties.view.frame=CGRect(x: 0, y: 0, width: UIScreen.main.bounds.size.width, height: UIScreen.main.bounds.size.height);
- sender.isEnabled = true
- }, completion:nil)
+ else {
+ // Activate
+
+ // Mark as activated
+ sender.isEnabled = false
+ sender.tag = 99
+
+ // make instance of PropertiesController
+ let prop : PropertiesController = self.storyboard!.instantiateViewController(
+ withIdentifier: "PropertiesController") as! PropertiesController
+ view.addSubview(prop.view)
+ addChildViewController(prop)
+ prop.view.layoutIfNeeded()
+ prop.view.frame=CGRect(x: 0 - UIScreen.main.bounds.size.width,
+ y: 0,
+ width: UIScreen.main.bounds.size.width,
+ height: UIScreen.main.bounds.size.height);
+
+ // Blend in sidebar
+ UIView.animate(withDuration: 0.3, animations: { () -> Void in
+ prop.view.frame=CGRect(x: 0,
+ y: 0,
+ width: UIScreen.main.bounds.size.width,
+ height: UIScreen.main.bounds.size.height);
+ sender.isEnabled = true
+ }, completion:nil)
+ }
}
+ // Handling of Background (hipernate)
public func Hipernate() -> Void
{
}
diff --git a/ios/LibreOfficeLight/LibreOfficeLight/en.lproj/Main.storyboard b/ios/LibreOfficeLight/LibreOfficeLight/en.lproj/Main.storyboard
index 81a2b4b5376c..925ce28c9b27 100755
--- a/ios/LibreOfficeLight/LibreOfficeLight/en.lproj/Main.storyboard
+++ b/ios/LibreOfficeLight/LibreOfficeLight/en.lproj/Main.storyboard
@@ -117,10 +117,10 @@
</objects>
<point key="canvasLocation" x="259.19999999999999" y="305.84707646176912"/>
</scene>
- <!--Sidebar Controller-->
+ <!--Properties Controller-->
<scene sceneID="moB-At-Om8">
<objects>
- <viewController storyboardIdentifier="SidebarController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="E9y-3m-fEc" customClass="SidebarController" customModule="LibreOfficeLight" customModuleProvider="target" sceneMemberID="viewController">
+ <viewController storyboardIdentifier="PropertiesController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="E9y-3m-fEc" userLabel="Properties Controller" customClass="PropertiesController" customModule="LibreOfficeLight" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="qJv-1E-iEi"/>
<viewControllerLayoutGuide type="bottom" id="syI-80-ufe"/>
commit 351d83c357093ac0ec6d3768355df9ee1b224d02
Author: jan Iversen <jani at libreoffice.org>
Date: Sun Oct 29 10:15:44 2017 +0100
iOS background handling
When the app moves to background (hipernate) LOkit needs to be
stopped, and when it reenters foreground started again.
In order to keep AppDelegate slim as recommended, calls to
DocumentController are added.
Change-Id: I7e4c8c5ae7fe29235381e3e7217abfd1911e39ad
diff --git a/ios/LibreOfficeLight/LibreOfficeLight/AppDelegate.swift b/ios/LibreOfficeLight/LibreOfficeLight/AppDelegate.swift
index 12e596bc030d..9bdc1fefa48e 100644
--- a/ios/LibreOfficeLight/LibreOfficeLight/AppDelegate.swift
+++ b/ios/LibreOfficeLight/LibreOfficeLight/AppDelegate.swift
@@ -39,14 +39,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate
let appInfo = Bundle.main.infoDictionary! as Dictionary<String,AnyObject>
let applicationVersion = (appInfo["CFBundleShortVersionString"] as! String) + "." +
(appInfo["CFBundleVersion"] as! String)
+
+ // Add version string to setting
let defaults = UserDefaults.standard
defaults.set(applicationVersion, forKey: "application_version")
defaults.synchronize()
// start LibreOfficeKit
//FIX BridgeLOkit_Init(Bundle.main.bundlePath)
- //FIX BridgeLOkit_open("jan");
- //FIX BridgeLOkit_ClientCommand("jan");
return true
}
@@ -72,7 +72,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate
// this method is called instead of applicationWillTerminate: when the user quits.
func applicationDidEnterBackground(_ application: UIApplication)
{
- // Jan to do done (scale down LO)
+ let document = window?.rootViewController?.childViewControllers[0] as! DocumentController
+ document.Hipernate()
}
@@ -81,7 +82,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate
// Restart timers, tasks as well as graphic rendering
func applicationWillEnterForeground(_ application: UIApplication)
{
- // Jan to be done (reactivate LO)
+ let document = window?.rootViewController?.childViewControllers[0] as! DocumentController
+ document.LeaveHipernate()
}
diff --git a/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift b/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift
index 1ef7d80c792f..0190ad946666 100755
--- a/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift
+++ b/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift
@@ -53,6 +53,14 @@ class DocumentController: UIViewController, MenuDelegate, UIDocumentBrowserViewC
+ public func Hipernate() -> Void
+ {
+ }
+
+ public func LeaveHipernate() -> Void
+ {
+ }
+
// var currentDocumentName : String?
@@ -67,6 +75,9 @@ class DocumentController: UIViewController, MenuDelegate, UIDocumentBrowserViewC
toDestinationURL destinationURL: URL)
{
// Tells the delegate that a document has been successfully imported.
+ //FIX BridgeLOkit_open("jan");
+ //FIX BridgeLOkit_ClientCommand("jan");
+
}
internal func documentBrowser(_ controller: UIDocumentBrowserViewController,
@@ -80,6 +91,8 @@ class DocumentController: UIViewController, MenuDelegate, UIDocumentBrowserViewC
didPickDocumentURLs documentURLs: [URL])
{
// Tells the delegate that the user has selected one or more documents.
+ //FIX BridgeLOkit_open("jan");
+ //FIX BridgeLOkit_ClientCommand("jan");
}
@IBOutlet weak var janTest: UILabel!
@@ -112,16 +125,19 @@ class DocumentController: UIViewController, MenuDelegate, UIDocumentBrowserViewC
self.present(openMenu, animated: true, completion: nil)
print("menu Open... to be done")
- case 2: // Save
+ case 2: // Properties
+ print("menu Properties to be done")
+
+ case 3: // Save
print("menu Save to be done")
- case 3: // Save as...
+ case 4: // Save as...
print("menu Save as... to be done")
- case 4: // Save as PDF...
+ case 5: // Save as PDF...
print("menu Save as PDF... to be done")
- case 5: // Print...
+ case 6: // Print...
print("menu Print... to be done")
default: // should not happen
@@ -172,6 +188,7 @@ class DocumentActions: UITableViewController
delegate?.actionMenuSelected(sender.tag)
}
+ @IBOutlet weak var buttonProperties: UIButton!
@IBOutlet weak var buttonNew: UIButton!
@IBOutlet weak var buttonOpen: UIButton!
@IBOutlet weak var buttonSave: UIButton!
diff --git a/ios/LibreOfficeLight/LibreOfficeLight/en.lproj/Main.storyboard b/ios/LibreOfficeLight/LibreOfficeLight/en.lproj/Main.storyboard
index 25d77018d279..81a2b4b5376c 100755
--- a/ios/LibreOfficeLight/LibreOfficeLight/en.lproj/Main.storyboard
+++ b/ios/LibreOfficeLight/LibreOfficeLight/en.lproj/Main.storyboard
@@ -286,7 +286,7 @@
<objects>
<tableViewController autoresizesArchivedViewToFullSize="NO" title="Document Actions" automaticallyAdjustsScrollViewInsets="NO" modalTransitionStyle="crossDissolve" modalPresentationStyle="overCurrentContext" clearsSelectionOnViewWillAppear="NO" id="IER-X5-Ax8" customClass="DocumentActions" customModule="LibreOfficeLight" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="static" style="plain" separatorStyle="default" rowHeight="30" sectionHeaderHeight="28" sectionFooterHeight="28" id="RqF-IL-YJc">
- <rect key="frame" x="0.0" y="0.0" width="134" height="150"/>
+ <rect key="frame" x="0.0" y="0.0" width="134" height="180"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<sections>
@@ -320,7 +320,28 @@
<rect key="frame" x="0.0" y="0.0" width="134" height="29.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
- <button opaque="NO" tag="2" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="b90-ja-Wm0">
+ <button opaque="NO" tag="2" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="b90-ja-Wm0" userLabel="Button Properties">
+ <rect key="frame" x="8" y="0.0" width="118" height="30"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <accessibility key="accessibilityConfiguration" identifier="actionSave">
+ <bool key="isElement" value="NO"/>
+ </accessibility>
+ <state key="normal" title="Properties"/>
+ <connections>
+ <action selector="actionMenuSelect:" destination="IER-X5-Ax8" eventType="touchUpInside" id="ErC-4Q-0we"/>
+ </connections>
+ </button>
+ </subviews>
+ </tableViewCellContentView>
+ </tableViewCell>
+ <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="Osp-RA-lhK">
+ <rect key="frame" x="0.0" y="60" width="134" height="30"/>
+ <autoresizingMask key="autoresizingMask"/>
+ <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Osp-RA-lhK" id="mU4-Wv-5dR">
+ <rect key="frame" x="0.0" y="0.0" width="134" height="29.5"/>
+ <autoresizingMask key="autoresizingMask"/>
+ <subviews>
+ <button opaque="NO" tag="3" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="m45-MR-Gca">
<rect key="frame" x="8" y="0.0" width="118" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<accessibility key="accessibilityConfiguration" identifier="actionSave">
@@ -328,20 +349,20 @@
</accessibility>
<state key="normal" title="Save"/>
<connections>
- <action selector="actionMenuSelect:" destination="IER-X5-Ax8" eventType="touchUpInside" id="0gI-or-ji3"/>
+ <action selector="actionMenuSelect:" destination="IER-X5-Ax8" eventType="touchUpInside" id="pXt-Kb-Vjw"/>
</connections>
</button>
</subviews>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="AN7-6j-wO7">
- <rect key="frame" x="0.0" y="60" width="134" height="30"/>
+ <rect key="frame" x="0.0" y="90" width="134" height="30"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="AN7-6j-wO7" id="kl1-nQ-aIu">
<rect key="frame" x="0.0" y="0.0" width="134" height="29.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
- <button opaque="NO" tag="3" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="6vH-aM-aYe">
+ <button opaque="NO" tag="4" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="6vH-aM-aYe">
<rect key="frame" x="8" y="0.0" width="118" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<accessibility key="accessibilityConfiguration">
@@ -356,13 +377,13 @@
</tableViewCellContentView>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="GmK-gj-GYu">
- <rect key="frame" x="0.0" y="90" width="134" height="30"/>
+ <rect key="frame" x="0.0" y="120" width="134" height="30"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="GmK-gj-GYu" id="3OK-Zz-mqN">
<rect key="frame" x="0.0" y="0.0" width="134" height="29.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
- <button opaque="NO" tag="4" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="apE-3B-lUt" userLabel="Button Save As PDF">
+ <button opaque="NO" tag="5" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="apE-3B-lUt" userLabel="Button Save As PDF">
<rect key="frame" x="8" y="0.0" width="118" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<accessibility key="accessibilityConfiguration" identifier="actionSaveAsPDF">
@@ -377,13 +398,13 @@
</tableViewCellContentView>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="diN-3v-tgm">
- <rect key="frame" x="0.0" y="120" width="134" height="30"/>
+ <rect key="frame" x="0.0" y="150" width="134" height="30"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="diN-3v-tgm" id="24s-fs-4cw">
<rect key="frame" x="0.0" y="0.0" width="134" height="29.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
- <button opaque="NO" tag="5" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="tvH-WR-c61" userLabel="Button Print">
+ <button opaque="NO" tag="6" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="tvH-WR-c61" userLabel="Button Print">
<rect key="frame" x="8" y="0.0" width="118" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<accessibility key="accessibilityConfiguration">
@@ -406,15 +427,16 @@
</connections>
</tableView>
<extendedEdge key="edgesForExtendedLayout"/>
- <value key="contentSizeForViewInPopover" type="size" width="134" height="150"/>
+ <value key="contentSizeForViewInPopover" type="size" width="134" height="180"/>
<nil key="simulatedStatusBarMetrics"/>
<nil key="simulatedTopBarMetrics"/>
<nil key="simulatedBottomBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
- <size key="freeformSize" width="134" height="150"/>
+ <size key="freeformSize" width="134" height="180"/>
<connections>
<outlet property="buttonOpen" destination="myk-zs-md7" id="xQK-I1-pDl"/>
<outlet property="buttonPrint" destination="tvH-WR-c61" id="4YU-p2-Fim"/>
+ <outlet property="buttonProperties" destination="b90-ja-Wm0" id="scY-Fn-fss"/>
<outlet property="buttonSave" destination="b90-ja-Wm0" id="Sdz-lq-s3S"/>
<outlet property="buttonSaveAs" destination="6vH-aM-aYe" id="4KY-Zi-iH4"/>
<outlet property="buttonSaveAsPDF" destination="apE-3B-lUt" id="AZL-ON-v2Y"/>
More information about the Libreoffice-commits
mailing list