-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
watermark feature for iOS App #1420
Changes from 11 commits
2323f5e
7adf11b
83c3ce8
a7dc905
4180f0e
ca4cf39
3e646be
510d5b6
6c2b87d
04152dc
1076f23
ebbc6f3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72450,6 +72450,75 @@ | |
} | ||
} | ||
}, | ||
"ScreenshotNotificationButton" : { | ||
"extractionState" : "manual", | ||
"localizations" : { | ||
"ar" : { | ||
"stringUnit" : { | ||
"state" : "translated", | ||
"value" : "أنا أفهم" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For the future: translations will happen on https://app.transifex.com/owncloud-org/owncloud-ios/dashboard/ Any change done in the source code will be overwritten on a daily basis once merged. |
||
} | ||
}, | ||
"de" : { | ||
"stringUnit" : { | ||
"state" : "translated", | ||
"value" : "Verstanden" | ||
} | ||
}, | ||
"en" : { | ||
"stringUnit" : { | ||
"state" : "translated", | ||
"value" : "I understand" | ||
} | ||
} | ||
} | ||
}, | ||
"ScreenshotNotificationMessage" : { | ||
"extractionState" : "manual", | ||
"localizations" : { | ||
"ar" : { | ||
"stringUnit" : { | ||
"state" : "translated", | ||
"value" : " تم اكتشاف لقطة شاشة، ولا يسمح بلقطات الشاشة وتسجيلات الشاشة لهذا التطبيق" | ||
} | ||
}, | ||
"de" : { | ||
"stringUnit" : { | ||
"state" : "translated", | ||
"value" : "Screen Capture Detected, Screenshots und Bildschirmaufnahmen dieser Anwendung sind nicht erlaubt." | ||
} | ||
}, | ||
"en" : { | ||
"stringUnit" : { | ||
"state" : "translated", | ||
"value" : "Screen Capture Detected, Screenshots and screen recordings of this app are not allowed." | ||
} | ||
} | ||
} | ||
}, | ||
"ScreenshotNotificationTitle" : { | ||
"extractionState" : "manual", | ||
"localizations" : { | ||
"ar" : { | ||
"stringUnit" : { | ||
"state" : "translated", | ||
"value" : "Screenshot taken" | ||
} | ||
}, | ||
"de" : { | ||
"stringUnit" : { | ||
"state" : "translated", | ||
"value" : "Bildschirmaufnahme gemacht" | ||
} | ||
}, | ||
"en" : { | ||
"stringUnit" : { | ||
"state" : "translated", | ||
"value" : "Screenshot taken" | ||
} | ||
} | ||
} | ||
}, | ||
"Scroll to Bottom": { | ||
"extractionState": "manual", | ||
"localizations": { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,6 +103,58 @@ public class VendorServices : NSObject { | |
return false | ||
} | ||
|
||
public var watermarkEnabled: Bool { | ||
if let watermarkEnabled = self.classSetting(forOCClassSettingsKey: .watermarkEnabled) as? Bool { | ||
return watermarkEnabled | ||
} | ||
|
||
return false | ||
} | ||
|
||
public var watermarkOpacity: Int { | ||
if let watermarkOpacity = self.classSetting(forOCClassSettingsKey: .watermarkOpacity) as? Int { | ||
return watermarkOpacity | ||
} | ||
|
||
return 100 | ||
} | ||
|
||
public var watermarkFontSize: Int { | ||
if let watermarkFontSize = self.classSetting(forOCClassSettingsKey: .watermarkFontSize) as? Int { | ||
return watermarkFontSize | ||
} | ||
|
||
return 15 | ||
} | ||
|
||
public var watermarkText: String? { | ||
return self.classSetting(forOCClassSettingsKey: .watermarkText) as? String | ||
} | ||
|
||
public var watermarkShowMail: Bool { | ||
if let watermarkShowMail = self.classSetting(forOCClassSettingsKey: .watermarkShowMail) as? Bool { | ||
return watermarkShowMail | ||
} | ||
|
||
return false | ||
} | ||
|
||
public var watermarkShowDate: Bool { | ||
if let watermarkShowDate = self.classSetting(forOCClassSettingsKey: .watermarkShowDate) as? Bool { | ||
return watermarkShowDate | ||
} | ||
|
||
return false | ||
} | ||
|
||
public var showScreenshotNotification: Bool { | ||
if let showScreenshotNotification = self.classSetting(forOCClassSettingsKey: .showScreenshotNotification) as? Bool { | ||
return showScreenshotNotification | ||
} | ||
|
||
return false | ||
} | ||
|
||
static public var shared : VendorServices = { | ||
return VendorServices() | ||
}() | ||
|
@@ -151,6 +203,14 @@ public extension OCClassSettingsKey { | |
|
||
static let appStoreLink = OCClassSettingsKey("app-store-link") | ||
static let recommendToFriendEnabled = OCClassSettingsKey("recommend-to-friend-enabled") | ||
|
||
static let watermarkEnabled = OCClassSettingsKey("watermark-enabled") | ||
static let watermarkOpacity = OCClassSettingsKey("watermark-opacity") | ||
static let watermarkFontSize = OCClassSettingsKey("watermark-font-size") | ||
static let watermarkText = OCClassSettingsKey("watermark-text") | ||
static let watermarkShowMail = OCClassSettingsKey("watermark-show-mail") | ||
static let watermarkShowDate = OCClassSettingsKey("watermark-show-date") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since the |
||
static let showScreenshotNotification = OCClassSettingsKey("show-screenshot-notification") | ||
} | ||
|
||
extension VendorServices : OCClassSettingsSupport { | ||
|
@@ -165,7 +225,16 @@ extension VendorServices : OCClassSettingsSupport { | |
.enableReviewPrompt: VendorServices.shared.enableReviewPrompt, | ||
|
||
.appStoreLink : "https://itunes.apple.com/app/id1359583808?mt=8", | ||
.recommendToFriendEnabled: !VendorServices.shared.isBranded | ||
.recommendToFriendEnabled: !VendorServices.shared.isBranded, | ||
|
||
.watermarkEnabled: false, | ||
.watermarkOpacity: 80, | ||
.watermarkFontSize: 20, | ||
.watermarkText: "", | ||
.watermarkShowMail: true, | ||
.watermarkShowDate: true, | ||
.showScreenshotNotification: true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's a trailing comma here that should be removed. |
||
|
||
] | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,8 @@ | |
*/ | ||
|
||
import UIKit | ||
import ownCloudApp | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change is not needed and should be removed. |
||
|
||
|
||
public extension UIView { | ||
// MARK: - Animation | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and similar code is repeated several times across in different places. It would require changes if
Passing the bookmark directly and extracting the desired information in the
watermark
method would be a more flexible and less repetitive pattern.