mirror of
https://github.com/bitwarden/android.git
synced 2024-12-24 18:08:26 +03:00
storage services
This commit is contained in:
parent
a88f799372
commit
21777602f6
10 changed files with 381 additions and 18 deletions
|
@ -49,6 +49,9 @@
|
|||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Xamarin.Essentials">
|
||||
<Version>1.1.0</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Xamarin.Forms" Version="3.6.0.264807" />
|
||||
<PackageReference Include="Xamarin.Android.Support.Design" Version="28.0.0.1" />
|
||||
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="28.0.0.1" />
|
||||
|
@ -80,6 +83,10 @@
|
|||
<Project>{9F1742A7-7D03-4BB3-8FCD-41BC3002B00A}</Project>
|
||||
<Name>App</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Core\Core.csproj">
|
||||
<Project>{4b8a8c41-9820-4341-974c-41e65b7f4366}</Project>
|
||||
<Name>Core</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\xml\accessibilityservice.xml" />
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
using System;
|
||||
|
||||
using Android.App;
|
||||
using Android.App;
|
||||
using Android.Content.PM;
|
||||
using Android.Runtime;
|
||||
using Android.Views;
|
||||
using Android.Widget;
|
||||
using Android.OS;
|
||||
|
||||
namespace Bit.Droid
|
||||
|
@ -16,7 +12,7 @@ namespace Bit.Droid
|
|||
Theme = "@style/MainTheme",
|
||||
ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
|
||||
[Register("com.x8bit.bitwarden.MainActivity")]
|
||||
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
|
||||
public class MainActivity : Xamarin.Forms.Platform.Android.FormsAppCompatActivity
|
||||
{
|
||||
protected override void OnCreate(Bundle savedInstanceState)
|
||||
{
|
||||
|
@ -24,8 +20,16 @@ namespace Bit.Droid
|
|||
ToolbarResource = Resource.Layout.Toolbar;
|
||||
|
||||
base.OnCreate(savedInstanceState);
|
||||
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
|
||||
Xamarin.Essentials.Platform.Init(this, savedInstanceState);
|
||||
Xamarin.Forms.Forms.Init(this, savedInstanceState);
|
||||
LoadApplication(new App.App());
|
||||
}
|
||||
|
||||
public override void OnRequestPermissionsResult(int requestCode, string[] permissions,
|
||||
[GeneratedEnum] Permission[] grantResults)
|
||||
{
|
||||
Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
185
src/Android/Resources/Resource.designer.cs
generated
185
src/Android/Resources/Resource.designer.cs
generated
|
@ -26,6 +26,188 @@ namespace Bit.Droid
|
|||
|
||||
public static void UpdateIdValues()
|
||||
{
|
||||
global::Xamarin.Essentials.Resource.Attribute.alpha = global::Bit.Droid.Resource.Attribute.alpha;
|
||||
global::Xamarin.Essentials.Resource.Attribute.coordinatorLayoutStyle = global::Bit.Droid.Resource.Attribute.coordinatorLayoutStyle;
|
||||
global::Xamarin.Essentials.Resource.Attribute.font = global::Bit.Droid.Resource.Attribute.font;
|
||||
global::Xamarin.Essentials.Resource.Attribute.fontProviderAuthority = global::Bit.Droid.Resource.Attribute.fontProviderAuthority;
|
||||
global::Xamarin.Essentials.Resource.Attribute.fontProviderCerts = global::Bit.Droid.Resource.Attribute.fontProviderCerts;
|
||||
global::Xamarin.Essentials.Resource.Attribute.fontProviderFetchStrategy = global::Bit.Droid.Resource.Attribute.fontProviderFetchStrategy;
|
||||
global::Xamarin.Essentials.Resource.Attribute.fontProviderFetchTimeout = global::Bit.Droid.Resource.Attribute.fontProviderFetchTimeout;
|
||||
global::Xamarin.Essentials.Resource.Attribute.fontProviderPackage = global::Bit.Droid.Resource.Attribute.fontProviderPackage;
|
||||
global::Xamarin.Essentials.Resource.Attribute.fontProviderQuery = global::Bit.Droid.Resource.Attribute.fontProviderQuery;
|
||||
global::Xamarin.Essentials.Resource.Attribute.fontStyle = global::Bit.Droid.Resource.Attribute.fontStyle;
|
||||
global::Xamarin.Essentials.Resource.Attribute.fontVariationSettings = global::Bit.Droid.Resource.Attribute.fontVariationSettings;
|
||||
global::Xamarin.Essentials.Resource.Attribute.fontWeight = global::Bit.Droid.Resource.Attribute.fontWeight;
|
||||
global::Xamarin.Essentials.Resource.Attribute.keylines = global::Bit.Droid.Resource.Attribute.keylines;
|
||||
global::Xamarin.Essentials.Resource.Attribute.layout_anchor = global::Bit.Droid.Resource.Attribute.layout_anchor;
|
||||
global::Xamarin.Essentials.Resource.Attribute.layout_anchorGravity = global::Bit.Droid.Resource.Attribute.layout_anchorGravity;
|
||||
global::Xamarin.Essentials.Resource.Attribute.layout_behavior = global::Bit.Droid.Resource.Attribute.layout_behavior;
|
||||
global::Xamarin.Essentials.Resource.Attribute.layout_dodgeInsetEdges = global::Bit.Droid.Resource.Attribute.layout_dodgeInsetEdges;
|
||||
global::Xamarin.Essentials.Resource.Attribute.layout_insetEdge = global::Bit.Droid.Resource.Attribute.layout_insetEdge;
|
||||
global::Xamarin.Essentials.Resource.Attribute.layout_keyline = global::Bit.Droid.Resource.Attribute.layout_keyline;
|
||||
global::Xamarin.Essentials.Resource.Attribute.statusBarBackground = global::Bit.Droid.Resource.Attribute.statusBarBackground;
|
||||
global::Xamarin.Essentials.Resource.Attribute.ttcIndex = global::Bit.Droid.Resource.Attribute.ttcIndex;
|
||||
global::Xamarin.Essentials.Resource.Color.browser_actions_bg_grey = global::Bit.Droid.Resource.Color.browser_actions_bg_grey;
|
||||
global::Xamarin.Essentials.Resource.Color.browser_actions_divider_color = global::Bit.Droid.Resource.Color.browser_actions_divider_color;
|
||||
global::Xamarin.Essentials.Resource.Color.browser_actions_text_color = global::Bit.Droid.Resource.Color.browser_actions_text_color;
|
||||
global::Xamarin.Essentials.Resource.Color.browser_actions_title_color = global::Bit.Droid.Resource.Color.browser_actions_title_color;
|
||||
global::Xamarin.Essentials.Resource.Color.notification_action_color_filter = global::Bit.Droid.Resource.Color.notification_action_color_filter;
|
||||
global::Xamarin.Essentials.Resource.Color.notification_icon_bg_color = global::Bit.Droid.Resource.Color.notification_icon_bg_color;
|
||||
global::Xamarin.Essentials.Resource.Color.ripple_material_light = global::Bit.Droid.Resource.Color.ripple_material_light;
|
||||
global::Xamarin.Essentials.Resource.Color.secondary_text_default_material_light = global::Bit.Droid.Resource.Color.secondary_text_default_material_light;
|
||||
global::Xamarin.Essentials.Resource.Dimension.browser_actions_context_menu_max_width = global::Bit.Droid.Resource.Dimension.browser_actions_context_menu_max_width;
|
||||
global::Xamarin.Essentials.Resource.Dimension.browser_actions_context_menu_min_padding = global::Bit.Droid.Resource.Dimension.browser_actions_context_menu_min_padding;
|
||||
global::Xamarin.Essentials.Resource.Dimension.compat_button_inset_horizontal_material = global::Bit.Droid.Resource.Dimension.compat_button_inset_horizontal_material;
|
||||
global::Xamarin.Essentials.Resource.Dimension.compat_button_inset_vertical_material = global::Bit.Droid.Resource.Dimension.compat_button_inset_vertical_material;
|
||||
global::Xamarin.Essentials.Resource.Dimension.compat_button_padding_horizontal_material = global::Bit.Droid.Resource.Dimension.compat_button_padding_horizontal_material;
|
||||
global::Xamarin.Essentials.Resource.Dimension.compat_button_padding_vertical_material = global::Bit.Droid.Resource.Dimension.compat_button_padding_vertical_material;
|
||||
global::Xamarin.Essentials.Resource.Dimension.compat_control_corner_material = global::Bit.Droid.Resource.Dimension.compat_control_corner_material;
|
||||
global::Xamarin.Essentials.Resource.Dimension.compat_notification_large_icon_max_height = global::Bit.Droid.Resource.Dimension.compat_notification_large_icon_max_height;
|
||||
global::Xamarin.Essentials.Resource.Dimension.compat_notification_large_icon_max_width = global::Bit.Droid.Resource.Dimension.compat_notification_large_icon_max_width;
|
||||
global::Xamarin.Essentials.Resource.Dimension.notification_action_icon_size = global::Bit.Droid.Resource.Dimension.notification_action_icon_size;
|
||||
global::Xamarin.Essentials.Resource.Dimension.notification_action_text_size = global::Bit.Droid.Resource.Dimension.notification_action_text_size;
|
||||
global::Xamarin.Essentials.Resource.Dimension.notification_big_circle_margin = global::Bit.Droid.Resource.Dimension.notification_big_circle_margin;
|
||||
global::Xamarin.Essentials.Resource.Dimension.notification_content_margin_start = global::Bit.Droid.Resource.Dimension.notification_content_margin_start;
|
||||
global::Xamarin.Essentials.Resource.Dimension.notification_large_icon_height = global::Bit.Droid.Resource.Dimension.notification_large_icon_height;
|
||||
global::Xamarin.Essentials.Resource.Dimension.notification_large_icon_width = global::Bit.Droid.Resource.Dimension.notification_large_icon_width;
|
||||
global::Xamarin.Essentials.Resource.Dimension.notification_main_column_padding_top = global::Bit.Droid.Resource.Dimension.notification_main_column_padding_top;
|
||||
global::Xamarin.Essentials.Resource.Dimension.notification_media_narrow_margin = global::Bit.Droid.Resource.Dimension.notification_media_narrow_margin;
|
||||
global::Xamarin.Essentials.Resource.Dimension.notification_right_icon_size = global::Bit.Droid.Resource.Dimension.notification_right_icon_size;
|
||||
global::Xamarin.Essentials.Resource.Dimension.notification_right_side_padding_top = global::Bit.Droid.Resource.Dimension.notification_right_side_padding_top;
|
||||
global::Xamarin.Essentials.Resource.Dimension.notification_small_icon_background_padding = global::Bit.Droid.Resource.Dimension.notification_small_icon_background_padding;
|
||||
global::Xamarin.Essentials.Resource.Dimension.notification_small_icon_size_as_large = global::Bit.Droid.Resource.Dimension.notification_small_icon_size_as_large;
|
||||
global::Xamarin.Essentials.Resource.Dimension.notification_subtext_size = global::Bit.Droid.Resource.Dimension.notification_subtext_size;
|
||||
global::Xamarin.Essentials.Resource.Dimension.notification_top_pad = global::Bit.Droid.Resource.Dimension.notification_top_pad;
|
||||
global::Xamarin.Essentials.Resource.Dimension.notification_top_pad_large_text = global::Bit.Droid.Resource.Dimension.notification_top_pad_large_text;
|
||||
global::Xamarin.Essentials.Resource.Drawable.notification_action_background = global::Bit.Droid.Resource.Drawable.notification_action_background;
|
||||
global::Xamarin.Essentials.Resource.Drawable.notification_bg = global::Bit.Droid.Resource.Drawable.notification_bg;
|
||||
global::Xamarin.Essentials.Resource.Drawable.notification_bg_low = global::Bit.Droid.Resource.Drawable.notification_bg_low;
|
||||
global::Xamarin.Essentials.Resource.Drawable.notification_bg_low_normal = global::Bit.Droid.Resource.Drawable.notification_bg_low_normal;
|
||||
global::Xamarin.Essentials.Resource.Drawable.notification_bg_low_pressed = global::Bit.Droid.Resource.Drawable.notification_bg_low_pressed;
|
||||
global::Xamarin.Essentials.Resource.Drawable.notification_bg_normal = global::Bit.Droid.Resource.Drawable.notification_bg_normal;
|
||||
global::Xamarin.Essentials.Resource.Drawable.notification_bg_normal_pressed = global::Bit.Droid.Resource.Drawable.notification_bg_normal_pressed;
|
||||
global::Xamarin.Essentials.Resource.Drawable.notification_icon_background = global::Bit.Droid.Resource.Drawable.notification_icon_background;
|
||||
global::Xamarin.Essentials.Resource.Drawable.notification_template_icon_bg = global::Bit.Droid.Resource.Drawable.notification_template_icon_bg;
|
||||
global::Xamarin.Essentials.Resource.Drawable.notification_template_icon_low_bg = global::Bit.Droid.Resource.Drawable.notification_template_icon_low_bg;
|
||||
global::Xamarin.Essentials.Resource.Drawable.notification_tile_bg = global::Bit.Droid.Resource.Drawable.notification_tile_bg;
|
||||
global::Xamarin.Essentials.Resource.Drawable.notify_panel_notification_icon_bg = global::Bit.Droid.Resource.Drawable.notify_panel_notification_icon_bg;
|
||||
global::Xamarin.Essentials.Resource.Id.action_container = global::Bit.Droid.Resource.Id.action_container;
|
||||
global::Xamarin.Essentials.Resource.Id.action_divider = global::Bit.Droid.Resource.Id.action_divider;
|
||||
global::Xamarin.Essentials.Resource.Id.action_image = global::Bit.Droid.Resource.Id.action_image;
|
||||
global::Xamarin.Essentials.Resource.Id.action_text = global::Bit.Droid.Resource.Id.action_text;
|
||||
global::Xamarin.Essentials.Resource.Id.actions = global::Bit.Droid.Resource.Id.actions;
|
||||
global::Xamarin.Essentials.Resource.Id.all = global::Bit.Droid.Resource.Id.all;
|
||||
global::Xamarin.Essentials.Resource.Id.async = global::Bit.Droid.Resource.Id.async;
|
||||
global::Xamarin.Essentials.Resource.Id.blocking = global::Bit.Droid.Resource.Id.blocking;
|
||||
global::Xamarin.Essentials.Resource.Id.bottom = global::Bit.Droid.Resource.Id.bottom;
|
||||
global::Xamarin.Essentials.Resource.Id.browser_actions_header_text = global::Bit.Droid.Resource.Id.browser_actions_header_text;
|
||||
global::Xamarin.Essentials.Resource.Id.browser_actions_menu_item_icon = global::Bit.Droid.Resource.Id.browser_actions_menu_item_icon;
|
||||
global::Xamarin.Essentials.Resource.Id.browser_actions_menu_item_text = global::Bit.Droid.Resource.Id.browser_actions_menu_item_text;
|
||||
global::Xamarin.Essentials.Resource.Id.browser_actions_menu_items = global::Bit.Droid.Resource.Id.browser_actions_menu_items;
|
||||
global::Xamarin.Essentials.Resource.Id.browser_actions_menu_view = global::Bit.Droid.Resource.Id.browser_actions_menu_view;
|
||||
global::Xamarin.Essentials.Resource.Id.center = global::Bit.Droid.Resource.Id.center;
|
||||
global::Xamarin.Essentials.Resource.Id.center_horizontal = global::Bit.Droid.Resource.Id.center_horizontal;
|
||||
global::Xamarin.Essentials.Resource.Id.center_vertical = global::Bit.Droid.Resource.Id.center_vertical;
|
||||
global::Xamarin.Essentials.Resource.Id.chronometer = global::Bit.Droid.Resource.Id.chronometer;
|
||||
global::Xamarin.Essentials.Resource.Id.clip_horizontal = global::Bit.Droid.Resource.Id.clip_horizontal;
|
||||
global::Xamarin.Essentials.Resource.Id.clip_vertical = global::Bit.Droid.Resource.Id.clip_vertical;
|
||||
global::Xamarin.Essentials.Resource.Id.end = global::Bit.Droid.Resource.Id.end;
|
||||
global::Xamarin.Essentials.Resource.Id.fill = global::Bit.Droid.Resource.Id.fill;
|
||||
global::Xamarin.Essentials.Resource.Id.fill_horizontal = global::Bit.Droid.Resource.Id.fill_horizontal;
|
||||
global::Xamarin.Essentials.Resource.Id.fill_vertical = global::Bit.Droid.Resource.Id.fill_vertical;
|
||||
global::Xamarin.Essentials.Resource.Id.forever = global::Bit.Droid.Resource.Id.forever;
|
||||
global::Xamarin.Essentials.Resource.Id.icon = global::Bit.Droid.Resource.Id.icon;
|
||||
global::Xamarin.Essentials.Resource.Id.icon_group = global::Bit.Droid.Resource.Id.icon_group;
|
||||
global::Xamarin.Essentials.Resource.Id.info = global::Bit.Droid.Resource.Id.info;
|
||||
global::Xamarin.Essentials.Resource.Id.italic = global::Bit.Droid.Resource.Id.italic;
|
||||
global::Xamarin.Essentials.Resource.Id.left = global::Bit.Droid.Resource.Id.left;
|
||||
global::Xamarin.Essentials.Resource.Id.line1 = global::Bit.Droid.Resource.Id.line1;
|
||||
global::Xamarin.Essentials.Resource.Id.line3 = global::Bit.Droid.Resource.Id.line3;
|
||||
global::Xamarin.Essentials.Resource.Id.none = global::Bit.Droid.Resource.Id.none;
|
||||
global::Xamarin.Essentials.Resource.Id.normal = global::Bit.Droid.Resource.Id.normal;
|
||||
global::Xamarin.Essentials.Resource.Id.notification_background = global::Bit.Droid.Resource.Id.notification_background;
|
||||
global::Xamarin.Essentials.Resource.Id.notification_main_column = global::Bit.Droid.Resource.Id.notification_main_column;
|
||||
global::Xamarin.Essentials.Resource.Id.notification_main_column_container = global::Bit.Droid.Resource.Id.notification_main_column_container;
|
||||
global::Xamarin.Essentials.Resource.Id.right = global::Bit.Droid.Resource.Id.right;
|
||||
global::Xamarin.Essentials.Resource.Id.right_icon = global::Bit.Droid.Resource.Id.right_icon;
|
||||
global::Xamarin.Essentials.Resource.Id.right_side = global::Bit.Droid.Resource.Id.right_side;
|
||||
global::Xamarin.Essentials.Resource.Id.start = global::Bit.Droid.Resource.Id.start;
|
||||
global::Xamarin.Essentials.Resource.Id.tag_transition_group = global::Bit.Droid.Resource.Id.tag_transition_group;
|
||||
global::Xamarin.Essentials.Resource.Id.tag_unhandled_key_event_manager = global::Bit.Droid.Resource.Id.tag_unhandled_key_event_manager;
|
||||
global::Xamarin.Essentials.Resource.Id.tag_unhandled_key_listeners = global::Bit.Droid.Resource.Id.tag_unhandled_key_listeners;
|
||||
global::Xamarin.Essentials.Resource.Id.text = global::Bit.Droid.Resource.Id.text;
|
||||
global::Xamarin.Essentials.Resource.Id.text2 = global::Bit.Droid.Resource.Id.text2;
|
||||
global::Xamarin.Essentials.Resource.Id.time = global::Bit.Droid.Resource.Id.time;
|
||||
global::Xamarin.Essentials.Resource.Id.title = global::Bit.Droid.Resource.Id.title;
|
||||
global::Xamarin.Essentials.Resource.Id.top = global::Bit.Droid.Resource.Id.top;
|
||||
global::Xamarin.Essentials.Resource.Integer.status_bar_notification_info_maxnum = global::Bit.Droid.Resource.Integer.status_bar_notification_info_maxnum;
|
||||
global::Xamarin.Essentials.Resource.Layout.browser_actions_context_menu_page = global::Bit.Droid.Resource.Layout.browser_actions_context_menu_page;
|
||||
global::Xamarin.Essentials.Resource.Layout.browser_actions_context_menu_row = global::Bit.Droid.Resource.Layout.browser_actions_context_menu_row;
|
||||
global::Xamarin.Essentials.Resource.Layout.notification_action = global::Bit.Droid.Resource.Layout.notification_action;
|
||||
global::Xamarin.Essentials.Resource.Layout.notification_action_tombstone = global::Bit.Droid.Resource.Layout.notification_action_tombstone;
|
||||
global::Xamarin.Essentials.Resource.Layout.notification_template_custom_big = global::Bit.Droid.Resource.Layout.notification_template_custom_big;
|
||||
global::Xamarin.Essentials.Resource.Layout.notification_template_icon_group = global::Bit.Droid.Resource.Layout.notification_template_icon_group;
|
||||
global::Xamarin.Essentials.Resource.Layout.notification_template_part_chronometer = global::Bit.Droid.Resource.Layout.notification_template_part_chronometer;
|
||||
global::Xamarin.Essentials.Resource.Layout.notification_template_part_time = global::Bit.Droid.Resource.Layout.notification_template_part_time;
|
||||
global::Xamarin.Essentials.Resource.String.status_bar_notification_info_overflow = global::Bit.Droid.Resource.String.status_bar_notification_info_overflow;
|
||||
global::Xamarin.Essentials.Resource.Style.TextAppearance_Compat_Notification = global::Bit.Droid.Resource.Style.TextAppearance_Compat_Notification;
|
||||
global::Xamarin.Essentials.Resource.Style.TextAppearance_Compat_Notification_Info = global::Bit.Droid.Resource.Style.TextAppearance_Compat_Notification_Info;
|
||||
global::Xamarin.Essentials.Resource.Style.TextAppearance_Compat_Notification_Line2 = global::Bit.Droid.Resource.Style.TextAppearance_Compat_Notification_Line2;
|
||||
global::Xamarin.Essentials.Resource.Style.TextAppearance_Compat_Notification_Time = global::Bit.Droid.Resource.Style.TextAppearance_Compat_Notification_Time;
|
||||
global::Xamarin.Essentials.Resource.Style.TextAppearance_Compat_Notification_Title = global::Bit.Droid.Resource.Style.TextAppearance_Compat_Notification_Title;
|
||||
global::Xamarin.Essentials.Resource.Style.Widget_Compat_NotificationActionContainer = global::Bit.Droid.Resource.Style.Widget_Compat_NotificationActionContainer;
|
||||
global::Xamarin.Essentials.Resource.Style.Widget_Compat_NotificationActionText = global::Bit.Droid.Resource.Style.Widget_Compat_NotificationActionText;
|
||||
global::Xamarin.Essentials.Resource.Style.Widget_Support_CoordinatorLayout = global::Bit.Droid.Resource.Style.Widget_Support_CoordinatorLayout;
|
||||
global::Xamarin.Essentials.Resource.Xml.xamarin_essentials_fileprovider_file_paths = global::Bit.Droid.Resource.Xml.xamarin_essentials_fileprovider_file_paths;
|
||||
global::Xamarin.Essentials.Resource.Styleable.ColorStateListItem = global::Bit.Droid.Resource.Styleable.ColorStateListItem;
|
||||
global::Xamarin.Essentials.Resource.Styleable.ColorStateListItem_alpha = global::Bit.Droid.Resource.Styleable.ColorStateListItem_alpha;
|
||||
global::Xamarin.Essentials.Resource.Styleable.ColorStateListItem_android_alpha = global::Bit.Droid.Resource.Styleable.ColorStateListItem_android_alpha;
|
||||
global::Xamarin.Essentials.Resource.Styleable.ColorStateListItem_android_color = global::Bit.Droid.Resource.Styleable.ColorStateListItem_android_color;
|
||||
global::Xamarin.Essentials.Resource.Styleable.CoordinatorLayout = global::Bit.Droid.Resource.Styleable.CoordinatorLayout;
|
||||
global::Xamarin.Essentials.Resource.Styleable.CoordinatorLayout_keylines = global::Bit.Droid.Resource.Styleable.CoordinatorLayout_keylines;
|
||||
global::Xamarin.Essentials.Resource.Styleable.CoordinatorLayout_statusBarBackground = global::Bit.Droid.Resource.Styleable.CoordinatorLayout_statusBarBackground;
|
||||
global::Xamarin.Essentials.Resource.Styleable.CoordinatorLayout_Layout = global::Bit.Droid.Resource.Styleable.CoordinatorLayout_Layout;
|
||||
global::Xamarin.Essentials.Resource.Styleable.CoordinatorLayout_Layout_android_layout_gravity = global::Bit.Droid.Resource.Styleable.CoordinatorLayout_Layout_android_layout_gravity;
|
||||
global::Xamarin.Essentials.Resource.Styleable.CoordinatorLayout_Layout_layout_anchor = global::Bit.Droid.Resource.Styleable.CoordinatorLayout_Layout_layout_anchor;
|
||||
global::Xamarin.Essentials.Resource.Styleable.CoordinatorLayout_Layout_layout_anchorGravity = global::Bit.Droid.Resource.Styleable.CoordinatorLayout_Layout_layout_anchorGravity;
|
||||
global::Xamarin.Essentials.Resource.Styleable.CoordinatorLayout_Layout_layout_behavior = global::Bit.Droid.Resource.Styleable.CoordinatorLayout_Layout_layout_behavior;
|
||||
global::Xamarin.Essentials.Resource.Styleable.CoordinatorLayout_Layout_layout_dodgeInsetEdges = global::Bit.Droid.Resource.Styleable.CoordinatorLayout_Layout_layout_dodgeInsetEdges;
|
||||
global::Xamarin.Essentials.Resource.Styleable.CoordinatorLayout_Layout_layout_insetEdge = global::Bit.Droid.Resource.Styleable.CoordinatorLayout_Layout_layout_insetEdge;
|
||||
global::Xamarin.Essentials.Resource.Styleable.CoordinatorLayout_Layout_layout_keyline = global::Bit.Droid.Resource.Styleable.CoordinatorLayout_Layout_layout_keyline;
|
||||
global::Xamarin.Essentials.Resource.Styleable.FontFamily = global::Bit.Droid.Resource.Styleable.FontFamily;
|
||||
global::Xamarin.Essentials.Resource.Styleable.FontFamily_fontProviderAuthority = global::Bit.Droid.Resource.Styleable.FontFamily_fontProviderAuthority;
|
||||
global::Xamarin.Essentials.Resource.Styleable.FontFamily_fontProviderCerts = global::Bit.Droid.Resource.Styleable.FontFamily_fontProviderCerts;
|
||||
global::Xamarin.Essentials.Resource.Styleable.FontFamily_fontProviderFetchStrategy = global::Bit.Droid.Resource.Styleable.FontFamily_fontProviderFetchStrategy;
|
||||
global::Xamarin.Essentials.Resource.Styleable.FontFamily_fontProviderFetchTimeout = global::Bit.Droid.Resource.Styleable.FontFamily_fontProviderFetchTimeout;
|
||||
global::Xamarin.Essentials.Resource.Styleable.FontFamily_fontProviderPackage = global::Bit.Droid.Resource.Styleable.FontFamily_fontProviderPackage;
|
||||
global::Xamarin.Essentials.Resource.Styleable.FontFamily_fontProviderQuery = global::Bit.Droid.Resource.Styleable.FontFamily_fontProviderQuery;
|
||||
global::Xamarin.Essentials.Resource.Styleable.FontFamilyFont = global::Bit.Droid.Resource.Styleable.FontFamilyFont;
|
||||
global::Xamarin.Essentials.Resource.Styleable.FontFamilyFont_android_font = global::Bit.Droid.Resource.Styleable.FontFamilyFont_android_font;
|
||||
global::Xamarin.Essentials.Resource.Styleable.FontFamilyFont_android_fontStyle = global::Bit.Droid.Resource.Styleable.FontFamilyFont_android_fontStyle;
|
||||
global::Xamarin.Essentials.Resource.Styleable.FontFamilyFont_android_fontVariationSettings = global::Bit.Droid.Resource.Styleable.FontFamilyFont_android_fontVariationSettings;
|
||||
global::Xamarin.Essentials.Resource.Styleable.FontFamilyFont_android_fontWeight = global::Bit.Droid.Resource.Styleable.FontFamilyFont_android_fontWeight;
|
||||
global::Xamarin.Essentials.Resource.Styleable.FontFamilyFont_android_ttcIndex = global::Bit.Droid.Resource.Styleable.FontFamilyFont_android_ttcIndex;
|
||||
global::Xamarin.Essentials.Resource.Styleable.FontFamilyFont_font = global::Bit.Droid.Resource.Styleable.FontFamilyFont_font;
|
||||
global::Xamarin.Essentials.Resource.Styleable.FontFamilyFont_fontStyle = global::Bit.Droid.Resource.Styleable.FontFamilyFont_fontStyle;
|
||||
global::Xamarin.Essentials.Resource.Styleable.FontFamilyFont_fontVariationSettings = global::Bit.Droid.Resource.Styleable.FontFamilyFont_fontVariationSettings;
|
||||
global::Xamarin.Essentials.Resource.Styleable.FontFamilyFont_fontWeight = global::Bit.Droid.Resource.Styleable.FontFamilyFont_fontWeight;
|
||||
global::Xamarin.Essentials.Resource.Styleable.FontFamilyFont_ttcIndex = global::Bit.Droid.Resource.Styleable.FontFamilyFont_ttcIndex;
|
||||
global::Xamarin.Essentials.Resource.Styleable.GradientColor = global::Bit.Droid.Resource.Styleable.GradientColor;
|
||||
global::Xamarin.Essentials.Resource.Styleable.GradientColor_android_centerColor = global::Bit.Droid.Resource.Styleable.GradientColor_android_centerColor;
|
||||
global::Xamarin.Essentials.Resource.Styleable.GradientColor_android_centerX = global::Bit.Droid.Resource.Styleable.GradientColor_android_centerX;
|
||||
global::Xamarin.Essentials.Resource.Styleable.GradientColor_android_centerY = global::Bit.Droid.Resource.Styleable.GradientColor_android_centerY;
|
||||
global::Xamarin.Essentials.Resource.Styleable.GradientColor_android_endColor = global::Bit.Droid.Resource.Styleable.GradientColor_android_endColor;
|
||||
global::Xamarin.Essentials.Resource.Styleable.GradientColor_android_endX = global::Bit.Droid.Resource.Styleable.GradientColor_android_endX;
|
||||
global::Xamarin.Essentials.Resource.Styleable.GradientColor_android_endY = global::Bit.Droid.Resource.Styleable.GradientColor_android_endY;
|
||||
global::Xamarin.Essentials.Resource.Styleable.GradientColor_android_gradientRadius = global::Bit.Droid.Resource.Styleable.GradientColor_android_gradientRadius;
|
||||
global::Xamarin.Essentials.Resource.Styleable.GradientColor_android_startColor = global::Bit.Droid.Resource.Styleable.GradientColor_android_startColor;
|
||||
global::Xamarin.Essentials.Resource.Styleable.GradientColor_android_startX = global::Bit.Droid.Resource.Styleable.GradientColor_android_startX;
|
||||
global::Xamarin.Essentials.Resource.Styleable.GradientColor_android_startY = global::Bit.Droid.Resource.Styleable.GradientColor_android_startY;
|
||||
global::Xamarin.Essentials.Resource.Styleable.GradientColor_android_tileMode = global::Bit.Droid.Resource.Styleable.GradientColor_android_tileMode;
|
||||
global::Xamarin.Essentials.Resource.Styleable.GradientColor_android_type = global::Bit.Droid.Resource.Styleable.GradientColor_android_type;
|
||||
global::Xamarin.Essentials.Resource.Styleable.GradientColorItem = global::Bit.Droid.Resource.Styleable.GradientColorItem;
|
||||
global::Xamarin.Essentials.Resource.Styleable.GradientColorItem_android_color = global::Bit.Droid.Resource.Styleable.GradientColorItem_android_color;
|
||||
global::Xamarin.Essentials.Resource.Styleable.GradientColorItem_android_offset = global::Bit.Droid.Resource.Styleable.GradientColorItem_android_offset;
|
||||
global::Xamarin.Forms.Platform.Android.Resource.Animation.abc_fade_in = global::Bit.Droid.Resource.Animation.abc_fade_in;
|
||||
global::Xamarin.Forms.Platform.Android.Resource.Animation.abc_fade_out = global::Bit.Droid.Resource.Animation.abc_fade_out;
|
||||
global::Xamarin.Forms.Platform.Android.Resource.Animation.abc_grow_fade_in_from_bottom = global::Bit.Droid.Resource.Animation.abc_grow_fade_in_from_bottom;
|
||||
|
@ -9336,6 +9518,9 @@ namespace Bit.Droid
|
|||
// aapt resource value: 0x7f080003
|
||||
public const int network_security_config = 2131230723;
|
||||
|
||||
// aapt resource value: 0x7f080004
|
||||
public const int xamarin_essentials_fileprovider_file_paths = 2131230724;
|
||||
|
||||
static Xml()
|
||||
{
|
||||
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
|
||||
|
|
11
src/Core/Abstractions/IStorageService.cs
Normal file
11
src/Core/Abstractions/IStorageService.cs
Normal file
|
@ -0,0 +1,11 @@
|
|||
using System.Threading.Tasks;
|
||||
|
||||
namespace Bit.Core.Abstractions
|
||||
{
|
||||
public interface IStorageService
|
||||
{
|
||||
Task<T> GetAsync<T>(string key);
|
||||
Task SaveAsync<T>(string key, T obj);
|
||||
Task RemoveAsync(string key);
|
||||
}
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
using System;
|
||||
|
||||
namespace Bit.Core
|
||||
{
|
||||
public class Class1
|
||||
{
|
||||
}
|
||||
}
|
|
@ -11,4 +11,10 @@
|
|||
<DebugSymbols>true</DebugSymbols>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="LiteDB" Version="4.1.4" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
|
||||
<PackageReference Include="Xamarin.Essentials" Version="1.1.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
56
src/Core/Services/LiteDbStorageService.cs
Normal file
56
src/Core/Services/LiteDbStorageService.cs
Normal file
|
@ -0,0 +1,56 @@
|
|||
using Bit.Core.Abstractions;
|
||||
using LiteDB;
|
||||
using Newtonsoft.Json;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Bit.Core.Services
|
||||
{
|
||||
public class LiteDbStorageService : IStorageService
|
||||
{
|
||||
private LiteCollection<JsonItem> _collection;
|
||||
|
||||
public LiteDbStorageService(string dbPath)
|
||||
{
|
||||
var db = new LiteDatabase($"filename={dbPath}");
|
||||
_collection = db.GetCollection<JsonItem>("json_items");
|
||||
}
|
||||
|
||||
public Task<T> GetAsync<T>(string key)
|
||||
{
|
||||
var item = _collection.Find(i => i.Id == key).FirstOrDefault();
|
||||
if(item == null)
|
||||
{
|
||||
return Task.FromResult(default(T));
|
||||
}
|
||||
return Task.FromResult(JsonConvert.DeserializeObject<T>(item.Value));
|
||||
}
|
||||
|
||||
public Task SaveAsync<T>(string key, T obj)
|
||||
{
|
||||
var data = JsonConvert.SerializeObject(obj);
|
||||
_collection.Upsert(new JsonItem(key, data));
|
||||
return Task.FromResult(0);
|
||||
}
|
||||
|
||||
public Task RemoveAsync(string key)
|
||||
{
|
||||
_collection.Delete(i => i.Id == key);
|
||||
return Task.FromResult(0);
|
||||
}
|
||||
|
||||
private class JsonItem
|
||||
{
|
||||
public JsonItem() { }
|
||||
|
||||
public JsonItem(string key, string value)
|
||||
{
|
||||
Id = key;
|
||||
Value = value;
|
||||
}
|
||||
|
||||
public string Id { get; set; }
|
||||
public string Value { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
95
src/Core/Services/PreferencesStorageService.cs
Normal file
95
src/Core/Services/PreferencesStorageService.cs
Normal file
|
@ -0,0 +1,95 @@
|
|||
using Bit.Core.Abstractions;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Bit.Core.Services
|
||||
{
|
||||
public class PreferencesStorageService : IStorageService
|
||||
{
|
||||
private string _keyFormat = "bwPref:{0}";
|
||||
|
||||
public Task<T> GetAsync<T>(string key)
|
||||
{
|
||||
var formattedKey = string.Format(_keyFormat, key);
|
||||
if(!Xamarin.Essentials.Preferences.ContainsKey(formattedKey))
|
||||
{
|
||||
return Task.FromResult(default(T));
|
||||
}
|
||||
|
||||
var objType = typeof(T);
|
||||
if(objType == typeof(string))
|
||||
{
|
||||
var val = Xamarin.Essentials.Preferences.Get(key, default(string));
|
||||
return Task.FromResult((T)(object)val);
|
||||
}
|
||||
else if(objType == typeof(int))
|
||||
{
|
||||
var val = Xamarin.Essentials.Preferences.Get(key, default(int));
|
||||
return Task.FromResult((T)Convert.ChangeType(val, objType));
|
||||
}
|
||||
else if(objType == typeof(long))
|
||||
{
|
||||
var val = Xamarin.Essentials.Preferences.Get(key, default(long));
|
||||
return Task.FromResult((T)Convert.ChangeType(val, objType));
|
||||
}
|
||||
else if(objType == typeof(double))
|
||||
{
|
||||
var val = Xamarin.Essentials.Preferences.Get(key, default(double));
|
||||
return Task.FromResult((T)Convert.ChangeType(val, objType));
|
||||
}
|
||||
else if(objType == typeof(DateTime))
|
||||
{
|
||||
var val = Xamarin.Essentials.Preferences.Get(key, default(DateTime));
|
||||
return Task.FromResult((T)Convert.ChangeType(val, objType));
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception("Unsupported object type for preferences.");
|
||||
}
|
||||
}
|
||||
|
||||
public Task SaveAsync<T>(string key, T obj)
|
||||
{
|
||||
if(obj == null)
|
||||
{
|
||||
return RemoveAsync(key);
|
||||
}
|
||||
|
||||
var objType = typeof(T);
|
||||
if(objType == typeof(string))
|
||||
{
|
||||
Xamarin.Essentials.Preferences.Set(key, obj as string);
|
||||
}
|
||||
else if(objType == typeof(int))
|
||||
{
|
||||
Xamarin.Essentials.Preferences.Set(key, (obj as int?).Value);
|
||||
}
|
||||
else if(objType == typeof(long))
|
||||
{
|
||||
Xamarin.Essentials.Preferences.Set(key, (obj as long?).Value);
|
||||
}
|
||||
else if(objType == typeof(double))
|
||||
{
|
||||
Xamarin.Essentials.Preferences.Set(key, (obj as double?).Value);
|
||||
}
|
||||
else if(objType == typeof(DateTime))
|
||||
{
|
||||
Xamarin.Essentials.Preferences.Set(key, (obj as DateTime?).Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception("Unsupported object type for preferences.");
|
||||
}
|
||||
return Task.FromResult(0);
|
||||
}
|
||||
|
||||
public Task RemoveAsync(string key)
|
||||
{
|
||||
if(Xamarin.Essentials.Preferences.ContainsKey(key))
|
||||
{
|
||||
Xamarin.Essentials.Preferences.Remove(key);
|
||||
}
|
||||
return Task.FromResult(0);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -11,7 +11,7 @@ namespace Bit.iOS
|
|||
// User Interface of the application, as well as listening (and optionally responding) to
|
||||
// application events from iOS.
|
||||
[Register("AppDelegate")]
|
||||
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
|
||||
public partial class AppDelegate : Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
|
||||
{
|
||||
//
|
||||
// This method is invoked when the application has loaded and is ready to run. In this
|
||||
|
@ -22,7 +22,7 @@ namespace Bit.iOS
|
|||
//
|
||||
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
|
||||
{
|
||||
global::Xamarin.Forms.Forms.Init();
|
||||
Xamarin.Forms.Forms.Init();
|
||||
LoadApplication(new App.App());
|
||||
|
||||
return base.FinishedLaunching(app, options);
|
||||
|
|
|
@ -149,6 +149,9 @@
|
|||
<Reference Include="Xamarin.iOS" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Xamarin.Essentials">
|
||||
<Version>1.1.0</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Xamarin.Forms" Version="3.6.0.264807" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
||||
|
@ -157,5 +160,9 @@
|
|||
<Project>{9F1742A7-7D03-4BB3-8FCD-41BC3002B00A}</Project>
|
||||
<Name>App</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Core\Core.csproj">
|
||||
<Project>{4b8a8c41-9820-4341-974c-41e65b7f4366}</Project>
|
||||
<Name>Core</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
Loading…
Reference in a new issue