mirror of
https://github.com/bitwarden/mobile.git
synced 2024-11-07 09:20:04 +01:00
fixed size icons
This commit is contained in:
parent
3d239a3c2b
commit
cd60c3da2a
@ -110,6 +110,7 @@
|
||||
<Compile Include="Autofill\FilledItem.cs" />
|
||||
<Compile Include="Autofill\Parser.cs" />
|
||||
<Compile Include="Autofill\SavedItem.cs" />
|
||||
<Compile Include="Effects\FixedSizeEffect.cs" />
|
||||
<Compile Include="Effects\SelectableLabelEffect.cs" />
|
||||
<Compile Include="Effects\TabBarEffect.cs" />
|
||||
<Compile Include="Migration\AndroidKeyStoreStorageService.cs" />
|
||||
|
26
src/Android/Effects/FixedSizeEffect.cs
Normal file
26
src/Android/Effects/FixedSizeEffect.cs
Normal 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(FixedSizeEffect), "FixedSizeEffect")]
|
||||
namespace Bit.Droid.Effects
|
||||
{
|
||||
public class FixedSizeEffect : PlatformEffect
|
||||
{
|
||||
protected override void OnAttached()
|
||||
{
|
||||
if(Element is Label label && Control is TextView textView)
|
||||
{
|
||||
textView.SetTextSize(Android.Util.ComplexUnitType.Pt, (float)label.FontSize);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnDetached()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
@ -118,7 +118,7 @@ namespace Bit.Droid.Renderers
|
||||
MoreButton.Typeface = _miTypeface;
|
||||
|
||||
var small = (float)Device.GetNamedSize(NamedSize.Small, typeof(Label));
|
||||
Icon.SetTextSize(ComplexUnitType.Sp, 22.0952380952381F);
|
||||
Icon.SetTextSize(ComplexUnitType.Pt, 10);
|
||||
Name.SetTextSize(ComplexUnitType.Sp, (float)Device.GetNamedSize(NamedSize.Medium, typeof(Label)));
|
||||
SubTitle.SetTextSize(ComplexUnitType.Sp, small);
|
||||
SharedIcon.SetTextSize(ComplexUnitType.Sp, small);
|
||||
|
@ -32,7 +32,7 @@
|
||||
Grid.RowSpan="2"
|
||||
HorizontalOptions="Center"
|
||||
VerticalOptions="Center"
|
||||
StyleClass="list-icon" />
|
||||
StyleClass="list-icon, list-icon-platform" />
|
||||
<ff:CachedImage x:Name="_image"
|
||||
Grid.Column="0"
|
||||
Grid.Row="0"
|
||||
|
11
src/App/Effects/FixedSizeEffect.cs
Normal file
11
src/App/Effects/FixedSizeEffect.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Bit.App.Effects
|
||||
{
|
||||
public class FixedSizeEffect : RoutingEffect
|
||||
{
|
||||
public FixedSizeEffect()
|
||||
: base("Bitwarden.FixedSizeEffect")
|
||||
{ }
|
||||
}
|
||||
}
|
@ -4,6 +4,7 @@
|
||||
x:Class="Bit.App.Pages.GroupingsPage"
|
||||
xmlns:pages="clr-namespace:Bit.App.Pages"
|
||||
xmlns:u="clr-namespace:Bit.App.Utilities"
|
||||
xmlns:effects="clr-namespace:Bit.App.Effects"
|
||||
xmlns:controls="clr-namespace:Bit.App.Controls"
|
||||
xmlns:fab="clr-namespace:Refractored.FabControl;assembly=Refractored.FabControl"
|
||||
x:DataType="pages:GroupingsPageViewModel"
|
||||
@ -45,7 +46,11 @@
|
||||
<controls:FaLabel Text="{Binding Icon, Mode=OneWay}"
|
||||
HorizontalOptions="Start"
|
||||
VerticalOptions="Center"
|
||||
StyleClass="list-icon" />
|
||||
StyleClass="list-icon, list-icon-platform">
|
||||
<controls:FaLabel.Effects>
|
||||
<effects:FixedSizeEffect />
|
||||
</controls:FaLabel.Effects>
|
||||
</controls:FaLabel>
|
||||
<Label Text="{Binding Name, Mode=OneWay}"
|
||||
LineBreakMode="TailTruncation"
|
||||
HorizontalOptions="StartAndExpand"
|
||||
|
@ -67,6 +67,12 @@
|
||||
<Style TargetType="Grid"
|
||||
Class="list-row-platform">
|
||||
</Style>
|
||||
<Style TargetType="Label"
|
||||
Class="list-icon-platform"
|
||||
ApplyToDerivedTypes="True">
|
||||
<Setter Property="FontSize"
|
||||
Value="10" />
|
||||
</Style>
|
||||
<Style TargetType="Button"
|
||||
ApplyToDerivedTypes="True"
|
||||
Class="list-row-button-platform">
|
||||
|
@ -223,8 +223,6 @@
|
||||
Value="Center" />
|
||||
<Setter Property="VerticalTextAlignment"
|
||||
Value="Center" />
|
||||
<Setter Property="FontSize"
|
||||
Value="22.0952380952381" />
|
||||
<Setter Property="TextColor"
|
||||
Value="{StaticResource MutedColor}" />
|
||||
</Style>
|
||||
|
Loading…
Reference in New Issue
Block a user