mirror of
https://github.com/bitwarden/android.git
synced 2024-12-20 08:12:26 +03:00
Adjusted some spacing on about and settings
This commit is contained in:
parent
9e314233d5
commit
7060ee838c
2 changed files with 48 additions and 38 deletions
|
@ -35,7 +35,7 @@ namespace Bit.App.Pages
|
||||||
{
|
{
|
||||||
Children = { logo, versionLabel },
|
Children = { logo, versionLabel },
|
||||||
Spacing = 20,
|
Spacing = 20,
|
||||||
Padding = new Thickness(0, 40)
|
Padding = new Thickness(0, 40, 0, 0)
|
||||||
};
|
};
|
||||||
|
|
||||||
var creditsCell = new ExtendedTextCell
|
var creditsCell = new ExtendedTextCell
|
||||||
|
@ -49,7 +49,6 @@ namespace Bit.App.Pages
|
||||||
{
|
{
|
||||||
VerticalOptions = LayoutOptions.Start,
|
VerticalOptions = LayoutOptions.Start,
|
||||||
EnableScrolling = false,
|
EnableScrolling = false,
|
||||||
NoHeader = true,
|
|
||||||
Intent = TableIntent.Settings,
|
Intent = TableIntent.Settings,
|
||||||
HasUnevenRows = true,
|
HasUnevenRows = true,
|
||||||
Root = new TableRoot
|
Root = new TableRoot
|
||||||
|
|
|
@ -123,13 +123,18 @@ namespace Bit.App.Pages
|
||||||
};
|
};
|
||||||
helpCell.Tapped += HelpCell_Tapped;
|
helpCell.Tapped += HelpCell_Tapped;
|
||||||
|
|
||||||
var rateCell = new ExtendedTextCell
|
var rateCell = new LongDetailViewCell("Rate the App", null);
|
||||||
{
|
|
||||||
Text = "Rate the App",
|
|
||||||
ShowDisclousure = true
|
|
||||||
};
|
|
||||||
rateCell.Tapped += RateCell_Tapped;
|
rateCell.Tapped += RateCell_Tapped;
|
||||||
|
|
||||||
|
if(Device.OS == TargetPlatform.iOS)
|
||||||
|
{
|
||||||
|
rateCell.Detail.Text = "App Store ratings are reset with every new version of bitwarden. Please consider helping us out with a good review!";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
rateCell.Detail.Text = "Please consider helping us out with a good review!";
|
||||||
|
}
|
||||||
|
|
||||||
Table = new CustomTable
|
Table = new CustomTable
|
||||||
{
|
{
|
||||||
Root = new TableRoot
|
Root = new TableRoot
|
||||||
|
@ -165,36 +170,8 @@ namespace Bit.App.Pages
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var rateLabel = new Label
|
|
||||||
{
|
|
||||||
LineBreakMode = LineBreakMode.WordWrap,
|
|
||||||
FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)),
|
|
||||||
Style = (Style)Application.Current.Resources["text-muted"],
|
|
||||||
Margin = new Thickness(15, 0, 15, 25)
|
|
||||||
};
|
|
||||||
|
|
||||||
if(Device.OS == TargetPlatform.iOS)
|
|
||||||
{
|
|
||||||
rateLabel.Text = "App Store ratings are reset with every new version of bitwarden. Please consider helping us out with a good review!";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
rateLabel.Text = "Please consider helping us out with a good review!";
|
|
||||||
}
|
|
||||||
|
|
||||||
var stackLayout = new StackLayout
|
|
||||||
{
|
|
||||||
Children = { Table, rateLabel },
|
|
||||||
Spacing = 0
|
|
||||||
};
|
|
||||||
|
|
||||||
stackLayout.LayoutChanged += (sender, args) =>
|
|
||||||
{
|
|
||||||
rateLabel.WidthRequest = stackLayout.Bounds.Width - rateLabel.Bounds.Left * 2;
|
|
||||||
};
|
|
||||||
|
|
||||||
Title = AppResources.Settings;
|
Title = AppResources.Settings;
|
||||||
Content = new ScrollView { Content = stackLayout };
|
Content = Table;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void TwoStepCell_Tapped(object sender, EventArgs e)
|
private async void TwoStepCell_Tapped(object sender, EventArgs e)
|
||||||
|
@ -406,8 +383,6 @@ namespace Bit.App.Pages
|
||||||
{
|
{
|
||||||
public CustomTable()
|
public CustomTable()
|
||||||
{
|
{
|
||||||
VerticalOptions = LayoutOptions.Start;
|
|
||||||
EnableScrolling = false;
|
|
||||||
Intent = TableIntent.Settings;
|
Intent = TableIntent.Settings;
|
||||||
HasUnevenRows = true;
|
HasUnevenRows = true;
|
||||||
|
|
||||||
|
@ -418,5 +393,41 @@ namespace Bit.App.Pages
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class LongDetailViewCell : ExtendedViewCell
|
||||||
|
{
|
||||||
|
public LongDetailViewCell(string labelText, string detailText)
|
||||||
|
{
|
||||||
|
Label = new Label
|
||||||
|
{
|
||||||
|
VerticalOptions = LayoutOptions.CenterAndExpand,
|
||||||
|
LineBreakMode = LineBreakMode.TailTruncation,
|
||||||
|
Text = labelText
|
||||||
|
};
|
||||||
|
|
||||||
|
Detail = new Label
|
||||||
|
{
|
||||||
|
FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)),
|
||||||
|
LineBreakMode = LineBreakMode.WordWrap,
|
||||||
|
VerticalOptions = LayoutOptions.End,
|
||||||
|
Style = (Style)Application.Current.Resources["text-muted"],
|
||||||
|
Text = detailText
|
||||||
|
};
|
||||||
|
|
||||||
|
var labelDetailStackLayout = new StackLayout
|
||||||
|
{
|
||||||
|
HorizontalOptions = LayoutOptions.StartAndExpand,
|
||||||
|
VerticalOptions = LayoutOptions.FillAndExpand,
|
||||||
|
Children = { Label, Detail },
|
||||||
|
Padding = new Thickness(15)
|
||||||
|
};
|
||||||
|
|
||||||
|
ShowDisclousure = true;
|
||||||
|
View = labelDetailStackLayout;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Label Label { get; set; }
|
||||||
|
public Label Detail { get; set; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue