mirror of
https://github.com/bitwarden/mobile.git
synced 2024-09-06 00:28:07 +02:00
PM-3349 PM-3350 Migrated IconLabelButton Frames to Borders to fix issue with TapGestureRecognizer in Android
Also fixed some minor "styles" for normal Button and IconLabelButton (both Android and iOS)
This commit is contained in:
parent
946c465f0c
commit
c6309173ba
@ -1,29 +1,23 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<Frame xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
x:Class="Bit.App.Controls.IconLabelButton"
|
x:Class="Bit.App.Controls.IconLabelButton"
|
||||||
xmlns:controls="clr-namespace:Bit.App.Controls"
|
xmlns:controls="clr-namespace:Bit.App.Controls"
|
||||||
x:Name="_iconLabelButton"
|
x:Name="_iconLabelButton"
|
||||||
HeightRequest="45"
|
HeightRequest="45"
|
||||||
Padding="1"
|
StyleClass="btn-icon-secondary">
|
||||||
StyleClass="btn-icon-secondary"
|
<Border StrokeThickness="2" BackgroundColor="{Binding IconLabelBackgroundColor, Source={x:Reference _iconLabelButton}}" Stroke="{Binding IconLabelBorderColor, Source={x:Reference _iconLabelButton}}">
|
||||||
BackgroundColor="{Binding IconLabelBorderColor, Source={x:Reference _iconLabelButton}}"
|
<Border.StrokeShape>
|
||||||
BorderColor="Transparent"
|
<RoundRectangle CornerRadius="{Binding CornerRadius, Source={x:Reference _iconLabelButton}}" />
|
||||||
HasShadow="False">
|
</Border.StrokeShape>
|
||||||
<Frame.GestureRecognizers>
|
<Grid>
|
||||||
<TapGestureRecognizer Command="{Binding ButtonCommand, Source={x:Reference _iconLabelButton}}" />
|
|
||||||
</Frame.GestureRecognizers>
|
|
||||||
<Frame
|
|
||||||
Margin="0"
|
|
||||||
Padding="0"
|
|
||||||
CornerRadius="{Binding CornerRadius, Source={x:Reference _iconLabelButton}}"
|
|
||||||
BackgroundColor="{Binding IconLabelBackgroundColor, Source={x:Reference _iconLabelButton}}"
|
|
||||||
BorderColor="Transparent"
|
|
||||||
IsClippedToBounds="True"
|
|
||||||
HasShadow="False">
|
|
||||||
<StackLayout
|
<StackLayout
|
||||||
|
Spacing="6"
|
||||||
Orientation="Horizontal"
|
Orientation="Horizontal"
|
||||||
HorizontalOptions="Center">
|
HorizontalOptions="Center">
|
||||||
|
<StackLayout.GestureRecognizers>
|
||||||
|
<TapGestureRecognizer Command="{Binding ButtonCommand, Source={x:Reference _iconLabelButton}}" />
|
||||||
|
</StackLayout.GestureRecognizers>
|
||||||
<controls:IconLabel
|
<controls:IconLabel
|
||||||
VerticalOptions="Center"
|
VerticalOptions="Center"
|
||||||
HorizontalTextAlignment="Center"
|
HorizontalTextAlignment="Center"
|
||||||
@ -38,5 +32,6 @@
|
|||||||
FontSize="Medium"
|
FontSize="Medium"
|
||||||
Text="{Binding Label, Source={x:Reference _iconLabelButton}}" />
|
Text="{Binding Label, Source={x:Reference _iconLabelButton}}" />
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
</Frame>
|
</Grid>
|
||||||
</Frame>
|
</Border>
|
||||||
|
</ContentView>
|
||||||
|
@ -1,18 +1,8 @@
|
|||||||
using System;
|
using System.Windows.Input;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using Bit.Core.Models.Domain;
|
|
||||||
using Microsoft.Maui.Controls.Xaml;
|
|
||||||
using Microsoft.Maui.Graphics;
|
|
||||||
using Microsoft.Maui.Controls;
|
|
||||||
using Microsoft.Maui;
|
|
||||||
|
|
||||||
namespace Bit.App.Controls
|
namespace Bit.App.Controls
|
||||||
{
|
{
|
||||||
public partial class IconLabelButton : Frame
|
public partial class IconLabelButton : ContentView
|
||||||
{
|
{
|
||||||
public static readonly BindableProperty IconProperty = BindableProperty.Create(
|
public static readonly BindableProperty IconProperty = BindableProperty.Create(
|
||||||
nameof(Icon), typeof(string), typeof(IconLabelButton));
|
nameof(Icon), typeof(string), typeof(IconLabelButton));
|
||||||
@ -32,6 +22,9 @@ namespace Bit.App.Controls
|
|||||||
public static readonly BindableProperty IconLabelBorderColorProperty = BindableProperty.Create(
|
public static readonly BindableProperty IconLabelBorderColorProperty = BindableProperty.Create(
|
||||||
nameof(IconLabelBorderColor), typeof(Color), typeof(IconLabelButton), Colors.White);
|
nameof(IconLabelBorderColor), typeof(Color), typeof(IconLabelButton), Colors.White);
|
||||||
|
|
||||||
|
public static readonly BindableProperty CornerRadiusProperty = BindableProperty.Create(
|
||||||
|
nameof(CornerRadius), typeof(CornerRadius), typeof(IconLabelButton));
|
||||||
|
|
||||||
public IconLabelButton()
|
public IconLabelButton()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
@ -72,6 +65,12 @@ namespace Bit.App.Controls
|
|||||||
get { return (Color)GetValue(IconLabelBorderColorProperty); }
|
get { return (Color)GetValue(IconLabelBorderColorProperty); }
|
||||||
set { SetValue(IconLabelBorderColorProperty, value); }
|
set { SetValue(IconLabelBorderColorProperty, value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CornerRadius CornerRadius
|
||||||
|
{
|
||||||
|
get { return (CornerRadius)GetValue(CornerRadiusProperty); }
|
||||||
|
set { SetValue(CornerRadiusProperty, value); }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@
|
|||||||
</Label>
|
</Label>
|
||||||
</Grid>
|
</Grid>
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
<StackLayout Padding="10, 10">
|
<StackLayout Padding="10, 10" Spacing="6">
|
||||||
<Button x:Name="_loginWithMasterPassword"
|
<Button x:Name="_loginWithMasterPassword"
|
||||||
Text="{u:I18n LogInWithMasterPassword}"
|
Text="{u:I18n LogInWithMasterPassword}"
|
||||||
StyleClass="btn-primary"
|
StyleClass="btn-primary"
|
||||||
|
@ -175,6 +175,10 @@
|
|||||||
Value="Bold" />
|
Value="Bold" />
|
||||||
<Setter Property="Margin"
|
<Setter Property="Margin"
|
||||||
Value="0, 5, 0, 0" />
|
Value="0, 5, 0, 0" />
|
||||||
|
<Setter Property="CornerRadius"
|
||||||
|
Value="5" />
|
||||||
|
<Setter Property="MinimumHeightRequest"
|
||||||
|
Value="45" />
|
||||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||||
<VisualStateGroupList>
|
<VisualStateGroupList>
|
||||||
<VisualStateGroup x:Name="CommonStates">
|
<VisualStateGroup x:Name="CommonStates">
|
||||||
|
Loading…
Reference in New Issue
Block a user