diff --git a/src/Android/Controls/ExtendedEntryRenderer.cs b/src/Android/Controls/ExtendedEntryRenderer.cs
index f1a4a6dd3..dd8441018 100644
--- a/src/Android/Controls/ExtendedEntryRenderer.cs
+++ b/src/Android/Controls/ExtendedEntryRenderer.cs
@@ -21,11 +21,14 @@ namespace Bit.Android.Controls
base.OnElementChanged(e);
var view = (ExtendedEntry)Element;
-
- if(Control != null && e.NewElement != null && e.NewElement.IsPassword)
+ if(Control != null)
{
- Control.SetTypeface(Typeface.Default, TypefaceStyle.Normal);
- Control.TransformationMethod = new PasswordTransformationMethod();
+ Control.SetIncludeFontPadding(false);
+ if(e.NewElement != null && e.NewElement.IsPassword)
+ {
+ Control.SetTypeface(Typeface.Default, TypefaceStyle.Normal);
+ Control.TransformationMethod = new PasswordTransformationMethod();
+ }
}
SetBorder(view);
diff --git a/src/Android/Resources/values/colors.xml b/src/Android/Resources/values/colors.xml
index 86c8b0c2f..f23da718e 100644
--- a/src/Android/Resources/values/colors.xml
+++ b/src/Android/Resources/values/colors.xml
@@ -7,5 +7,5 @@
#efeff4
#3c8dbc
#222d32
- #286090
+ #3883af
diff --git a/src/App/App.cs b/src/App/App.cs
index 2d4642132..3e4ba2335 100644
--- a/src/App/App.cs
+++ b/src/App/App.cs
@@ -71,9 +71,9 @@ namespace Bit.App
await Task.Run(() => IncrementalSyncAsync()).ConfigureAwait(false);
});
- MessagingCenter.Subscribe(Current, "Lock", async (sender, args) =>
+ MessagingCenter.Subscribe(Current, "Lock", (sender, args) =>
{
- await CheckLockAsync(args);
+ Device.BeginInvokeOnMainThread(async () => await CheckLockAsync(args));
});
MessagingCenter.Subscribe(Current, "Logout", (sender, args) =>
@@ -129,7 +129,7 @@ namespace Bit.App
{
try
{
- await _syncService.IncrementalSyncAsync(TimeSpan.FromMinutes(30));
+ await _syncService.IncrementalSyncAsync(TimeSpan.FromMinutes(30)).ConfigureAwait(false);
break;
}
catch(WebException)
@@ -162,7 +162,7 @@ namespace Bit.App
{
try
{
- await _syncService.FullSyncAsync();
+ await _syncService.FullSyncAsync().ConfigureAwait(false);
break;
}
catch(WebException)
diff --git a/src/App/Controls/ExtendedContentPage.cs b/src/App/Controls/ExtendedContentPage.cs
index b66f794c8..bf5b8d1d5 100644
--- a/src/App/Controls/ExtendedContentPage.cs
+++ b/src/App/Controls/ExtendedContentPage.cs
@@ -28,12 +28,12 @@ namespace Bit.App.Controls
{
MessagingCenter.Subscribe(Application.Current, "SyncCompleted", (sender, success) =>
{
- IsBusy = _syncService.SyncInProgress;
+ Device.BeginInvokeOnMainThread(() => IsBusy = _syncService.SyncInProgress);
});
MessagingCenter.Subscribe(Application.Current, "SyncStarted", (sender) =>
{
- IsBusy = _syncService.SyncInProgress;
+ Device.BeginInvokeOnMainThread(() => IsBusy = _syncService.SyncInProgress);
});
}
}
diff --git a/src/App/Controls/FormEntryCell.cs b/src/App/Controls/FormEntryCell.cs
index 128c28d5e..4e7852a4c 100644
--- a/src/App/Controls/FormEntryCell.cs
+++ b/src/App/Controls/FormEntryCell.cs
@@ -84,8 +84,11 @@ namespace Bit.App.Controls
if(Device.OS == TargetPlatform.Android)
{
Entry.FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label));
- Entry.TextColor = Color.Black;
formStackLayout.Spacing = 0;
+ if(!useLabelAsPlaceholder)
+ {
+ Entry.Margin = new Thickness(-4, -2, -4, -10);
+ }
}
if(!useLabelAsPlaceholder)
diff --git a/src/App/Pages/Lock/LockFingerprintPage.cs b/src/App/Pages/Lock/LockFingerprintPage.cs
index b2a8c7748..4be663220 100644
--- a/src/App/Pages/Lock/LockFingerprintPage.cs
+++ b/src/App/Pages/Lock/LockFingerprintPage.cs
@@ -69,7 +69,7 @@ namespace Bit.App.Pages
protected override bool OnBackButtonPressed()
{
- return false;
+ return true;
}
protected override void OnAppearing()
diff --git a/src/App/Pages/Lock/LockPasswordPage.cs b/src/App/Pages/Lock/LockPasswordPage.cs
index 9a166778e..06cc5a5bd 100644
--- a/src/App/Pages/Lock/LockPasswordPage.cs
+++ b/src/App/Pages/Lock/LockPasswordPage.cs
@@ -33,8 +33,13 @@ namespace Bit.App.Pages
public void Init()
{
+ var padding = Device.OnPlatform(
+ iOS: new Thickness(15, 20),
+ Android: new Thickness(15, 8),
+ WinPhone: new Thickness(15, 20));
+
PasswordCell = new FormEntryCell(AppResources.MasterPassword, IsPassword: true,
- useLabelAsPlaceholder: true, imageSource: "lock");
+ useLabelAsPlaceholder: true, imageSource: "lock", containerPadding: padding);
PasswordCell.Entry.ReturnType = Enums.ReturnType.Go;
PasswordCell.Entry.Completed += Entry_Completed;
@@ -87,7 +92,7 @@ namespace Bit.App.Pages
protected override bool OnBackButtonPressed()
{
- return false;
+ return true;
}
protected override void OnAppearing()
diff --git a/src/App/Pages/Lock/LockPinPage.cs b/src/App/Pages/Lock/LockPinPage.cs
index 85f5a7245..bcc6b4c31 100644
--- a/src/App/Pages/Lock/LockPinPage.cs
+++ b/src/App/Pages/Lock/LockPinPage.cs
@@ -79,7 +79,7 @@ namespace Bit.App.Pages
protected override bool OnBackButtonPressed()
{
- return false;
+ return true;
}
protected override void OnAppearing()
diff --git a/src/App/Services/SyncService.cs b/src/App/Services/SyncService.cs
index 186de827b..b4b8766ce 100644
--- a/src/App/Services/SyncService.cs
+++ b/src/App/Services/SyncService.cs
@@ -49,7 +49,7 @@ namespace Bit.App.Services
SyncStarted();
- var cipher = await _cipherApiRepository.GetByIdAsync(id);
+ var cipher = await _cipherApiRepository.GetByIdAsync(id).ConfigureAwait(false);
if(!cipher.Succeeded)
{
SyncCompleted(false);
@@ -70,11 +70,11 @@ namespace Bit.App.Services
var existingLocalFolder = _folderRepository.GetByIdAsync(id);
if(existingLocalFolder == null)
{
- await _folderRepository.InsertAsync(folderData);
+ await _folderRepository.InsertAsync(folderData).ConfigureAwait(false);
}
else
{
- await _folderRepository.UpdateAsync(folderData);
+ await _folderRepository.UpdateAsync(folderData).ConfigureAwait(false);
}
break;
case Enums.CipherType.Site:
@@ -82,11 +82,11 @@ namespace Bit.App.Services
var existingLocalSite = _siteRepository.GetByIdAsync(id);
if(existingLocalSite == null)
{
- await _siteRepository.InsertAsync(siteData);
+ await _siteRepository.InsertAsync(siteData).ConfigureAwait(false);
}
else
{
- await _siteRepository.UpdateAsync(siteData);
+ await _siteRepository.UpdateAsync(siteData).ConfigureAwait(false);
}
break;
default:
@@ -107,7 +107,7 @@ namespace Bit.App.Services
SyncStarted();
- await _folderRepository.DeleteWithSiteUpdateAsync(id, revisionDate);
+ await _folderRepository.DeleteWithSiteUpdateAsync(id, revisionDate).ConfigureAwait(false);
SyncCompleted(true);
return true;
}
@@ -121,7 +121,7 @@ namespace Bit.App.Services
SyncStarted();
- await _siteRepository.DeleteAsync(id);
+ await _siteRepository.DeleteAsync(id).ConfigureAwait(false);
SyncCompleted(true);
return true;
}
@@ -136,7 +136,7 @@ namespace Bit.App.Services
SyncStarted();
var now = DateTime.UtcNow;
- var ciphers = await _cipherApiRepository.GetAsync();
+ var ciphers = await _cipherApiRepository.GetAsync().ConfigureAwait(false);
if(!ciphers.Succeeded)
{
SyncCompleted(false);
@@ -155,7 +155,7 @@ namespace Bit.App.Services
var siteTask = SyncSitesAsync(sites, true);
var folderTask = SyncFoldersAsync(folders, true);
- await Task.WhenAll(siteTask, folderTask);
+ await Task.WhenAll(siteTask, folderTask).ConfigureAwait(false);
if(folderTask.Exception != null || siteTask.Exception != null)
{
@@ -176,7 +176,7 @@ namespace Bit.App.Services
return false;
}
- return await IncrementalSyncAsync();
+ return await IncrementalSyncAsync().ConfigureAwait(false);
}
public async Task IncrementalSyncAsync()
@@ -190,12 +190,12 @@ namespace Bit.App.Services
DateTime? lastSync = _settings.GetValueOrDefault(Constants.LastSync);
if(lastSync == null)
{
- return await FullSyncAsync();
+ return await FullSyncAsync().ConfigureAwait(false);
}
SyncStarted();
- var ciphers = await _cipherApiRepository.GetByRevisionDateWithHistoryAsync(lastSync.Value);
+ var ciphers = await _cipherApiRepository.GetByRevisionDateWithHistoryAsync(lastSync.Value).ConfigureAwait(false);
if(!ciphers.Succeeded)
{
SyncCompleted(false);
@@ -216,7 +216,7 @@ namespace Bit.App.Services
var folderTask = SyncFoldersAsync(folders, false);
var deleteTask = DeleteCiphersAsync(ciphers.Result.Deleted);
- await Task.WhenAll(siteTask, folderTask, deleteTask);
+ await Task.WhenAll(siteTask, folderTask, deleteTask).ConfigureAwait(false);
if(folderTask.Exception != null || siteTask.Exception != null || deleteTask.Exception != null)
{
SyncCompleted(false);
@@ -235,7 +235,8 @@ namespace Bit.App.Services
return;
}
- var localFolders = (await _folderRepository.GetAllByUserIdAsync(_authService.UserId)).ToDictionary(f => f.Id);
+ var localFolders = (await _folderRepository.GetAllByUserIdAsync(_authService.UserId).ConfigureAwait(false))
+ .ToDictionary(f => f.Id);
foreach(var serverFolder in serverFolders)
{
@@ -248,12 +249,12 @@ namespace Bit.App.Services
if(existingLocalFolder == null)
{
var data = new FolderData(serverFolder.Value, _authService.UserId);
- await _folderRepository.InsertAsync(data);
+ await _folderRepository.InsertAsync(data).ConfigureAwait(false);
}
else if(existingLocalFolder.RevisionDateTime != serverFolder.Value.RevisionDate)
{
var data = new FolderData(serverFolder.Value, _authService.UserId);
- await _folderRepository.UpdateAsync(data);
+ await _folderRepository.UpdateAsync(data).ConfigureAwait(false);
}
}
@@ -264,7 +265,7 @@ namespace Bit.App.Services
foreach(var folder in localFolders.Where(localFolder => !serverFolders.ContainsKey(localFolder.Key)))
{
- await _folderRepository.DeleteAsync(folder.Value.Id);
+ await _folderRepository.DeleteAsync(folder.Value.Id).ConfigureAwait(false);
}
}
@@ -275,7 +276,8 @@ namespace Bit.App.Services
return;
}
- var localSites = (await _siteRepository.GetAllByUserIdAsync(_authService.UserId)).ToDictionary(s => s.Id);
+ var localSites = (await _siteRepository.GetAllByUserIdAsync(_authService.UserId).ConfigureAwait(false))
+ .ToDictionary(s => s.Id);
foreach(var serverSite in serverSites)
{
@@ -288,12 +290,12 @@ namespace Bit.App.Services
if(existingLocalSite == null)
{
var data = new SiteData(serverSite.Value, _authService.UserId);
- await _siteRepository.InsertAsync(data);
+ await _siteRepository.InsertAsync(data).ConfigureAwait(false);
}
else if(existingLocalSite.RevisionDateTime != serverSite.Value.RevisionDate)
{
var data = new SiteData(serverSite.Value, _authService.UserId);
- await _siteRepository.UpdateAsync(data);
+ await _siteRepository.UpdateAsync(data).ConfigureAwait(false);
}
}
@@ -304,7 +306,7 @@ namespace Bit.App.Services
foreach(var site in localSites.Where(localSite => !serverSites.ContainsKey(localSite.Key)))
{
- await _siteRepository.DeleteAsync(site.Value.Id);
+ await _siteRepository.DeleteAsync(site.Value.Id).ConfigureAwait(false);
}
}
@@ -321,7 +323,7 @@ namespace Bit.App.Services
tasks.Add(_siteRepository.DeleteAsync(cipherId));
tasks.Add(_folderRepository.DeleteAsync(cipherId));
}
- await Task.WhenAll(tasks);
+ await Task.WhenAll(tasks).ConfigureAwait(false);
}
private void SyncStarted()