Browse Source

Добавил кнопки для мобилки

Данилов Денис 1 year ago
parent
commit
404d28f680

+ 1 - 1
esoft_Mobile/esoft_Mobile.Android/Properties/AndroidManifest.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.companyname.esoft_mobile" android:installLocation="auto">
 	<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="33" />
-	<application android:label="esoft_Mobile.Android" android:theme="@style/MainTheme" android:icon="@mipmap/icon"></application>
+	<application android:label="esoft_Mobile.Android" android:theme="@style/MainTheme" android:usesCleartextTraffic="true" android:icon="@mipmap/icon"></application>
 	<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
 	<uses-permission android:name="android.permission.INTERNET" />
 </manifest>

BIN
esoft_Mobile/esoft_Mobile/Exception.png


+ 34 - 2
esoft_Mobile/esoft_Mobile/MainPage.xaml

@@ -4,17 +4,49 @@
              x:Class="esoft_Mobile.MainPage">
 
     <StackLayout>
-        <ListView x:Name="LviewTask" ItemSelected="LviewTask_ItemSelected" HasUnevenRows="True">
+
+        <Label Text="E-SOFT - mobile alfa test" VerticalTextAlignment="Center" Margin="120, 10, 10, 10"></Label>
+        <Grid Margin="15" >
+
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition Width="110"/>
+                <ColumnDefinition Width="160"/>
+                <ColumnDefinition Width="100"/>
+            </Grid.ColumnDefinitions>
+
+            <Button Text="Добавить"
+                    Grid.Column="0"
+                    TextColor="White"
+                    FontSize="12"
+                    BorderColor="#04a0ff"
+                    Background="#04a0ff"/>
+            <Button Text="Редактировать" 
+                    Grid.Column="1"
+                    BorderWidth="2" 
+                    TextColor="White" 
+                    FontSize="12" />
+            <Button  Text="Удалить" 
+                     Grid.Column="2"
+                     BorderWidth="2" 
+                     TextColor="White" 
+                     FontSize="12"
+                     Background="#04a0ff"/>
+        </Grid>
+
+        
+        <ListView x:Name="LviewTask" HasUnevenRows="True">
             <ListView.ItemTemplate>
                 <DataTemplate>
                     <ViewCell>
                         <StackLayout>
-                            <Label Margin="5" FontSize="30" HorizontalOptions="Center" Text="{Binding Title}"></Label>
+                            <Label Text="{Binding Title}" Margin="5" FontSize="25" HorizontalOptions="Start" />
+                            <Label Text="{Binding Status}" Margin="10" FontSize="15" HorizontalOptions="Start"/>
                         </StackLayout>
                     </ViewCell>
                 </DataTemplate>
             </ListView.ItemTemplate>
         </ListView>
+
     </StackLayout>
 
 </ContentPage>

+ 3 - 8
esoft_Mobile/esoft_Mobile/MainPage.xaml.cs

@@ -43,16 +43,11 @@ namespace esoft_Mobile
                 {
                     await DisplayAlert("Ошибка", "Не удалось получить задания", "OK");
                 }
-            }
+            } 
             catch (Exception ex)
-            { 
-                await DisplayAlert("Ошибка", ex.Message, "OK");
+            {
+                
             }
         }
-
-        private void LviewTask_ItemSelected(object sender, SelectedItemChangedEventArgs e)
-        {
-
-        }
     }
 }

+ 0 - 2
esoft_Mobile/esoft_Mobile/Tasks.cs

@@ -16,7 +16,5 @@ namespace esoft_Mobile
         public int Time { get; set; }
         public string Status { get; set; }
         public string WorkType { get; set; }
-        public DateTime? CompletedDateTime { get; set; }
-        public bool IsDeleted { get; set; }
     }
 }

+ 8 - 0
esoft_Mobile/esoft_Mobile/esoft_Mobile.csproj

@@ -11,9 +11,17 @@
     <DebugSymbols>true</DebugSymbols>
   </PropertyGroup>
 
+  <ItemGroup>
+    <None Remove="Exception.png" />
+  </ItemGroup>
+
   <ItemGroup>
     <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
     <PackageReference Include="Xamarin.Forms" Version="5.0.0.2196" />
     <PackageReference Include="Xamarin.Essentials" Version="1.7.0" />
   </ItemGroup>
+
+  <ItemGroup>
+    <Resource Include="Exception.png" />
+  </ItemGroup>
 </Project>