Skip to content

Commit

Permalink
Add versionNumberText to createdByLabel
Browse files Browse the repository at this point in the history
  • Loading branch information
brminnick committed Mar 23, 2020
1 parent d18bcb4 commit b253c32
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions GitTrends/Pages/SettingsPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,16 @@ RelativeLayout CreateLayout(bool isPortraitOrientation)
var trendsSettingsView = new TrendsChartSettingsView(_trendsChartSettingsService);
var registerforNotificationsView = new RegisterForNotificationsView();

var versionNumberLabel = new Label
{
var versionNumberText =
#if AppStore
Text = $"Version: {VersionTracking.CurrentVersion}",
$"Version: {VersionTracking.CurrentVersion}";
#elif RELEASE
Text = $"Version: {VersionTracking.CurrentVersion} (Release)",
$"Version: {VersionTracking.CurrentVersion} (Release)";
#elif DEBUG
Text = $"Version: {VersionTracking.CurrentVersion} (Debug)",
$"Version: {VersionTracking.CurrentVersion} (Debug)";
#else
throw new NotSupportedException()
throw new NotSupportedException();
#endif
HorizontalTextAlignment = TextAlignment.Start,
Opacity = 0.75,
Margin = new Thickness(2, 5, 0, 0),
FontSize = 14
};
versionNumberLabel.SetDynamicResource(Label.TextColorProperty, nameof(BaseTheme.TextColor));

var createdByLabel = new Label
{
AutomationId = SettingsPageAutomationIds.CreatedByLabel,
Expand All @@ -77,7 +69,7 @@ RelativeLayout CreateLayout(bool isPortraitOrientation)
HorizontalOptions = LayoutOptions.FillAndExpand,
HorizontalTextAlignment = TextAlignment.Center,
VerticalTextAlignment = TextAlignment.End,
Text = "Mobile App Created by Code Traveler LLC",
Text = $"{versionNumberText}\nMobile App Created by Code Traveler LLC",
FontSize = 12,
};
createdByLabel.SetDynamicResource(Label.TextColorProperty, nameof(BaseTheme.TextColor));
Expand Down Expand Up @@ -125,10 +117,6 @@ RelativeLayout CreateLayout(bool isPortraitOrientation)
yConstraint: Constraint.RelativeToView(trendsSettingsView, (parent, view) => view.Y + view.Height + 20),
widthConstraint: Constraint.RelativeToView(trendsSettingsView, (parent, view) => view.Width));

relativeLayout.Children.Add(versionNumberLabel,
xConstraint: Constraint.RelativeToView(registerforNotificationsView, (parent, view) => view.X),
yConstraint: Constraint.RelativeToView(registerforNotificationsView, (parent, view) => view.Y + view.Height + 10));

return relativeLayout;
}

Expand Down

0 comments on commit b253c32

Please sign in to comment.