You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

240 lines
12 KiB

1 year ago
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <Shell xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
  4. xmlns:local="clr-namespace:GMCabsDriverAssistantSolution.Views"
  5. Title="GMCabsDriverAssistant"
  6. xmlns:vm="clr-namespace:GMCabsDriverAssistant.ViewModels"
  7. x:Class="GMCabsDriverAssistantSolution.AppShell"
  8. FlyoutWidth="220"
  9. Visual="Material">
  10. <!--<Shell.BindingContext>
  11. <vm:AppShellViewModel />
  12. </Shell.BindingContext>-->
  13. <!--
  14. The overall app visual hierarchy is defined here, along with navigation.
  15. https://docs.microsoft.com/xamarin/xamarin-forms/app-fundamentals/shell/
  16. -->
  17. <Shell.Resources>
  18. <ResourceDictionary>
  19. <Style x:Key="BaseStyle" TargetType="Element">
  20. <Setter Property="Shell.BackgroundColor" Value="{StaticResource Primary}" />
  21. <Setter Property="Shell.ForegroundColor" Value="White" />
  22. <Setter Property="Shell.TitleColor" Value="White" />
  23. <Setter Property="Shell.DisabledColor" Value="#B4FFFFFF" />
  24. <Setter Property="Shell.UnselectedColor" Value="#95FFFFFF" />
  25. <Setter Property="Shell.TabBarBackgroundColor" Value="{StaticResource Primary}" />
  26. <Setter Property="Shell.TabBarForegroundColor" Value="White"/>
  27. <Setter Property="Shell.TabBarUnselectedColor" Value="#95FFFFFF"/>
  28. <Setter Property="Shell.TabBarTitleColor" Value="White"/>
  29. </Style>
  30. <Style TargetType="TabBar" BasedOn="{StaticResource BaseStyle}" x:Key="TabBar" />
  31. <Style TargetType="FlyoutItem" BasedOn="{StaticResource BaseStyle}" x:Key="FlyoutItem"/>
  32. <!--
  33. Default Styles for all Flyout Items
  34. https://docs.microsoft.com/xamarin/xamarin-forms/app-fundamentals/shell/flyout#flyoutitem-and-menuitem-style-classes
  35. -->
  36. <Style Class="FlyoutItemLabelStyle" TargetType="Label" x:Key="FlyoutItemLabelStyle">
  37. <Setter Property="TextColor" Value="White"></Setter>
  38. </Style>
  39. <Style Class="FlyoutItemLayoutStyle" TargetType="Layout" ApplyToDerivedTypes="True" x:Key="FlyoutItemLayoutStyle">
  40. <Setter Property="VisualStateManager.VisualStateGroups">
  41. <VisualStateGroupList>
  42. <VisualStateGroup x:Name="CommonStates">
  43. <VisualState x:Name="Normal">
  44. <VisualState.Setters>
  45. <Setter Property="BackgroundColor" Value="{x:OnPlatform WinUI=Transparent, iOS=White}"/>
  46. <Setter TargetName="FlyoutItemLabel" Property="Label.TextColor" Value="{StaticResource Primary}" />
  47. </VisualState.Setters>
  48. </VisualState>
  49. <VisualState x:Name="Selected">
  50. <VisualState.Setters>
  51. <Setter Property="BackgroundColor" Value="{StaticResource Primary}" />
  52. </VisualState.Setters>
  53. </VisualState>
  54. </VisualStateGroup>
  55. </VisualStateGroupList>
  56. </Setter>
  57. </Style>
  58. <!--
  59. Custom Style you can apply to any Flyout Item
  60. -->
  61. <Style Class="MenuItemLayoutStyle" TargetType="Layout" ApplyToDerivedTypes="True" x:Key="MenuItemLayoutStyle">
  62. <Setter Property="VisualStateManager.VisualStateGroups">
  63. <VisualStateGroupList>
  64. <VisualStateGroup x:Name="CommonStates">
  65. <VisualState x:Name="Normal">
  66. <VisualState.Setters>
  67. <Setter TargetName="FlyoutItemLabel" Property="Label.TextColor" Value="{StaticResource Primary}" />
  68. </VisualState.Setters>
  69. </VisualState>
  70. </VisualStateGroup>
  71. </VisualStateGroupList>
  72. </Setter>
  73. </Style>
  74. </ResourceDictionary>
  75. </Shell.Resources>
  76. <ShellItem Route="PermissionPage" FlyoutItemIsVisible="False" >
  77. <!--<ShellContent ContentTemplate="{DataTemplate local:PermissionCheckPage}" />-->
  78. </ShellItem>
  79. <ShellItem Route="splashpage" FlyoutItemIsVisible="false" >
  80. <!--<ShellContent ContentTemplate="{DataTemplate local:SplashPage}" />-->
  81. </ShellItem>
  82. <ShellItem Route="LoginPage" FlyoutItemIsVisible="False" >
  83. <ShellContent ContentTemplate="{DataTemplate local:LoginPage}" />
  84. </ShellItem>
  85. <!--
  86. When the Flyout is visible this defines the content to display in the flyout.
  87. FlyoutDisplayOptions="AsMultipleItems" will create a separate flyout item for each child element
  88. https://docs.microsoft.com/dotnet/api/xamarin.forms.shellgroupitem.flyoutdisplayoptions?view=xamarin-forms
  89. -->
  90. <FlyoutItem x:Name="homePageFlyout" IsVisible="{OnIdiom Phone=True,Tablet=False}" Title="Home" Icon="ic_menu_home.png">
  91. <ShellContent Route="HomePage" ContentTemplate="{DataTemplate local:HomePage}"/>
  92. </FlyoutItem>
  93. <!--<FlyoutItem x:Name="homePageTabletFlyout" Shell.FlyoutItemIsVisible="{Binding IsCanViewHome}" Title="Home" Icon="ic_menu_home.png">
  94. <ShellContent Route="HomePageTablet" ContentTemplate="{DataTemplate local:HomePageTablet}"/>
  95. </FlyoutItem>-->
  96. <!--<FlyoutItem Title="Coupons" Icon="ic_menu_end_shift.png">
  97. <ShellContent Route="CouponsPage" ContentTemplate="{DataTemplate local:CouponsPage}" />
  98. </FlyoutItem>-->
  99. <!--<FlyoutItem Title="Rydo" Icon="ic_menu_rydo.png">
  100. <ShellContent Route="AcceptedFutureBookingsPage" ContentTemplate="{DataTemplate local:AcceptedFutureBookingsPage}" />
  101. </FlyoutItem>-->
  102. <!--<FlyoutItem Title="Scan Driving Licence" Icon="ic_outline_document_scanner_black_24.png">
  103. <ShellContent Route="ScanDrivingLicencePage" ContentTemplate="{DataTemplate local:ScanDrivingLicencePage}" />
  104. </FlyoutItem>-->
  105. <!--<FlyoutItem Title="Scan Voucher" Icon="ic_outline_document_scanner_black_24.png">
  106. <ShellContent Route="ScanVoucherPage" ContentTemplate="{DataTemplate local:ScanVoucherPage}" />
  107. </FlyoutItem>-->
  108. <!-- When the Flyout is visible this will be a menu item you can tie a click behavior to -->
  109. <MenuItem Text="Coupons" x:Name="Coupons" StyleClass="MenuItemLayoutStyle" Clicked="Coupons_Clicked" IconImageSource="ic_menu_end_shift.png" Shell.FlyoutItemIsVisible="{Binding IsVisibleCoupons}">
  110. </MenuItem>
  111. <MenuItem Text="Rydo" x:Name="Rydo" Shell.FlyoutItemIsVisible="{Binding IsVisibleRydo}" StyleClass="MenuItemLayoutStyle" Clicked="Rydo_Clicked" IconImageSource="ic_menu_rydo.png">
  112. </MenuItem>
  113. <MenuItem Text="Licence Scan" x:Name="ScanDrivingLicence" Shell.FlyoutItemIsVisible="{Binding IsVisibleDrivingLicenceScan}" StyleClass="MenuItemLayoutStyle" Clicked="ScanDrivingLicence_Clicked" IconImageSource="ic_menu_licence_scan.png">
  114. </MenuItem>
  115. <MenuItem Text="Voucher Scan" x:Name="ScanVoucher" Shell.FlyoutItemIsVisible="{Binding IsVisibleVoucherScan}" StyleClass="MenuItemLayoutStyle" Clicked="ScanVoucher_Clicked" IconImageSource="ic_menu_voucher_scan.png">
  116. </MenuItem>
  117. <MenuItem Text="Settings" x:Name="Settings" StyleClass="MenuItemLayoutStyle" Clicked="Settings_Clicked" IconImageSource="ic_menu_settings.png" Shell.FlyoutItemIsVisible="{Binding IsVisibleSettings}">
  118. </MenuItem>
  119. <!--<MenuItem Text="Job History" x:Name="JobHistory" StyleClass="MenuItemLayoutStyle" Clicked="JobHistory_Clicked" IconImageSource="ic_menu_end_shift.png" Shell.FlyoutItemIsVisible="{Binding IsVisibleJobHistory}">
  120. </MenuItem>-->
  121. <!--<MenuItem Text="My Account" x:Name="MyAccount" StyleClass="MenuItemLayoutStyle" Clicked="MyAccount_Clicked" IconImageSource="ic_menu_settings.png" Shell.FlyoutItemIsVisible="{Binding IsVisibleMyAccount}">
  122. </MenuItem>-->
  123. <!--<MenuItem Text="My Shifts" x:Name="MyShifts" StyleClass="MenuItemLayoutStyle" Clicked="MyShifts_Clicked" IconImageSource="ic_menu_voucher_scan.png" Shell.FlyoutItemIsVisible="{Binding IsVisibleMyShifts}">
  124. </MenuItem>-->
  125. <MenuItem Text="Logout" StyleClass="MenuItemLayoutStyle" Clicked="LogoutClicked">
  126. </MenuItem>
  127. <!--
  128. TabBar lets you define content that won't show up in a flyout menu. When this content is active
  129. the flyout menu won't be available. This is useful for creating areas of the application where
  130. you don't want users to be able to navigate away from. If you would like to navigate to this
  131. content you can do so by calling
  132. await Shell.Current.GoToAsync("//LoginPage");
  133. -->
  134. <TabBar>
  135. <ShellContent Route="LoginPage" ContentTemplate="{DataTemplate local:LoginPage}" />
  136. </TabBar>
  137. <Shell.FlyoutHeaderTemplate>
  138. <DataTemplate>
  139. <Grid ColumnDefinitions="0.3*,0.9*" BackgroundColor="{StaticResource Primary}" HeightRequest="122" Padding="16">
  140. <Image Source="driver.png"
  141. VerticalOptions="End"/>
  142. <StackLayout Grid.Column="1" Orientation="Vertical" VerticalOptions="End" Padding="0" Spacing="0">
  143. <Label Text="{Binding DriverName}" TextColor="White" Margin="0" Padding="0"/>
  144. <Label Text="{Binding DriverMobileNumber}" TextColor="White" FontSize="20" Margin="0" Padding="0"/>
  145. <Label Text="{Binding VersionNumber}" TextColor="White" FontSize="15" Margin="0" Padding="0" />
  146. </StackLayout>
  147. </Grid>
  148. </DataTemplate>
  149. </Shell.FlyoutHeaderTemplate>
  150. <Shell.ItemTemplate>
  151. <DataTemplate>
  152. <Grid ColumnDefinitions="0.2*,0.8*" BackgroundColor="#FFFFFF" Padding="8">
  153. <Image Source="{Binding FlyoutIcon}"
  154. HeightRequest="24"
  155. Aspect="AspectFit"/>
  156. <Label Grid.Column="1"
  157. Text="{Binding Title}"
  158. TextColor="Black"
  159. FontSize="24"
  160. VerticalTextAlignment="Start" />
  161. </Grid>
  162. </DataTemplate>
  163. </Shell.ItemTemplate>
  164. <Shell.MenuItemTemplate>
  165. <DataTemplate>
  166. <Grid ColumnDefinitions="0.2*,0.8*" BackgroundColor="#FFFFFF" Padding="8">
  167. <Image Source="{Binding Icon}"
  168. HeightRequest="24"
  169. WidthRequest="24"
  170. Aspect="AspectFit"/>
  171. <Label Grid.Column="1"
  172. Text="{Binding Text}"
  173. TextColor="Black"
  174. FontSize="24"
  175. VerticalTextAlignment="Start" />
  176. </Grid>
  177. </DataTemplate>
  178. </Shell.MenuItemTemplate>
  179. <Shell.FlyoutFooterTemplate>
  180. <DataTemplate>
  181. <Label BackgroundColor="#FFFFFF"
  182. Text="Privacy Policy"
  183. TextColor="Black"
  184. FontSize="16"
  185. Padding="16"
  186. HorizontalTextAlignment="Center">
  187. <Label.GestureRecognizers>
  188. <TapGestureRecognizer Command="{Binding PrivacyPolicyClickCommand}" />
  189. </Label.GestureRecognizers>
  190. </Label>
  191. </DataTemplate>
  192. </Shell.FlyoutFooterTemplate>
  193. <!-- Optional Templates
  194. // These may be provided inline as below or as separate classes.
  195. // This header appears at the top of the Flyout.
  196. // https://docs.microsoft.com/xamarin/xamarin-forms/app-fundamentals/shell/flyout#flyout-header
  197. <Shell.FlyoutHeaderTemplate>
  198. <DataTemplate>
  199. <Grid>ContentHere</Grid>
  200. </DataTemplate>
  201. </Shell.FlyoutHeaderTemplate>
  202. // ItemTemplate is for ShellItems as displayed in a Flyout
  203. // https://docs.microsoft.com/xamarin/xamarin-forms/app-fundamentals/shell/flyout#define-flyoutitem-appearance
  204. <Shell.ItemTemplate>
  205. <DataTemplate>
  206. <ContentView>
  207. Bindable Properties: Title, Icon
  208. </ContentView>
  209. </DataTemplate>
  210. </Shell.ItemTemplate>
  211. // MenuItemTemplate is for MenuItems as displayed in a Flyout
  212. // https://docs.microsoft.com/xamarin/xamarin-forms/app-fundamentals/shell/flyout#define-menuitem-appearance
  213. <Shell.MenuItemTemplate>
  214. <DataTemplate>
  215. <ContentView>
  216. Bindable Properties: Text, Icon
  217. </ContentView>
  218. </DataTemplate>
  219. </Shell.MenuItemTemplate>
  220. -->
  221. </Shell>