Kis kerek gombok + Egyéb nyalánkságok
This commit is contained in:
@@ -51,7 +51,7 @@
|
||||
<CollectionView x:Name="CheckList">
|
||||
<CollectionView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Frame BorderColor="Gray" Padding="10" Margin="5" HasShadow="True" BackgroundColor="WhiteSmoke">
|
||||
<Frame BorderColor="Gray" Padding="15" Margin="5" HasShadow="True" BackgroundColor="WhiteSmoke">
|
||||
<Grid ColumnDefinitions="*,Auto">
|
||||
<!-- Bal oldali oszlop: Két Label egymás alatt -->
|
||||
<StackLayout Grid.Column="0" Spacing="2">
|
||||
@@ -62,20 +62,23 @@
|
||||
</StackLayout>
|
||||
|
||||
<!-- Jobb oldali oszlop: Két gomb egymás mellett -->
|
||||
<HorizontalStackLayout Grid.Column="1" HorizontalOptions="End" Spacing="5">
|
||||
<Button Text="Blokkolás"
|
||||
Margin="5,0,0,0"
|
||||
<HorizontalStackLayout Grid.Column="1" HorizontalOptions="End" Spacing="3">
|
||||
<Button Text=""
|
||||
Margin="0,0,0,0"
|
||||
ImageSource="arrow_down.svg"
|
||||
BackgroundColor="Red"
|
||||
HeightRequest="50"
|
||||
MaximumHeightRequest="50"
|
||||
WidthRequest="120"
|
||||
MaximumWidthRequest="120"
|
||||
WidthRequest="50"
|
||||
MaximumWidthRequest="50"
|
||||
CornerRadius="25"
|
||||
IsVisible="{Binding CheckStatus, Converter={StaticResource BlockedConverter}}"
|
||||
Command="{Binding BindingContext.BlockCommand, Source={x:Reference CheckList}}"
|
||||
CommandParameter="{Binding .}">
|
||||
</Button>
|
||||
<Button Text="Feloldás"
|
||||
Margin="5,0,0,0"
|
||||
ImageSource="arrow_up.svg"
|
||||
Margin="0,0,0,0"
|
||||
BackgroundColor="Green"
|
||||
HeightRequest="50"
|
||||
MaximumHeightRequest="50"
|
||||
@@ -85,25 +88,29 @@
|
||||
Command="{Binding BindingContext.UnblockCommand, Source={x:Reference CheckList}}"
|
||||
CommandParameter="{Binding .}">
|
||||
</Button>
|
||||
<Button Text="Jóváhagyás"
|
||||
Margin="5,0,0,0"
|
||||
<Button Text=""
|
||||
ImageSource="check_circle.svg"
|
||||
Margin="0,0,0,0"
|
||||
BackgroundColor="DarkGreen"
|
||||
HeightRequest="50"
|
||||
MaximumHeightRequest="50"
|
||||
WidthRequest="120"
|
||||
MaximumWidthRequest="120"
|
||||
WidthRequest="50"
|
||||
MaximumWidthRequest="50"
|
||||
CornerRadius="25"
|
||||
IsVisible="{Binding CheckStatus, Converter={StaticResource AcceptConverter}}"
|
||||
Command="{Binding BindingContext.AcceptCommand, Source={x:Reference CheckList}}"
|
||||
CommandParameter="{Binding .}">
|
||||
</Button>
|
||||
<Button Text="Folytatás"
|
||||
Margin="5,0,0,0"
|
||||
<Button Text=""
|
||||
ImageSource="arrow_right.svg"
|
||||
Margin="0,0,0,0"
|
||||
BackgroundColor="Blue"
|
||||
CornerRadius="25"
|
||||
HeightRequest="50"
|
||||
MaximumHeightRequest="50"
|
||||
WidthRequest="120"
|
||||
MaximumWidthRequest="120"
|
||||
IsVisible="{Binding CheckStatus, Converter={StaticResource ContinueConverter}}"
|
||||
WidthRequest="50"
|
||||
MaximumWidthRequest="50"
|
||||
IsVisible="{Binding CheckStatus, Converter={StaticResource ContinueConverter}, ConverterParameter = {Binding IsNFCSupported}}"
|
||||
Command="{Binding BindingContext.ContinueCommand, Source={x:Reference CheckList}}"
|
||||
CommandParameter="{Binding .}">
|
||||
</Button>
|
||||
@@ -174,6 +181,7 @@
|
||||
<local:BlockedConverter x:Key="BlockedConverter" />
|
||||
<local:UnBlockedConverter x:Key="UnBlockedConverter" />
|
||||
<local:ContinueConverter x:Key="ContinueConverter" />
|
||||
<local:AcceptConverter x:Key="AcceptConverter" />
|
||||
</ResourceDictionary>
|
||||
</ContentPage.Resources>
|
||||
</ContentPage>
|
||||
@@ -1,5 +1,6 @@
|
||||
using CommunityToolkit.Maui.Alerts;
|
||||
using CommunityToolkit.Maui.Core;
|
||||
using Plugin.NFC;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.Threading.Tasks;
|
||||
@@ -17,6 +18,7 @@ public partial class CheckListPage : ContentPage
|
||||
private readonly IUserService _userService;
|
||||
private readonly ISyncService _syncService;
|
||||
private bool _isLoading;
|
||||
private bool _isNFCSupported;
|
||||
private UserDTO _currentUser;
|
||||
|
||||
public ICommand NewCommand { get; set; }
|
||||
@@ -24,6 +26,7 @@ public partial class CheckListPage : ContentPage
|
||||
public ICommand UnblockCommand { get; set; }
|
||||
public ICommand BlockCommand { get; set; }
|
||||
public ICommand AcceptCommand { get; set; }
|
||||
|
||||
public bool IsLoading
|
||||
{
|
||||
get => _isLoading;
|
||||
@@ -33,7 +36,15 @@ public partial class CheckListPage : ContentPage
|
||||
OnPropertyChanged(nameof(IsLoading));
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsNFCSupported
|
||||
{
|
||||
get => _isNFCSupported;
|
||||
set
|
||||
{
|
||||
_isNFCSupported = value;
|
||||
OnPropertyChanged(nameof(IsNFCSupported));
|
||||
}
|
||||
}
|
||||
|
||||
public CheckListPage()
|
||||
{
|
||||
@@ -46,7 +57,8 @@ public partial class CheckListPage : ContentPage
|
||||
UnblockCommand = new Command<CheckListHeaderDTO>(OnUnblockItem);
|
||||
BlockCommand = new Command<CheckListHeaderDTO>(OnBlockItem);
|
||||
AcceptCommand = new Command<CheckListHeaderDTO>(OnAcceptItem);
|
||||
|
||||
|
||||
|
||||
}
|
||||
private void SetInfo()
|
||||
{
|
||||
@@ -62,8 +74,10 @@ public partial class CheckListPage : ContentPage
|
||||
protected override async void OnAppearing()
|
||||
{
|
||||
base.OnAppearing();
|
||||
SetInfo();
|
||||
BindingContext = this;
|
||||
//CrossNFC.Legacy = false;
|
||||
//IsNFCSupported = CrossNFC.IsSupported;
|
||||
SetInfo();
|
||||
await LoadCheckListTemplate();
|
||||
await LoadCheckList();
|
||||
}
|
||||
@@ -233,7 +247,7 @@ public class ContinueConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is CheckStatus status)
|
||||
if (value is CheckStatus status && CrossNFC.IsSupported && CrossNFC.Current.IsAvailable)
|
||||
{
|
||||
if (status == CheckStatus.InProgress || status == CheckStatus.Open)
|
||||
{
|
||||
|
||||
@@ -72,7 +72,8 @@ public partial class CheckListWorkPage : ContentPage
|
||||
{
|
||||
if (Navigation.ModalStack.Count > 0)
|
||||
{
|
||||
await Shell.Current.Navigation.PopModalAsync();
|
||||
//await Navigation.PopModalAsync();
|
||||
await Shell.Current.GoToAsync("//CheckListPage");
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user