Project lib updates and migration (#789)

* Replace 3rd party FAB lib with our own code

* merged

* merged

* WIP

* WIP

* WIP

* WIP

* Updated LiteDB

* Update ZXing libs to 2.4.1

* Missing semicolon

* rename fab style to btn-fab

* Revert project guid modified by VSmac
This commit is contained in:
Matt Portune 2020-03-20 17:54:23 -04:00 committed by GitHub
parent 6fdb1e3356
commit 145482ea30
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 125 additions and 114 deletions

View file

@ -15,11 +15,11 @@
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest> <AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix> <MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix> <MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
<TargetFrameworkVersion>v10.0</TargetFrameworkVersion> <TargetFrameworkVersion>v10.0</TargetFrameworkVersion>
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType> <AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
<NuGetPackageImportStamp> <NuGetPackageImportStamp>
</NuGetPackageImportStamp> </NuGetPackageImportStamp>
<AndroidLinkSkip>Xamarin.GooglePlayServices.Base;Xamarin.GooglePlayServices.Basement;Xamarin.GooglePlayServices.Measurement;Xamarin.GooglePlayServices.Gcm;BitwardenAndroid;BitwardenApp;BitwardenCore;Xamarin.Android.Net;Xamarin.Android.Net.OldAndroidSSLSocketFactory</AndroidLinkSkip>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
@ -30,10 +30,8 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>3</WarningLevel> <WarningLevel>3</WarningLevel>
<AndroidLinkMode>None</AndroidLinkMode> <AndroidLinkMode>None</AndroidLinkMode>
<AndroidEnableMultiDex>true</AndroidEnableMultiDex>
<AndroidSupportedAbis /> <AndroidSupportedAbis />
<JavaMaximumHeapSize>1G</JavaMaximumHeapSize> <JavaMaximumHeapSize>1G</JavaMaximumHeapSize>
<AndroidLinkSkip>Xamarin.GooglePlayServices.Base;Xamarin.GooglePlayServices.Basement;Xamarin.GooglePlayServices.Measurement;Xamarin.GooglePlayServices.Gcm;BitwardenAndroid;BitwardenApp;BitwardenCore;Xamarin.Android.Net;Xamarin.Android.Net.OldAndroidSSLSocketFactory</AndroidLinkSkip>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>false</DebugSymbols> <DebugSymbols>false</DebugSymbols>
@ -46,8 +44,6 @@
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime> <AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
<AndroidSupportedAbis>armeabi-v7a;x86;x86_64;arm64-v8a</AndroidSupportedAbis> <AndroidSupportedAbis>armeabi-v7a;x86;x86_64;arm64-v8a</AndroidSupportedAbis>
<JavaMaximumHeapSize>1G</JavaMaximumHeapSize> <JavaMaximumHeapSize>1G</JavaMaximumHeapSize>
<AndroidEnableMultiDex>true</AndroidEnableMultiDex>
<AndroidLinkSkip>Xamarin.GooglePlayServices.Base;Xamarin.GooglePlayServices.Basement;Xamarin.GooglePlayServices.Measurement;Xamarin.GooglePlayServices.Gcm;BitwardenAndroid;BitwardenApp;BitwardenCore;Xamarin.Android.Net;Xamarin.Android.Net.OldAndroidSSLSocketFactory</AndroidLinkSkip>
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk> <EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
<AndroidLinkMode>Full</AndroidLinkMode> <AndroidLinkMode>Full</AndroidLinkMode>
</PropertyGroup> </PropertyGroup>
@ -63,10 +59,8 @@
<DefineConstants>FDROID</DefineConstants> <DefineConstants>FDROID</DefineConstants>
<AndroidSupportedAbis>armeabi-v7a;x86;x86_64;arm64-v8a</AndroidSupportedAbis> <AndroidSupportedAbis>armeabi-v7a;x86;x86_64;arm64-v8a</AndroidSupportedAbis>
<JavaMaximumHeapSize>1G</JavaMaximumHeapSize> <JavaMaximumHeapSize>1G</JavaMaximumHeapSize>
<AndroidEnableMultiDex>true</AndroidEnableMultiDex>
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime> <AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk> <EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
<AndroidLinkSkip>Xamarin.GooglePlayServices.Base;Xamarin.GooglePlayServices.Basement;Xamarin.GooglePlayServices.Measurement;Xamarin.GooglePlayServices.Gcm;BitwardenAndroid;BitwardenApp;BitwardenCore;Xamarin.Android.Net;Xamarin.Android.Net.OldAndroidSSLSocketFactory</AndroidLinkSkip>
<AndroidLinkMode>Full</AndroidLinkMode> <AndroidLinkMode>Full</AndroidLinkMode>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@ -82,21 +76,22 @@
<Version>2.1.0.4</Version> <Version>2.1.0.4</Version>
</PackageReference> </PackageReference>
<PackageReference Include="Portable.BouncyCastle"> <PackageReference Include="Portable.BouncyCastle">
<Version>1.8.5.2</Version> <Version>1.8.6</Version>
</PackageReference> </PackageReference>
<PackageReference Include="Xamarin.Essentials"> <PackageReference Include="Xamarin.Essentials">
<Version>1.3.1</Version> <Version>1.5.1</Version>
</PackageReference> </PackageReference>
<PackageReference Include="Xamarin.Firebase.Messaging"> <PackageReference Include="Xamarin.Firebase.Messaging">
<Version>60.1142.1</Version> <Version>71.1740.0</Version>
</PackageReference> </PackageReference>
<PackageReference Include="Xamarin.Android.Support.Design" Version="28.0.0.3" /> <PackageReference Include="Xamarin.Google.Android.Material" Version="1.0.0" />
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="28.0.0.3" /> <PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.1.0" />
<PackageReference Include="Xamarin.Android.Support.v4" Version="28.0.0.3" /> <PackageReference Include="Xamarin.AndroidX.Legacy.Support.V4" Version="1.0.0" />
<PackageReference Include="Xamarin.Android.Support.v7.CardView" Version="28.0.0.3" /> <PackageReference Include="Xamarin.AndroidX.CardView" Version="1.0.0" />
<PackageReference Include="Xamarin.Android.Support.v7.MediaRouter" Version="28.0.0.3" /> <PackageReference Include="Xamarin.AndroidX.MediaRouter" Version="1.1.0" />
<PackageReference Include="Xamarin.AndroidX.Migration" Version="1.0.1" />
<PackageReference Include="Xamarin.GooglePlayServices.SafetyNet"> <PackageReference Include="Xamarin.GooglePlayServices.SafetyNet">
<Version>60.1142.1</Version> <Version>71.1600.0</Version>
</PackageReference> </PackageReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@ -113,6 +108,7 @@
<Compile Include="Autofill\FilledItem.cs" /> <Compile Include="Autofill\FilledItem.cs" />
<Compile Include="Autofill\Parser.cs" /> <Compile Include="Autofill\Parser.cs" />
<Compile Include="Autofill\SavedItem.cs" /> <Compile Include="Autofill\SavedItem.cs" />
<Compile Include="Effects\FabShadowEffect.cs" />
<Compile Include="Effects\FixedSizeEffect.cs" /> <Compile Include="Effects\FixedSizeEffect.cs" />
<Compile Include="Effects\SelectableLabelEffect.cs" /> <Compile Include="Effects\SelectableLabelEffect.cs" />
<Compile Include="Effects\TabBarEffect.cs" /> <Compile Include="Effects\TabBarEffect.cs" />
@ -143,7 +139,6 @@
<Compile Include="Tiles\GeneratorTileService.cs" /> <Compile Include="Tiles\GeneratorTileService.cs" />
<Compile Include="Tiles\MyVaultTileService.cs" /> <Compile Include="Tiles\MyVaultTileService.cs" />
<Compile Include="Utilities\AndroidHelpers.cs" /> <Compile Include="Utilities\AndroidHelpers.cs" />
<Compile Include="Utilities\CustomFingerprintDialogFragment.cs" />
<Compile Include="Utilities\HockeyAppCrashManagerListener.cs" /> <Compile Include="Utilities\HockeyAppCrashManagerListener.cs" />
<Compile Include="Utilities\StaticStore.cs" /> <Compile Include="Utilities\StaticStore.cs" />
</ItemGroup> </ItemGroup>

View file

@ -0,0 +1,29 @@
using Android.Graphics.Drawables;
using Bit.Droid.Effects;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
[assembly: ExportEffect(typeof(FabShadowEffect), "FabShadowEffect")]
namespace Bit.Droid.Effects
{
public class FabShadowEffect : PlatformEffect
{
protected override void OnAttached ()
{
if(Control is Android.Widget.Button button)
{
var gd = new GradientDrawable();
gd.SetColor(((Color)Application.Current.Resources["FabColor"]).ToAndroid());
gd.SetCornerRadius(100);
button.SetBackground(gd);
button.Elevation = 6;
button.TranslationZ = 20;
}
}
protected override void OnDetached ()
{
}
}
}

View file

@ -1,7 +1,4 @@
using Android.Support.Design.BottomNavigation; using Android.Widget;
using Android.Support.Design.Widget;
using Android.Views;
using Android.Widget;
using Bit.Droid.Effects; using Bit.Droid.Effects;
using Xamarin.Forms; using Xamarin.Forms;
using Xamarin.Forms.Platform.Android; using Xamarin.Forms.Platform.Android;

View file

@ -1,7 +1,4 @@
using Android.Support.Design.BottomNavigation; using Android.Widget;
using Android.Support.Design.Widget;
using Android.Views;
using Android.Widget;
using Bit.Droid.Effects; using Bit.Droid.Effects;
using Xamarin.Forms; using Xamarin.Forms;
using Xamarin.Forms.Platform.Android; using Xamarin.Forms.Platform.Android;

View file

@ -1,7 +1,6 @@
using Android.Support.Design.BottomNavigation; using Android.Views;
using Android.Support.Design.Widget;
using Android.Views;
using Bit.Droid.Effects; using Bit.Droid.Effects;
using Google.Android.Material.BottomNavigation;
using Xamarin.Forms; using Xamarin.Forms;
using Xamarin.Forms.Platform.Android; using Xamarin.Forms.Platform.Android;

View file

@ -17,7 +17,7 @@ using Bit.Core.Enums;
using Android.Nfc; using Android.Nfc;
using Bit.App.Utilities; using Bit.App.Utilities;
using System.Threading.Tasks; using System.Threading.Tasks;
using Android.Support.V4.Content; using AndroidX.Core.Content;
namespace Bit.Droid namespace Bit.Droid
{ {

View file

@ -70,7 +70,6 @@ namespace Bit.Droid
{ {
ServiceContainer.Register<ILogService>("logService", new AndroidLogService()); ServiceContainer.Register<ILogService>("logService", new AndroidLogService());
Refractored.FabControl.Droid.FloatingActionButtonViewRenderer.Init();
// Note: This might cause a race condition. Investigate more. // Note: This might cause a race condition. Investigate more.
Task.Run(() => Task.Run(() =>
{ {
@ -83,7 +82,6 @@ namespace Bit.Droid
ZXing.Net.Mobile.Forms.Android.Platform.Init(); ZXing.Net.Mobile.Forms.Android.Platform.Init();
}); });
CrossFingerprint.SetCurrentActivityResolver(() => CrossCurrentActivity.Current.Activity); CrossFingerprint.SetCurrentActivityResolver(() => CrossCurrentActivity.Current.Activity);
CrossFingerprint.SetDialogFragmentType<CustomFingerprintDialogFragment>();
var preferencesStorage = new PreferencesStorageService(null); var preferencesStorage = new PreferencesStorageService(null);
var documentsPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal); var documentsPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);

View file

@ -6,7 +6,7 @@
android:versionName="2.3.1" android:versionName="2.3.1"
package="com.x8bit.bitwarden"> package="com.x8bit.bitwarden">
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="29" /> <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="29" />
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.NFC" /> <uses-permission android:name="android.permission.NFC" />
@ -30,7 +30,7 @@
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:networkSecurityConfig="@xml/network_security_config"> android:networkSecurityConfig="@xml/network_security_config">
<provider <provider
android:name="android.support.v4.content.FileProvider" android:name="androidx.core.content.FileProvider"
android:authorities="com.x8bit.bitwarden.fileprovider" android:authorities="com.x8bit.bitwarden.fileprovider"
android:exported="false" android:exported="false"
android:grantUriPermissions="true"> android:grantUriPermissions="true">

View file

@ -1,6 +1,6 @@
using Android.Content; using Android.Content;
using Android.Graphics.Drawables; using Android.Graphics.Drawables;
using Android.Support.V4.Content.Res; using AndroidX.Core.Content.Resources;
using Bit.App.Controls; using Bit.App.Controls;
using Bit.Droid.Renderers; using Bit.Droid.Renderers;
using Xamarin.Forms; using Xamarin.Forms;

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.TabLayout xmlns:android="http://schemas.android.com/apk/res/android" <com.google.android.material.tabs.TabLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/sliding_tabs" android:id="@+id/sliding_tabs"
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -1,4 +1,4 @@
<android.support.v7.widget.Toolbar <androidx.appcompat.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/toolbar" android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -14,14 +14,14 @@ using Android.Nfc;
using Android.OS; using Android.OS;
using Android.Provider; using Android.Provider;
using Android.Runtime; using Android.Runtime;
using Android.Support.V4.App;
using Android.Support.V4.Content;
using Android.Text; using Android.Text;
using Android.Text.Method; using Android.Text.Method;
using Android.Views.Autofill; using Android.Views.Autofill;
using Android.Views.InputMethods; using Android.Views.InputMethods;
using Android.Webkit; using Android.Webkit;
using Android.Widget; using Android.Widget;
using AndroidX.Core.App;
using AndroidX.Core.Content;
using Bit.App.Abstractions; using Bit.App.Abstractions;
using Bit.App.Resources; using Bit.App.Resources;
using Bit.Core; using Bit.Core;

View file

@ -1,30 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Plugin.Fingerprint.Dialog;
using Xamarin.Forms.Platform.Android;
namespace Bit.Droid.Utilities
{
public class CustomFingerprintDialogFragment : FingerprintDialogFragment
{
public CustomFingerprintDialogFragment()
: base()
{
DefaultColor = ((Xamarin.Forms.Color)Xamarin.Forms.Application.Current.Resources["MutedColor"])
.ToAndroid();
NegativeColor = ((Xamarin.Forms.Color)Xamarin.Forms.Application.Current.Resources["DangerColor"])
.ToAndroid();
PositiveColor = ((Xamarin.Forms.Color)Xamarin.Forms.Application.Current.Resources["SuccessColor"])
.ToAndroid();
}
}
}

View file

@ -14,12 +14,12 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="HockeySDK.Xamarin" Version="5.2.0" /> <PackageReference Include="HockeySDK.Xamarin" Version="5.2.0" />
<PackageReference Include="Plugin.Fingerprint" Version="1.4.9" /> <PackageReference Include="Plugin.Fingerprint" Version="2.1.1" />
<PackageReference Include="Refractored.FloatingActionButtonForms" Version="2.1.0" /> <PackageReference Include="Xamarin.Essentials" Version="1.5.1" />
<PackageReference Include="Xamarin.Essentials" Version="1.3.1" />
<PackageReference Include="Xamarin.FFImageLoading.Forms" Version="2.4.11.982" /> <PackageReference Include="Xamarin.FFImageLoading.Forms" Version="2.4.11.982" />
<PackageReference Include="Xamarin.Forms" Version="4.4.0.991265" /> <PackageReference Include="Xamarin.Forms" Version="4.5.0.356" />
<PackageReference Include="ZXing.Net.Mobile.Forms" Version="2.1.47" /> <PackageReference Include="ZXing.Net.Mobile" Version="2.4.1" />
<PackageReference Include="ZXing.Net.Mobile.Forms" Version="2.4.1" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View file

@ -0,0 +1,11 @@
using Xamarin.Forms;
namespace Bit.App.Effects
{
public class FabShadowEffect : RoutingEffect
{
public FabShadowEffect()
: base("Bitwarden.FabShadowEffect")
{ }
}
}

View file

@ -7,7 +7,7 @@
xmlns:controls="clr-namespace:Bit.App.Controls" xmlns:controls="clr-namespace:Bit.App.Controls"
xmlns:u="clr-namespace:Bit.App.Utilities" xmlns:u="clr-namespace:Bit.App.Utilities"
xmlns:views="clr-namespace:Bit.Core.Models.View;assembly=BitwardenCore" xmlns:views="clr-namespace:Bit.Core.Models.View;assembly=BitwardenCore"
xmlns:fab="clr-namespace:Refractored.FabControl;assembly=Refractored.FabControl" xmlns:effects="clr-namespace:Bit.App.Effects;assembly=BitwardenApp"
x:DataType="pages:FoldersPageViewModel" x:DataType="pages:FoldersPageViewModel"
x:Name="_page" x:Name="_page"
Title="{Binding PageTitle}"> Title="{Binding PageTitle}">
@ -66,14 +66,19 @@
AbsoluteLayout.LayoutFlags="All" AbsoluteLayout.LayoutFlags="All"
AbsoluteLayout.LayoutBounds="0, 0, 1, 1"> AbsoluteLayout.LayoutBounds="0, 0, 1, 1">
</ContentView> </ContentView>
<fab:FloatingActionButtonView <Button
x:Name="_fab" x:Name="_fab"
ImageName="plus.png" Image="plus.png"
Clicked="AddButton_Clicked"
Style="{StaticResource btn-fab}"
AbsoluteLayout.LayoutFlags="PositionProportional" AbsoluteLayout.LayoutFlags="PositionProportional"
AbsoluteLayout.LayoutBounds="1, 1, AutoSize, AutoSize" AbsoluteLayout.LayoutBounds="1, 1, AutoSize, AutoSize"
AutomationProperties.IsInAccessibleTree="True" AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n AddFolder}"> AutomationProperties.Name="{u:I18n AddFolder}">
</fab:FloatingActionButtonView> <Button.Effects>
<effects:FabShadowEffect />
</Button.Effects>
</Button>
</AbsoluteLayout> </AbsoluteLayout>
</pages:BaseContentPage> </pages:BaseContentPage>

View file

@ -21,10 +21,6 @@ namespace Bit.App.Pages
ToolbarItems.Add(_closeItem); ToolbarItems.Add(_closeItem);
ToolbarItems.Add(_addItem); ToolbarItems.Add(_addItem);
} }
else
{
_fab.Clicked = AddButton_Clicked;
}
} }
protected override async void OnAppearing() protected override async void OnAppearing()

View file

@ -5,7 +5,7 @@
xmlns:pages="clr-namespace:Bit.App.Pages" xmlns:pages="clr-namespace:Bit.App.Pages"
xmlns:u="clr-namespace:Bit.App.Utilities" xmlns:u="clr-namespace:Bit.App.Utilities"
xmlns:controls="clr-namespace:Bit.App.Controls" xmlns:controls="clr-namespace:Bit.App.Controls"
xmlns:fab="clr-namespace:Refractored.FabControl;assembly=Refractored.FabControl" xmlns:effects="clr-namespace:Bit.App.Effects;assembly=BitwardenApp"
x:DataType="pages:AutofillCiphersPageViewModel" x:DataType="pages:AutofillCiphersPageViewModel"
Title="{Binding PageTitle}" Title="{Binding PageTitle}"
x:Name="_page"> x:Name="_page">
@ -94,12 +94,16 @@
AbsoluteLayout.LayoutFlags="All" AbsoluteLayout.LayoutFlags="All"
AbsoluteLayout.LayoutBounds="0, 0, 1, 1"> AbsoluteLayout.LayoutBounds="0, 0, 1, 1">
</ContentView> </ContentView>
<fab:FloatingActionButtonView <Button
x:Name="_fab" x:Name="_fab"
ImageName="plus.png" Clicked="AddButton_Clicked"
Style="{StaticResource btn-fab}"
AbsoluteLayout.LayoutFlags="PositionProportional" AbsoluteLayout.LayoutFlags="PositionProportional"
AbsoluteLayout.LayoutBounds="1, 1, AutoSize, AutoSize"> AbsoluteLayout.LayoutBounds="1, 1, AutoSize, AutoSize">
</fab:FloatingActionButtonView> <Button.Effects>
<effects:FabShadowEffect />
</Button.Effects>
</Button>
</AbsoluteLayout> </AbsoluteLayout>
</pages:BaseContentPage> </pages:BaseContentPage>

View file

@ -22,7 +22,6 @@ namespace Bit.App.Pages
InitializeComponent(); InitializeComponent();
_vm = BindingContext as AutofillCiphersPageViewModel; _vm = BindingContext as AutofillCiphersPageViewModel;
_vm.Page = this; _vm.Page = this;
_fab.Clicked = AddButton_Clicked;
_vm.Init(appOptions); _vm.Init(appOptions);
_platformUtilsService = ServiceContainer.Resolve<IPlatformUtilsService>("platformUtilsService"); _platformUtilsService = ServiceContainer.Resolve<IPlatformUtilsService>("platformUtilsService");

View file

@ -6,7 +6,6 @@
xmlns:u="clr-namespace:Bit.App.Utilities" xmlns:u="clr-namespace:Bit.App.Utilities"
xmlns:effects="clr-namespace:Bit.App.Effects" xmlns:effects="clr-namespace:Bit.App.Effects"
xmlns:controls="clr-namespace:Bit.App.Controls" xmlns:controls="clr-namespace:Bit.App.Controls"
xmlns:fab="clr-namespace:Refractored.FabControl;assembly=Refractored.FabControl"
x:DataType="pages:GroupingsPageViewModel" x:DataType="pages:GroupingsPageViewModel"
Title="{Binding PageTitle}" Title="{Binding PageTitle}"
x:Name="_page"> x:Name="_page">
@ -144,14 +143,19 @@
AbsoluteLayout.LayoutFlags="All" AbsoluteLayout.LayoutFlags="All"
AbsoluteLayout.LayoutBounds="0, 0, 1, 1"> AbsoluteLayout.LayoutBounds="0, 0, 1, 1">
</ContentView> </ContentView>
<fab:FloatingActionButtonView <Button
x:Name="_fab" x:Name="_fab"
ImageName="plus.png" Image="plus.png"
Clicked="AddButton_Clicked"
Style="{StaticResource btn-fab}"
AbsoluteLayout.LayoutFlags="PositionProportional" AbsoluteLayout.LayoutFlags="PositionProportional"
AbsoluteLayout.LayoutBounds="1, 1, AutoSize, AutoSize" AbsoluteLayout.LayoutBounds="1, 1, AutoSize, AutoSize"
AutomationProperties.IsInAccessibleTree="True" AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n AddItem}"> AutomationProperties.Name="{u:I18n AddItem}">
</fab:FloatingActionButtonView> <Button.Effects>
<effects:FabShadowEffect />
</Button.Effects>
</Button>
</AbsoluteLayout> </AbsoluteLayout>
</pages:BaseContentPage> </pages:BaseContentPage>

View file

@ -60,7 +60,6 @@ namespace Bit.App.Pages
} }
else else
{ {
_fab.Clicked = AddButton_Clicked;
ToolbarItems.Add(_syncItem); ToolbarItems.Add(_syncItem);
ToolbarItems.Add(_lockItem); ToolbarItems.Add(_lockItem);
ToolbarItems.Add(_exitItem); ToolbarItems.Add(_exitItem);

View file

@ -7,7 +7,6 @@
xmlns:u="clr-namespace:Bit.App.Utilities" xmlns:u="clr-namespace:Bit.App.Utilities"
xmlns:controls="clr-namespace:Bit.App.Controls" xmlns:controls="clr-namespace:Bit.App.Controls"
xmlns:effects="clr-namespace:Bit.App.Effects" xmlns:effects="clr-namespace:Bit.App.Effects"
xmlns:fab="clr-namespace:Refractored.FabControl;assembly=Refractored.FabControl"
xmlns:views="clr-namespace:Bit.Core.Models.View;assembly=BitwardenCore" xmlns:views="clr-namespace:Bit.Core.Models.View;assembly=BitwardenCore"
x:DataType="pages:ViewPageViewModel" x:DataType="pages:ViewPageViewModel"
x:Name="_page" x:Name="_page"
@ -663,14 +662,19 @@
AbsoluteLayout.LayoutFlags="All" AbsoluteLayout.LayoutFlags="All"
AbsoluteLayout.LayoutBounds="0, 0, 1, 1"> AbsoluteLayout.LayoutBounds="0, 0, 1, 1">
</ContentView> </ContentView>
<fab:FloatingActionButtonView <Button
x:Name="_fab" x:Name="_fab"
ImageName="pencil.png" Image="pencil.png"
Clicked="EditButton_Clicked"
Style="{StaticResource btn-fab}"
AbsoluteLayout.LayoutFlags="PositionProportional" AbsoluteLayout.LayoutFlags="PositionProportional"
AbsoluteLayout.LayoutBounds="1, 1, AutoSize, AutoSize" AbsoluteLayout.LayoutBounds="1, 1, AutoSize, AutoSize"
AutomationProperties.IsInAccessibleTree="True" AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n EditItem}"> AutomationProperties.Name="{u:I18n EditItem}">
</fab:FloatingActionButtonView> <Button.Effects>
<effects:FabShadowEffect />
</Button.Effects>
</Button>
</AbsoluteLayout> </AbsoluteLayout>
</pages:BaseContentPage> </pages:BaseContentPage>

View file

@ -33,7 +33,6 @@ namespace Bit.App.Pages
} }
else else
{ {
_fab.Clicked = EditButton_Clicked;
_mainLayout.Padding = new Thickness(0, 0, 0, 75); _mainLayout.Padding = new Thickness(0, 0, 0, 75);
ToolbarItems.Add(_attachmentsItem); ToolbarItems.Add(_attachmentsItem);
ToolbarItems.Add(_deleteItem); ToolbarItems.Add(_deleteItem);

View file

@ -218,7 +218,7 @@ namespace Bit.App.Services
var supportsFace = await _deviceActionService.SupportsFaceBiometricAsync(); var supportsFace = await _deviceActionService.SupportsFaceBiometricAsync();
text = supportsFace ? AppResources.FaceIDDirection : AppResources.FingerprintDirection; text = supportsFace ? AppResources.FaceIDDirection : AppResources.FingerprintDirection;
} }
var fingerprintRequest = new AuthenticationRequestConfiguration(text) var fingerprintRequest = new AuthenticationRequestConfiguration(text, text)
{ {
CancelTitle = AppResources.Cancel, CancelTitle = AppResources.Cancel,
FallbackTitle = fallbackText FallbackTitle = fallbackText

View file

@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<ResourceDictionary xmlns="http://xamarin.com/schemas/2014/forms" <ResourceDictionary xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Bit.App.Styles.Base" x:Class="Bit.App.Styles.Base">
xmlns:fab="clr-namespace:Refractored.FabControl;assembly=Refractored.FabControl">
<!-- General --> <!-- General -->
<Style TargetType="Label" <Style TargetType="Label"
@ -97,13 +96,19 @@
<Setter Property="TextColor" <Setter Property="TextColor"
Value="{StaticResource DisabledIconColor}" /> Value="{StaticResource DisabledIconColor}" />
</Style> </Style>
<Style TargetType="fab:FloatingActionButtonView"> <Style x:Key="btn-fab" TargetType="Button">
<Setter Property="ColorNormal" <Setter Property="HeightRequest"
Value="{StaticResource FabColor}" /> Value="56" />
<Setter Property="ColorPressed" <Setter Property="WidthRequest"
Value="{StaticResource FabPressedColor}" /> Value="56" />
<Setter Property="ColorRipple" <Setter Property="HorizontalOptions"
Value="{StaticResource FabPressedColor}" /> Value="CenterAndExpand" />
<Setter Property="VerticalOptions"
Value="CenterAndExpand" />
<Setter Property="Padding"
Value="16" />
<Setter Property="Margin"
Value="16" />
</Style> </Style>
<!-- Title --> <!-- Title -->

View file

@ -24,7 +24,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="CsvHelper" Version="15.0.1" /> <PackageReference Include="CsvHelper" Version="15.0.1" />
<PackageReference Include="LiteDB" Version="4.1.4" /> <PackageReference Include="LiteDB" Version="5.0.4" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" /> <PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="PCLCrypto" Version="2.0.147" /> <PackageReference Include="PCLCrypto" Version="2.0.147" />
</ItemGroup> </ItemGroup>

View file

@ -14,7 +14,7 @@ namespace Bit.Core.Services
ContractResolver = new CamelCasePropertyNamesContractResolver() ContractResolver = new CamelCasePropertyNamesContractResolver()
}; };
private readonly string _dbPath; private readonly string _dbPath;
private LiteCollection<JsonItem> _collection; private ILiteCollection<JsonItem> _collection;
private Task _initTask; private Task _initTask;
public LiteDbStorageService(string dbPath) public LiteDbStorageService(string dbPath)
@ -36,7 +36,7 @@ namespace Bit.Core.Services
{ {
try try
{ {
var db = new LiteDatabase($"Filename={_dbPath};"); var db = new LiteDatabase($"Filename={_dbPath};Upgrade=true;");
_collection = db.GetCollection<JsonItem>("json_items"); _collection = db.GetCollection<JsonItem>("json_items");
} }
finally finally
@ -68,7 +68,7 @@ namespace Bit.Core.Services
public async Task RemoveAsync(string key) public async Task RemoveAsync(string key)
{ {
await InitAsync(); await InitAsync();
_collection.Delete(i => i.Id == key); _collection.DeleteMany(i => i.Id == key);
} }
private class JsonItem private class JsonItem

View file

@ -168,7 +168,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Xamarin.Essentials"> <PackageReference Include="Xamarin.Essentials">
<Version>1.3.1</Version> <Version>1.5.1</Version>
</PackageReference> </PackageReference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" /> <Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />