Initial version.

This commit is contained in:
Oliver Hauff 2021-05-13 20:03:07 +02:00
parent 193aaa1a56
commit b72c67a53e
228 changed files with 25924 additions and 0 deletions

View file

@ -0,0 +1,82 @@
using System;
using System.Threading.Tasks;
namespace TINK.View
{
public interface IViewService
{
/// <summary> Displays alert message. </summary>
/// <param name="title">Title of message.</param>
/// <param name="message">Message to display.</param>
/// <param name="cancel">Text of button.</param>
Task DisplayAlert(
string title,
string message,
string cancel);
/// <summary> Displays alert message. </summary>
/// <param name="title">Title of message.</param>
/// <param name="message">Message to display.</param>
/// <param name="details">Detailed error description.</param>
/// <param name="cancel">Text of button.</param>
Task DisplayAdvancedAlert(
string title,
string message,
string details,
string cancel);
/// <summary> Displays alert message. </summary>
/// <param name="p_strTitle">Title of message.</param>
/// <param name="p_strMessage">Message to display.</param>
/// <param name="p_strAccept">Text of accept button.</param>
/// <param name="p_strCancel">Text of button.</param>
/// <returns>True if user pressed accept.</returns>
Task<bool> DisplayAlert(string p_strTitle, string p_strMessage, string p_strAccept, string p_strCancel);
/// <summary> Displays an action sheet. </summary>
/// <param name="title">Title of message.</param>
/// <param name="p_strMessage">Message to display.</param>
/// <param name="cancel">Text of button.</param>
/// <param name="destruction"></param>
/// <param name="buttons">Buttons holding options to select.</param>
/// <returns>T</returns>
Task<string> DisplayActionSheet(string title, string cancel, string destruction, params string[] buttons);
/// <summary> Show a page.</summary>
/// <param name="type">Type of page to show.</param>
/// <param name="title">Title of page to show.</param>
void ShowPage(ViewTypes type, string title = null);
/// <summary> Pushes a page onto the stack. </summary>
/// <param name="typeOfPage">Page to display.</param>
Task PushAsync(ViewTypes typeOfPage);
/// <summary> Pushes a page onto the modal stack. </summary>
/// <param name="typeOfPage">Page to display.</param>
Task PushModalAsync(ViewTypes typeOfPage);
/// <summary> Pushes a page onto the modal stack. </summary>
Task PopModalAsync();
Task<IUserFeedback> DisplayUserFeedbackPopup();
/// <summary>
/// Feedback given by user when returning bike.
/// </summary>
public interface IUserFeedback
{
/// <summary>
/// Holds whether bike is broken or not.
/// </summary>
bool IsBikeBroken { get; set; }
/// <summary>
/// Holds either
/// - general feedback
/// - error description of broken bike
/// or both.
/// </summary>
string Message { get; set; }
}
}
}

View file

@ -0,0 +1,15 @@
using Serilog;
using System;
namespace TINK.View.MasterDetail
{
public class EmptyNavigationMasterDetail : INavigationMasterDetail
{
public bool IsGestureEnabled { set => Log.ForContext<EmptyNavigationMasterDetail>().Error($"Unexpected call of {nameof(IsGestureEnabled)} detected."); }
public void ShowPage(Type p_oTypeOfPage, string p_strTitle = null)
{
Log.ForContext<EmptyNavigationMasterDetail>().Error($"Unexpected call of {nameof(ShowPage)} detected.");
}
}
}

View file

@ -0,0 +1,15 @@
using TINK.View.MasterDetail;
namespace TINK.View
{
/// <summary>
/// Interface to provide navigation functionality to detail page.
/// </summary>
public interface IDetailPage
{
/// <summary>
/// Delegate to perform navigation.
/// </summary>
INavigationMasterDetail NavigationMasterDetail { set; }
}
}

View file

@ -0,0 +1,18 @@
using System;
namespace TINK.View.MasterDetail
{
public interface INavigationMasterDetail
{
/// <summary>
/// Creates and a page an shows it.
/// </summary>
/// <param name="p_oTypeOfPage">Type of page to show.</param>
void ShowPage(Type p_oTypeOfPage, string p_strTitle = null);
/// <summary>
/// Set a value indicating whether master deatail navigation menu is available or not.
/// </summary>
bool IsGestureEnabled { set; }
}
}

View file

@ -0,0 +1,7 @@
namespace TINK.View.Themes
{
public interface ITheme
{
string OperatorInfo { get; }
}
}

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<ResourceDictionary xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="TINK.Themes.Konrad">
<!-- Pallete -->
<Color x:Key="primary-back-title-color">Red</Color>
<!-- Pallete-end -->
<Style ApplyToDerivedTypes="true" TargetType="NavigationPage">
<Setter Property="BarBackgroundColor" Value="{DynamicResource Key=primary-back-title-color}"/>
</Style>
</ResourceDictionary>

View file

@ -0,0 +1,17 @@
using TINK.View.Themes;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace TINK.Themes
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class Konrad : ResourceDictionary, ITheme
{
public Konrad ()
{
InitializeComponent ();
}
public string OperatorInfo => "Konrad Konstanz";
}
}

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<ResourceDictionary xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="TINK.Themes.ShareeBike">
<!-- Pallete -->
<Color x:Key="primary-back-title-color">#009899</Color>
<!-- Pallete-end -->
<Style ApplyToDerivedTypes="true" TargetType="NavigationPage">
<Setter Property="BarBackgroundColor" Value="{DynamicResource Key=primary-back-title-color}"/>
</Style>
</ResourceDictionary>

View file

@ -0,0 +1,17 @@
using TINK.View.Themes;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace TINK.Themes
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class ShareeBike : ResourceDictionary, ITheme
{
public ShareeBike ()
{
InitializeComponent ();
}
public string OperatorInfo => string.Empty;
}
}