@@ -205,6 +205,44 @@ class NCShare: UIViewController, NCShareNetworkingDelegate, NCSharePagingContent
205205 textField? . layer. borderColor = NCBrandColor . shared. brand. cgColor
206206 }
207207
208+ @objc func keyboardWillHide( notification: Notification ) {
209+ if view. frame. origin. y != 0 {
210+ self . view. frame. origin. y = 0
211+ }
212+ textField? . layer. borderColor = NCBrandColor . shared. label. cgColor
213+ }
214+
215+ @objc func keyboardWillShow( notification: Notification ) {
216+ if UIDevice . current. userInterfaceIdiom == . phone {
217+ if ( UIScreen . main. bounds. width < 374 || UIDevice . current. orientation. isLandscape) {
218+ if let keyboardSize = ( notification. userInfo ? [ UIResponder . keyboardFrameEndUserInfoKey] as? NSValue ) ? . cgRectValue {
219+ if view. frame. origin. y == 0 {
220+ self . tableView. scrollToRow ( at: IndexPath ( row: 0 , section: 0 ) , at: . top, animated: false )
221+ self . view. frame. origin. y -= keyboardSize. height
222+ }
223+ }
224+ } else if UIScreen . main. bounds. height < 850 {
225+ if view. frame. origin. y == 0 {
226+ self . tableView. scrollToRow ( at: IndexPath ( row: 0 , section: 0 ) , at: . top, animated: false )
227+ self . view. frame. origin. y -= 70
228+ }
229+ } else {
230+ if view. frame. origin. y == 0 {
231+ self . tableView. scrollToRow ( at: IndexPath ( row: 0 , section: 0 ) , at: . top, animated: false )
232+ self . view. frame. origin. y -= 40
233+ }
234+ }
235+ }
236+
237+ if UIDevice . current. userInterfaceIdiom == . pad, UIDevice . current. orientation. isLandscape {
238+ if view. frame. origin. y == 0 {
239+ self . tableView. scrollToRow ( at: IndexPath ( row: 0 , section: 0 ) , at: . top, animated: false )
240+ self . view. frame. origin. y -= 230
241+ }
242+ }
243+ textField? . layer. borderColor = NCBrandColor . shared. brand. cgColor
244+ }
245+
208246 @objc func keyboardWillHide( notification: Notification ) {
209247 if view. frame. origin. y != 0 {
210248 self . view. frame. origin. y = 0
@@ -285,7 +323,7 @@ class NCShare: UIViewController, NCShareNetworkingDelegate, NCSharePagingContent
285323 }
286324
287325 func checkEnforcedPassword( shareType: Int , completion: @escaping ( String ? ) -> Void ) {
288- guard NCCapabilities . shared. getCapabilities ( account : session . account ) . capabilityFileSharingPubPasswdEnforced,
326+ guard NCGlobal . shared. capabilityFileSharingPubPasswdEnforced,
289327 shareType == shareCommon. SHARE_TYPE_LINK || shareType == shareCommon. SHARE_TYPE_EMAIL
290328 else { return completion ( nil ) }
291329
0 commit comments