-
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1117 from kiwix/1116-ios-library-scroll-no-viewmo…
…difier-fix Fix library scroll issue - part 1
- Loading branch information
Showing
7 changed files
with
215 additions
and
97 deletions.
There are no files selected for viewing
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,36 @@ | ||
// This file is part of Kiwix for iOS & macOS. | ||
// | ||
// Kiwix is free software; you can redistribute it and/or modify it | ||
// under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation; either version 3 of the License, or | ||
// any later version. | ||
// | ||
// Kiwix is distributed in the hope that it will be useful, but | ||
// WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
// General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Kiwix; If not, see https://www.gnu.org/licenses/. | ||
|
||
import SwiftUI | ||
|
||
struct ArticleActions: View { | ||
|
||
let zimFileID: UUID | ||
|
||
var body: some View { | ||
AsyncButton { | ||
guard let url = await ZimFileService.shared.getMainPageURL(zimFileID: zimFileID) else { return } | ||
NotificationCenter.openURL(url, inNewTab: true) | ||
} label: { | ||
Label(LocalString.library_zim_file_context_main_page_label, systemImage: "house") | ||
} | ||
AsyncButton { | ||
guard let url = await ZimFileService.shared.getRandomPageURL(zimFileID: zimFileID) else { return } | ||
NotificationCenter.openURL(url, inNewTab: true) | ||
} label: { | ||
Label(LocalString.library_zim_file_context_random_label, systemImage: "die.face.5") | ||
} | ||
} | ||
} |
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,35 @@ | ||
// This file is part of Kiwix for iOS & macOS. | ||
// | ||
// Kiwix is free software; you can redistribute it and/or modify it | ||
// under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation; either version 3 of the License, or | ||
// any later version. | ||
// | ||
// Kiwix is distributed in the hope that it will be useful, but | ||
// WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
// General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Kiwix; If not, see https://www.gnu.org/licenses/. | ||
|
||
import SwiftUI | ||
import UniformTypeIdentifiers | ||
|
||
struct CopyPasteMenu: View { | ||
|
||
let downloadURL: URL | ||
|
||
var body: some View { | ||
Button { | ||
#if os(macOS) | ||
NSPasteboard.general.clearContents() | ||
NSPasteboard.general.setString(downloadURL.absoluteString, forType: .string) | ||
#elseif os(iOS) | ||
UIPasteboard.general.setValue(downloadURL.absoluteString, forPasteboardType: UTType.url.identifier) | ||
#endif | ||
} label: { | ||
Label(LocalString.library_zim_file_context_copy_url, systemImage: "doc.on.doc") | ||
} | ||
} | ||
} |
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
Oops, something went wrong.