forked from ppy/osu-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Merge pull request ppy#6105 from hwsmm/sdl-cs-android"
- Loading branch information
Showing
23 changed files
with
2,231 additions
and
240 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,31 @@ | ||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using Android.Content; | ||
using osu.Framework.Platform; | ||
using SixLabors.ImageSharp; | ||
|
||
namespace osu.Framework.Android | ||
{ | ||
public class AndroidClipboard : Clipboard | ||
{ | ||
private readonly ClipboardManager? clipboardManager; | ||
|
||
public AndroidClipboard(AndroidGameView view) | ||
{ | ||
clipboardManager = view.Activity.GetSystemService(Context.ClipboardService) as ClipboardManager; | ||
} | ||
|
||
public override string? GetText() => clipboardManager?.PrimaryClip?.GetItemAt(0)?.Text; | ||
|
||
public override void SetText(string text) | ||
{ | ||
if (clipboardManager != null) | ||
clipboardManager.PrimaryClip = ClipData.NewPlainText(null, text); | ||
} | ||
|
||
public override Image<TPixel>? GetImage<TPixel>() => null; | ||
|
||
public override bool SetImage(Image image) => false; | ||
} | ||
} |
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.