mirror of
https://github.com/bitwarden/android.git
synced 2024-12-25 18:38:27 +03:00
bind to image with OnBindingContextChanged
This commit is contained in:
parent
6ba396440f
commit
7c56f1a773
8 changed files with 42 additions and 29 deletions
|
@ -92,16 +92,16 @@
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="FFImageLoading, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="FFImageLoading, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xamarin.FFImageLoading.2.2.9\lib\MonoAndroid10\FFImageLoading.dll</HintPath>
|
<HintPath>..\..\packages\Xamarin.FFImageLoading.2.2.20\lib\MonoAndroid10\FFImageLoading.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="FFImageLoading.Forms, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="FFImageLoading.Forms, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xamarin.FFImageLoading.Forms.2.2.9\lib\MonoAndroid10\FFImageLoading.Forms.dll</HintPath>
|
<HintPath>..\..\packages\Xamarin.FFImageLoading.Forms.2.2.20\lib\MonoAndroid10\FFImageLoading.Forms.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="FFImageLoading.Forms.Droid, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="FFImageLoading.Forms.Droid, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xamarin.FFImageLoading.Forms.2.2.9\lib\MonoAndroid10\FFImageLoading.Forms.Droid.dll</HintPath>
|
<HintPath>..\..\packages\Xamarin.FFImageLoading.Forms.2.2.20\lib\MonoAndroid10\FFImageLoading.Forms.Droid.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="FFImageLoading.Platform, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="FFImageLoading.Platform, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xamarin.FFImageLoading.2.2.9\lib\MonoAndroid10\FFImageLoading.Platform.dll</HintPath>
|
<HintPath>..\..\packages\Xamarin.FFImageLoading.2.2.20\lib\MonoAndroid10\FFImageLoading.Platform.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="FormsViewGroup, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="FormsViewGroup, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xamarin.Forms.2.3.4.267\lib\MonoAndroid10\FormsViewGroup.dll</HintPath>
|
<HintPath>..\..\packages\Xamarin.Forms.2.3.4.267\lib\MonoAndroid10\FormsViewGroup.dll</HintPath>
|
||||||
|
|
|
@ -78,8 +78,8 @@
|
||||||
<package id="Xamarin.Android.Support.v7.MediaRouter" version="23.3.0" targetFramework="monoandroid60" />
|
<package id="Xamarin.Android.Support.v7.MediaRouter" version="23.3.0" targetFramework="monoandroid60" />
|
||||||
<package id="Xamarin.Android.Support.v7.RecyclerView" version="23.3.0" targetFramework="monoandroid60" />
|
<package id="Xamarin.Android.Support.v7.RecyclerView" version="23.3.0" targetFramework="monoandroid60" />
|
||||||
<package id="Xamarin.Android.Support.Vector.Drawable" version="23.3.0" targetFramework="monoandroid60" />
|
<package id="Xamarin.Android.Support.Vector.Drawable" version="23.3.0" targetFramework="monoandroid60" />
|
||||||
<package id="Xamarin.FFImageLoading" version="2.2.9" targetFramework="monoandroid71" />
|
<package id="Xamarin.FFImageLoading" version="2.2.20" targetFramework="monoandroid71" />
|
||||||
<package id="Xamarin.FFImageLoading.Forms" version="2.2.9" targetFramework="monoandroid71" />
|
<package id="Xamarin.FFImageLoading.Forms" version="2.2.20" targetFramework="monoandroid71" />
|
||||||
<package id="Xamarin.Forms" version="2.3.4.267" targetFramework="monoandroid71" />
|
<package id="Xamarin.Forms" version="2.3.4.267" targetFramework="monoandroid71" />
|
||||||
<package id="Xamarin.GooglePlayServices.Analytics" version="29.0.0.2" targetFramework="monoandroid60" />
|
<package id="Xamarin.GooglePlayServices.Analytics" version="29.0.0.2" targetFramework="monoandroid60" />
|
||||||
<package id="Xamarin.GooglePlayServices.Base" version="29.0.0.2" targetFramework="monoandroid60" />
|
<package id="Xamarin.GooglePlayServices.Base" version="29.0.0.2" targetFramework="monoandroid60" />
|
||||||
|
|
|
@ -484,13 +484,13 @@
|
||||||
<HintPath>..\..\packages\Acr.UserDialogs.6.3.10\lib\portable-win+net45+wp8+win8+wpa81\Acr.UserDialogs.Interface.dll</HintPath>
|
<HintPath>..\..\packages\Acr.UserDialogs.6.3.10\lib\portable-win+net45+wp8+win8+wpa81\Acr.UserDialogs.Interface.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="FFImageLoading, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="FFImageLoading, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xamarin.FFImageLoading.2.2.9\lib\portable-net45+win8+wpa81+wp8\FFImageLoading.dll</HintPath>
|
<HintPath>..\..\packages\Xamarin.FFImageLoading.2.2.20\lib\portable-net45+win8+wpa81+wp8\FFImageLoading.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="FFImageLoading.Forms, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="FFImageLoading.Forms, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xamarin.FFImageLoading.Forms.2.2.9\lib\portable-net45+win8+wpa81+wp8\FFImageLoading.Forms.dll</HintPath>
|
<HintPath>..\..\packages\Xamarin.FFImageLoading.Forms.2.2.20\lib\portable-net45+win8+wpa81+wp8+netstandard1.0\FFImageLoading.Forms.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="FFImageLoading.Platform, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="FFImageLoading.Platform, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xamarin.FFImageLoading.2.2.9\lib\portable-net45+win8+wpa81+wp8\FFImageLoading.Platform.dll</HintPath>
|
<HintPath>..\..\packages\Xamarin.FFImageLoading.2.2.20\lib\portable-net45+win8+wpa81+wp8\FFImageLoading.Platform.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="HockeySDK, Version=1.0.6387.33440, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="HockeySDK, Version=1.0.6387.33440, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\HockeySDK.Xamarin.4.1.5\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\HockeySDK.dll</HintPath>
|
<HintPath>..\..\packages\HockeySDK.Xamarin.4.1.5\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\HockeySDK.dll</HintPath>
|
||||||
|
|
|
@ -7,21 +7,19 @@ namespace Bit.App.Controls
|
||||||
{
|
{
|
||||||
public class VaultListViewCell : LabeledDetailCell
|
public class VaultListViewCell : LabeledDetailCell
|
||||||
{
|
{
|
||||||
public static readonly BindableProperty LoginParameterProperty = BindableProperty.Create(nameof(LoginParameter),
|
public static readonly BindableProperty CipherParameterProperty = BindableProperty.Create(nameof(CipherParameter),
|
||||||
typeof(VaultListPageModel.Cipher), typeof(VaultListViewCell), null);
|
typeof(VaultListPageModel.Cipher), typeof(VaultListViewCell), null);
|
||||||
|
|
||||||
public VaultListViewCell(Action<VaultListPageModel.Cipher> moreClickedAction)
|
public VaultListViewCell(Action<VaultListPageModel.Cipher> moreClickedAction)
|
||||||
{
|
{
|
||||||
SetBinding(LoginParameterProperty, new Binding("."));
|
SetBinding(CipherParameterProperty, new Binding("."));
|
||||||
Icon.SetBinding(CachedImage.SourceProperty, nameof(VaultListPageModel.Cipher.Icon));
|
|
||||||
Icon.SetBinding(CachedImage.LoadingPlaceholderProperty, nameof(VaultListPageModel.Cipher.Icon));
|
|
||||||
Label.SetBinding(Label.TextProperty, nameof(VaultListPageModel.Cipher.Name));
|
Label.SetBinding(Label.TextProperty, nameof(VaultListPageModel.Cipher.Name));
|
||||||
Detail.SetBinding(Label.TextProperty, nameof(VaultListPageModel.Cipher.Subtitle));
|
Detail.SetBinding(Label.TextProperty, nameof(VaultListPageModel.Cipher.Subtitle));
|
||||||
LabelIcon.SetBinding(VisualElement.IsVisibleProperty, nameof(VaultListPageModel.Cipher.Shared));
|
LabelIcon.SetBinding(VisualElement.IsVisibleProperty, nameof(VaultListPageModel.Cipher.Shared));
|
||||||
LabelIcon2.SetBinding(VisualElement.IsVisibleProperty, nameof(VaultListPageModel.Cipher.HasAttachments));
|
LabelIcon2.SetBinding(VisualElement.IsVisibleProperty, nameof(VaultListPageModel.Cipher.HasAttachments));
|
||||||
|
|
||||||
Button.Image = "more.png";
|
Button.Image = "more.png";
|
||||||
Button.Command = new Command(() => moreClickedAction?.Invoke(LoginParameter));
|
Button.Command = new Command(() => moreClickedAction?.Invoke(CipherParameter));
|
||||||
Button.BackgroundColor = Color.Transparent;
|
Button.BackgroundColor = Color.Transparent;
|
||||||
|
|
||||||
LabelIcon.Source = "share.png";
|
LabelIcon.Source = "share.png";
|
||||||
|
@ -30,10 +28,25 @@ namespace Bit.App.Controls
|
||||||
BackgroundColor = Color.White;
|
BackgroundColor = Color.White;
|
||||||
}
|
}
|
||||||
|
|
||||||
public VaultListPageModel.Cipher LoginParameter
|
public VaultListPageModel.Cipher CipherParameter
|
||||||
{
|
{
|
||||||
get { return GetValue(LoginParameterProperty) as VaultListPageModel.Cipher; }
|
get { return GetValue(CipherParameterProperty) as VaultListPageModel.Cipher; }
|
||||||
set { SetValue(LoginParameterProperty, value); }
|
set { SetValue(CipherParameterProperty, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnBindingContextChanged()
|
||||||
|
{
|
||||||
|
Icon.Source = null;
|
||||||
|
if(BindingContext is VaultListPageModel.Cipher item)
|
||||||
|
{
|
||||||
|
Icon.Source = item.Icon;
|
||||||
|
if(item.Type == Enums.CipherType.Login)
|
||||||
|
{
|
||||||
|
Icon.LoadingPlaceholder = "login.png";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
base.OnBindingContextChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,8 +17,8 @@
|
||||||
<package id="Validation" version="2.3.7" targetFramework="portable45-net45+win8+wpa81" />
|
<package id="Validation" version="2.3.7" targetFramework="portable45-net45+win8+wpa81" />
|
||||||
<package id="Xam.Plugin.Connectivity" version="3.0.2" targetFramework="portable45-net45+win8+wpa81" />
|
<package id="Xam.Plugin.Connectivity" version="3.0.2" targetFramework="portable45-net45+win8+wpa81" />
|
||||||
<package id="Xam.Plugins.Settings" version="3.0.1" targetFramework="portable45-net45+win8+wpa81" />
|
<package id="Xam.Plugins.Settings" version="3.0.1" targetFramework="portable45-net45+win8+wpa81" />
|
||||||
<package id="Xamarin.FFImageLoading" version="2.2.9" targetFramework="portable45-net45+win8+wpa81" />
|
<package id="Xamarin.FFImageLoading" version="2.2.20" targetFramework="portable45-net45+win8+wpa81" />
|
||||||
<package id="Xamarin.FFImageLoading.Forms" version="2.2.9" targetFramework="portable45-net45+win8+wpa81" />
|
<package id="Xamarin.FFImageLoading.Forms" version="2.2.20" targetFramework="portable45-net45+win8+wpa81" />
|
||||||
<package id="Xamarin.Forms" version="2.3.4.267" targetFramework="portable45-net45+win8+wpa81" />
|
<package id="Xamarin.Forms" version="2.3.4.267" targetFramework="portable45-net45+win8+wpa81" />
|
||||||
<package id="XLabs.IoC" version="2.0.5782" targetFramework="portable45-net45+win8+wpa81" />
|
<package id="XLabs.IoC" version="2.0.5782" targetFramework="portable45-net45+win8+wpa81" />
|
||||||
<package id="ZXing.Net.Mobile" version="2.1.47" targetFramework="portable45-net45+win8+wpa81" />
|
<package id="ZXing.Net.Mobile" version="2.1.47" targetFramework="portable45-net45+win8+wpa81" />
|
||||||
|
|
|
@ -175,7 +175,7 @@
|
||||||
<Version>3.0.1</Version>
|
<Version>3.0.1</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Xamarin.FFImageLoading.Forms">
|
<PackageReference Include="Xamarin.FFImageLoading.Forms">
|
||||||
<Version>2.2.9</Version>
|
<Version>2.2.20</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Xamarin.Forms">
|
<PackageReference Include="Xamarin.Forms">
|
||||||
<Version>2.3.4.267</Version>
|
<Version>2.3.4.267</Version>
|
||||||
|
|
|
@ -267,16 +267,16 @@
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="FFImageLoading, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="FFImageLoading, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xamarin.FFImageLoading.2.2.9\lib\Xamarin.iOS10\FFImageLoading.dll</HintPath>
|
<HintPath>..\..\packages\Xamarin.FFImageLoading.2.2.20\lib\Xamarin.iOS10\FFImageLoading.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="FFImageLoading.Forms, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="FFImageLoading.Forms, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xamarin.FFImageLoading.Forms.2.2.9\lib\Xamarin.iOS10\FFImageLoading.Forms.dll</HintPath>
|
<HintPath>..\..\packages\Xamarin.FFImageLoading.Forms.2.2.20\lib\Xamarin.iOS10\FFImageLoading.Forms.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="FFImageLoading.Forms.Touch, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="FFImageLoading.Forms.Touch, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xamarin.FFImageLoading.Forms.2.2.9\lib\Xamarin.iOS10\FFImageLoading.Forms.Touch.dll</HintPath>
|
<HintPath>..\..\packages\Xamarin.FFImageLoading.Forms.2.2.20\lib\Xamarin.iOS10\FFImageLoading.Forms.Touch.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="FFImageLoading.Platform, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="FFImageLoading.Platform, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xamarin.FFImageLoading.2.2.9\lib\Xamarin.iOS10\FFImageLoading.Platform.dll</HintPath>
|
<HintPath>..\..\packages\Xamarin.FFImageLoading.2.2.20\lib\Xamarin.iOS10\FFImageLoading.Platform.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Google.Analytics, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Google.Analytics, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xamarin.Google.iOS.Analytics.3.17.0.1\lib\Xamarin.iOS10\Google.Analytics.dll</HintPath>
|
<HintPath>..\..\packages\Xamarin.Google.iOS.Analytics.3.17.0.1\lib\Xamarin.iOS10\Google.Analytics.dll</HintPath>
|
||||||
|
@ -351,8 +351,8 @@
|
||||||
<HintPath>..\..\packages\Validation.2.3.7\lib\dotnet\Validation.dll</HintPath>
|
<HintPath>..\..\packages\Validation.2.3.7\lib\dotnet\Validation.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="WebP.Touch, Version=1.0.6230.37678, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="WebP.Touch, Version=1.0.6443.32796, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\WebP.Touch.1.0.3\lib\Xamarin.iOS10\WebP.Touch.dll</HintPath>
|
<HintPath>..\..\packages\WebP.Touch.1.0.4\lib\Xamarin.iOS10\WebP.Touch.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Xamarin.Forms.2.3.4.267\lib\Xamarin.iOS10\Xamarin.Forms.Core.dll</HintPath>
|
<HintPath>..\..\packages\Xamarin.Forms.2.3.4.267\lib\Xamarin.iOS10\Xamarin.Forms.Core.dll</HintPath>
|
||||||
|
|
|
@ -65,12 +65,12 @@
|
||||||
<package id="System.Xml.ReaderWriter" version="4.0.11" targetFramework="xamarinios10" />
|
<package id="System.Xml.ReaderWriter" version="4.0.11" targetFramework="xamarinios10" />
|
||||||
<package id="System.Xml.XDocument" version="4.0.11" targetFramework="xamarinios10" />
|
<package id="System.Xml.XDocument" version="4.0.11" targetFramework="xamarinios10" />
|
||||||
<package id="Validation" version="2.3.7" targetFramework="xamarinios10" />
|
<package id="Validation" version="2.3.7" targetFramework="xamarinios10" />
|
||||||
<package id="WebP.Touch" version="1.0.3" targetFramework="xamarinios10" />
|
<package id="WebP.Touch" version="1.0.4" targetFramework="xamarinios10" />
|
||||||
<package id="Xam.Plugin.Connectivity" version="3.0.2" targetFramework="xamarinios10" />
|
<package id="Xam.Plugin.Connectivity" version="3.0.2" targetFramework="xamarinios10" />
|
||||||
<package id="Xam.Plugins.Settings" version="3.0.1" targetFramework="xamarinios10" />
|
<package id="Xam.Plugins.Settings" version="3.0.1" targetFramework="xamarinios10" />
|
||||||
<package id="Xamarin.Build.Download" version="0.4.7" targetFramework="xamarinios10" />
|
<package id="Xamarin.Build.Download" version="0.4.7" targetFramework="xamarinios10" />
|
||||||
<package id="Xamarin.FFImageLoading" version="2.2.9" targetFramework="xamarinios10" />
|
<package id="Xamarin.FFImageLoading" version="2.2.20" targetFramework="xamarinios10" />
|
||||||
<package id="Xamarin.FFImageLoading.Forms" version="2.2.9" targetFramework="xamarinios10" />
|
<package id="Xamarin.FFImageLoading.Forms" version="2.2.20" targetFramework="xamarinios10" />
|
||||||
<package id="Xamarin.Forms" version="2.3.4.267" targetFramework="xamarinios10" />
|
<package id="Xamarin.Forms" version="2.3.4.267" targetFramework="xamarinios10" />
|
||||||
<package id="Xamarin.Google.iOS.Analytics" version="3.17.0.1" targetFramework="xamarinios10" />
|
<package id="Xamarin.Google.iOS.Analytics" version="3.17.0.1" targetFramework="xamarinios10" />
|
||||||
<package id="XLabs.IoC" version="2.0.5782" targetFramework="xamarinios10" />
|
<package id="XLabs.IoC" version="2.0.5782" targetFramework="xamarinios10" />
|
||||||
|
|
Loading…
Reference in a new issue