mirror of
https://github.com/bitwarden/android.git
synced 2024-10-31 15:15:34 +03:00
Use tableview on about page for credits selections. Break settings page out into individual table views so we can use footer labels.
This commit is contained in:
parent
948dc9511f
commit
193ef8c995
2 changed files with 92 additions and 22 deletions
|
@ -26,31 +26,61 @@ namespace Bit.App.Pages
|
|||
|
||||
var versionLabel = new Label
|
||||
{
|
||||
Text = $@"Version {_appInfoService.Version}
|
||||
Text = $@"Version {_appInfoService.Version} ({_appInfoService.Build})
|
||||
© 8bit Solutions LLC 2015-{DateTime.Now.Year}",
|
||||
HorizontalTextAlignment = TextAlignment.Center
|
||||
};
|
||||
|
||||
var creditsButton = new Button
|
||||
var logoVersionStackLayout = new StackLayout
|
||||
{
|
||||
Children = { logo, versionLabel },
|
||||
Spacing = 20,
|
||||
Padding = new Thickness(0, 40)
|
||||
};
|
||||
|
||||
var creditsCell = new ExtendedTextCell
|
||||
{
|
||||
Text = "Credits",
|
||||
Style = (Style)Application.Current.Resources["btn-primaryAccent"],
|
||||
Margin = new Thickness(15, 0, 15, 25),
|
||||
Command = new Command(async () => await Navigation.PushAsync(new SettingsCreditsPage())),
|
||||
HorizontalOptions = LayoutOptions.Center
|
||||
ShowDisclousure = true
|
||||
};
|
||||
creditsCell.Tapped += RateCell_Tapped;
|
||||
|
||||
var table = new ExtendedTableView
|
||||
{
|
||||
VerticalOptions = LayoutOptions.Start,
|
||||
EnableScrolling = false,
|
||||
NoHeader = true,
|
||||
Intent = TableIntent.Menu,
|
||||
HasUnevenRows = true,
|
||||
Root = new TableRoot
|
||||
{
|
||||
new TableSection
|
||||
{
|
||||
creditsCell
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if(Device.OS == TargetPlatform.iOS)
|
||||
{
|
||||
table.RowHeight = -1;
|
||||
table.EstimatedRowHeight = 44;
|
||||
}
|
||||
|
||||
var stackLayout = new StackLayout
|
||||
{
|
||||
Children = { logo, versionLabel, creditsButton },
|
||||
VerticalOptions = LayoutOptions.Center,
|
||||
Spacing = 20,
|
||||
Margin = new Thickness(0, 0, 0, 40)
|
||||
Children = { logoVersionStackLayout, table },
|
||||
Spacing = 0
|
||||
};
|
||||
|
||||
Title = "About bitwarden";
|
||||
Content = new ScrollView { Content = stackLayout };
|
||||
NavigationPage.SetBackButtonTitle(this, "About");
|
||||
}
|
||||
|
||||
private void RateCell_Tapped(object sender, EventArgs e)
|
||||
{
|
||||
Navigation.PushAsync(new SettingsCreditsPage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -122,13 +122,8 @@ namespace Bit.App.Pages
|
|||
};
|
||||
rateCell.Tapped += RateCell_Tapped;
|
||||
|
||||
var table = new ExtendedTableView
|
||||
var table = new CustomTable
|
||||
{
|
||||
NoFooter = true,
|
||||
VerticalOptions = LayoutOptions.Start,
|
||||
EnableScrolling = false,
|
||||
Intent = TableIntent.Menu,
|
||||
HasUnevenRows = true,
|
||||
Root = new TableRoot
|
||||
{
|
||||
new TableSection("Security")
|
||||
|
@ -136,22 +131,50 @@ namespace Bit.App.Pages
|
|||
LockOptionsCell,
|
||||
FingerprintCell,
|
||||
PinCell
|
||||
},
|
||||
new TableSection
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var table2 = new CustomTable
|
||||
{
|
||||
Root = new TableRoot
|
||||
{
|
||||
new TableSection("Account")
|
||||
{
|
||||
changeMasterPasswordCell,
|
||||
changeEmailCell
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var table3 = new CustomTable
|
||||
{
|
||||
Root = new TableRoot
|
||||
{
|
||||
new TableSection("Manage")
|
||||
{
|
||||
foldersCell,
|
||||
syncCell
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var table4 = new CustomTable
|
||||
{
|
||||
Root = new TableRoot
|
||||
{
|
||||
new TableSection("Current Session")
|
||||
{
|
||||
lockCell,
|
||||
logOutCell
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var table5 = new CustomTable
|
||||
{
|
||||
Root = new TableRoot
|
||||
{
|
||||
new TableSection("Other")
|
||||
{
|
||||
aboutCell,
|
||||
|
@ -186,10 +209,15 @@ namespace Bit.App.Pages
|
|||
|
||||
var stackLayout = new StackLayout
|
||||
{
|
||||
Children = { table, rateLabel },
|
||||
Children = { table, table2, table3, table4, table5, rateLabel },
|
||||
Spacing = 0
|
||||
};
|
||||
|
||||
stackLayout.LayoutChanged += (sender, args) =>
|
||||
{
|
||||
rateLabel.WidthRequest = stackLayout.Bounds.Width - rateLabel.Bounds.Left * 2;
|
||||
};
|
||||
|
||||
Title = AppResources.Settings;
|
||||
Content = new ScrollView { Content = stackLayout };
|
||||
}
|
||||
|
@ -383,5 +411,17 @@ namespace Bit.App.Pages
|
|||
return "Immediately";
|
||||
}
|
||||
}
|
||||
|
||||
private class CustomTable : ExtendedTableView
|
||||
{
|
||||
public CustomTable()
|
||||
{
|
||||
NoFooter = true;
|
||||
VerticalOptions = LayoutOptions.Start;
|
||||
EnableScrolling = false;
|
||||
Intent = TableIntent.Menu;
|
||||
HasUnevenRows = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue