This repository has been archived by the owner on Nov 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-Renamed File/Folder/FileSystemContainerBase to File/Folder/FileSyste…
…mContainer. This is because the user is interacting with the classes directly as a Container, so the naming looks better. -Added CreationCollisonOption Handling into the FolderContainer Abstraction, this gets overriden by UWPs Implementation for StorageFolders. This was reworked to ensure all Folder Implementations use the same Default Collision Option of FailIfExists. -In FolderContainer, added FileExistsAsync and FolderExistsAsync, made GetItemsAsync Virtual to be overriden if required. -Removed Delete Void from FileSystemContainer, added CanWrite method check to see if the file/folder can be written to. -Added FormatMarkers Support to PromptUser methods, this is a custom formatting technique of my own design, that allows spans of formatted text. Currently this is limited to toggling Bold with ^B^. This is currently supported by UWP and Android, and Removed from Console as it is unsupported. -Merged Android Shared Projects back into one. There is now a Toggle Boolean to use any Android AppComapt UI Classes over the default, called AndroidAppServices.UseAppCompatUI. -Created AlertDialogBuilder class Abstractions to handle setting PromptUser Dialog data in a uniform manner between the Default and AppCompat AlertDialogBuilder. -You can now fetch the CurrentActivity without providing a UIBinding. -Added AndroidDocumentsProviderFile/Folder Containers, these allow you to interact with files/folders from Android's Picker, however, Opening files with the Default App fails as Uris need to be reshared. -Added UpdateCurrentActivity back to OnCreate for PlatformBindingActivity, as it is required for UI handling during the OnCreate period of an Activity, such as Prompting the User with a Dialog. -Added more File/Folder Test Procedures.
- Loading branch information
1 parent
eb1b755
commit c1cb381
Showing
57 changed files
with
6,260 additions
and
505 deletions.
There are no files selected for viewing
31 changes: 0 additions & 31 deletions
31
Android-AppCompatV7/PlatformBindings-Android-AppCompatV7.csproj
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
15 changes: 7 additions & 8 deletions
15
...red/Activities/PlatformBindingActivity.cs → ...oid/Activities/PlatformBindingActivity.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using Android.App; | ||
using Android.Content; | ||
using Android.OS; | ||
using Android.Runtime; | ||
using Android.Views; | ||
|
||
namespace PlatformBindings.Activities | ||
{ | ||
public class PlatformBindingCompatActivity : Android.Support.V7.App.AppCompatActivity | ||
{ | ||
public PlatformBindingCompatActivity() | ||
{ | ||
Handler = ActivityHandler.GetActivityHandler(this); | ||
} | ||
|
||
protected override void OnCreate(Bundle savedInstanceState) | ||
{ | ||
Handler.UpdateCurrentActivity(); | ||
base.OnCreate(savedInstanceState); | ||
} | ||
|
||
protected override void OnResume() | ||
{ | ||
Handler.UpdateCurrentActivity(); | ||
base.OnResume(); | ||
} | ||
|
||
protected override void OnActivityResult(int requestCode, [GeneratedEnum] Result resultCode, Intent data) | ||
{ | ||
Handler.UpdateCurrentActivity(); | ||
Handler.OnActivityResult(requestCode, resultCode, data); | ||
base.OnActivityResult(requestCode, resultCode, data); | ||
} | ||
|
||
public override void OnCreateContextMenu(IContextMenu menu, View v, IContextMenuContextMenuInfo menuInfo) | ||
{ | ||
if (!Handler.OnCreateContextMenu(menu, v, menuInfo)) | ||
{ | ||
base.OnCreateContextMenu(menu, v, menuInfo); | ||
} | ||
} | ||
|
||
public ActivityHandler Handler { get; } | ||
} | ||
} |
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
File renamed without changes.
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
3 changes: 1 addition & 2 deletions
3
Android-Shared/Models/ActivityResult.cs → Android/Models/ActivityResult.cs
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
| ||
using Android.App; | ||
using Android.App; | ||
using Android.Content; | ||
|
||
namespace PlatformBindings.Models | ||
|
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,55 @@ | ||
using System; | ||
using Java.Lang; | ||
using Android.App; | ||
using Android.Content; | ||
using PlatformBindings.Enums; | ||
using Android.Views; | ||
using System.Threading.Tasks; | ||
|
||
namespace PlatformBindings.Models.DialogHandling | ||
{ | ||
public class AlertDialogBuilder : AlertDialogBuilderBase | ||
{ | ||
public AlertDialogBuilder(Context Context) : base(Context) | ||
{ | ||
Builder = new AlertDialog.Builder(Context); | ||
} | ||
|
||
public override void SetMessage(ICharSequence text) | ||
{ | ||
Builder.SetMessage(text); | ||
} | ||
|
||
public override void SetPrimaryButton(ICharSequence text) | ||
{ | ||
Builder.SetNegativeButton(text, new EventHandler<DialogClickEventArgs>((s, e) => Waiter.TrySetResult(DialogResult.Primary))); | ||
} | ||
|
||
public override void SetSecondaryButton(ICharSequence text) | ||
{ | ||
Builder.SetPositiveButton(text, new EventHandler<DialogClickEventArgs>((s, e) => Waiter.TrySetResult(DialogResult.Secondary))); | ||
} | ||
|
||
public override void SetTitle(ICharSequence text) | ||
{ | ||
Builder.SetTitle(text); | ||
} | ||
|
||
public override void SetView(View view) | ||
{ | ||
Builder.SetView(view); | ||
} | ||
|
||
public override void SetView(int LayoutResId) | ||
{ | ||
Builder.SetView(LayoutResId); | ||
} | ||
|
||
public override void Show() | ||
{ | ||
Builder.Show(); | ||
} | ||
|
||
private AlertDialog.Builder Builder { get; } | ||
} | ||
} |
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,65 @@ | ||
using Android.Content; | ||
using Android.Views; | ||
using Java.Lang; | ||
using PlatformBindings.Enums; | ||
using System.Threading.Tasks; | ||
|
||
namespace PlatformBindings.Models.DialogHandling | ||
{ | ||
public abstract class AlertDialogBuilderBase | ||
{ | ||
public static AlertDialogBuilderBase Pick(Context Context) | ||
{ | ||
if (AndroidAppServices.UseAppCompatUI) return new CompatAlertDialogBuilder(Context); | ||
else return new AlertDialogBuilder(Context); | ||
} | ||
|
||
public AlertDialogBuilderBase(Context Context) | ||
{ | ||
this.Context = Context; | ||
} | ||
|
||
public void SetTitle(string text) | ||
{ | ||
SetTitle(new String(text)); | ||
} | ||
|
||
public abstract void SetTitle(ICharSequence text); | ||
|
||
public void SetMessage(string text) | ||
{ | ||
SetMessage(new String(text)); | ||
} | ||
|
||
public abstract void SetMessage(ICharSequence text); | ||
|
||
public void SetPrimaryButton(string text) | ||
{ | ||
SetPrimaryButton(new String(text)); | ||
} | ||
|
||
public abstract void SetPrimaryButton(ICharSequence text); | ||
|
||
public void SetSecondaryButton(string text) | ||
{ | ||
SetSecondaryButton(new String(text)); | ||
} | ||
|
||
public abstract void SetSecondaryButton(ICharSequence text); | ||
|
||
public abstract void SetView(View view); | ||
|
||
public abstract void SetView(int LayoutResId); | ||
|
||
public abstract void Show(); | ||
|
||
public async Task<DialogResult> ShowAsync() | ||
{ | ||
Show(); | ||
return await Waiter.Task; | ||
} | ||
|
||
public Context Context { get; } | ||
protected TaskCompletionSource<DialogResult> Waiter = new TaskCompletionSource<DialogResult>(); | ||
} | ||
} |
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,53 @@ | ||
using System; | ||
using Java.Lang; | ||
using Android.Content; | ||
using PlatformBindings.Enums; | ||
using Android.Views; | ||
|
||
namespace PlatformBindings.Models.DialogHandling | ||
{ | ||
public class CompatAlertDialogBuilder : AlertDialogBuilderBase | ||
{ | ||
public CompatAlertDialogBuilder(Context Context) : base(Context) | ||
{ | ||
Builder = new Android.Support.V7.App.AlertDialog.Builder(Context); | ||
} | ||
|
||
public override void SetMessage(ICharSequence text) | ||
{ | ||
Builder.SetMessage(text); | ||
} | ||
|
||
public override void SetPrimaryButton(ICharSequence text) | ||
{ | ||
Builder.SetPositiveButton(text, new EventHandler<DialogClickEventArgs>((s, e) => Waiter.TrySetResult(DialogResult.Primary))); | ||
} | ||
|
||
public override void SetSecondaryButton(ICharSequence text) | ||
{ | ||
Builder.SetNegativeButton(text, new EventHandler<DialogClickEventArgs>((s, e) => Waiter.TrySetResult(DialogResult.Secondary))); | ||
} | ||
|
||
public override void SetTitle(ICharSequence text) | ||
{ | ||
Builder.SetTitle(text); | ||
} | ||
|
||
public override void SetView(View view) | ||
{ | ||
Builder.SetView(view); | ||
} | ||
|
||
public override void SetView(int LayoutResId) | ||
{ | ||
Builder.SetView(LayoutResId); | ||
} | ||
|
||
public override void Show() | ||
{ | ||
Builder.Show(); | ||
} | ||
|
||
private Android.Support.V7.App.AlertDialog.Builder Builder { get; } | ||
} | ||
} |
Oops, something went wrong.