Skip to content

Commit

Permalink
#48 update URL of infosheet
Browse files Browse the repository at this point in the history
  • Loading branch information
robo-w committed Mar 5, 2019
1 parent c3272af commit 77c1f22
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 29 deletions.
39 changes: 18 additions & 21 deletions GeoClient/GeoClient/Views/AboutPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,6 @@
<Label
Text="Diese App dient der Verortung von Einheiten des Wiener Roten Kreuzes im Zuge von Ambulanzen. Eine Verwendung ist nur mit gültigen Zugangsdaten (QR Code) möglich." />

<Label>
<Label.FormattedText>
<FormattedString>
<FormattedString.Spans>
<Span
Text="Weitere Details zu der App sind für Mitarbeiter des WRK " />

<Span
Text="hier im Intranet (Confluence) ersichtlich."
TextDecorations="Underline">
<Span.GestureRecognizers>
<TapGestureRecognizer Command="{Binding OpenWebCommand}" />
</Span.GestureRecognizers>
</Span>
</FormattedString.Spans>
</FormattedString>
</Label.FormattedText>
</Label>

<Label
Text="Registrierte Einheit"
FontSize="Medium"
Expand Down Expand Up @@ -93,12 +74,12 @@
</Label.FormattedText>
</Label>

<Label>
<Label x:Name="LabelUnitUrl">
<Label.FormattedText>
<FormattedString>
<Span Text="Kartenansicht: " FontAttributes="Bold" />
<Span
Text="N/A"
Text="Im Browser öffnen"
x:Name="ContentUnitUrl"
TextDecorations="Underline">
<Span.GestureRecognizers>
Expand All @@ -108,6 +89,22 @@
</FormattedString>
</Label.FormattedText>
</Label>

<Label x:Name="LabelInfoSheetUrl">
<Label.FormattedText>
<FormattedString>
<Span Text="Infoblatt: " FontAttributes="Bold" />
<Span
Text="Im Browser öffnen"
x:Name="ContentInfoSheetUrl"
TextDecorations="Underline">
<Span.GestureRecognizers>
<TapGestureRecognizer Tapped="OpenInfoSheetUrl_Clicked" />
</Span.GestureRecognizers>
</Span>
</FormattedString>
</Label.FormattedText>
</Label>
</StackLayout>

<Grid Margin="0,10">
Expand Down
23 changes: 15 additions & 8 deletions GeoClient/GeoClient/Views/AboutPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,21 @@ public void LocationUpdated(Location updatedLocation)
}
}

private async void OpenUnitUrl_Clicked(object sender, EventArgs e)
private void OpenUnitUrl_Clicked(object sender, EventArgs e)
{
var registrationInfo = _registrationService.GetRegistrationInfo();
if (registrationInfo != null)
{
Device.OpenUri(new Uri(registrationInfo.GetMapViewUrl()));
}
else
}

private void OpenInfoSheetUrl_Clicked(object sender, EventArgs e)
{
var registrationInfo = _registrationService.GetRegistrationInfo();
if (registrationInfo != null)
{
await DisplayAlert(
"Gerät nicht registriert",
"Die App ist nicht registriert. Scanne deinen QR Code um auf die Kartenansicht zugreifen zu können.",
"OK");
Device.OpenUri(new Uri(registrationInfo.BaseUrl + "/about.html"));
}
}

Expand Down Expand Up @@ -119,7 +121,10 @@ private void ResetRegistrationInfo()
ContentUnitRegistered.Text = "Nein";
ContentUnitId.Text = "";
ContentUnitName.Text = "";
ContentUnitUrl.Text = "nicht verfügbar";

LabelUnitUrl.IsVisible = false;
LabelInfoSheetUrl.IsVisible = false;

RegisterButton.Text = "Jetzt registrieren";
}

Expand All @@ -132,7 +137,9 @@ private void DisplayRegistrationInfo()
ContentUnitName.Text =
_registrationService.RegisteredUnitInformation?.UnitName ??
"Wird von Server abgefragt...";
ContentUnitUrl.Text = "Im Browser öffnen";

LabelUnitUrl.IsVisible = true;
LabelInfoSheetUrl.IsVisible = true;

RegisterButton.Text = "Andere Einheit registrieren";
}
Expand Down

0 comments on commit 77c1f22

Please sign in to comment.