Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
VladislavAntonyuk committed Nov 2, 2023
1 parent 34f0687 commit 40abaa2
Show file tree
Hide file tree
Showing 141 changed files with 1,658 additions and 1,774 deletions.
26 changes: 13 additions & 13 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ updates:
assignees:
- "VladislavAntonyuk"
open-pull-requests-limit: 10
groups:
Microsoft:
patterns:
- "Microsoft*"
Syncfusion:
patterns:
- "Syncfusion*"
CommunityToolkit:
patterns:
- "CommunityToolkit*"
SQLitePCLRaw:
patterns:
- "SQLitePCLRaw*"
groups:
Microsoft:
patterns:
- "Microsoft*"
Syncfusion:
patterns:
- "Syncfusion*"
CommunityToolkit:
patterns:
- "CommunityToolkit*"
SQLitePCLRaw:
patterns:
- "SQLitePCLRaw*"
28 changes: 14 additions & 14 deletions task-list-app-maui/App.xaml → Database/MauiTaskListApp/App.xaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version = "1.0" encoding = "UTF-8" ?>
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:task_list_app_maui"
x:Class="task_list_app_maui.App">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Resources/Styles/Colors.xaml" />
<ResourceDictionary Source="Resources/Styles/Styles.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
<?xml version = "1.0" encoding = "UTF-8" ?>
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:MauiTaskListApp"
x:Class="MauiTaskListApp.App">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Resources/Styles/Colors.xaml" />
<ResourceDictionary Source="Resources/Styles/Styles.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
namespace task_list_app_maui;

public partial class App : Application
{
public App()
{
InitializeComponent();

MainPage = new AppShell();
}
namespace MauiTaskListApp;

public partial class App : Application
{
public App()
{
InitializeComponent();

MainPage = new AppShell();
}
}
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Shell
x:Class="task_list_app_maui.AppShell"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:views="clr-namespace:task_list_app_maui.Views"
Shell.FlyoutBehavior="Disabled"
Shell.BackgroundColor="DarkGreen"
Title="Task List">

<Shell.ToolbarItems>
<ToolbarItem Text="Search"
IconImageSource="search.png"
Clicked="OnSearchClicked" />
<ToolbarItem Text="About"
Order="Secondary"
Clicked="OnAboutClicked" />
</Shell.ToolbarItems>

<TabBar>
<Tab Title="Pending Tasks"
Icon="task_list.png">
<ShellContent ContentTemplate="{DataTemplate views:TarefasPendentesView}" />
</Tab>
<Tab Title="Completed Tasks"
Icon="task_check.png">
<ShellContent ContentTemplate="{DataTemplate views:TarefasConcluidasView}" />
</Tab>
</TabBar>
</Shell>
<?xml version="1.0" encoding="UTF-8" ?>
<Shell
x:Class="MauiTaskListApp.AppShell"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:views="clr-namespace:MauiTaskListApp.Views"
Shell.FlyoutBehavior="Disabled"
Shell.BackgroundColor="DarkGreen"
Title="Task List">

<Shell.ToolbarItems>
<ToolbarItem Text="Search"
IconImageSource="search.png"
Clicked="OnSearchClicked" />

<ToolbarItem Text="About"
Order="Secondary"
Clicked="OnAboutClicked" />
</Shell.ToolbarItems>

<TabBar>
<Tab Title="Pending Tasks"
Icon="task_list.png">

<ShellContent ContentTemplate="{DataTemplate views:PendingTasksView}" />
</Tab>

<Tab Title="Completed Tasks"
Icon="task_check.png">

<ShellContent ContentTemplate="{DataTemplate views:CompletedTasksView}" />
</Tab>
</TabBar>
</Shell>
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
namespace task_list_app_maui;

public partial class AppShell : Shell
{
public AppShell()
{
InitializeComponent();
}

private void OnSearchClicked(object sender, EventArgs e)
{
DisplayAlert(Title, "Search Tasks", "OK");
}

private void OnAboutClicked(object sender, EventArgs e)
{
DisplayAlert(Title, "Information about the Task List app", "OK");
}
namespace MauiTaskListApp;

public partial class AppShell : Shell
{
public AppShell()
{
InitializeComponent();
}

private void OnSearchClicked(object sender, EventArgs e)
{
DisplayAlert(Title, "Search Tasks", "OK");
}

private void OnAboutClicked(object sender, EventArgs e)
{
DisplayAlert(Title, "Information about the Task List app", "OK");
}
}
9 changes: 9 additions & 0 deletions Database/MauiTaskListApp/Data/AppDbContext.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace MauiTaskListApp.Data;

using Microsoft.EntityFrameworkCore;
using Models;

public class AppDbContext(DbContextOptions<AppDbContext> options) : DbContext(options)
{
public DbSet<Task> Tasks => Set<Task>();
}
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
using CommunityToolkit.Maui;
using Microsoft.EntityFrameworkCore;
using task_list_app_maui.Data;
using task_list_app_maui.ViewModels;
using task_list_app_maui.Views;

namespace task_list_app_maui;

public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseMauiCommunityToolkit()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});

builder.Services.AddDbContext<AppDbContext>(options => { options.UseInMemoryDatabase("task-list-app-maui"); });

builder.Services.AddSingleton<TarefasViewModel>();

builder.Services.AddSingleton<TarefasPendentesView>();
builder.Services.AddSingleton<TarefasConcluidasView>();

return builder.Build();
}
namespace MauiTaskListApp;

using CommunityToolkit.Maui;
using Data;
using Microsoft.EntityFrameworkCore;
using ViewModels;
using Views;

public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseMauiCommunityToolkit()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});

builder.Services.AddDbContext<AppDbContext>(options => { options.UseInMemoryDatabase("MauiTaskListApp"); });

builder.Services.AddSingleton<TasksViewModel>();

builder.Services.AddSingleton<PendingTasksView>();
builder.Services.AddSingleton<CompletedTasksView>();

return builder.Build();
}
}
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<RootNamespace>task_list_app_maui</RootNamespace>

<!-- Display name -->
<ApplicationTitle>Task List</ApplicationTitle>

<!-- App Identifier -->
<ApplicationId>jfs-dev.task-list-app-maui</ApplicationId>

<!-- Versions -->
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>
</PropertyGroup>

<ItemGroup>
<!-- App Icon -->
<MauiIcon Include="Resources\AppIcon\appicon.svg" Color="#006400" />

<!-- Splash Screen -->
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#006400" BaseSize="128,128" />

<!-- Images -->
<MauiImage Include="Resources\Images\*" />

<!-- Custom Fonts -->
<MauiFont Include="Resources\Fonts\*" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="CommunityToolkit.Maui" Version="5.3.0" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.0-rc.2.23480.1" />
</ItemGroup>

</Project>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<RootNamespace>MauiTaskListApp</RootNamespace>

<!-- Display name -->
<ApplicationTitle>Task List</ApplicationTitle>

<!-- App Identifier -->
<ApplicationId>jfs-dev.task-list-app-maui</ApplicationId>

<!-- Versions -->
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>
</PropertyGroup>

<ItemGroup>
<!-- App Icon -->
<MauiIcon Include="Resources\AppIcon\appicon.svg" Color="#006400" />

<!-- Splash Screen -->
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#006400" BaseSize="128,128" />

<!-- Images -->
<MauiImage Include="Resources\Images\*" />

<!-- Custom Fonts -->
<MauiFont Include="Resources\Fonts\*" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="CommunityToolkit.Maui" Version="6.0.0" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.0-rc.2.23480.1" />
</ItemGroup>

</Project>
26 changes: 26 additions & 0 deletions Database/MauiTaskListApp/Models/Task.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
namespace MauiTaskListApp.Models;

using System.ComponentModel.DataAnnotations;
using CommunityToolkit.Mvvm.ComponentModel;

public class Task : ObservableValidator
{
private int id;
private string description = string.Empty;
private DateTime date;
private bool isFinished;

[Key]
[Required]
public int Id { get => id; set => SetProperty(ref id, value, true); }

[Required]
[MaxLength(60)]
public string Description { get => description; set => SetProperty(ref description, value, true); }

[Required]
public DateTime Date { get => date; set => SetProperty(ref date, value, true); }

[Required]
public bool IsFinished { get => isFinished; set => SetProperty(ref isFinished, value, true); }
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
Loading

0 comments on commit 40abaa2

Please sign in to comment.