mirror of
https://github.com/ppy/osu.git
synced 2026-05-13 19:54:15 +08:00
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 <pe@ppy.sh>
This commit is contained in:
committed by
GitHub
Unverified
parent
caffc7238b
commit
321e698906
@@ -5,16 +5,13 @@
|
||||
android:supportsRtl="true"
|
||||
android:label="osu!"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:roundIcon="@mipmap/ic_launcher" />
|
||||
<!-- for editor usage -->
|
||||
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
|
||||
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
|
||||
<!--
|
||||
READ_MEDIA_* permissions are available only on API 33 or greater. Devices with older android versions
|
||||
don't understand the new permissions, so request the old READ_EXTERNAL_STORAGE permission to get storage access.
|
||||
Since the old permission has no effect on >= API 33, don't request it.
|
||||
|
||||
Care needs to be taken to ensure runtime permission checks target the correct permission for the API level.
|
||||
-->
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32"/>
|
||||
android:roundIcon="@mipmap/ic_launcher">
|
||||
<provider android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="sh.ppy.osulazer.fileprovider"
|
||||
android:grantUriPermissions="true"
|
||||
android:exported="false">
|
||||
<meta-data android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/filepaths" />
|
||||
</provider>
|
||||
</application>
|
||||
</manifest>
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<paths>
|
||||
<!-- https://developer.android.com/reference/androidx/core/content/FileProvider -->
|
||||
<external-files-path path="logs" name="logs" />
|
||||
<external-files-path path="exports" name="exports" />
|
||||
</paths>
|
||||
@@ -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]
|
||||
|
||||
@@ -47,5 +47,12 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
{
|
||||
base.Dispose(isDisposing);
|
||||
|
||||
selector?.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user