File tree Expand file tree Collapse file tree
src/library/DIPS.Mobile.UI/Components/Toolbar Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,12 +29,13 @@ protected override LinearLayout CreatePlatformView()
2929 border . SetBackgroundColor ( Resources . Colors . Colors . GetColor ( ColorName . color_border_default ) . ToPlatform ( ) ) ;
3030 outer . AddView ( border , new LinearLayout . LayoutParams ( ViewGroup . LayoutParams . MatchParent , borderPx ) ) ;
3131
32- // Buttons row
32+ // Buttons row: fills remaining space, centers buttons vertically (M3 spec: icons vertically centered in 80dp bar)
3333 m_buttonsLayout = new LinearLayout ( Context )
3434 {
3535 Orientation = Orientation . Horizontal ,
36+ Gravity = GravityFlags . CenterVertical ,
3637 } ;
37- outer . AddView ( m_buttonsLayout , new LinearLayout . LayoutParams ( ViewGroup . LayoutParams . MatchParent , ViewGroup . LayoutParams . WrapContent ) ) ;
38+ outer . AddView ( m_buttonsLayout , new LinearLayout . LayoutParams ( ViewGroup . LayoutParams . MatchParent , ViewGroup . LayoutParams . MatchParent ) ) ;
3839
3940 return outer ;
4041 }
Original file line number Diff line number Diff line change @@ -5,11 +5,22 @@ namespace DIPS.Mobile.UI.Components.Toolbar;
55/// </summary>
66/// <remarks>
77/// iOS: https://developer.apple.com/design/human-interface-guidelines/toolbars
8- /// Android: https://m3.material.io/components/toolbars/overview
8+ /// Android: https://m3.material.io/components/toolbars/overview (Bottom App Bar, height 80dp)
99/// </remarks>
1010[ ContentProperty ( nameof ( Buttons ) ) ]
1111public partial class Toolbar : View
1212{
13+ public Toolbar ( )
14+ {
15+ // M3 Bottom App Bar spec: height = 80dp
16+ HeightRequest = Sizes . GetSize ( SizeName . size_20 ) ;
17+ }
18+
19+ private void OnButtonsChanged ( )
20+ {
21+ Handler ? . UpdateValue ( nameof ( Buttons ) ) ;
22+ }
23+
1324 protected override void OnBindingContextChanged ( )
1425 {
1526 base . OnBindingContextChanged ( ) ;
You can’t perform that action at this time.
0 commit comments