From 3539d7389e8af03d38a3afda1ad33d16448a86ce Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 5 Apr 2019 16:13:17 -0400 Subject: [PATCH] cell buttons --- .../Renderers/BoxedView/Cells/BaseCellView.cs | 76 +++ src/Android/Resources/Resource.designer.cs | 452 +++++++++--------- .../Resources/layout/CellBaseView.axml | 26 +- src/App/Controls/BoxedView/Cells/BaseCell.cs | 91 ++++ src/App/Pages/SettingsPage.xaml | 13 +- src/App/Pages/SettingsPage.xaml.cs | 2 + src/App/Pages/SettingsPageViewModel.cs | 8 + 7 files changed, 445 insertions(+), 223 deletions(-) diff --git a/src/Android/Renderers/BoxedView/Cells/BaseCellView.cs b/src/Android/Renderers/BoxedView/Cells/BaseCellView.cs index d8972f4c5..aa2afc478 100644 --- a/src/Android/Renderers/BoxedView/Cells/BaseCellView.cs +++ b/src/Android/Renderers/BoxedView/Cells/BaseCellView.cs @@ -41,6 +41,10 @@ namespace Bit.Droid.Renderers.BoxedView public TextView CellTitle { get; set; } public LinearLayout CellTitleContent { get; set; } public LinearLayout CellContent { get; set; } + public LinearLayout CellButtonContent { get; set; } + public Android.Widget.ImageButton CellButton1 { get; set; } + public Android.Widget.ImageButton CellButton2 { get; set; } + public Android.Widget.ImageButton CellButton3 { get; set; } public LinearLayout CellAccessory { get; set; } private void CreateContentView() @@ -54,6 +58,13 @@ namespace Bit.Droid.Renderers.BoxedView CellTitle = contentView.FindViewById(Resource.Id.CellTitle); CellContent = contentView.FindViewById(Resource.Id.CellContent); CellTitleContent = contentView.FindViewById(Resource.Id.CellTitleContent); + CellButtonContent = contentView.FindViewById(Resource.Id.CellButtonContent); + CellButton1 = contentView.FindViewById(Resource.Id.CellButton1); + CellButton1.Click += CellButton1_Click; + CellButton2 = contentView.FindViewById(Resource.Id.CellButton2); + CellButton2.Click += CellButton2_Click; + CellButton3 = contentView.FindViewById(Resource.Id.CellButton3); + CellButton3.Click += CellButton3_Click; CellAccessory = contentView.FindViewById(Resource.Id.CellAccessory); _backgroundColor = new ColorDrawable(); @@ -100,6 +111,18 @@ namespace Bit.Droid.Renderers.BoxedView { UpdateIsEnabled(); } + else if(e.PropertyName == BaseCell.Button1IconProperty.PropertyName) + { + UpdateButtonIcon(CellButton1, CellBase.Button1Icon); + } + else if(e.PropertyName == BaseCell.Button2IconProperty.PropertyName) + { + UpdateButtonIcon(CellButton2, CellBase.Button2Icon); + } + else if(e.PropertyName == BaseCell.Button3IconProperty.PropertyName) + { + UpdateButtonIcon(CellButton3, CellBase.Button3Icon); + } } public virtual void ParentPropertyChanged(object sender, PropertyChangedEventArgs e) @@ -142,6 +165,9 @@ namespace Bit.Droid.Renderers.BoxedView public virtual void UpdateCell() { + UpdateButtonIcon(CellButton1, CellBase.Button1Icon); + UpdateButtonIcon(CellButton2, CellBase.Button2Icon); + UpdateButtonIcon(CellButton3, CellBase.Button3Icon); UpdateBackgroundColor(); UpdateSelectedColor(); UpdateTitleText(); @@ -153,6 +179,43 @@ namespace Bit.Droid.Renderers.BoxedView Invalidate(); } + private void UpdateButtonIcon(Android.Widget.ImageButton cellButton, string icon) + { + if(string.IsNullOrWhiteSpace(icon)) + { + cellButton.Visibility = ViewStates.Gone; + } + else + { + cellButton.Background = _Context.GetDrawable(icon); + cellButton.Visibility = ViewStates.Visible; + } + } + + private void CellButton1_Click(object sender, EventArgs e) + { + if(CellBase.Button1Command?.CanExecute(CellBase.Button1CommandParameter) ?? false) + { + CellBase.Button1Command.Execute(CellBase.Button1CommandParameter); + } + } + + private void CellButton2_Click(object sender, EventArgs e) + { + if(CellBase.Button2Command?.CanExecute(CellBase.Button2CommandParameter) ?? false) + { + CellBase.Button2Command.Execute(CellBase.Button2CommandParameter); + } + } + + private void CellButton3_Click(object sender, EventArgs e) + { + if(CellBase.Button3Command?.CanExecute(CellBase.Button3CommandParameter) ?? false) + { + CellBase.Button3Command.Execute(CellBase.Button3CommandParameter); + } + } + private void UpdateBackgroundColor() { Selected = false; @@ -252,6 +315,9 @@ namespace Bit.Droid.Renderers.BoxedView { CellBase.PropertyChanged -= CellPropertyChanged; CellParent.PropertyChanged -= ParentPropertyChanged; + CellButton1.Click -= CellButton1_Click; + CellButton2.Click -= CellButton2_Click; + CellButton3.Click -= CellButton3_Click; if(CellBase.Section != null) { @@ -265,6 +331,16 @@ namespace Bit.Droid.Renderers.BoxedView CellTitleContent = null; CellAccessory?.Dispose(); CellAccessory = null; + CellButton1?.Dispose(); + CellButton1 = null; + CellButton2?.Dispose(); + CellButton2 = null; + CellButton3?.Dispose(); + CellButton3 = null; + CellButtonContent?.Dispose(); + CellButtonContent = null; + CellContent?.Dispose(); + CellContent = null; Cell = null; _iconTokenSource?.Dispose(); diff --git a/src/Android/Resources/Resource.designer.cs b/src/Android/Resources/Resource.designer.cs index 7fe112f18..657cba3df 100644 --- a/src/Android/Resources/Resource.designer.cs +++ b/src/Android/Resources/Resource.designer.cs @@ -6534,8 +6534,20 @@ namespace Bit.Droid // aapt resource value: 0x7f0a003a public const int CTRL = 2131361850; + // aapt resource value: 0x7f0a00ac + public const int CellAccessory = 2131361964; + + // aapt resource value: 0x7f0a00a9 + public const int CellButton1 = 2131361961; + + // aapt resource value: 0x7f0a00aa + public const int CellButton2 = 2131361962; + + // aapt resource value: 0x7f0a00ab + public const int CellButton3 = 2131361963; + // aapt resource value: 0x7f0a00a8 - public const int CellAccessory = 2131361960; + public const int CellButtonContent = 2131361960; // aapt resource value: 0x7f0a00a5 public const int CellContent = 2131361957; @@ -6546,23 +6558,23 @@ namespace Bit.Droid // aapt resource value: 0x7f0a00a6 public const int CellTitleContent = 2131361958; - // aapt resource value: 0x7f0a00a9 - public const int ContentCellBody = 2131361961; + // aapt resource value: 0x7f0a00ad + public const int ContentCellBody = 2131361965; - // aapt resource value: 0x7f0a00aa - public const int ContentCellBorder = 2131361962; + // aapt resource value: 0x7f0a00ae + public const int ContentCellBorder = 2131361966; // aapt resource value: 0x7f0a003b public const int FUNCTION = 2131361851; - // aapt resource value: 0x7f0a00b9 - public const int FooterCellText = 2131361977; + // aapt resource value: 0x7f0a00bd + public const int FooterCellText = 2131361981; - // aapt resource value: 0x7f0a00bb - public const int HeaderCellBorder = 2131361979; + // aapt resource value: 0x7f0a00bf + public const int HeaderCellBorder = 2131361983; - // aapt resource value: 0x7f0a00ba - public const int HeaderCellText = 2131361978; + // aapt resource value: 0x7f0a00be + public const int HeaderCellText = 2131361982; // aapt resource value: 0x7f0a003c public const int META = 2131361852; @@ -6573,8 +6585,8 @@ namespace Bit.Droid // aapt resource value: 0x7f0a003e public const int SYM = 2131361854; - // aapt resource value: 0x7f0a00ee - public const int action0 = 2131362030; + // aapt resource value: 0x7f0a00f2 + public const int action0 = 2131362034; // aapt resource value: 0x7f0a008d public const int action_bar = 2131361933; @@ -6597,17 +6609,17 @@ namespace Bit.Droid // aapt resource value: 0x7f0a0069 public const int action_bar_title = 2131361897; - // aapt resource value: 0x7f0a00eb - public const int action_container = 2131362027; + // aapt resource value: 0x7f0a00ef + public const int action_container = 2131362031; // aapt resource value: 0x7f0a008e public const int action_context_bar = 2131361934; - // aapt resource value: 0x7f0a00f2 - public const int action_divider = 2131362034; + // aapt resource value: 0x7f0a00f6 + public const int action_divider = 2131362038; - // aapt resource value: 0x7f0a00ec - public const int action_image = 2131362028; + // aapt resource value: 0x7f0a00f0 + public const int action_image = 2131362032; // aapt resource value: 0x7f0a0003 public const int action_menu_divider = 2131361795; @@ -6624,11 +6636,11 @@ namespace Bit.Droid // aapt resource value: 0x7f0a006b public const int action_mode_close_button = 2131361899; - // aapt resource value: 0x7f0a00ed - public const int action_text = 2131362029; + // aapt resource value: 0x7f0a00f1 + public const int action_text = 2131362033; - // aapt resource value: 0x7f0a00fb - public const int actions = 2131362043; + // aapt resource value: 0x7f0a00ff + public const int actions = 2131362047; // aapt resource value: 0x7f0a006c public const int activity_chooser_view_content = 2131361900; @@ -6684,8 +6696,8 @@ namespace Bit.Droid // aapt resource value: 0x7f0a0072 public const int buttonPanel = 2131361906; - // aapt resource value: 0x7f0a00ef - public const int cancel_action = 2131362031; + // aapt resource value: 0x7f0a00f3 + public const int cancel_action = 2131362035; // aapt resource value: 0x7f0a004c public const int center = 2131361868; @@ -6699,8 +6711,8 @@ namespace Bit.Droid // aapt resource value: 0x7f0a0086 public const int checkbox = 2131361926; - // aapt resource value: 0x7f0a00f7 - public const int chronometer = 2131362039; + // aapt resource value: 0x7f0a00fb + public const int chronometer = 2131362043; // aapt resource value: 0x7f0a0061 public const int clip_horizontal = 2131361889; @@ -6711,8 +6723,8 @@ namespace Bit.Droid // aapt resource value: 0x7f0a0040 public const int collapseActionView = 2131361856; - // aapt resource value: 0x7f0a00ad - public const int container = 2131361965; + // aapt resource value: 0x7f0a00b1 + public const int container = 2131361969; // aapt resource value: 0x7f0a0082 public const int content = 2131361922; @@ -6720,8 +6732,8 @@ namespace Bit.Droid // aapt resource value: 0x7f0a0075 public const int contentPanel = 2131361909; - // aapt resource value: 0x7f0a00ae - public const int coordinator = 2131361966; + // aapt resource value: 0x7f0a00b2 + public const int coordinator = 2131361970; // aapt resource value: 0x7f0a007c public const int custom = 2131361916; @@ -6735,20 +6747,20 @@ namespace Bit.Droid // aapt resource value: 0x7f0a006f public const int default_activity_button = 2131361903; - // aapt resource value: 0x7f0a00b0 - public const int design_bottom_sheet = 2131361968; - - // aapt resource value: 0x7f0a00b5 - public const int design_menu_item_action_area = 2131361973; - // aapt resource value: 0x7f0a00b4 - public const int design_menu_item_action_area_stub = 2131361972; + public const int design_bottom_sheet = 2131361972; - // aapt resource value: 0x7f0a00b3 - public const int design_menu_item_text = 2131361971; + // aapt resource value: 0x7f0a00b9 + public const int design_menu_item_action_area = 2131361977; - // aapt resource value: 0x7f0a00b2 - public const int design_navigation_view = 2131361970; + // aapt resource value: 0x7f0a00b8 + public const int design_menu_item_action_area_stub = 2131361976; + + // aapt resource value: 0x7f0a00b7 + public const int design_menu_item_text = 2131361975; + + // aapt resource value: 0x7f0a00b6 + public const int design_navigation_view = 2131361974; // aapt resource value: 0x7f0a0027 public const int disableHome = 2131361831; @@ -6759,8 +6771,8 @@ namespace Bit.Droid // aapt resource value: 0x7f0a0037 public const int end = 2131361847; - // aapt resource value: 0x7f0a00fd - public const int end_padder = 2131362045; + // aapt resource value: 0x7f0a0101 + public const int end_padder = 2131362049; // aapt resource value: 0x7f0a0046 public const int enterAlways = 2131361862; @@ -6792,11 +6804,11 @@ namespace Bit.Droid // aapt resource value: 0x7f0a005c public const int @fixed = 2131361884; - // aapt resource value: 0x7f0a00b7 - public const int flyoutcontent_appbar = 2131361975; + // aapt resource value: 0x7f0a00bb + public const int flyoutcontent_appbar = 2131361979; - // aapt resource value: 0x7f0a00b8 - public const int flyoutcontent_recycler = 2131361976; + // aapt resource value: 0x7f0a00bc + public const int flyoutcontent_recycler = 2131361980; // aapt resource value: 0x7f0a0067 public const int forever = 2131361895; @@ -6816,8 +6828,8 @@ namespace Bit.Droid // aapt resource value: 0x7f0a0071 public const int icon = 2131361905; - // aapt resource value: 0x7f0a00fc - public const int icon_group = 2131362044; + // aapt resource value: 0x7f0a0100 + public const int icon_group = 2131362048; // aapt resource value: 0x7f0a0041 public const int ifRoom = 2131361857; @@ -6825,8 +6837,8 @@ namespace Bit.Droid // aapt resource value: 0x7f0a006e public const int image = 2131361902; - // aapt resource value: 0x7f0a00f8 - public const int info = 2131362040; + // aapt resource value: 0x7f0a00fc + public const int info = 2131362044; // aapt resource value: 0x7f0a0068 public const int italic = 2131361896; @@ -6837,8 +6849,8 @@ namespace Bit.Droid // aapt resource value: 0x7f0a004e public const int labeled = 2131361870; - // aapt resource value: 0x7f0a00ac - public const int largeLabel = 2131361964; + // aapt resource value: 0x7f0a00b0 + public const int largeLabel = 2131361968; // aapt resource value: 0x7f0a0054 public const int left = 2131361876; @@ -6855,23 +6867,23 @@ namespace Bit.Droid // aapt resource value: 0x7f0a0070 public const int list_item = 2131361904; - // aapt resource value: 0x7f0a00fe - public const int main_appbar = 2131362046; + // aapt resource value: 0x7f0a0102 + public const int main_appbar = 2131362050; - // aapt resource value: 0x7f0a0101 - public const int main_scrollview = 2131362049; + // aapt resource value: 0x7f0a0105 + public const int main_scrollview = 2131362053; - // aapt resource value: 0x7f0a0100 - public const int main_tablayout = 2131362048; + // aapt resource value: 0x7f0a0104 + public const int main_tablayout = 2131362052; - // aapt resource value: 0x7f0a00ff - public const int main_toolbar = 2131362047; + // aapt resource value: 0x7f0a0103 + public const int main_toolbar = 2131362051; - // aapt resource value: 0x7f0a0108 - public const int masked = 2131362056; + // aapt resource value: 0x7f0a010c + public const int masked = 2131362060; - // aapt resource value: 0x7f0a00f1 - public const int media_actions = 2131362033; + // aapt resource value: 0x7f0a00f5 + public const int media_actions = 2131362037; // aapt resource value: 0x7f0a009c public const int message = 2131361948; @@ -6882,143 +6894,143 @@ namespace Bit.Droid // aapt resource value: 0x7f0a0059 public const int mini = 2131361881; - // aapt resource value: 0x7f0a00d8 - public const int mr_art = 2131362008; - - // aapt resource value: 0x7f0a00c9 - public const int mr_cast_checkbox = 2131361993; - - // aapt resource value: 0x7f0a00c2 - public const int mr_cast_close_button = 2131361986; - - // aapt resource value: 0x7f0a00bd - public const int mr_cast_group_icon = 2131361981; - - // aapt resource value: 0x7f0a00be - public const int mr_cast_group_name = 2131361982; - - // aapt resource value: 0x7f0a00bc - public const int mr_cast_list = 2131361980; - - // aapt resource value: 0x7f0a00c1 - public const int mr_cast_meta = 2131361985; - - // aapt resource value: 0x7f0a00c3 - public const int mr_cast_meta_art = 2131361987; - - // aapt resource value: 0x7f0a00c5 - public const int mr_cast_meta_subtitle = 2131361989; - - // aapt resource value: 0x7f0a00c4 - public const int mr_cast_meta_title = 2131361988; - - // aapt resource value: 0x7f0a00c7 - public const int mr_cast_route_icon = 2131361991; - - // aapt resource value: 0x7f0a00c8 - public const int mr_cast_route_name = 2131361992; - - // aapt resource value: 0x7f0a00c6 - public const int mr_cast_stop_button = 2131361990; - - // aapt resource value: 0x7f0a00ca - public const int mr_cast_volume_layout = 2131361994; - - // aapt resource value: 0x7f0a00cb - public const int mr_cast_volume_slider = 2131361995; + // aapt resource value: 0x7f0a00dc + public const int mr_art = 2131362012; // aapt resource value: 0x7f0a00cd - public const int mr_chooser_list = 2131361997; + public const int mr_cast_checkbox = 2131361997; - // aapt resource value: 0x7f0a00d0 - public const int mr_chooser_route_desc = 2131362000; + // aapt resource value: 0x7f0a00c6 + public const int mr_cast_close_button = 2131361990; - // aapt resource value: 0x7f0a00ce - public const int mr_chooser_route_icon = 2131361998; + // aapt resource value: 0x7f0a00c1 + public const int mr_cast_group_icon = 2131361985; - // aapt resource value: 0x7f0a00cf - public const int mr_chooser_route_name = 2131361999; - - // aapt resource value: 0x7f0a00cc - public const int mr_chooser_title = 2131361996; - - // aapt resource value: 0x7f0a00d5 - public const int mr_close = 2131362005; - - // aapt resource value: 0x7f0a00db - public const int mr_control_divider = 2131362011; - - // aapt resource value: 0x7f0a00e6 - public const int mr_control_playback_ctrl = 2131362022; - - // aapt resource value: 0x7f0a00e9 - public const int mr_control_subtitle = 2131362025; - - // aapt resource value: 0x7f0a00e8 - public const int mr_control_title = 2131362024; - - // aapt resource value: 0x7f0a00e7 - public const int mr_control_title_container = 2131362023; - - // aapt resource value: 0x7f0a00d6 - public const int mr_custom_control = 2131362006; - - // aapt resource value: 0x7f0a00d7 - public const int mr_default_control = 2131362007; - - // aapt resource value: 0x7f0a00d2 - public const int mr_dialog_area = 2131362002; - - // aapt resource value: 0x7f0a00e1 - public const int mr_dialog_header_name = 2131362017; - - // aapt resource value: 0x7f0a00d1 - public const int mr_expandable_area = 2131362001; - - // aapt resource value: 0x7f0a00ea - public const int mr_group_expand_collapse = 2131362026; - - // aapt resource value: 0x7f0a00bf - public const int mr_group_volume_route_name = 2131361983; + // aapt resource value: 0x7f0a00c2 + public const int mr_cast_group_name = 2131361986; // aapt resource value: 0x7f0a00c0 - public const int mr_group_volume_slider = 2131361984; + public const int mr_cast_list = 2131361984; - // aapt resource value: 0x7f0a00d9 - public const int mr_media_main_control = 2131362009; + // aapt resource value: 0x7f0a00c5 + public const int mr_cast_meta = 2131361989; + + // aapt resource value: 0x7f0a00c7 + public const int mr_cast_meta_art = 2131361991; + + // aapt resource value: 0x7f0a00c9 + public const int mr_cast_meta_subtitle = 2131361993; + + // aapt resource value: 0x7f0a00c8 + public const int mr_cast_meta_title = 2131361992; + + // aapt resource value: 0x7f0a00cb + public const int mr_cast_route_icon = 2131361995; + + // aapt resource value: 0x7f0a00cc + public const int mr_cast_route_name = 2131361996; + + // aapt resource value: 0x7f0a00ca + public const int mr_cast_stop_button = 2131361994; + + // aapt resource value: 0x7f0a00ce + public const int mr_cast_volume_layout = 2131361998; + + // aapt resource value: 0x7f0a00cf + public const int mr_cast_volume_slider = 2131361999; + + // aapt resource value: 0x7f0a00d1 + public const int mr_chooser_list = 2131362001; // aapt resource value: 0x7f0a00d4 - public const int mr_name = 2131362004; + public const int mr_chooser_route_desc = 2131362004; - // aapt resource value: 0x7f0a00e2 - public const int mr_picker_close_button = 2131362018; - - // aapt resource value: 0x7f0a00e3 - public const int mr_picker_list = 2131362019; - - // aapt resource value: 0x7f0a00e4 - public const int mr_picker_route_icon = 2131362020; - - // aapt resource value: 0x7f0a00e5 - public const int mr_picker_route_name = 2131362021; - - // aapt resource value: 0x7f0a00da - public const int mr_playback_control = 2131362010; + // aapt resource value: 0x7f0a00d2 + public const int mr_chooser_route_icon = 2131362002; // aapt resource value: 0x7f0a00d3 - public const int mr_title_bar = 2131362003; + public const int mr_chooser_route_name = 2131362003; - // aapt resource value: 0x7f0a00dc - public const int mr_volume_control = 2131362012; + // aapt resource value: 0x7f0a00d0 + public const int mr_chooser_title = 2131362000; - // aapt resource value: 0x7f0a00dd - public const int mr_volume_group_list = 2131362013; + // aapt resource value: 0x7f0a00d9 + public const int mr_close = 2131362009; // aapt resource value: 0x7f0a00df - public const int mr_volume_item_icon = 2131362015; + public const int mr_control_divider = 2131362015; + + // aapt resource value: 0x7f0a00ea + public const int mr_control_playback_ctrl = 2131362026; + + // aapt resource value: 0x7f0a00ed + public const int mr_control_subtitle = 2131362029; + + // aapt resource value: 0x7f0a00ec + public const int mr_control_title = 2131362028; + + // aapt resource value: 0x7f0a00eb + public const int mr_control_title_container = 2131362027; + + // aapt resource value: 0x7f0a00da + public const int mr_custom_control = 2131362010; + + // aapt resource value: 0x7f0a00db + public const int mr_default_control = 2131362011; + + // aapt resource value: 0x7f0a00d6 + public const int mr_dialog_area = 2131362006; + + // aapt resource value: 0x7f0a00e5 + public const int mr_dialog_header_name = 2131362021; + + // aapt resource value: 0x7f0a00d5 + public const int mr_expandable_area = 2131362005; + + // aapt resource value: 0x7f0a00ee + public const int mr_group_expand_collapse = 2131362030; + + // aapt resource value: 0x7f0a00c3 + public const int mr_group_volume_route_name = 2131361987; + + // aapt resource value: 0x7f0a00c4 + public const int mr_group_volume_slider = 2131361988; + + // aapt resource value: 0x7f0a00dd + public const int mr_media_main_control = 2131362013; + + // aapt resource value: 0x7f0a00d8 + public const int mr_name = 2131362008; + + // aapt resource value: 0x7f0a00e6 + public const int mr_picker_close_button = 2131362022; + + // aapt resource value: 0x7f0a00e7 + public const int mr_picker_list = 2131362023; + + // aapt resource value: 0x7f0a00e8 + public const int mr_picker_route_icon = 2131362024; + + // aapt resource value: 0x7f0a00e9 + public const int mr_picker_route_name = 2131362025; + + // aapt resource value: 0x7f0a00de + public const int mr_playback_control = 2131362014; + + // aapt resource value: 0x7f0a00d7 + public const int mr_title_bar = 2131362007; // aapt resource value: 0x7f0a00e0 - public const int mr_volume_slider = 2131362016; + public const int mr_volume_control = 2131362016; + + // aapt resource value: 0x7f0a00e1 + public const int mr_volume_group_list = 2131362017; + + // aapt resource value: 0x7f0a00e3 + public const int mr_volume_item_icon = 2131362019; + + // aapt resource value: 0x7f0a00e4 + public const int mr_volume_slider = 2131362020; // aapt resource value: 0x7f0a0014 public const int mtrl_child_content_container = 2131361812; @@ -7029,8 +7041,8 @@ namespace Bit.Droid // aapt resource value: 0x7f0a002f public const int multiply = 2131361839; - // aapt resource value: 0x7f0a00b1 - public const int navigation_header_container = 2131361969; + // aapt resource value: 0x7f0a00b5 + public const int navigation_header_container = 2131361973; // aapt resource value: 0x7f0a0042 public const int never = 2131361858; @@ -7041,14 +7053,14 @@ namespace Bit.Droid // aapt resource value: 0x7f0a0025 public const int normal = 2131361829; - // aapt resource value: 0x7f0a00fa - public const int notification_background = 2131362042; + // aapt resource value: 0x7f0a00fe + public const int notification_background = 2131362046; - // aapt resource value: 0x7f0a00f4 - public const int notification_main_column = 2131362036; + // aapt resource value: 0x7f0a00f8 + public const int notification_main_column = 2131362040; - // aapt resource value: 0x7f0a00f3 - public const int notification_main_column_container = 2131362035; + // aapt resource value: 0x7f0a00f7 + public const int notification_main_column_container = 2131362039; // aapt resource value: 0x7f0a0060 public const int outline = 2131361888; @@ -7077,11 +7089,11 @@ namespace Bit.Droid // aapt resource value: 0x7f0a0055 public const int right = 2131361877; - // aapt resource value: 0x7f0a00f9 - public const int right_icon = 2131362041; + // aapt resource value: 0x7f0a00fd + public const int right_icon = 2131362045; - // aapt resource value: 0x7f0a00f5 - public const int right_side = 2131362037; + // aapt resource value: 0x7f0a00f9 + public const int right_side = 2131362041; // aapt resource value: 0x7f0a000c public const int save_image_matrix = 2131361804; @@ -7146,14 +7158,14 @@ namespace Bit.Droid // aapt resource value: 0x7f0a004f public const int selected = 2131361871; - // aapt resource value: 0x7f0a0102 - public const int shellcontent_appbar = 2131362050; + // aapt resource value: 0x7f0a0106 + public const int shellcontent_appbar = 2131362054; - // aapt resource value: 0x7f0a0104 - public const int shellcontent_scrollview = 2131362052; + // aapt resource value: 0x7f0a0108 + public const int shellcontent_scrollview = 2131362056; - // aapt resource value: 0x7f0a0103 - public const int shellcontent_toolbar = 2131362051; + // aapt resource value: 0x7f0a0107 + public const int shellcontent_toolbar = 2131362055; // aapt resource value: 0x7f0a0083 public const int shortcut = 2131361923; @@ -7167,11 +7179,11 @@ namespace Bit.Droid // aapt resource value: 0x7f0a002c public const int showTitle = 2131361836; - // aapt resource value: 0x7f0a0105 - public const int sliding_tabs = 2131362053; + // aapt resource value: 0x7f0a0109 + public const int sliding_tabs = 2131362057; - // aapt resource value: 0x7f0a00ab - public const int smallLabel = 2131361963; + // aapt resource value: 0x7f0a00af + public const int smallLabel = 2131361967; // aapt resource value: 0x7f0a0016 public const int snackbar_action = 2131361814; @@ -7203,8 +7215,8 @@ namespace Bit.Droid // aapt resource value: 0x7f0a0056 public const int start = 2131361878; - // aapt resource value: 0x7f0a00f0 - public const int status_bar_latest_event_content = 2131362032; + // aapt resource value: 0x7f0a00f4 + public const int status_bar_latest_event_content = 2131362036; // aapt resource value: 0x7f0a005b public const int stretch = 2131361883; @@ -7245,8 +7257,8 @@ namespace Bit.Droid // aapt resource value: 0x7f0a005a public const int textStart = 2131361882; - // aapt resource value: 0x7f0a00b6 - public const int text_input_password_toggle = 2131361974; + // aapt resource value: 0x7f0a00ba + public const int text_input_password_toggle = 2131361978; // aapt resource value: 0x7f0a0018 public const int textinput_counter = 2131361816; @@ -7257,8 +7269,8 @@ namespace Bit.Droid // aapt resource value: 0x7f0a001a public const int textinput_helper_text = 2131361818; - // aapt resource value: 0x7f0a00f6 - public const int time = 2131362038; + // aapt resource value: 0x7f0a00fa + public const int time = 2131362042; // aapt resource value: 0x7f0a0023 public const int title = 2131361827; @@ -7269,8 +7281,8 @@ namespace Bit.Droid // aapt resource value: 0x7f0a007e public const int title_template = 2131361918; - // aapt resource value: 0x7f0a0106 - public const int toolbar = 2131362054; + // aapt resource value: 0x7f0a010a + public const int toolbar = 2131362058; // aapt resource value: 0x7f0a0045 public const int top = 2131361861; @@ -7278,8 +7290,8 @@ namespace Bit.Droid // aapt resource value: 0x7f0a007d public const int topPanel = 2131361917; - // aapt resource value: 0x7f0a00af - public const int touch_outside = 2131361967; + // aapt resource value: 0x7f0a00b3 + public const int touch_outside = 2131361971; // aapt resource value: 0x7f0a000f public const int transition_current_scene = 2131361807; @@ -7311,11 +7323,11 @@ namespace Bit.Droid // aapt resource value: 0x7f0a001b public const int view_offset_helper = 2131361819; - // aapt resource value: 0x7f0a0107 - public const int visible = 2131362055; + // aapt resource value: 0x7f0a010b + public const int visible = 2131362059; - // aapt resource value: 0x7f0a00de - public const int volume_item_container = 2131362014; + // aapt resource value: 0x7f0a00e2 + public const int volume_item_container = 2131362018; // aapt resource value: 0x7f0a0043 public const int withText = 2131361859; diff --git a/src/Android/Resources/layout/CellBaseView.axml b/src/Android/Resources/layout/CellBaseView.axml index 92d939e6f..b57a1917a 100644 --- a/src/Android/Resources/layout/CellBaseView.axml +++ b/src/Android/Resources/layout/CellBaseView.axml @@ -11,7 +11,7 @@ android:id="@+id/CellContent" android:orientation="vertical" android:layout_centerVertical="true" - android:layout_width="match_parent" + android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center_vertical"> + + + + + SetValue(TitleFontSizeProperty, value); } + public string Button1Icon + { + get => (string)GetValue(Button1IconProperty); + set => SetValue(Button1IconProperty, value); + } + + public ICommand Button1Command + { + get => (ICommand)GetValue(Button1CommandProperty); + set => SetValue(Button1CommandProperty, value); + } + + public object Button1CommandParameter + { + get => GetValue(Button1CommandParameterProperty); + set => SetValue(Button1CommandParameterProperty, value); + } + + public string Button2Icon + { + get => (string)GetValue(Button2IconProperty); + set => SetValue(Button2IconProperty, value); + } + + public ICommand Button2Command + { + get => (ICommand)GetValue(Button2CommandProperty); + set => SetValue(Button2CommandProperty, value); + } + + public object Button2CommandParameter + { + get => GetValue(Button2CommandParameterProperty); + set => SetValue(Button2CommandParameterProperty, value); + } + + public string Button3Icon + { + get => (string)GetValue(Button3IconProperty); + set => SetValue(Button3IconProperty, value); + } + + public ICommand Button3Command + { + get => (ICommand)GetValue(Button3CommandProperty); + set => SetValue(Button3CommandProperty, value); + } + + public object Button3CommandParameter + { + get => GetValue(Button3CommandParameterProperty); + set => SetValue(Button3CommandParameterProperty, value); + } + public Color BackgroundColor { get => (Color)GetValue(BackgroundColorProperty); diff --git a/src/App/Pages/SettingsPage.xaml b/src/App/Pages/SettingsPage.xaml index 310d40ad4..64ec95a88 100644 --- a/src/App/Pages/SettingsPage.xaml +++ b/src/App/Pages/SettingsPage.xaml @@ -16,13 +16,22 @@ FooterText="The Footer" UseDragSort="True"> + ValueText="The value for entry" + Button1Icon="cogs" + Button1Command="{Binding ButtonCommand}" + Button2Icon="cogs" + Button2Command="{Binding Button2Command}" + Button3Icon="cogs" /> + ValueText="The value" + Button3Icon="cogs" /> Page.DisplayAlert("Button 1 Command", "Button 1 message", "Cancel")); + Button2Command = new Command(() => Page.DisplayAlert("Button 2 Command", "Button 2 message", "Cancel")); } + + public ICommand ButtonCommand { get; } + public ICommand Button2Command { get; } } }