Переглянути джерело

PRS MOBILE - tweaks to appearance of setout view items and setout searching

Nick-PRSDigital@bitbucket.org 2 роки тому
батько
коміт
171ff054d2

+ 2 - 1
.gitignore

@@ -221,4 +221,5 @@ prs.server/PRSServer.exe
 prs.server/PRSSetup.exe
 prs.desktop/PRSDesktop.sln
 *.DS_Store
-*.ipa
+*.ipa
+prs.mobile/comal.timesheet.sln

+ 26 - 5
prs.mobile/comal.timesheets/SetoutPacketGrid.cs

@@ -16,7 +16,7 @@ namespace comal.timesheets
 
         public SetoutPacketGrid(SetoutShell shell)
         {
-            Margin = 0;
+            Margin = new Thickness(1, 1, 2, 1);
             Padding = 0;
             BorderColor = Color.Gray;
             HasShadow = false;
@@ -41,23 +41,37 @@ namespace comal.timesheets
         {
             StackLayout layout = new StackLayout
             {
-                Orientation = StackOrientation.Vertical
+                Orientation = StackOrientation.Vertical,
+                Spacing = 0
             };
 
             layout.SetValue(Grid.ColumnProperty, 1);
 
             foreach (var packet in shell.Packets)
             {
-                layout.Children.Add(CreatePacketView(packet));
+                ViewPosition position = ViewPosition.Middle;
+
+                if (packet == shell.Packets.First())
+                    position = ViewPosition.First;
+                else if (packet == shell.Packets.Last())
+                    position = ViewPosition.Last;
+
+                layout.Children.Add(CreatePacketView(packet, position));
             }
 
             return layout;
         }
 
-        private View CreatePacketView(MiniManufacturingPacket packet)
+        private View CreatePacketView(MiniManufacturingPacket packet, ViewPosition position)
         {
             Frame frame = new Frame();
-            frame.Margin = 1;
+            frame.Margin = new Thickness(0, 1.5, 0, 1.5);
+
+            if(position == ViewPosition.First)
+                frame.Margin = new Thickness(0, 0, 0, 1.5);
+            else if (position == ViewPosition.Last)
+                frame.Margin = new Thickness(0, 1.5, 0, 0);
+
             frame.Padding = 0;
             frame.BorderColor = Color.Gray;
             frame.HasShadow = false;
@@ -155,6 +169,13 @@ namespace comal.timesheets
 
             return label;
         }
+
+        enum ViewPosition
+        { 
+            First,
+            Middle,
+            Last
+        }
         #endregion
     }
 }

+ 8 - 0
prs.mobile/comal.timesheets/SetoutsScreen.xaml.cs

@@ -99,6 +99,8 @@ namespace comal.timesheets
                 setoutsList.Children.Add(item);
             }
 
+            titleLbl.Text = "Setouts (" +  setoutsList.Children.Count().ToString() + ")";
+
         }
 
         private SetoutPacketGrid CreateSetOutViewItem(SetoutShell shell)
@@ -164,13 +166,18 @@ namespace comal.timesheets
         {
             if (!string.IsNullOrWhiteSpace(searchEnt.Text))
             {
+                int count = 0;
                 foreach (var child in setoutsList.Children)
                 {
                     if (ConditionsMet(child, searchEnt.Text))
+                    {
                         child.IsVisible = true;
+                        count++;
+                    }                       
                     else
                         child.IsVisible = false;
                 }
+                titleLbl.Text = "Setouts (" + count.ToString() + ")";
             }
             else
             {
@@ -178,6 +185,7 @@ namespace comal.timesheets
                 {
                     c.IsVisible = true;
                 }
+                titleLbl.Text = "Setouts (" + setoutsList.Children.Count().ToString() + ")";
             }
         }