mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-06-21 21:46:27 +02:00
Initial version.
This commit is contained in:
parent
193aaa1a56
commit
b72c67a53e
228 changed files with 25924 additions and 0 deletions
82
TINKLib/View/IViewService.cs
Normal file
82
TINKLib/View/IViewService.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
}
|
15
TINKLib/View/MasterDetail/EmptyNavigationMasterDetail.cs
Normal file
15
TINKLib/View/MasterDetail/EmptyNavigationMasterDetail.cs
Normal 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.");
|
||||
}
|
||||
}
|
||||
}
|
15
TINKLib/View/MasterDetail/IDetailPage.cs
Normal file
15
TINKLib/View/MasterDetail/IDetailPage.cs
Normal 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; }
|
||||
}
|
||||
}
|
18
TINKLib/View/MasterDetail/INavigationMasterDetail.cs
Normal file
18
TINKLib/View/MasterDetail/INavigationMasterDetail.cs
Normal 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; }
|
||||
}
|
||||
}
|
7
TINKLib/View/Themes/ITheme.cs
Normal file
7
TINKLib/View/Themes/ITheme.cs
Normal file
|
@ -0,0 +1,7 @@
|
|||
namespace TINK.View.Themes
|
||||
{
|
||||
public interface ITheme
|
||||
{
|
||||
string OperatorInfo { get; }
|
||||
}
|
||||
}
|
11
TINKLib/View/Themes/Konrad.xaml
Normal file
11
TINKLib/View/Themes/Konrad.xaml
Normal 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>
|
17
TINKLib/View/Themes/Konrad.xaml.cs
Normal file
17
TINKLib/View/Themes/Konrad.xaml.cs
Normal 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";
|
||||
}
|
||||
}
|
11
TINKLib/View/Themes/ShareeBike.xaml
Normal file
11
TINKLib/View/Themes/ShareeBike.xaml
Normal 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>
|
17
TINKLib/View/Themes/ShareeBike.xaml.cs
Normal file
17
TINKLib/View/Themes/ShareeBike.xaml.cs
Normal 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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue