mirror of
https://github.com/bitwarden/mobile
synced 2026-02-25 00:52:49 +00:00
Android UI updates.
This commit is contained in:
@@ -42,6 +42,8 @@ namespace Bit.App.Controls
|
||||
set { SetValue(DisclousureImageProperty, value); }
|
||||
}
|
||||
|
||||
public LineBreakMode DetailLineBreakMode { get; set; } = LineBreakMode.TailTruncation;
|
||||
|
||||
public event EventHandler DisclousureTapped;
|
||||
|
||||
public void OnDisclousureTapped()
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace Bit.App.Controls
|
||||
{
|
||||
if(!useLabelAsPlaceholder)
|
||||
{
|
||||
Entry.Margin = new Thickness(-11, 0, -11, -5);
|
||||
Entry.Margin = new Thickness(-4, -7, -4, -11);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,10 @@ namespace Bit.App.Controls
|
||||
HorizontalOptions = LayoutOptions.StartAndExpand,
|
||||
VerticalOptions = LayoutOptions.CenterAndExpand,
|
||||
Children = { Label, Detail },
|
||||
Padding = new Thickness(15, 5, 5, 5),
|
||||
Padding = Device.OnPlatform(
|
||||
iOS: new Thickness(15, 5, 5, 5),
|
||||
Android: new Thickness(15, 0, 5, 5),
|
||||
WinPhone: new Thickness(15, 5, 5, 5)),
|
||||
Spacing = 0
|
||||
};
|
||||
|
||||
|
||||
@@ -41,9 +41,17 @@ namespace Bit.App.Controls
|
||||
Orientation = StackOrientation.Horizontal,
|
||||
Children = { Label, StepperValueLabel, Stepper },
|
||||
Spacing = 15,
|
||||
Padding = new Thickness(15, 8)
|
||||
Padding = Device.OnPlatform(
|
||||
iOS: new Thickness(15, 8),
|
||||
Android: new Thickness(15, 2),
|
||||
WinPhone: new Thickness(15, 8))
|
||||
};
|
||||
|
||||
if(Device.OS == TargetPlatform.Android)
|
||||
{
|
||||
Label.TextColor = Color.Black;
|
||||
}
|
||||
|
||||
View = stackLayout;
|
||||
}
|
||||
|
||||
|
||||
@@ -53,9 +53,18 @@ Fingerprint by masterpage.com from the Noun Project")
|
||||
var layout = new StackLayout
|
||||
{
|
||||
Children = { label },
|
||||
Padding = new Thickness(15, 20)
|
||||
Padding = Device.OnPlatform(
|
||||
iOS: new Thickness(15, 20),
|
||||
Android: new Thickness(16, 20),
|
||||
WinPhone: new Thickness(15, 20)),
|
||||
BackgroundColor = Color.White
|
||||
};
|
||||
|
||||
if(Device.OS == TargetPlatform.Android)
|
||||
{
|
||||
label.TextColor = Color.Black;
|
||||
}
|
||||
|
||||
View = layout;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,15 +41,6 @@ namespace Bit.App.Pages
|
||||
|
||||
private void Init()
|
||||
{
|
||||
var fingerprintName = Device.OnPlatform(iOS: "Touch ID", Android: "Fingerprint", WinPhone: "Fingerprint");
|
||||
FingerprintCell = new ExtendedSwitchCell
|
||||
{
|
||||
Text = "Unlock with " + fingerprintName + (!_fingerprint.IsAvailable ? " (Unavilable)" : null),
|
||||
On = _settings.GetValueOrDefault<bool>(Constants.SettingFingerprintUnlockOn),
|
||||
IsEnabled = _fingerprint.IsAvailable
|
||||
};
|
||||
FingerprintCell.OnChanged += FingerprintCell_Changed;
|
||||
|
||||
PinCell = new ExtendedSwitchCell
|
||||
{
|
||||
Text = "Unlock with PIN Code",
|
||||
@@ -72,6 +63,26 @@ namespace Bit.App.Pages
|
||||
};
|
||||
twoStepCell.Tapped += TwoStepCell_Tapped; ;
|
||||
|
||||
var securitySecion = new TableSection("Security")
|
||||
{
|
||||
LockOptionsCell,
|
||||
PinCell,
|
||||
twoStepCell
|
||||
};
|
||||
|
||||
if(_fingerprint.IsAvailable)
|
||||
{
|
||||
var fingerprintName = Device.OnPlatform(iOS: "Touch ID", Android: "Fingerprint", WinPhone: "Fingerprint");
|
||||
FingerprintCell = new ExtendedSwitchCell
|
||||
{
|
||||
Text = "Unlock with " + fingerprintName,
|
||||
On = _settings.GetValueOrDefault<bool>(Constants.SettingFingerprintUnlockOn),
|
||||
IsEnabled = _fingerprint.IsAvailable
|
||||
};
|
||||
FingerprintCell.OnChanged += FingerprintCell_Changed;
|
||||
securitySecion.Insert(1, FingerprintCell);
|
||||
}
|
||||
|
||||
var changeMasterPasswordCell = new ExtendedTextCell
|
||||
{
|
||||
Text = "Change Master Password",
|
||||
@@ -126,30 +137,38 @@ namespace Bit.App.Pages
|
||||
};
|
||||
helpCell.Tapped += HelpCell_Tapped;
|
||||
|
||||
var rateCell = new LongDetailViewCell("Rate the App", null);
|
||||
rateCell.Tapped += RateCell_Tapped;
|
||||
var otherSection = new TableSection("Other")
|
||||
{
|
||||
aboutCell,
|
||||
helpCell
|
||||
};
|
||||
|
||||
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!";
|
||||
var rateCell = new LongDetailViewCell("Rate the App",
|
||||
"App Store ratings are reset with every new version of bitwarden."
|
||||
+ " Please consider helping us out with a good review!");
|
||||
rateCell.Tapped += RateCell_Tapped;
|
||||
otherSection.Add(rateCell);
|
||||
}
|
||||
else
|
||||
{
|
||||
rateCell.Detail.Text = "Please consider helping us out with a good review!";
|
||||
var rateCell = new ExtendedTextCell
|
||||
{
|
||||
Text = "Rate the App",
|
||||
Detail = "Please consider helping us out with a good review!",
|
||||
ShowDisclousure = true,
|
||||
DetailLineBreakMode = LineBreakMode.WordWrap
|
||||
};
|
||||
rateCell.Tapped += RateCell_Tapped;
|
||||
otherSection.Add(rateCell);
|
||||
}
|
||||
|
||||
Table = new CustomTable
|
||||
{
|
||||
Root = new TableRoot
|
||||
{
|
||||
new TableSection("Security")
|
||||
{
|
||||
LockOptionsCell,
|
||||
FingerprintCell,
|
||||
PinCell,
|
||||
twoStepCell
|
||||
},
|
||||
securitySecion,
|
||||
new TableSection("Account")
|
||||
{
|
||||
changeMasterPasswordCell,
|
||||
@@ -165,12 +184,7 @@ namespace Bit.App.Pages
|
||||
lockCell,
|
||||
logOutCell
|
||||
},
|
||||
new TableSection("Other")
|
||||
{
|
||||
aboutCell,
|
||||
helpCell,
|
||||
rateCell
|
||||
}
|
||||
otherSection
|
||||
}
|
||||
};
|
||||
|
||||
@@ -349,7 +363,11 @@ namespace Bit.App.Pages
|
||||
_settings.AddOrUpdateValue(Constants.SettingPinUnlockOn, true);
|
||||
_settings.AddOrUpdateValue(Constants.SettingFingerprintUnlockOn, false);
|
||||
PinCell.On = true;
|
||||
FingerprintCell.On = false;
|
||||
|
||||
if(FingerprintCell != null)
|
||||
{
|
||||
FingerprintCell.On = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void FoldersCell_Tapped(object sender, EventArgs e)
|
||||
@@ -430,12 +448,6 @@ namespace Bit.App.Pages
|
||||
Padding = new Thickness(15)
|
||||
};
|
||||
|
||||
if(Device.OS == TargetPlatform.Android)
|
||||
{
|
||||
labelDetailStackLayout.Spacing = 5;
|
||||
Label.TextColor = Color.Black;
|
||||
}
|
||||
|
||||
ShowDisclousure = true;
|
||||
View = labelDetailStackLayout;
|
||||
}
|
||||
|
||||
@@ -209,9 +209,17 @@ namespace Bit.App.Pages
|
||||
Orientation = StackOrientation.Horizontal,
|
||||
Spacing = 15,
|
||||
Children = { label, LengthSlider, Value },
|
||||
Padding = new Thickness(15, 8)
|
||||
Padding = Device.OnPlatform(
|
||||
iOS: new Thickness(15, 8),
|
||||
Android: new Thickness(16, 10),
|
||||
WinPhone: new Thickness(15, 8))
|
||||
};
|
||||
|
||||
if(Device.OS == TargetPlatform.Android)
|
||||
{
|
||||
label.TextColor = Color.Black;
|
||||
}
|
||||
|
||||
View = stackLayout;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user