1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-11-07 09:20:04 +01:00

selectable label effect

This commit is contained in:
Kyle Spearrin 2019-06-12 08:31:33 -04:00
parent 26d0077bb8
commit 3d239a3c2b
6 changed files with 46 additions and 5 deletions

View File

@ -110,6 +110,7 @@
<Compile Include="Autofill\FilledItem.cs" />
<Compile Include="Autofill\Parser.cs" />
<Compile Include="Autofill\SavedItem.cs" />
<Compile Include="Effects\SelectableLabelEffect.cs" />
<Compile Include="Effects\TabBarEffect.cs" />
<Compile Include="Migration\AndroidKeyStoreStorageService.cs" />
<Compile Include="Push\FirebaseInstanceIdService.cs" />

View File

@ -0,0 +1,26 @@
using Android.Support.Design.BottomNavigation;
using Android.Support.Design.Widget;
using Android.Views;
using Android.Widget;
using Bit.Droid.Effects;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
[assembly: ExportEffect(typeof(SelectableLabelEffect), "SelectableLabelEffect")]
namespace Bit.Droid.Effects
{
public class SelectableLabelEffect : PlatformEffect
{
protected override void OnAttached()
{
if(Control is TextView textView)
{
textView.SetTextIsSelectable(true);
}
}
protected override void OnDetached()
{
}
}
}

View File

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

View File

@ -1,6 +1,6 @@
using Xamarin.Forms;
namespace Bit.App.Effect
namespace Bit.App.Effects
{
public class TabBarEffect : RoutingEffect
{

View File

@ -1,8 +1,6 @@
using Bit.App.Effect;
using Bit.App.Effects;
using Bit.App.Models;
using Bit.App.Resources;
using Bit.Core.Abstractions;
using Bit.Core.Utilities;
using Xamarin.Forms;
namespace Bit.App.Pages

View File

@ -6,6 +6,7 @@
xmlns:pages="clr-namespace:Bit.App.Pages"
xmlns:u="clr-namespace:Bit.App.Utilities"
xmlns:controls="clr-namespace:Bit.App.Controls"
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"
x:DataType="pages:ViewPageViewModel"
@ -480,7 +481,11 @@
<Label
Text="{Binding Cipher.Notes, Mode=OneWay}"
StyleClass="box-value"
LineBreakMode="WordWrap" />
LineBreakMode="WordWrap">
<Label.Effects>
<effects:SelectableLabelEffect />
</Label.Effects>
</Label>
</StackLayout>
<BoxView StyleClass="box-row-separator" />
</StackLayout>