mirror of
https://github.com/bitwarden/mobile
synced 2025-12-10 21:33:36 +00:00
fab on view page
This commit is contained in:
@@ -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:fab="clr-namespace:Refractored.FabControl;assembly=Refractored.FabControl"
|
||||
xmlns:views="clr-namespace:Bit.Core.Models.View;assembly=BitwardenCore"
|
||||
x:DataType="pages:ViewPageViewModel"
|
||||
x:Name="_page"
|
||||
@@ -23,11 +24,9 @@
|
||||
<u:InverseBoolConverter x:Key="inverseBool" />
|
||||
<u:StringHasValueConverter x:Key="stringHasValue" />
|
||||
<u:IsNotNullConverter x:Key="notNull" />
|
||||
</ResourceDictionary>
|
||||
</ContentPage.Resources>
|
||||
|
||||
<ScrollView x:Name="_scrollView">
|
||||
<StackLayout Spacing="20">
|
||||
<ScrollView x:Key="scrollView" x:Name="_scrollView">
|
||||
<StackLayout Spacing="20" x:Name="_mainLayout">
|
||||
<StackLayout StyleClass="box">
|
||||
<StackLayout StyleClass="box-row-header">
|
||||
<Label Text="{u:I18n ItemInformation}"
|
||||
@@ -599,4 +598,24 @@
|
||||
</StackLayout>
|
||||
</ScrollView>
|
||||
|
||||
</ResourceDictionary>
|
||||
</ContentPage.Resources>
|
||||
|
||||
<AbsoluteLayout
|
||||
x:Name="_absLayout"
|
||||
VerticalOptions="FillAndExpand"
|
||||
HorizontalOptions="FillAndExpand">
|
||||
<ContentView
|
||||
x:Name="_mainContent"
|
||||
AbsoluteLayout.LayoutFlags="All"
|
||||
AbsoluteLayout.LayoutBounds="0, 0, 1, 1">
|
||||
</ContentView>
|
||||
<fab:FloatingActionButtonView
|
||||
x:Name="_fab"
|
||||
ImageName="pencil.png"
|
||||
AbsoluteLayout.LayoutFlags="PositionProportional"
|
||||
AbsoluteLayout.LayoutBounds="1, 1, AutoSize, AutoSize">
|
||||
</fab:FloatingActionButtonView>
|
||||
</AbsoluteLayout>
|
||||
|
||||
</pages:BaseContentPage>
|
||||
|
||||
@@ -17,7 +17,18 @@ namespace Bit.App.Pages
|
||||
_vm = BindingContext as ViewPageViewModel;
|
||||
_vm.Page = this;
|
||||
_vm.CipherId = cipherId;
|
||||
SetActivityIndicator();
|
||||
SetActivityIndicator(_mainContent);
|
||||
|
||||
if(Device.RuntimePlatform == Device.iOS)
|
||||
{
|
||||
_absLayout.Children.Remove(_fab);
|
||||
}
|
||||
else
|
||||
{
|
||||
ToolbarItems.RemoveAt(0);
|
||||
_fab.Clicked = EditButton_Clicked;
|
||||
_mainLayout.Padding = new Thickness(0, 0, 0, 75);
|
||||
}
|
||||
}
|
||||
|
||||
protected override async void OnAppearing()
|
||||
@@ -38,7 +49,7 @@ namespace Bit.App.Pages
|
||||
}
|
||||
}
|
||||
});
|
||||
await LoadOnAppearedAsync(_scrollView, true, () => _vm.LoadAsync());
|
||||
await LoadOnAppearedAsync(_scrollView, true, () => _vm.LoadAsync(), _mainContent);
|
||||
}
|
||||
|
||||
protected override void OnDisappearing()
|
||||
@@ -63,5 +74,10 @@ namespace Bit.App.Pages
|
||||
await Navigation.PushModalAsync(new NavigationPage(new AddEditPage(_vm.CipherId)));
|
||||
}
|
||||
}
|
||||
|
||||
private void EditButton_Clicked(object sender, System.EventArgs e)
|
||||
{
|
||||
EditToolbarItem_Clicked(sender, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user