Skip to content

Commit

Permalink
#52 CompletingHomeRequestView and ConfirmationPopup
Browse files Browse the repository at this point in the history
  • Loading branch information
AcabreraT committed Dec 7, 2017
1 parent 93beee4 commit ba13133
Show file tree
Hide file tree
Showing 6 changed files with 147 additions and 143 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public override Task InitializeAsync(object navigationData)
CurrentRequest = navigationData as RequestModel;
CurrentAddress = CurrentRequest.RequestAddress;
RequestTypeHeader = CurrentRequest.RequestType.Name;
DisplayRequestInfo = "Tu petición es:\n \""+CurrentRequest.RequestType.Name+"\"\n"+CurrentRequest.RequestAddress.DisplayAddress;
return Task.CompletedTask;
}
public override Task ActivateAsync()
Expand Down Expand Up @@ -77,23 +78,16 @@ private async void OnOpenRequestConfirmationPopupCommand(object obj)
{
if (DateToApplyParsed==null)
{
RequestConfirmationPopupVM.DisplayDate = DateTime.Now.ToString().Remove(10);
DateToApplyParsed = DateTime.Now.ToString().Remove(10);
}
else
{
RequestConfirmationPopupVM.DisplayDate = DateToApplyParsed;
}


if (TimeToApplyParsed == null)
{
RequestConfirmationPopupVM.DisplayTime = new TimeSpan(DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second).ToString().Remove(5);
TimeToApplyParsed = new TimeSpan(DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second).ToString().Remove(5);
}
else
{
RequestConfirmationPopupVM.DisplayTime = TimeToApplyParsed;
}

RequestConfirmationPopupVM.DisplayRequestInfo = DisplayRequestInfo;
RequestConfirmationPopupVM.DisplayDate = DateToApplyParsed+","+TimeToApplyParsed;

await NavigationService.ShowPopupAsync(RequestConfirmationPopupVM);

Expand Down Expand Up @@ -166,6 +160,20 @@ private async void OnSendRequestConfirmationCommand(object sender, EventArgs e)
await NavigationService.ShowPopupAsync(RequestSentPopupVM);
}

private Command _closeConfimationPopupCommand;
public ICommand CloseConfimationPopupCommand
{
get
{
return _closeConfimationPopupCommand ??
(_closeConfimationPopupCommand = new Command(OnCloseConfimationPopupCommand, o => !IsBusy));
}
}

private async void OnCloseConfimationPopupCommand(object obj)
{
await NavigationService.HidePopupAsync();
}

#endregion

Expand All @@ -176,6 +184,15 @@ private async void OnSendRequestConfirmationCommand(object sender, EventArgs e)
public RequestDateAndTimePopupViewModel RequestDateAndTimePopupVM { get; private set; }


private string _displayRequestInfo;

public string DisplayRequestInfo
{
get { return _displayRequestInfo; }
set { Set(ref _displayRequestInfo, value); }
}


private string _requestTypeHeader;

public string RequestTypeHeader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,23 +96,23 @@
Margin="35,0,35,0"
Padding="1"
BackgroundColor="{StaticResource LightGraySubtitle}"
CornerRadius="20"
CornerRadius="25"
HasShadow="False"
HorizontalOptions="Center"
VerticalOptions="Center">
<Frame
Margin="0"
Padding="15,3,75,3"
Padding="15,3,15,3"
BackgroundColor="White"
CornerRadius="20"
CornerRadius="25"
HasShadow="False"
HorizontalOptions="Center"
VerticalOptions="Center">


<Entry
Margin="0"
FontSize="{StaticResource MidLargeSize}"
FontSize="{StaticResource MediumSize}"
HorizontalOptions="Center"
HorizontalTextAlignment="Start"
Placeholder="{Binding [CompletingRequestCommentsPlaceHolder]}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,130 +9,124 @@
xmlns:vPop="clr-namespace:Rg.Plugins.Popup.Pages;assembly=Rg.Plugins.Popup"
BackgroundColor="{StaticResource SeeThrough}">

<ContentView
Margin="10"
Style="{StaticResource BorderStyle}"
VerticalOptions="Center">
<ContentView Style="{StaticResource InternalViewStyle}">
<ScrollView>
<StackLayout
Margin="20,70,20,70"
Padding="20,10,20,10"
BackgroundColor="{StaticResource BackgroundColor}">
<ctrl:CustomImage
Margin="20"
HeightRequest="50"
<Frame Style="{StaticResource PopupFrameStyle}">
<ScrollView>
<StackLayout>
<ctrl:CustomImage
Grid.Column="0"
Margin="25,25,0,0"
HeightRequest="13"
HorizontalOptions="Start"
SourcePlatform="x_icon"
VerticalOptions="Center"
WidthRequest="13">
<ctrl:CustomImage.GestureRecognizers>
<TapGestureRecognizer Command="{Binding CloseConfimationPopupCommand}" />
</ctrl:CustomImage.GestureRecognizers>

</ctrl:CustomImage>
<ctrl:CustomImage
Margin="0,17,0,0"
HeightRequest="55"
HorizontalOptions="Center"
SourcePlatform="round_question_icon"
VerticalOptions="Center"
WidthRequest="55" />

<Label
Margin="33,27,33,20"
FontAttributes="Bold"
FontSize="Large"
HorizontalOptions="Center"
HorizontalTextAlignment="Center"
Text="{Binding [PopupRequestConfirmationTextTitle]}"
TextColor="{StaticResource GreyText}" />

<Label
Margin="0"
FontAttributes="None"
HorizontalOptions="Center"
HorizontalTextAlignment="Center"
Text="{Binding DisplayRequestInfo}"
TextColor="{StaticResource LightGrey2}" />

<Frame
Margin="35,20,35,25"
Padding="1"
BackgroundColor="{StaticResource LightGrey}"
CornerRadius="25"
HasShadow="False"
HorizontalOptions="Center"
VerticalOptions="Center">
<Frame
Margin="0"
Padding="15,3,15,3"
BackgroundColor="{StaticResource LightSilver}"
CornerRadius="25"
HasShadow="False"
HorizontalOptions="Center"
SourcePlatform="round_question_icon"
VerticalOptions="Center"
WidthRequest="50" />

<Label
Margin="0,0,0,20"
FontSize="Large"
HorizontalOptions="Center"
Text="{Binding [PopupRequestConfirmationTextTitle]}" />

<Label
Margin="0,0,0,20"
VerticalOptions="Center">
<StackLayout Orientation="Horizontal">
<ctrl:CustomImage
Grid.Row="0"
Grid.Column="0"
Margin="5"
HeightRequest="13"
HorizontalOptions="Center"
SourcePlatform="date_icon"
VerticalOptions="Center"
WidthRequest="13" />
<Label
Grid.Column="1"
Text="{Binding DisplayDate}"
VerticalOptions="Center" />
</StackLayout>
</Frame>
</Frame>


<Grid ColumnSpacing="0" RowSpacing="0">
<Grid.RowDefinitions>
<RowDefinition Height="60" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<BoxView
Grid.Row="0"
Grid.ColumnSpan="2"
BackgroundColor="{StaticResource LightGrey}"
HeightRequest="1"
VerticalOptions="Start" />

<BoxView
Grid.Row="0"
Grid.ColumnSpan="2"
BackgroundColor="{StaticResource LightGrey}"
HorizontalOptions="Center"
Text="{Binding DisplayRequestInfo}"
TextColor="LightGray" />

<Grid
Padding="5"
BackgroundColor="LightGray"
HorizontalOptions="FillAndExpand">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>

<Grid.Margin>
<OnPlatform x:TypeArguments="Thickness">
<On Platform="WinPhone,Windows" Value="70,0,70,10" />
<On Platform="iOS" Value="50,0,50,10" />
<On Platform="Android" Value="60,0,60,10" />
</OnPlatform>
</Grid.Margin>

WidthRequest="1" />

<Button
Grid.Row="0"
Margin="0,1,1,0"
Command="{Binding ClosePopupCommand}"
Style="{StaticResource ButtonWhiteStyle}"
Text="{Binding [CommonNo]}" />

<ctrl:CustomImage
Grid.Row="0"
Grid.Column="0"
Margin="5"
HeightRequest="30"
HorizontalOptions="Center"
SourcePlatform="date_icon"
VerticalOptions="Center"
WidthRequest="30" />
<Label
Grid.Column="1"
Text="{Binding DisplayDate}"
VerticalOptions="Center" />
</Grid>

<Grid
Padding="5"
BackgroundColor="LightGray"
HorizontalOptions="FillAndExpand">
<Grid.Margin>
<OnPlatform x:TypeArguments="Thickness">
<On Platform="WinPhone,Windows" Value="70,0,70,10" />
<On Platform="iOS" Value="50,0,50,10" />
<On Platform="Android" Value="60,0,60,10" />
</OnPlatform>
</Grid.Margin>


<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<ctrl:CustomImage
Grid.Row="0"
Grid.Column="0"
Margin="5"
HeightRequest="30"
HorizontalOptions="Center"
SourcePlatform="time_icon"
VerticalOptions="Center"
WidthRequest="30" />
<Label
Grid.Row="0"
Grid.Column="1"
Text="{Binding DisplayTime}"
VerticalOptions="Center" />
</Grid>

<StackLayout
Margin="0,20,0,0"
HorizontalOptions="Center"
Orientation="Horizontal">
<Button
Grid.Row="0"
Grid.Column="1"
Margin="1,1,0,0"
Command="{Binding SendRequestConfirmationCommand}"
Style="{StaticResource ButtonWhiteStyle}"
Text="{Binding [CommonYes]}" />

<Button
Command="{Binding SendRequestConfirmationCommand}"
HorizontalOptions="CenterAndExpand"
Style="{StaticResource ButtonSmallStyle}"
Text="{Binding [CommonYes]}" />
<Button
Command="{Binding ClosePopupCommand}"
HorizontalOptions="CenterAndExpand"
Style="{StaticResource ButtonSmallStyle}"
Text="{Binding [CommonNo]}" />

</StackLayout>
</Grid>

</StackLayout>
</ScrollView>
</Frame>

</StackLayout>
</ScrollView>
</ContentView>
</ContentView>
</vPop:PopupPage>
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
using Rg.Plugins.Popup.Pages;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Xamarin.Forms;
using Xamarin.Forms.Xaml;

namespace AeccApp.Core.Views.Popups
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
<ctrl:CustomImage
Grid.Column="0"
Margin="10"
HeightRequest="30"
HorizontalOptions="End"
HeightRequest="13"
HorizontalOptions="Start"
SourcePlatform="x_icon"
VerticalOptions="Center"
WidthRequest="30">
WidthRequest="13">
<ctrl:CustomImage.GestureRecognizers>
<TapGestureRecognizer Command="{Binding CloseRequestSentPopupCommand}" />
</ctrl:CustomImage.GestureRecognizers>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ba13133

Please sign in to comment.