mirror of
https://github.com/bitwarden/android.git
synced 2024-12-25 02:18:27 +03:00
adjust bottom paddings on listviews/tableviews
This commit is contained in:
parent
fbe1a6d4c5
commit
f0662bb878
23 changed files with 175 additions and 47 deletions
|
@ -86,6 +86,7 @@
|
||||||
<Compile Include="AutofillActivity.cs" />
|
<Compile Include="AutofillActivity.cs" />
|
||||||
<Compile Include="AutofillCredentials.cs" />
|
<Compile Include="AutofillCredentials.cs" />
|
||||||
<Compile Include="Controls\CustomSliderRenderer.cs" />
|
<Compile Include="Controls\CustomSliderRenderer.cs" />
|
||||||
|
<Compile Include="Controls\ExtendedListViewRenderer.cs" />
|
||||||
<Compile Include="FirebaseInstanceIdService.cs" />
|
<Compile Include="FirebaseInstanceIdService.cs" />
|
||||||
<Compile Include="FirebaseMessagingService.cs" />
|
<Compile Include="FirebaseMessagingService.cs" />
|
||||||
<Compile Include="Autofill\Field.cs" />
|
<Compile Include="Autofill\Field.cs" />
|
||||||
|
|
33
src/Android/Controls/ExtendedListViewRenderer.cs
Normal file
33
src/Android/Controls/ExtendedListViewRenderer.cs
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
using System;
|
||||||
|
using Bit.Android.Controls;
|
||||||
|
using Bit.App.Controls;
|
||||||
|
using Xamarin.Forms;
|
||||||
|
using Xamarin.Forms.Platform.Android;
|
||||||
|
using Android.Content;
|
||||||
|
using Android.Views;
|
||||||
|
|
||||||
|
[assembly: ExportRenderer(typeof(ExtendedListView), typeof(ExtendedListViewRenderer))]
|
||||||
|
namespace Bit.Android.Controls
|
||||||
|
{
|
||||||
|
public class ExtendedListViewRenderer : ListViewRenderer
|
||||||
|
{
|
||||||
|
public ExtendedListViewRenderer(Context context)
|
||||||
|
: base(context)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
protected override void OnElementChanged(ElementChangedEventArgs<ListView> e)
|
||||||
|
{
|
||||||
|
base.OnElementChanged(e);
|
||||||
|
|
||||||
|
if(e.NewElement is ExtendedListView listView)
|
||||||
|
{
|
||||||
|
if(listView.BottomPadding > 0)
|
||||||
|
{
|
||||||
|
Control.SetPadding(0, 0, 0, listView.BottomPadding);
|
||||||
|
Control.SetClipToPadding(false);
|
||||||
|
Control.ScrollBarStyle = ScrollbarStyles.OutsideOverlay;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -23,6 +23,16 @@ namespace Bit.Android.Controls
|
||||||
base.OnElementChanged(e);
|
base.OnElementChanged(e);
|
||||||
Control.Divider = null;
|
Control.Divider = null;
|
||||||
Control.DividerHeight = 0;
|
Control.DividerHeight = 0;
|
||||||
|
|
||||||
|
if(e.NewElement is ExtendedTableView tableView)
|
||||||
|
{
|
||||||
|
if(tableView.BottomPadding > 0)
|
||||||
|
{
|
||||||
|
Control.SetPadding(0, 0, 0, tableView.BottomPadding);
|
||||||
|
Control.SetClipToPadding(false);
|
||||||
|
Control.ScrollBarStyle = ScrollbarStyles.OutsideOverlay;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override TableViewModelRenderer GetModelRenderer(AListView listView, TableView view)
|
protected override TableViewModelRenderer GetModelRenderer(AListView listView, TableView view)
|
||||||
|
|
33
src/Android/Resources/Resource.Designer.cs
generated
33
src/Android/Resources/Resource.Designer.cs
generated
|
@ -6475,17 +6475,17 @@ namespace Bit.Android
|
||||||
// aapt resource value: 0x7f090051
|
// aapt resource value: 0x7f090051
|
||||||
public const int ApplicationName = 2131296337;
|
public const int ApplicationName = 2131296337;
|
||||||
|
|
||||||
// aapt resource value: 0x7f0900ab
|
// aapt resource value: 0x7f0900b2
|
||||||
public const int AutoFillServiceDescription = 2131296427;
|
public const int AutoFillServiceDescription = 2131296434;
|
||||||
|
|
||||||
// aapt resource value: 0x7f0900aa
|
// aapt resource value: 0x7f0900b1
|
||||||
public const int AutoFillServiceSummary = 2131296426;
|
public const int AutoFillServiceSummary = 2131296433;
|
||||||
|
|
||||||
// aapt resource value: 0x7f090050
|
// aapt resource value: 0x7f090050
|
||||||
public const int Hello = 2131296336;
|
public const int Hello = 2131296336;
|
||||||
|
|
||||||
// aapt resource value: 0x7f0900ac
|
// aapt resource value: 0x7f0900b3
|
||||||
public const int MyVault = 2131296428;
|
public const int MyVault = 2131296435;
|
||||||
|
|
||||||
// aapt resource value: 0x7f090027
|
// aapt resource value: 0x7f090027
|
||||||
public const int abc_action_bar_home_description = 2131296295;
|
public const int abc_action_bar_home_description = 2131296295;
|
||||||
|
@ -6640,6 +6640,27 @@ namespace Bit.Android
|
||||||
// aapt resource value: 0x7f09000f
|
// aapt resource value: 0x7f09000f
|
||||||
public const int common_signin_button_text_long = 2131296271;
|
public const int common_signin_button_text_long = 2131296271;
|
||||||
|
|
||||||
|
// aapt resource value: 0x7f0900ac
|
||||||
|
public const int default_web_client_id = 2131296428;
|
||||||
|
|
||||||
|
// aapt resource value: 0x7f0900ad
|
||||||
|
public const int firebase_database_url = 2131296429;
|
||||||
|
|
||||||
|
// aapt resource value: 0x7f0900aa
|
||||||
|
public const int gcm_defaultSenderId = 2131296426;
|
||||||
|
|
||||||
|
// aapt resource value: 0x7f0900ae
|
||||||
|
public const int google_api_key = 2131296430;
|
||||||
|
|
||||||
|
// aapt resource value: 0x7f0900ab
|
||||||
|
public const int google_app_id = 2131296427;
|
||||||
|
|
||||||
|
// aapt resource value: 0x7f0900af
|
||||||
|
public const int google_crash_reporting_api_key = 2131296431;
|
||||||
|
|
||||||
|
// aapt resource value: 0x7f0900b0
|
||||||
|
public const int google_storage_bucket = 2131296432;
|
||||||
|
|
||||||
// aapt resource value: 0x7f090052
|
// aapt resource value: 0x7f090052
|
||||||
public const int hockeyapp_crash_dialog_app_name_fallback = 2131296338;
|
public const int hockeyapp_crash_dialog_app_name_fallback = 2131296338;
|
||||||
|
|
||||||
|
|
16
src/App/Controls/ExtendedListView.cs
Normal file
16
src/App/Controls/ExtendedListView.cs
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
using Xamarin.Forms;
|
||||||
|
|
||||||
|
namespace Bit.App.Controls
|
||||||
|
{
|
||||||
|
public class ExtendedListView : ListView
|
||||||
|
{
|
||||||
|
public static readonly BindableProperty BottomPaddingProperty =
|
||||||
|
BindableProperty.Create(nameof(BottomPadding), typeof(int), typeof(ExtendedTableView), 0);
|
||||||
|
|
||||||
|
public ExtendedListView() { }
|
||||||
|
public ExtendedListView(ListViewCachingStrategy cachingStrategy)
|
||||||
|
: base(cachingStrategy) { }
|
||||||
|
|
||||||
|
public int BottomPadding { get; set; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,8 +1,4 @@
|
||||||
using System;
|
using Xamarin.Forms;
|
||||||
using Xamarin.Forms;
|
|
||||||
using System.Reflection;
|
|
||||||
using System.Reflection.Emit;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using XLabs.Ioc;
|
using XLabs.Ioc;
|
||||||
using Bit.App.Abstractions;
|
using Bit.App.Abstractions;
|
||||||
|
|
||||||
|
@ -19,6 +15,9 @@ namespace Bit.App.Controls
|
||||||
public static readonly BindableProperty SeparatorColorProperty =
|
public static readonly BindableProperty SeparatorColorProperty =
|
||||||
BindableProperty.Create(nameof(SeparatorColor), typeof(Color), typeof(ExtendedTableView), Color.FromHex("d2d6de"));
|
BindableProperty.Create(nameof(SeparatorColor), typeof(Color), typeof(ExtendedTableView), Color.FromHex("d2d6de"));
|
||||||
|
|
||||||
|
public static readonly BindableProperty BottomPaddingProperty =
|
||||||
|
BindableProperty.Create(nameof(BottomPadding), typeof(int), typeof(ExtendedTableView), 0);
|
||||||
|
|
||||||
public bool EnableScrolling
|
public bool EnableScrolling
|
||||||
{
|
{
|
||||||
get { return (bool)GetValue(EnableScrollingProperty); }
|
get { return (bool)GetValue(EnableScrollingProperty); }
|
||||||
|
@ -40,6 +39,7 @@ namespace Bit.App.Controls
|
||||||
public int EstimatedRowHeight { get; set; }
|
public int EstimatedRowHeight { get; set; }
|
||||||
public bool NoHeader { get; set; }
|
public bool NoHeader { get; set; }
|
||||||
public bool NoFooter { get; set; }
|
public bool NoFooter { get; set; }
|
||||||
|
public int BottomPadding { get; set; }
|
||||||
|
|
||||||
protected override SizeRequest OnSizeRequest(double widthConstraint, double heightConstraint)
|
protected override SizeRequest OnSizeRequest(double widthConstraint, double heightConstraint)
|
||||||
{
|
{
|
||||||
|
|
|
@ -123,6 +123,10 @@ namespace Bit.App.Pages
|
||||||
MessagingCenter.Send(Application.Current, "ShowStatusBar", false);
|
MessagingCenter.Send(Application.Current, "ShowStatusBar", false);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
else if(Device.RuntimePlatform == Device.Android)
|
||||||
|
{
|
||||||
|
table2.BottomPadding = 50;
|
||||||
|
}
|
||||||
|
|
||||||
ToolbarItems.Add(toolbarItem);
|
ToolbarItems.Add(toolbarItem);
|
||||||
Title = AppResources.Settings;
|
Title = AppResources.Settings;
|
||||||
|
|
|
@ -54,6 +54,10 @@ namespace Bit.App.Pages
|
||||||
table.RowHeight = -1;
|
table.RowHeight = -1;
|
||||||
table.EstimatedRowHeight = 70;
|
table.EstimatedRowHeight = 70;
|
||||||
}
|
}
|
||||||
|
else if(Device.RuntimePlatform == Device.Android)
|
||||||
|
{
|
||||||
|
table.BottomPadding = 50;
|
||||||
|
}
|
||||||
|
|
||||||
var saveToolBarItem = new ToolbarItem(AppResources.Save, Helpers.ToolbarImage("envelope.png"), async () =>
|
var saveToolBarItem = new ToolbarItem(AppResources.Save, Helpers.ToolbarImage("envelope.png"), async () =>
|
||||||
{
|
{
|
||||||
|
|
|
@ -71,6 +71,10 @@ namespace Bit.App.Pages
|
||||||
mainTable.RowHeight = -1;
|
mainTable.RowHeight = -1;
|
||||||
mainTable.EstimatedRowHeight = 70;
|
mainTable.EstimatedRowHeight = 70;
|
||||||
}
|
}
|
||||||
|
else if(Device.RuntimePlatform == Device.Android)
|
||||||
|
{
|
||||||
|
mainTable.BottomPadding = 50;
|
||||||
|
}
|
||||||
|
|
||||||
var saveToolBarItem = new ToolbarItem(AppResources.Save, Helpers.ToolbarImage("envelope.png"), async () =>
|
var saveToolBarItem = new ToolbarItem(AppResources.Save, Helpers.ToolbarImage("envelope.png"), async () =>
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,13 +23,13 @@ namespace Bit.App.Pages
|
||||||
|
|
||||||
public ExtendedObservableCollection<SettingsFolderPageModel> Folders { get; private set; }
|
public ExtendedObservableCollection<SettingsFolderPageModel> Folders { get; private set; }
|
||||||
= new ExtendedObservableCollection<SettingsFolderPageModel>();
|
= new ExtendedObservableCollection<SettingsFolderPageModel>();
|
||||||
public ListView ListView { get; set; }
|
public ExtendedListView ListView { get; set; }
|
||||||
private AddFolderToolBarItem AddItem { get; set; }
|
private AddFolderToolBarItem AddItem { get; set; }
|
||||||
public Fab Fab { get; set; }
|
public Fab Fab { get; set; }
|
||||||
|
|
||||||
private void Init()
|
private void Init()
|
||||||
{
|
{
|
||||||
ListView = new ListView
|
ListView = new ExtendedListView
|
||||||
{
|
{
|
||||||
ItemsSource = Folders,
|
ItemsSource = Folders,
|
||||||
ItemTemplate = new DataTemplate(() => new SettingsFolderListViewCell(this))
|
ItemTemplate = new DataTemplate(() => new SettingsFolderListViewCell(this))
|
||||||
|
@ -47,6 +47,7 @@ namespace Bit.App.Pages
|
||||||
{
|
{
|
||||||
await Navigation.PushForDeviceAsync(new SettingsAddFolderPage());
|
await Navigation.PushForDeviceAsync(new SettingsAddFolderPage());
|
||||||
});
|
});
|
||||||
|
ListView.BottomPadding = 50;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -488,6 +488,10 @@ namespace Bit.App.Pages
|
||||||
RowHeight = -1;
|
RowHeight = -1;
|
||||||
EstimatedRowHeight = 44;
|
EstimatedRowHeight = 44;
|
||||||
}
|
}
|
||||||
|
else if(Device.RuntimePlatform == Device.Android)
|
||||||
|
{
|
||||||
|
BottomPadding = 50;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,6 +71,10 @@ namespace Bit.App.Pages
|
||||||
table.RowHeight = -1;
|
table.RowHeight = -1;
|
||||||
table.EstimatedRowHeight = 100;
|
table.EstimatedRowHeight = 100;
|
||||||
}
|
}
|
||||||
|
else if(Device.RuntimePlatform == Device.Android)
|
||||||
|
{
|
||||||
|
table.BottomPadding = 50;
|
||||||
|
}
|
||||||
|
|
||||||
Title = AppResources.Tools;
|
Title = AppResources.Tools;
|
||||||
Content = table;
|
Content = table;
|
||||||
|
|
|
@ -158,6 +158,10 @@ namespace Bit.App.Pages
|
||||||
ToolbarItems.Add(new DismissModalToolBarItem(this, AppResources.Cancel));
|
ToolbarItems.Add(new DismissModalToolBarItem(this, AppResources.Cancel));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if(Device.RuntimePlatform == Device.Android)
|
||||||
|
{
|
||||||
|
table.BottomPadding = 50;
|
||||||
|
}
|
||||||
|
|
||||||
var stackLayout = new StackLayout
|
var stackLayout = new StackLayout
|
||||||
{
|
{
|
||||||
|
|
|
@ -564,6 +564,10 @@ namespace Bit.App.Pages
|
||||||
Table.RowHeight = -1;
|
Table.RowHeight = -1;
|
||||||
Table.EstimatedRowHeight = 70;
|
Table.EstimatedRowHeight = 70;
|
||||||
}
|
}
|
||||||
|
else if(Device.RuntimePlatform == Device.Android)
|
||||||
|
{
|
||||||
|
Table.BottomPadding = 50;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitSave()
|
private void InitSave()
|
||||||
|
|
|
@ -43,7 +43,7 @@ namespace Bit.App.Pages
|
||||||
|
|
||||||
public ExtendedObservableCollection<VaultAttachmentsPageModel.Attachment> PresentationAttchments { get; private set; }
|
public ExtendedObservableCollection<VaultAttachmentsPageModel.Attachment> PresentationAttchments { get; private set; }
|
||||||
= new ExtendedObservableCollection<VaultAttachmentsPageModel.Attachment>();
|
= new ExtendedObservableCollection<VaultAttachmentsPageModel.Attachment>();
|
||||||
public ListView ListView { get; set; }
|
public ExtendedListView ListView { get; set; }
|
||||||
public StackLayout NoDataStackLayout { get; set; }
|
public StackLayout NoDataStackLayout { get; set; }
|
||||||
public StackLayout AddNewStackLayout { get; set; }
|
public StackLayout AddNewStackLayout { get; set; }
|
||||||
public Label FileLabel { get; set; }
|
public Label FileLabel { get; set; }
|
||||||
|
@ -101,7 +101,7 @@ namespace Bit.App.Pages
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
ListView = new ListView(ListViewCachingStrategy.RecycleElement)
|
ListView = new ExtendedListView(ListViewCachingStrategy.RecycleElement)
|
||||||
{
|
{
|
||||||
ItemsSource = PresentationAttchments,
|
ItemsSource = PresentationAttchments,
|
||||||
HasUnevenRows = true,
|
HasUnevenRows = true,
|
||||||
|
@ -196,6 +196,10 @@ namespace Bit.App.Pages
|
||||||
ListView.BackgroundColor = Color.Transparent;
|
ListView.BackgroundColor = Color.Transparent;
|
||||||
ToolbarItems.Add(new DismissModalToolBarItem(this, AppResources.Close));
|
ToolbarItems.Add(new DismissModalToolBarItem(this, AppResources.Close));
|
||||||
}
|
}
|
||||||
|
else if(Device.RuntimePlatform == Device.Android)
|
||||||
|
{
|
||||||
|
ListView.BottomPadding = 50;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async override void OnAppearing()
|
protected async override void OnAppearing()
|
||||||
|
|
|
@ -51,13 +51,14 @@ namespace Bit.App.Pages
|
||||||
Init();
|
Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ContentView ContentView { get; set; }
|
||||||
|
public Fab Fab { get; set; }
|
||||||
public ExtendedObservableCollection<Section<AutofillCipher>> PresentationCiphersGroup { get; private set; }
|
public ExtendedObservableCollection<Section<AutofillCipher>> PresentationCiphersGroup { get; private set; }
|
||||||
= new ExtendedObservableCollection<Section<AutofillCipher>>();
|
= new ExtendedObservableCollection<Section<AutofillCipher>>();
|
||||||
public StackLayout NoDataStackLayout { get; set; }
|
public StackLayout NoDataStackLayout { get; set; }
|
||||||
public ListView ListView { get; set; }
|
public ExtendedListView ListView { get; set; }
|
||||||
public ActivityIndicator LoadingIndicator { get; set; }
|
public ActivityIndicator LoadingIndicator { get; set; }
|
||||||
private SearchToolBarItem SearchItem { get; set; }
|
private SearchToolBarItem SearchItem { get; set; }
|
||||||
private AddCipherToolBarItem AddCipherItem { get; set; }
|
|
||||||
private IGoogleAnalyticsService GoogleAnalyticsService { get; set; }
|
private IGoogleAnalyticsService GoogleAnalyticsService { get; set; }
|
||||||
private IDeviceActionService DeviceActionService { get; set; }
|
private IDeviceActionService DeviceActionService { get; set; }
|
||||||
private string Uri { get; set; }
|
private string Uri { get; set; }
|
||||||
|
@ -87,12 +88,10 @@ namespace Bit.App.Pages
|
||||||
Spacing = 20
|
Spacing = 20
|
||||||
};
|
};
|
||||||
|
|
||||||
AddCipherItem = new AddCipherToolBarItem(this);
|
|
||||||
ToolbarItems.Add(AddCipherItem);
|
|
||||||
SearchItem = new SearchToolBarItem(this);
|
SearchItem = new SearchToolBarItem(this);
|
||||||
ToolbarItems.Add(SearchItem);
|
ToolbarItems.Add(SearchItem);
|
||||||
|
|
||||||
ListView = new ListView(ListViewCachingStrategy.RecycleElement)
|
ListView = new ExtendedListView(ListViewCachingStrategy.RecycleElement)
|
||||||
{
|
{
|
||||||
IsGroupingEnabled = true,
|
IsGroupingEnabled = true,
|
||||||
ItemsSource = PresentationCiphersGroup,
|
ItemsSource = PresentationCiphersGroup,
|
||||||
|
@ -117,14 +116,22 @@ namespace Bit.App.Pages
|
||||||
HorizontalOptions = LayoutOptions.Center
|
HorizontalOptions = LayoutOptions.Center
|
||||||
};
|
};
|
||||||
|
|
||||||
Content = LoadingIndicator;
|
ContentView = new ContentView
|
||||||
|
{
|
||||||
|
Content = LoadingIndicator
|
||||||
|
};
|
||||||
|
|
||||||
|
var fabLayout = new FabLayout(ContentView);
|
||||||
|
Fab = new Fab(fabLayout, "plus.png", async (sender, args) => await AddCipherAsync());
|
||||||
|
ListView.BottomPadding = 170;
|
||||||
|
|
||||||
|
Content = fabLayout;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnAppearing()
|
protected override void OnAppearing()
|
||||||
{
|
{
|
||||||
base.OnAppearing();
|
base.OnAppearing();
|
||||||
ListView.ItemSelected += CipherSelected;
|
ListView.ItemSelected += CipherSelected;
|
||||||
AddCipherItem.InitEvents();
|
|
||||||
SearchItem.InitEvents();
|
SearchItem.InitEvents();
|
||||||
_filterResultsCancellationTokenSource = FetchAndLoadVault();
|
_filterResultsCancellationTokenSource = FetchAndLoadVault();
|
||||||
}
|
}
|
||||||
|
@ -133,7 +140,6 @@ namespace Bit.App.Pages
|
||||||
{
|
{
|
||||||
base.OnDisappearing();
|
base.OnDisappearing();
|
||||||
ListView.ItemSelected -= CipherSelected;
|
ListView.ItemSelected -= CipherSelected;
|
||||||
AddCipherItem.Dispose();
|
|
||||||
SearchItem.Dispose();
|
SearchItem.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,11 +154,11 @@ namespace Bit.App.Pages
|
||||||
{
|
{
|
||||||
if(PresentationCiphersGroup.Count > 0)
|
if(PresentationCiphersGroup.Count > 0)
|
||||||
{
|
{
|
||||||
Content = ListView;
|
ContentView.Content = ListView;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Content = NoDataStackLayout;
|
ContentView.Content = NoDataStackLayout;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -249,7 +255,7 @@ namespace Bit.App.Pages
|
||||||
((ListView)sender).SelectedItem = null;
|
((ListView)sender).SelectedItem = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void AddCipherAsync()
|
private async Task AddCipherAsync()
|
||||||
{
|
{
|
||||||
if(_appOptions.FillType.HasValue && _appOptions.FillType != CipherType.Login)
|
if(_appOptions.FillType.HasValue && _appOptions.FillType != CipherType.Login)
|
||||||
{
|
{
|
||||||
|
@ -262,17 +268,6 @@ namespace Bit.App.Pages
|
||||||
await Navigation.PushForDeviceAsync(pageForLogin);
|
await Navigation.PushForDeviceAsync(pageForLogin);
|
||||||
}
|
}
|
||||||
|
|
||||||
private class AddCipherToolBarItem : ExtendedToolbarItem
|
|
||||||
{
|
|
||||||
public AddCipherToolBarItem(VaultAutofillListCiphersPage page)
|
|
||||||
: base(() => page.AddCipherAsync())
|
|
||||||
{
|
|
||||||
Text = AppResources.Add;
|
|
||||||
Icon = "plus.png";
|
|
||||||
Priority = 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private class SearchToolBarItem : ExtendedToolbarItem
|
private class SearchToolBarItem : ExtendedToolbarItem
|
||||||
{
|
{
|
||||||
private readonly VaultAutofillListCiphersPage _page;
|
private readonly VaultAutofillListCiphersPage _page;
|
||||||
|
|
|
@ -140,6 +140,10 @@ namespace Bit.App.Pages
|
||||||
Table.RowHeight = -1;
|
Table.RowHeight = -1;
|
||||||
Table.EstimatedRowHeight = 44;
|
Table.EstimatedRowHeight = 44;
|
||||||
}
|
}
|
||||||
|
else if(Device.RuntimePlatform == Device.Android)
|
||||||
|
{
|
||||||
|
Table.BottomPadding = 50;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async override void OnAppearing()
|
protected async override void OnAppearing()
|
||||||
|
|
|
@ -433,6 +433,10 @@ namespace Bit.App.Pages
|
||||||
Table.RowHeight = -1;
|
Table.RowHeight = -1;
|
||||||
Table.EstimatedRowHeight = 70;
|
Table.EstimatedRowHeight = 70;
|
||||||
}
|
}
|
||||||
|
else if(Device.RuntimePlatform == Device.Android)
|
||||||
|
{
|
||||||
|
Table.BottomPadding = 50;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitSave()
|
private void InitSave()
|
||||||
|
|
|
@ -59,7 +59,7 @@ namespace Bit.App.Pages
|
||||||
public ExtendedObservableCollection<Section<Cipher>> PresentationSections { get; private set; }
|
public ExtendedObservableCollection<Section<Cipher>> PresentationSections { get; private set; }
|
||||||
= new ExtendedObservableCollection<Section<Cipher>>();
|
= new ExtendedObservableCollection<Section<Cipher>>();
|
||||||
public Cipher[] Ciphers { get; set; } = new Cipher[] { };
|
public Cipher[] Ciphers { get; set; } = new Cipher[] { };
|
||||||
public ListView ListView { get; set; }
|
public ExtendedListView ListView { get; set; }
|
||||||
public SearchBar Search { get; set; }
|
public SearchBar Search { get; set; }
|
||||||
public ActivityIndicator LoadingIndicator { get; set; }
|
public ActivityIndicator LoadingIndicator { get; set; }
|
||||||
public StackLayout NoDataStackLayout { get; set; }
|
public StackLayout NoDataStackLayout { get; set; }
|
||||||
|
@ -70,7 +70,7 @@ namespace Bit.App.Pages
|
||||||
|
|
||||||
private void Init()
|
private void Init()
|
||||||
{
|
{
|
||||||
ListView = new ListView(ListViewCachingStrategy.RecycleElement)
|
ListView = new ExtendedListView(ListViewCachingStrategy.RecycleElement)
|
||||||
{
|
{
|
||||||
IsGroupingEnabled = true,
|
IsGroupingEnabled = true,
|
||||||
ItemsSource = PresentationSections,
|
ItemsSource = PresentationSections,
|
||||||
|
@ -179,6 +179,7 @@ namespace Bit.App.Pages
|
||||||
{
|
{
|
||||||
if(Device.RuntimePlatform == Device.Android)
|
if(Device.RuntimePlatform == Device.Android)
|
||||||
{
|
{
|
||||||
|
ListView.BottomPadding = 170;
|
||||||
Fab = new Fab(fabLayout, "plus.png", (sender, args) => Helpers.AddCipher(this, _folderId));
|
Fab = new Fab(fabLayout, "plus.png", (sender, args) => Helpers.AddCipher(this, _folderId));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -187,6 +188,10 @@ namespace Bit.App.Pages
|
||||||
ToolbarItems.Add(AddCipherItem);
|
ToolbarItems.Add(AddCipherItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if(Device.RuntimePlatform == Device.Android)
|
||||||
|
{
|
||||||
|
ListView.BottomPadding = 50;
|
||||||
|
}
|
||||||
|
|
||||||
Content = fabLayout;
|
Content = fabLayout;
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ namespace Bit.App.Pages
|
||||||
|
|
||||||
public ExtendedObservableCollection<Section<GroupingOrCipher>> PresentationSections { get; private set; }
|
public ExtendedObservableCollection<Section<GroupingOrCipher>> PresentationSections { get; private set; }
|
||||||
= new ExtendedObservableCollection<Section<GroupingOrCipher>>();
|
= new ExtendedObservableCollection<Section<GroupingOrCipher>>();
|
||||||
public ListView ListView { get; set; }
|
public ExtendedListView ListView { get; set; }
|
||||||
public StackLayout NoDataStackLayout { get; set; }
|
public StackLayout NoDataStackLayout { get; set; }
|
||||||
public ActivityIndicator LoadingIndicator { get; set; }
|
public ActivityIndicator LoadingIndicator { get; set; }
|
||||||
private AddCipherToolBarItem AddCipherItem { get; set; }
|
private AddCipherToolBarItem AddCipherItem { get; set; }
|
||||||
|
@ -63,7 +63,7 @@ namespace Bit.App.Pages
|
||||||
SearchItem = new SearchToolBarItem(this);
|
SearchItem = new SearchToolBarItem(this);
|
||||||
ToolbarItems.Add(SearchItem);
|
ToolbarItems.Add(SearchItem);
|
||||||
|
|
||||||
ListView = new ListView(ListViewCachingStrategy.RecycleElement)
|
ListView = new ExtendedListView(ListViewCachingStrategy.RecycleElement)
|
||||||
{
|
{
|
||||||
IsGroupingEnabled = true,
|
IsGroupingEnabled = true,
|
||||||
ItemsSource = PresentationSections,
|
ItemsSource = PresentationSections,
|
||||||
|
@ -121,6 +121,7 @@ namespace Bit.App.Pages
|
||||||
if(Device.RuntimePlatform == Device.Android)
|
if(Device.RuntimePlatform == Device.Android)
|
||||||
{
|
{
|
||||||
Fab = new Fab(fabLayout, "plus.png", (sender, args) => Helpers.AddCipher(this, null));
|
Fab = new Fab(fabLayout, "plus.png", (sender, args) => Helpers.AddCipher(this, null));
|
||||||
|
ListView.BottomPadding = 170;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -265,6 +265,10 @@ namespace Bit.App.Pages
|
||||||
Table.RowHeight = -1;
|
Table.RowHeight = -1;
|
||||||
Table.EstimatedRowHeight = 70;
|
Table.EstimatedRowHeight = 70;
|
||||||
}
|
}
|
||||||
|
else if(Device.RuntimePlatform == Device.Android)
|
||||||
|
{
|
||||||
|
Table.BottomPadding = 170;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async override void OnAppearing()
|
protected async override void OnAppearing()
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
using System;
|
using Bit.App.Controls;
|
||||||
|
using System;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using UIKit;
|
using UIKit;
|
||||||
using Xamarin.Forms;
|
using Xamarin.Forms;
|
||||||
using Xamarin.Forms.Platform.iOS;
|
using Xamarin.Forms.Platform.iOS;
|
||||||
|
|
||||||
[assembly: ExportRenderer(typeof(ListView), typeof(Bit.iOS.Controls.ListViewRenderer))]
|
[assembly: ExportRenderer(typeof(ExtendedListView), typeof(Bit.iOS.Controls.ExtendedListViewRenderer))]
|
||||||
namespace Bit.iOS.Controls
|
namespace Bit.iOS.Controls
|
||||||
{
|
{
|
||||||
public class ListViewRenderer : Xamarin.Forms.Platform.iOS.ListViewRenderer
|
public class ExtendedListViewRenderer : ListViewRenderer
|
||||||
{
|
{
|
||||||
protected override void OnElementChanged(ElementChangedEventArgs<ListView> e)
|
protected override void OnElementChanged(ElementChangedEventArgs<ListView> e)
|
||||||
{
|
{
|
||||||
|
@ -16,7 +17,7 @@ namespace Bit.iOS.Controls
|
||||||
// primary color
|
// primary color
|
||||||
Control.SectionIndexColor = new UIColor(red: 0.24f, green: 0.55f, blue: 0.74f, alpha: 1.0f);
|
Control.SectionIndexColor = new UIColor(red: 0.24f, green: 0.55f, blue: 0.74f, alpha: 1.0f);
|
||||||
|
|
||||||
if(e.NewElement is ListView view)
|
if(e.NewElement is ExtendedListView view)
|
||||||
{
|
{
|
||||||
SetMargin(view);
|
SetMargin(view);
|
||||||
}
|
}
|
||||||
|
@ -31,7 +32,7 @@ namespace Bit.iOS.Controls
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetMargin(ListView view)
|
private void SetMargin(ExtendedListView view)
|
||||||
{
|
{
|
||||||
Control.ContentInset = new UIEdgeInsets(
|
Control.ContentInset = new UIEdgeInsets(
|
||||||
new nfloat(view.Margin.Top),
|
new nfloat(view.Margin.Top),
|
|
@ -226,7 +226,7 @@
|
||||||
<Compile Include="Controls\ExtendedEditorRenderer.cs" />
|
<Compile Include="Controls\ExtendedEditorRenderer.cs" />
|
||||||
<Compile Include="Controls\CustomSearchBarRenderer.cs" />
|
<Compile Include="Controls\CustomSearchBarRenderer.cs" />
|
||||||
<Compile Include="Controls\ExtendedSwitchCellRenderer.cs" />
|
<Compile Include="Controls\ExtendedSwitchCellRenderer.cs" />
|
||||||
<Compile Include="Controls\ListViewRenderer.cs" />
|
<Compile Include="Controls\ExtendedListViewRenderer.cs" />
|
||||||
<Compile Include="Controls\ExtendedViewCellRenderer.cs" />
|
<Compile Include="Controls\ExtendedViewCellRenderer.cs" />
|
||||||
<Compile Include="Controls\ExtendedTextCellRenderer.cs" />
|
<Compile Include="Controls\ExtendedTextCellRenderer.cs" />
|
||||||
<Compile Include="Controls\ExtendedTableViewRenderer.cs" />
|
<Compile Include="Controls\ExtendedTableViewRenderer.cs" />
|
||||||
|
|
Loading…
Reference in a new issue