mirror of
https://github.com/bitwarden/mobile
synced 2025-12-11 05:43:30 +00:00
fixed size icons
This commit is contained in:
@@ -110,6 +110,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\FixedSizeEffect.cs" />
|
||||||
<Compile Include="Effects\SelectableLabelEffect.cs" />
|
<Compile Include="Effects\SelectableLabelEffect.cs" />
|
||||||
<Compile Include="Effects\TabBarEffect.cs" />
|
<Compile Include="Effects\TabBarEffect.cs" />
|
||||||
<Compile Include="Migration\AndroidKeyStoreStorageService.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;
|
MoreButton.Typeface = _miTypeface;
|
||||||
|
|
||||||
var small = (float)Device.GetNamedSize(NamedSize.Small, typeof(Label));
|
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)));
|
Name.SetTextSize(ComplexUnitType.Sp, (float)Device.GetNamedSize(NamedSize.Medium, typeof(Label)));
|
||||||
SubTitle.SetTextSize(ComplexUnitType.Sp, small);
|
SubTitle.SetTextSize(ComplexUnitType.Sp, small);
|
||||||
SharedIcon.SetTextSize(ComplexUnitType.Sp, small);
|
SharedIcon.SetTextSize(ComplexUnitType.Sp, small);
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
Grid.RowSpan="2"
|
Grid.RowSpan="2"
|
||||||
HorizontalOptions="Center"
|
HorizontalOptions="Center"
|
||||||
VerticalOptions="Center"
|
VerticalOptions="Center"
|
||||||
StyleClass="list-icon" />
|
StyleClass="list-icon, list-icon-platform" />
|
||||||
<ff:CachedImage x:Name="_image"
|
<ff:CachedImage x:Name="_image"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Grid.Row="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"
|
x:Class="Bit.App.Pages.GroupingsPage"
|
||||||
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: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"
|
xmlns:fab="clr-namespace:Refractored.FabControl;assembly=Refractored.FabControl"
|
||||||
x:DataType="pages:GroupingsPageViewModel"
|
x:DataType="pages:GroupingsPageViewModel"
|
||||||
@@ -21,7 +22,7 @@
|
|||||||
<ContentPage.Resources>
|
<ContentPage.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<u:InverseBoolConverter x:Key="inverseBool" />
|
<u:InverseBoolConverter x:Key="inverseBool" />
|
||||||
|
|
||||||
<ToolbarItem x:Name="_syncItem" x:Key="syncItem" Text="{u:I18n Sync}"
|
<ToolbarItem x:Name="_syncItem" x:Key="syncItem" Text="{u:I18n Sync}"
|
||||||
Clicked="Sync_Clicked" Order="Secondary" />
|
Clicked="Sync_Clicked" Order="Secondary" />
|
||||||
<ToolbarItem x:Name="_lockItem" x:Key="lockItem" Text="{u:I18n Lock}"
|
<ToolbarItem x:Name="_lockItem" x:Key="lockItem" Text="{u:I18n Lock}"
|
||||||
@@ -45,7 +46,11 @@
|
|||||||
<controls:FaLabel Text="{Binding Icon, Mode=OneWay}"
|
<controls:FaLabel Text="{Binding Icon, Mode=OneWay}"
|
||||||
HorizontalOptions="Start"
|
HorizontalOptions="Start"
|
||||||
VerticalOptions="Center"
|
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}"
|
<Label Text="{Binding Name, Mode=OneWay}"
|
||||||
LineBreakMode="TailTruncation"
|
LineBreakMode="TailTruncation"
|
||||||
HorizontalOptions="StartAndExpand"
|
HorizontalOptions="StartAndExpand"
|
||||||
@@ -59,7 +64,7 @@
|
|||||||
</StackLayout>
|
</StackLayout>
|
||||||
</ViewCell>
|
</ViewCell>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
|
||||||
<pages:GroupingsPageListItemSelector x:Key="listItemDataTemplateSelector"
|
<pages:GroupingsPageListItemSelector x:Key="listItemDataTemplateSelector"
|
||||||
CipherTemplate="{StaticResource cipherTemplate}"
|
CipherTemplate="{StaticResource cipherTemplate}"
|
||||||
GroupTemplate="{StaticResource groupTemplate}" />
|
GroupTemplate="{StaticResource groupTemplate}" />
|
||||||
@@ -95,7 +100,7 @@
|
|||||||
<x:Arguments>
|
<x:Arguments>
|
||||||
<ListViewCachingStrategy>RecycleElement</ListViewCachingStrategy>
|
<ListViewCachingStrategy>RecycleElement</ListViewCachingStrategy>
|
||||||
</x:Arguments>
|
</x:Arguments>
|
||||||
|
|
||||||
<ListView.GroupHeaderTemplate>
|
<ListView.GroupHeaderTemplate>
|
||||||
<DataTemplate x:DataType="pages:GroupingsPageListGroup">
|
<DataTemplate x:DataType="pages:GroupingsPageListGroup">
|
||||||
<ViewCell>
|
<ViewCell>
|
||||||
|
|||||||
@@ -67,6 +67,12 @@
|
|||||||
<Style TargetType="Grid"
|
<Style TargetType="Grid"
|
||||||
Class="list-row-platform">
|
Class="list-row-platform">
|
||||||
</Style>
|
</Style>
|
||||||
|
<Style TargetType="Label"
|
||||||
|
Class="list-icon-platform"
|
||||||
|
ApplyToDerivedTypes="True">
|
||||||
|
<Setter Property="FontSize"
|
||||||
|
Value="10" />
|
||||||
|
</Style>
|
||||||
<Style TargetType="Button"
|
<Style TargetType="Button"
|
||||||
ApplyToDerivedTypes="True"
|
ApplyToDerivedTypes="True"
|
||||||
Class="list-row-button-platform">
|
Class="list-row-button-platform">
|
||||||
|
|||||||
@@ -223,8 +223,6 @@
|
|||||||
Value="Center" />
|
Value="Center" />
|
||||||
<Setter Property="VerticalTextAlignment"
|
<Setter Property="VerticalTextAlignment"
|
||||||
Value="Center" />
|
Value="Center" />
|
||||||
<Setter Property="FontSize"
|
|
||||||
Value="22.0952380952381" />
|
|
||||||
<Setter Property="TextColor"
|
<Setter Property="TextColor"
|
||||||
Value="{StaticResource MutedColor}" />
|
Value="{StaticResource MutedColor}" />
|
||||||
</Style>
|
</Style>
|
||||||
|
|||||||
Reference in New Issue
Block a user