From 321e6989061246275f30ef80030fe560109291fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 10 Mar 2026 08:02:13 +0100 Subject: [PATCH] Improve support for import & export flows on Android via using system file picker & share sheet (#36901) https://github.com/user-attachments/assets/57d0bc9d-f081-4d04-8cb6-422a83f1a1d3 https://github.com/user-attachments/assets/208f0676-a735-4055-a422-e6a2c3847220 --- - [x] Depends on https://github.com/ppy/osu-framework/pull/6717 to work - Closes https://github.com/ppy/osu/issues/21076 - Closes https://github.com/ppy/osu/issues/22676 - Closes https://github.com/ppy/osu/issues/28666 --------- Co-authored-by: Dean Herbert --- osu.Android/AndroidManifest.xml | 21 ++++++++----------- osu.Android/Resources/xml/filepaths.xml | 6 ++++++ .../Sections/General/QuickActionSettings.cs | 20 +++++++----------- .../Sections/Maintenance/GeneralSettings.cs | 7 +++++++ osu.Game/Screens/Edit/Editor.cs | 9 +++----- 5 files changed, 32 insertions(+), 31 deletions(-) create mode 100644 osu.Android/Resources/xml/filepaths.xml diff --git a/osu.Android/AndroidManifest.xml b/osu.Android/AndroidManifest.xml index a85e711cf2..d334888a5f 100644 --- a/osu.Android/AndroidManifest.xml +++ b/osu.Android/AndroidManifest.xml @@ -5,16 +5,13 @@ android:supportsRtl="true" android:label="osu!" android:icon="@mipmap/ic_launcher" - android:roundIcon="@mipmap/ic_launcher" /> - - - - - + android:roundIcon="@mipmap/ic_launcher"> + + + + diff --git a/osu.Android/Resources/xml/filepaths.xml b/osu.Android/Resources/xml/filepaths.xml new file mode 100644 index 0000000000..a2356c4aab --- /dev/null +++ b/osu.Android/Resources/xml/filepaths.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/osu.Game/Overlays/Settings/Sections/General/QuickActionSettings.cs b/osu.Game/Overlays/Settings/Sections/General/QuickActionSettings.cs index 4f988d667f..02c1dfb8df 100644 --- a/osu.Game/Overlays/Settings/Sections/General/QuickActionSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/General/QuickActionSettings.cs @@ -2,7 +2,6 @@ // See the LICENCE file in the repository root for full licence text. using System.Threading.Tasks; -using osu.Framework; using osu.Framework.Allocation; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; @@ -58,20 +57,15 @@ namespace osu.Game.Overlays.Settings.Sections.General }, }); - bool supportsExport = RuntimeInfo.OS != RuntimeInfo.Platform.Android; - - if (supportsExport) + Add(new SettingsButtonV2 { - Add(new SettingsButtonV2 - { - Text = GeneralSettingsStrings.ExportLogs, - BackgroundColour = colours.YellowDarker.Darken(0.5f), - Keywords = new[] { @"bug", "report", "logs", "files" }, - Action = () => Task.Run(exportLogs), - }); + Text = GeneralSettingsStrings.ExportLogs, + BackgroundColour = colours.YellowDarker.Darken(0.5f), + Keywords = new[] { @"bug", "report", "logs", "files" }, + Action = () => Task.Run(exportLogs), + }); - exportStorage = (storage as OsuStorage)?.GetExportStorage() ?? storage.GetStorageForDirectory(@"exports"); - } + exportStorage = (storage as OsuStorage)?.GetExportStorage() ?? storage.GetStorageForDirectory(@"exports"); } [Resolved] diff --git a/osu.Game/Overlays/Settings/Sections/Maintenance/GeneralSettings.cs b/osu.Game/Overlays/Settings/Sections/Maintenance/GeneralSettings.cs index 2c79daffb6..e8345c1946 100644 --- a/osu.Game/Overlays/Settings/Sections/Maintenance/GeneralSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Maintenance/GeneralSettings.cs @@ -47,5 +47,12 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance } }); } + + protected override void Dispose(bool isDisposing) + { + base.Dispose(isDisposing); + + selector?.Dispose(); + } } } diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index 2360febccb..452419ca45 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -1287,12 +1287,9 @@ namespace osu.Game.Screens.Edit Hotkey = new Hotkey(GlobalAction.EditorDiscardUnsavedChanges) }; - if (RuntimeInfo.OS != RuntimeInfo.Platform.Android) - { - var export = createExportMenu(); - saveRelatedMenuItems.AddRange(export.Items); - yield return export; - } + var export = createExportMenu(); + saveRelatedMenuItems.AddRange(export.Items); + yield return export; if (RuntimeInfo.IsDesktop) {