Added share buttons to android

This commit is contained in:
Yousef Khadadeh 2026-05-31 18:35:57 +03:00
parent e2a62e852c
commit 7f94f65bea
16 changed files with 146 additions and 19 deletions

View file

@ -427,6 +427,17 @@ void FileSelectScreen::move_selected_files(const std::filesystem::path& fromPath
}
}
void FileSelectScreen::share_selected_files() {
for(const FileInfo& f : fileList) {
if(f.selected) {
#ifdef __ANDROID__
AndroidJNICalls::shareInternalFile("saves/" + f.fileName + ".infpnt", "application/octet-stream");
#endif
break;
}
}
}
void FileSelectScreen::duplicate_selected_files(const std::filesystem::path& inPath) {
std::vector<std::string> toFolderListNames;
try {
@ -571,6 +582,15 @@ void FileSelectScreen::edit_action_bar() {
update_file_list(fileList, savePath, false);
editMode = false;
});
#ifdef __ANDROID__
if(numberOfSelectedEntries == 1) {
edit_action_bar_button("share", "data/icons/RemixIcon/share-line.svg", "Share", [&] {
share_selected_files();
update_file_list(fileList, savePath, false);
editMode = false;
});
}
#endif
}
else if(selectedMenu == SelectedMenu::TRASH) {
edit_action_bar_button("restore", "data/icons/RemixIcon/refresh-line.svg", "Restore", [&] {