@@ -14,7 +14,7 @@ public class EditorView : ContentView {
1414 MathKeyboard keyboard = new MathKeyboard ( Rendering . FrontEnd . PainterConstants . LargerFontSize ) ;
1515 public EditorView ( ) {
1616 // Basic functionality
17- var view = new GraphicsView { HeightRequest = 225 } ;
17+ var view = new GraphicsView ( ) ;
1818 var viewModel = keyboard . Keyboard ;
1919 viewModel . BindDisplay ( view , OutputMathPainter , new Color ( 0 , 0 , 0 , 153 ) ) ;
2020
@@ -26,7 +26,8 @@ public EditorView() {
2626 entry . TextChanged += ( sender , e ) => {
2727 entry . Text = "" ;
2828 foreach ( var c in e . NewTextValue )
29- // The (int) extra conversion seems to be required by Android or a crash occurs
29+ // The (int) extra conversion used to be required by Xamarin.Forms on Android or a crash occurs
30+ // Maybe this isn't required anymore in .NET MAUI
3031 viewModel . KeyPress ( ( Editor . MathKeyboardInput ) ( int ) c ) ;
3132 } ;
3233
@@ -59,11 +60,12 @@ static View GridItem(int row, int col, View view) {
5960 // Assemble
6061 Content = new Grid {
6162 RowDefinitions = {
63+ new RowDefinition { Height = new GridLength ( 1 , GridUnitType . Auto ) } ,
6264 new RowDefinition { Height = new GridLength ( 1 , GridUnitType . Star ) } ,
63- new RowDefinition { Height = new GridLength ( 1.5 , GridUnitType . Star ) } ,
64- new RowDefinition { Height = 1 } ,
65- new RowDefinition { Height = new GridLength ( 1.5 , GridUnitType . Star ) } ,
66- new RowDefinition { Height = new GridLength ( 2 , GridUnitType . Star ) } ,
65+ new RowDefinition { Height = new GridLength ( 1 , GridUnitType . Auto ) } ,
66+ new RowDefinition { Height = new GridLength ( 1 , GridUnitType . Star ) } ,
67+ new RowDefinition { Height = new GridLength ( 1 , GridUnitType . Star ) } ,
68+ new RowDefinition { Height = new GridLength ( 1 , GridUnitType . Auto ) } ,
6769 } ,
6870 Children = {
6971 GridItem ( 0 , 0 , new ScrollView {
@@ -74,19 +76,15 @@ static View GridItem(int row, int col, View view) {
7476 GridItem ( 1 , 0 , view ) ,
7577 GridItem ( 2 , 0 , new BoxView { Color = Colors . Gray } ) ,
7678 GridItem ( 3 , 0 , output ) ,
77- GridItem ( 4 , 0 , new StackLayout {
79+ GridItem ( 4 , 0 , keyboard ) ,
80+ GridItem ( 5 , 0 , new StackLayout {
81+ Orientation = StackOrientation . Horizontal ,
7882 Children = {
79- keyboard ,
80- new StackLayout {
81- Orientation = StackOrientation . Horizontal ,
82- Children = {
83- new Button { Text = "Change appearance" , Command = new Command ( ChangeAppearance ) } ,
84- entry ,
85- new Button {
86- Text = "Reset answer pan" ,
87- Command = new Command ( ( ) => output . DisplacementX = output . DisplacementY = 0 )
88- }
89- }
83+ new Button { Text = "Change appearance" , Command = new Command ( ChangeAppearance ) } ,
84+ entry ,
85+ new Button {
86+ Text = "Reset answer pan" ,
87+ Command = new Command ( ( ) => output . DisplacementX = output . DisplacementY = 0 )
9088 }
9189 }
9290 } )
0 commit comments