cell buttons

This commit is contained in:
Kyle Spearrin 2019-04-05 16:13:17 -04:00
parent 8c79c42b28
commit 3539d7389e
7 changed files with 445 additions and 223 deletions

View file

@ -41,6 +41,10 @@ namespace Bit.Droid.Renderers.BoxedView
public TextView CellTitle { get; set; } public TextView CellTitle { get; set; }
public LinearLayout CellTitleContent { get; set; } public LinearLayout CellTitleContent { get; set; }
public LinearLayout CellContent { 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; } public LinearLayout CellAccessory { get; set; }
private void CreateContentView() private void CreateContentView()
@ -54,6 +58,13 @@ namespace Bit.Droid.Renderers.BoxedView
CellTitle = contentView.FindViewById<TextView>(Resource.Id.CellTitle); CellTitle = contentView.FindViewById<TextView>(Resource.Id.CellTitle);
CellContent = contentView.FindViewById<LinearLayout>(Resource.Id.CellContent); CellContent = contentView.FindViewById<LinearLayout>(Resource.Id.CellContent);
CellTitleContent = contentView.FindViewById<LinearLayout>(Resource.Id.CellTitleContent); CellTitleContent = contentView.FindViewById<LinearLayout>(Resource.Id.CellTitleContent);
CellButtonContent = contentView.FindViewById<LinearLayout>(Resource.Id.CellButtonContent);
CellButton1 = contentView.FindViewById<Android.Widget.ImageButton>(Resource.Id.CellButton1);
CellButton1.Click += CellButton1_Click;
CellButton2 = contentView.FindViewById<Android.Widget.ImageButton>(Resource.Id.CellButton2);
CellButton2.Click += CellButton2_Click;
CellButton3 = contentView.FindViewById<Android.Widget.ImageButton>(Resource.Id.CellButton3);
CellButton3.Click += CellButton3_Click;
CellAccessory = contentView.FindViewById<LinearLayout>(Resource.Id.CellAccessory); CellAccessory = contentView.FindViewById<LinearLayout>(Resource.Id.CellAccessory);
_backgroundColor = new ColorDrawable(); _backgroundColor = new ColorDrawable();
@ -100,6 +111,18 @@ namespace Bit.Droid.Renderers.BoxedView
{ {
UpdateIsEnabled(); 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) public virtual void ParentPropertyChanged(object sender, PropertyChangedEventArgs e)
@ -142,6 +165,9 @@ namespace Bit.Droid.Renderers.BoxedView
public virtual void UpdateCell() public virtual void UpdateCell()
{ {
UpdateButtonIcon(CellButton1, CellBase.Button1Icon);
UpdateButtonIcon(CellButton2, CellBase.Button2Icon);
UpdateButtonIcon(CellButton3, CellBase.Button3Icon);
UpdateBackgroundColor(); UpdateBackgroundColor();
UpdateSelectedColor(); UpdateSelectedColor();
UpdateTitleText(); UpdateTitleText();
@ -153,6 +179,43 @@ namespace Bit.Droid.Renderers.BoxedView
Invalidate(); 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() private void UpdateBackgroundColor()
{ {
Selected = false; Selected = false;
@ -252,6 +315,9 @@ namespace Bit.Droid.Renderers.BoxedView
{ {
CellBase.PropertyChanged -= CellPropertyChanged; CellBase.PropertyChanged -= CellPropertyChanged;
CellParent.PropertyChanged -= ParentPropertyChanged; CellParent.PropertyChanged -= ParentPropertyChanged;
CellButton1.Click -= CellButton1_Click;
CellButton2.Click -= CellButton2_Click;
CellButton3.Click -= CellButton3_Click;
if(CellBase.Section != null) if(CellBase.Section != null)
{ {
@ -265,6 +331,16 @@ namespace Bit.Droid.Renderers.BoxedView
CellTitleContent = null; CellTitleContent = null;
CellAccessory?.Dispose(); CellAccessory?.Dispose();
CellAccessory = null; CellAccessory = null;
CellButton1?.Dispose();
CellButton1 = null;
CellButton2?.Dispose();
CellButton2 = null;
CellButton3?.Dispose();
CellButton3 = null;
CellButtonContent?.Dispose();
CellButtonContent = null;
CellContent?.Dispose();
CellContent = null;
Cell = null; Cell = null;
_iconTokenSource?.Dispose(); _iconTokenSource?.Dispose();

View file

@ -6534,8 +6534,20 @@ namespace Bit.Droid
// aapt resource value: 0x7f0a003a // aapt resource value: 0x7f0a003a
public const int CTRL = 2131361850; 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 // aapt resource value: 0x7f0a00a8
public const int CellAccessory = 2131361960; public const int CellButtonContent = 2131361960;
// aapt resource value: 0x7f0a00a5 // aapt resource value: 0x7f0a00a5
public const int CellContent = 2131361957; public const int CellContent = 2131361957;
@ -6546,23 +6558,23 @@ namespace Bit.Droid
// aapt resource value: 0x7f0a00a6 // aapt resource value: 0x7f0a00a6
public const int CellTitleContent = 2131361958; public const int CellTitleContent = 2131361958;
// aapt resource value: 0x7f0a00a9 // aapt resource value: 0x7f0a00ad
public const int ContentCellBody = 2131361961; public const int ContentCellBody = 2131361965;
// aapt resource value: 0x7f0a00aa // aapt resource value: 0x7f0a00ae
public const int ContentCellBorder = 2131361962; public const int ContentCellBorder = 2131361966;
// aapt resource value: 0x7f0a003b // aapt resource value: 0x7f0a003b
public const int FUNCTION = 2131361851; public const int FUNCTION = 2131361851;
// aapt resource value: 0x7f0a00b9 // aapt resource value: 0x7f0a00bd
public const int FooterCellText = 2131361977; public const int FooterCellText = 2131361981;
// aapt resource value: 0x7f0a00bb // aapt resource value: 0x7f0a00bf
public const int HeaderCellBorder = 2131361979; public const int HeaderCellBorder = 2131361983;
// aapt resource value: 0x7f0a00ba // aapt resource value: 0x7f0a00be
public const int HeaderCellText = 2131361978; public const int HeaderCellText = 2131361982;
// aapt resource value: 0x7f0a003c // aapt resource value: 0x7f0a003c
public const int META = 2131361852; public const int META = 2131361852;
@ -6573,8 +6585,8 @@ namespace Bit.Droid
// aapt resource value: 0x7f0a003e // aapt resource value: 0x7f0a003e
public const int SYM = 2131361854; public const int SYM = 2131361854;
// aapt resource value: 0x7f0a00ee // aapt resource value: 0x7f0a00f2
public const int action0 = 2131362030; public const int action0 = 2131362034;
// aapt resource value: 0x7f0a008d // aapt resource value: 0x7f0a008d
public const int action_bar = 2131361933; public const int action_bar = 2131361933;
@ -6597,17 +6609,17 @@ namespace Bit.Droid
// aapt resource value: 0x7f0a0069 // aapt resource value: 0x7f0a0069
public const int action_bar_title = 2131361897; public const int action_bar_title = 2131361897;
// aapt resource value: 0x7f0a00eb // aapt resource value: 0x7f0a00ef
public const int action_container = 2131362027; public const int action_container = 2131362031;
// aapt resource value: 0x7f0a008e // aapt resource value: 0x7f0a008e
public const int action_context_bar = 2131361934; public const int action_context_bar = 2131361934;
// aapt resource value: 0x7f0a00f2 // aapt resource value: 0x7f0a00f6
public const int action_divider = 2131362034; public const int action_divider = 2131362038;
// aapt resource value: 0x7f0a00ec // aapt resource value: 0x7f0a00f0
public const int action_image = 2131362028; public const int action_image = 2131362032;
// aapt resource value: 0x7f0a0003 // aapt resource value: 0x7f0a0003
public const int action_menu_divider = 2131361795; public const int action_menu_divider = 2131361795;
@ -6624,11 +6636,11 @@ namespace Bit.Droid
// aapt resource value: 0x7f0a006b // aapt resource value: 0x7f0a006b
public const int action_mode_close_button = 2131361899; public const int action_mode_close_button = 2131361899;
// aapt resource value: 0x7f0a00ed // aapt resource value: 0x7f0a00f1
public const int action_text = 2131362029; public const int action_text = 2131362033;
// aapt resource value: 0x7f0a00fb // aapt resource value: 0x7f0a00ff
public const int actions = 2131362043; public const int actions = 2131362047;
// aapt resource value: 0x7f0a006c // aapt resource value: 0x7f0a006c
public const int activity_chooser_view_content = 2131361900; public const int activity_chooser_view_content = 2131361900;
@ -6684,8 +6696,8 @@ namespace Bit.Droid
// aapt resource value: 0x7f0a0072 // aapt resource value: 0x7f0a0072
public const int buttonPanel = 2131361906; public const int buttonPanel = 2131361906;
// aapt resource value: 0x7f0a00ef // aapt resource value: 0x7f0a00f3
public const int cancel_action = 2131362031; public const int cancel_action = 2131362035;
// aapt resource value: 0x7f0a004c // aapt resource value: 0x7f0a004c
public const int center = 2131361868; public const int center = 2131361868;
@ -6699,8 +6711,8 @@ namespace Bit.Droid
// aapt resource value: 0x7f0a0086 // aapt resource value: 0x7f0a0086
public const int checkbox = 2131361926; public const int checkbox = 2131361926;
// aapt resource value: 0x7f0a00f7 // aapt resource value: 0x7f0a00fb
public const int chronometer = 2131362039; public const int chronometer = 2131362043;
// aapt resource value: 0x7f0a0061 // aapt resource value: 0x7f0a0061
public const int clip_horizontal = 2131361889; public const int clip_horizontal = 2131361889;
@ -6711,8 +6723,8 @@ namespace Bit.Droid
// aapt resource value: 0x7f0a0040 // aapt resource value: 0x7f0a0040
public const int collapseActionView = 2131361856; public const int collapseActionView = 2131361856;
// aapt resource value: 0x7f0a00ad // aapt resource value: 0x7f0a00b1
public const int container = 2131361965; public const int container = 2131361969;
// aapt resource value: 0x7f0a0082 // aapt resource value: 0x7f0a0082
public const int content = 2131361922; public const int content = 2131361922;
@ -6720,8 +6732,8 @@ namespace Bit.Droid
// aapt resource value: 0x7f0a0075 // aapt resource value: 0x7f0a0075
public const int contentPanel = 2131361909; public const int contentPanel = 2131361909;
// aapt resource value: 0x7f0a00ae // aapt resource value: 0x7f0a00b2
public const int coordinator = 2131361966; public const int coordinator = 2131361970;
// aapt resource value: 0x7f0a007c // aapt resource value: 0x7f0a007c
public const int custom = 2131361916; public const int custom = 2131361916;
@ -6735,20 +6747,20 @@ namespace Bit.Droid
// aapt resource value: 0x7f0a006f // aapt resource value: 0x7f0a006f
public const int default_activity_button = 2131361903; 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 // 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 // aapt resource value: 0x7f0a00b9
public const int design_menu_item_text = 2131361971; public const int design_menu_item_action_area = 2131361977;
// aapt resource value: 0x7f0a00b2 // aapt resource value: 0x7f0a00b8
public const int design_navigation_view = 2131361970; 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 // aapt resource value: 0x7f0a0027
public const int disableHome = 2131361831; public const int disableHome = 2131361831;
@ -6759,8 +6771,8 @@ namespace Bit.Droid
// aapt resource value: 0x7f0a0037 // aapt resource value: 0x7f0a0037
public const int end = 2131361847; public const int end = 2131361847;
// aapt resource value: 0x7f0a00fd // aapt resource value: 0x7f0a0101
public const int end_padder = 2131362045; public const int end_padder = 2131362049;
// aapt resource value: 0x7f0a0046 // aapt resource value: 0x7f0a0046
public const int enterAlways = 2131361862; public const int enterAlways = 2131361862;
@ -6792,11 +6804,11 @@ namespace Bit.Droid
// aapt resource value: 0x7f0a005c // aapt resource value: 0x7f0a005c
public const int @fixed = 2131361884; public const int @fixed = 2131361884;
// aapt resource value: 0x7f0a00b7 // aapt resource value: 0x7f0a00bb
public const int flyoutcontent_appbar = 2131361975; public const int flyoutcontent_appbar = 2131361979;
// aapt resource value: 0x7f0a00b8 // aapt resource value: 0x7f0a00bc
public const int flyoutcontent_recycler = 2131361976; public const int flyoutcontent_recycler = 2131361980;
// aapt resource value: 0x7f0a0067 // aapt resource value: 0x7f0a0067
public const int forever = 2131361895; public const int forever = 2131361895;
@ -6816,8 +6828,8 @@ namespace Bit.Droid
// aapt resource value: 0x7f0a0071 // aapt resource value: 0x7f0a0071
public const int icon = 2131361905; public const int icon = 2131361905;
// aapt resource value: 0x7f0a00fc // aapt resource value: 0x7f0a0100
public const int icon_group = 2131362044; public const int icon_group = 2131362048;
// aapt resource value: 0x7f0a0041 // aapt resource value: 0x7f0a0041
public const int ifRoom = 2131361857; public const int ifRoom = 2131361857;
@ -6825,8 +6837,8 @@ namespace Bit.Droid
// aapt resource value: 0x7f0a006e // aapt resource value: 0x7f0a006e
public const int image = 2131361902; public const int image = 2131361902;
// aapt resource value: 0x7f0a00f8 // aapt resource value: 0x7f0a00fc
public const int info = 2131362040; public const int info = 2131362044;
// aapt resource value: 0x7f0a0068 // aapt resource value: 0x7f0a0068
public const int italic = 2131361896; public const int italic = 2131361896;
@ -6837,8 +6849,8 @@ namespace Bit.Droid
// aapt resource value: 0x7f0a004e // aapt resource value: 0x7f0a004e
public const int labeled = 2131361870; public const int labeled = 2131361870;
// aapt resource value: 0x7f0a00ac // aapt resource value: 0x7f0a00b0
public const int largeLabel = 2131361964; public const int largeLabel = 2131361968;
// aapt resource value: 0x7f0a0054 // aapt resource value: 0x7f0a0054
public const int left = 2131361876; public const int left = 2131361876;
@ -6855,23 +6867,23 @@ namespace Bit.Droid
// aapt resource value: 0x7f0a0070 // aapt resource value: 0x7f0a0070
public const int list_item = 2131361904; public const int list_item = 2131361904;
// aapt resource value: 0x7f0a00fe // aapt resource value: 0x7f0a0102
public const int main_appbar = 2131362046; public const int main_appbar = 2131362050;
// aapt resource value: 0x7f0a0101 // aapt resource value: 0x7f0a0105
public const int main_scrollview = 2131362049; public const int main_scrollview = 2131362053;
// aapt resource value: 0x7f0a0100 // aapt resource value: 0x7f0a0104
public const int main_tablayout = 2131362048; public const int main_tablayout = 2131362052;
// aapt resource value: 0x7f0a00ff // aapt resource value: 0x7f0a0103
public const int main_toolbar = 2131362047; public const int main_toolbar = 2131362051;
// aapt resource value: 0x7f0a0108 // aapt resource value: 0x7f0a010c
public const int masked = 2131362056; public const int masked = 2131362060;
// aapt resource value: 0x7f0a00f1 // aapt resource value: 0x7f0a00f5
public const int media_actions = 2131362033; public const int media_actions = 2131362037;
// aapt resource value: 0x7f0a009c // aapt resource value: 0x7f0a009c
public const int message = 2131361948; public const int message = 2131361948;
@ -6882,143 +6894,143 @@ namespace Bit.Droid
// aapt resource value: 0x7f0a0059 // aapt resource value: 0x7f0a0059
public const int mini = 2131361881; public const int mini = 2131361881;
// aapt resource value: 0x7f0a00d8 // aapt resource value: 0x7f0a00dc
public const int mr_art = 2131362008; public const int mr_art = 2131362012;
// 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: 0x7f0a00cd // aapt resource value: 0x7f0a00cd
public const int mr_chooser_list = 2131361997; public const int mr_cast_checkbox = 2131361997;
// aapt resource value: 0x7f0a00d0 // aapt resource value: 0x7f0a00c6
public const int mr_chooser_route_desc = 2131362000; public const int mr_cast_close_button = 2131361990;
// aapt resource value: 0x7f0a00ce // aapt resource value: 0x7f0a00c1
public const int mr_chooser_route_icon = 2131361998; public const int mr_cast_group_icon = 2131361985;
// aapt resource value: 0x7f0a00cf // aapt resource value: 0x7f0a00c2
public const int mr_chooser_route_name = 2131361999; public const int mr_cast_group_name = 2131361986;
// 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: 0x7f0a00c0 // aapt resource value: 0x7f0a00c0
public const int mr_group_volume_slider = 2131361984; public const int mr_cast_list = 2131361984;
// aapt resource value: 0x7f0a00d9 // aapt resource value: 0x7f0a00c5
public const int mr_media_main_control = 2131362009; 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 // aapt resource value: 0x7f0a00d4
public const int mr_name = 2131362004; public const int mr_chooser_route_desc = 2131362004;
// aapt resource value: 0x7f0a00e2 // aapt resource value: 0x7f0a00d2
public const int mr_picker_close_button = 2131362018; public const int mr_chooser_route_icon = 2131362002;
// 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: 0x7f0a00d3 // aapt resource value: 0x7f0a00d3
public const int mr_title_bar = 2131362003; public const int mr_chooser_route_name = 2131362003;
// aapt resource value: 0x7f0a00dc // aapt resource value: 0x7f0a00d0
public const int mr_volume_control = 2131362012; public const int mr_chooser_title = 2131362000;
// aapt resource value: 0x7f0a00dd // aapt resource value: 0x7f0a00d9
public const int mr_volume_group_list = 2131362013; public const int mr_close = 2131362009;
// aapt resource value: 0x7f0a00df // 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 // 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 // aapt resource value: 0x7f0a0014
public const int mtrl_child_content_container = 2131361812; public const int mtrl_child_content_container = 2131361812;
@ -7029,8 +7041,8 @@ namespace Bit.Droid
// aapt resource value: 0x7f0a002f // aapt resource value: 0x7f0a002f
public const int multiply = 2131361839; public const int multiply = 2131361839;
// aapt resource value: 0x7f0a00b1 // aapt resource value: 0x7f0a00b5
public const int navigation_header_container = 2131361969; public const int navigation_header_container = 2131361973;
// aapt resource value: 0x7f0a0042 // aapt resource value: 0x7f0a0042
public const int never = 2131361858; public const int never = 2131361858;
@ -7041,14 +7053,14 @@ namespace Bit.Droid
// aapt resource value: 0x7f0a0025 // aapt resource value: 0x7f0a0025
public const int normal = 2131361829; public const int normal = 2131361829;
// aapt resource value: 0x7f0a00fa // aapt resource value: 0x7f0a00fe
public const int notification_background = 2131362042; public const int notification_background = 2131362046;
// aapt resource value: 0x7f0a00f4 // aapt resource value: 0x7f0a00f8
public const int notification_main_column = 2131362036; public const int notification_main_column = 2131362040;
// aapt resource value: 0x7f0a00f3 // aapt resource value: 0x7f0a00f7
public const int notification_main_column_container = 2131362035; public const int notification_main_column_container = 2131362039;
// aapt resource value: 0x7f0a0060 // aapt resource value: 0x7f0a0060
public const int outline = 2131361888; public const int outline = 2131361888;
@ -7077,11 +7089,11 @@ namespace Bit.Droid
// aapt resource value: 0x7f0a0055 // aapt resource value: 0x7f0a0055
public const int right = 2131361877; public const int right = 2131361877;
// aapt resource value: 0x7f0a00f9 // aapt resource value: 0x7f0a00fd
public const int right_icon = 2131362041; public const int right_icon = 2131362045;
// aapt resource value: 0x7f0a00f5 // aapt resource value: 0x7f0a00f9
public const int right_side = 2131362037; public const int right_side = 2131362041;
// aapt resource value: 0x7f0a000c // aapt resource value: 0x7f0a000c
public const int save_image_matrix = 2131361804; public const int save_image_matrix = 2131361804;
@ -7146,14 +7158,14 @@ namespace Bit.Droid
// aapt resource value: 0x7f0a004f // aapt resource value: 0x7f0a004f
public const int selected = 2131361871; public const int selected = 2131361871;
// aapt resource value: 0x7f0a0102 // aapt resource value: 0x7f0a0106
public const int shellcontent_appbar = 2131362050; public const int shellcontent_appbar = 2131362054;
// aapt resource value: 0x7f0a0104 // aapt resource value: 0x7f0a0108
public const int shellcontent_scrollview = 2131362052; public const int shellcontent_scrollview = 2131362056;
// aapt resource value: 0x7f0a0103 // aapt resource value: 0x7f0a0107
public const int shellcontent_toolbar = 2131362051; public const int shellcontent_toolbar = 2131362055;
// aapt resource value: 0x7f0a0083 // aapt resource value: 0x7f0a0083
public const int shortcut = 2131361923; public const int shortcut = 2131361923;
@ -7167,11 +7179,11 @@ namespace Bit.Droid
// aapt resource value: 0x7f0a002c // aapt resource value: 0x7f0a002c
public const int showTitle = 2131361836; public const int showTitle = 2131361836;
// aapt resource value: 0x7f0a0105 // aapt resource value: 0x7f0a0109
public const int sliding_tabs = 2131362053; public const int sliding_tabs = 2131362057;
// aapt resource value: 0x7f0a00ab // aapt resource value: 0x7f0a00af
public const int smallLabel = 2131361963; public const int smallLabel = 2131361967;
// aapt resource value: 0x7f0a0016 // aapt resource value: 0x7f0a0016
public const int snackbar_action = 2131361814; public const int snackbar_action = 2131361814;
@ -7203,8 +7215,8 @@ namespace Bit.Droid
// aapt resource value: 0x7f0a0056 // aapt resource value: 0x7f0a0056
public const int start = 2131361878; public const int start = 2131361878;
// aapt resource value: 0x7f0a00f0 // aapt resource value: 0x7f0a00f4
public const int status_bar_latest_event_content = 2131362032; public const int status_bar_latest_event_content = 2131362036;
// aapt resource value: 0x7f0a005b // aapt resource value: 0x7f0a005b
public const int stretch = 2131361883; public const int stretch = 2131361883;
@ -7245,8 +7257,8 @@ namespace Bit.Droid
// aapt resource value: 0x7f0a005a // aapt resource value: 0x7f0a005a
public const int textStart = 2131361882; public const int textStart = 2131361882;
// aapt resource value: 0x7f0a00b6 // aapt resource value: 0x7f0a00ba
public const int text_input_password_toggle = 2131361974; public const int text_input_password_toggle = 2131361978;
// aapt resource value: 0x7f0a0018 // aapt resource value: 0x7f0a0018
public const int textinput_counter = 2131361816; public const int textinput_counter = 2131361816;
@ -7257,8 +7269,8 @@ namespace Bit.Droid
// aapt resource value: 0x7f0a001a // aapt resource value: 0x7f0a001a
public const int textinput_helper_text = 2131361818; public const int textinput_helper_text = 2131361818;
// aapt resource value: 0x7f0a00f6 // aapt resource value: 0x7f0a00fa
public const int time = 2131362038; public const int time = 2131362042;
// aapt resource value: 0x7f0a0023 // aapt resource value: 0x7f0a0023
public const int title = 2131361827; public const int title = 2131361827;
@ -7269,8 +7281,8 @@ namespace Bit.Droid
// aapt resource value: 0x7f0a007e // aapt resource value: 0x7f0a007e
public const int title_template = 2131361918; public const int title_template = 2131361918;
// aapt resource value: 0x7f0a0106 // aapt resource value: 0x7f0a010a
public const int toolbar = 2131362054; public const int toolbar = 2131362058;
// aapt resource value: 0x7f0a0045 // aapt resource value: 0x7f0a0045
public const int top = 2131361861; public const int top = 2131361861;
@ -7278,8 +7290,8 @@ namespace Bit.Droid
// aapt resource value: 0x7f0a007d // aapt resource value: 0x7f0a007d
public const int topPanel = 2131361917; public const int topPanel = 2131361917;
// aapt resource value: 0x7f0a00af // aapt resource value: 0x7f0a00b3
public const int touch_outside = 2131361967; public const int touch_outside = 2131361971;
// aapt resource value: 0x7f0a000f // aapt resource value: 0x7f0a000f
public const int transition_current_scene = 2131361807; public const int transition_current_scene = 2131361807;
@ -7311,11 +7323,11 @@ namespace Bit.Droid
// aapt resource value: 0x7f0a001b // aapt resource value: 0x7f0a001b
public const int view_offset_helper = 2131361819; public const int view_offset_helper = 2131361819;
// aapt resource value: 0x7f0a0107 // aapt resource value: 0x7f0a010b
public const int visible = 2131362055; public const int visible = 2131362059;
// aapt resource value: 0x7f0a00de // aapt resource value: 0x7f0a00e2
public const int volume_item_container = 2131362014; public const int volume_item_container = 2131362018;
// aapt resource value: 0x7f0a0043 // aapt resource value: 0x7f0a0043
public const int withText = 2131361859; public const int withText = 2131361859;

View file

@ -11,7 +11,7 @@
android:id="@+id/CellContent" android:id="@+id/CellContent"
android:orientation="vertical" android:orientation="vertical"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_width="match_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_vertical"> android:gravity="center_vertical">
<LinearLayout <LinearLayout
@ -33,6 +33,30 @@
android:layout_gravity="left|center_vertical" /> android:layout_gravity="left|center_vertical" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<LinearLayout
android:id="@+id/CellButtonContent"
android:orientation="horizontal"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical">
<ImageButton
android:id="@+id/CellButton1"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<ImageButton
android:id="@+id/CellButton2"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<ImageButton
android:id="@+id/CellButton3"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/CellAccessory" android:id="@+id/CellAccessory"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"

View file

@ -1,4 +1,5 @@
using System; using System;
using System.Windows.Input;
using Xamarin.Forms; using Xamarin.Forms;
namespace Bit.App.Controls.BoxedView namespace Bit.App.Controls.BoxedView
@ -15,6 +16,42 @@ namespace Bit.App.Controls.BoxedView
public static BindableProperty TitleFontSizeProperty = BindableProperty.Create( public static BindableProperty TitleFontSizeProperty = BindableProperty.Create(
nameof(TitleFontSize), typeof(double), typeof(BaseCell), -1.0, defaultBindingMode: BindingMode.OneWay); nameof(TitleFontSize), typeof(double), typeof(BaseCell), -1.0, defaultBindingMode: BindingMode.OneWay);
public static BindableProperty Button1IconProperty = BindableProperty.Create(
nameof(Button1Icon), typeof(string), typeof(BaseCell), default(string),
defaultBindingMode: BindingMode.OneWay);
public static BindableProperty Button1CommandProperty = BindableProperty.Create(
nameof(Button1Command), typeof(ICommand), typeof(BaseCell), default(ICommand),
defaultBindingMode: BindingMode.OneWay);
public static BindableProperty Button1CommandParameterProperty = BindableProperty.Create(
nameof(Button1CommandParameter), typeof(object), typeof(BaseCell), default(object),
defaultBindingMode: BindingMode.OneWay);
public static BindableProperty Button2IconProperty = BindableProperty.Create(
nameof(Button2Icon), typeof(string), typeof(BaseCell), default(string),
defaultBindingMode: BindingMode.OneWay);
public static BindableProperty Button2CommandProperty = BindableProperty.Create(
nameof(Button2Command), typeof(ICommand), typeof(BaseCell), default(ICommand),
defaultBindingMode: BindingMode.OneWay);
public static BindableProperty Button2CommandParameterProperty = BindableProperty.Create(
nameof(Button2CommandParameter), typeof(object), typeof(BaseCell), default(object),
defaultBindingMode: BindingMode.OneWay);
public static BindableProperty Button3IconProperty = BindableProperty.Create(
nameof(Button3Icon), typeof(string), typeof(BaseCell), default(string),
defaultBindingMode: BindingMode.OneWay);
public static BindableProperty Button3CommandProperty = BindableProperty.Create(
nameof(Button3Command), typeof(ICommand), typeof(BaseCell), default(ICommand),
defaultBindingMode: BindingMode.OneWay);
public static BindableProperty Button3CommandParameterProperty = BindableProperty.Create(
nameof(Button3CommandParameter), typeof(object), typeof(BaseCell), default(object),
defaultBindingMode: BindingMode.OneWay);
public static BindableProperty BackgroundColorProperty = BindableProperty.Create( public static BindableProperty BackgroundColorProperty = BindableProperty.Create(
nameof(BackgroundColor), typeof(Color), typeof(BaseCell), default(Color), nameof(BackgroundColor), typeof(Color), typeof(BaseCell), default(Color),
defaultBindingMode: BindingMode.OneWay); defaultBindingMode: BindingMode.OneWay);
@ -38,6 +75,60 @@ namespace Bit.App.Controls.BoxedView
set => SetValue(TitleFontSizeProperty, value); set => 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 public Color BackgroundColor
{ {
get => (Color)GetValue(BackgroundColorProperty); get => (Color)GetValue(BackgroundColorProperty);

View file

@ -16,13 +16,22 @@
FooterText="The Footer" FooterText="The Footer"
UseDragSort="True"> UseDragSort="True">
<bv:EntryCell Title="The title" <bv:EntryCell Title="The title"
ValueText="The value for entry" /> ValueText="The value for entry"
Button1Icon="cogs"
Button1Command="{Binding ButtonCommand}"
Button2Icon="cogs"
Button2Command="{Binding Button2Command}"
Button3Icon="cogs" />
<bv:LabelCell Title="The title" <bv:LabelCell Title="The title"
ValueText="The value" /> ValueText="The value" />
<bv:LabelCell Title="The title 2" <bv:LabelCell Title="The title 2"
Button1Icon="cogs"
Button1Command="{Binding ButtonCommand}"
Button3Icon="cogs"
ValueText="The value" /> ValueText="The value" />
<bv:LabelCell Title="The title 3" <bv:LabelCell Title="The title 3"
ValueText="The value" /> ValueText="The value"
Button3Icon="cogs" />
<bv:LabelCell Title="The title 4" <bv:LabelCell Title="The title 4"
ValueText="The value" /> ValueText="The value" />
<bv:LabelCell Title="The title 5" <bv:LabelCell Title="The title 5"

View file

@ -13,6 +13,8 @@ namespace Bit.App.Pages
public SettingsPage() public SettingsPage()
{ {
InitializeComponent(); InitializeComponent();
var viewModel = BindingContext as SettingsPageViewModel;
viewModel.Page = this;
} }
} }
} }

View file

@ -1,6 +1,8 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
using System.Windows.Input;
using Xamarin.Forms;
namespace Bit.App.Pages namespace Bit.App.Pages
{ {
@ -9,6 +11,12 @@ namespace Bit.App.Pages
public SettingsPageViewModel() public SettingsPageViewModel()
{ {
PageTitle = "Settings"; PageTitle = "Settings";
}
ButtonCommand = new Command(() => 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; }
} }
} }