Skip to content

Commit

Permalink
Resolvendo delay entre loading messages e sincronizando dados
Browse files Browse the repository at this point in the history
  • Loading branch information
ozielguimaraes committed Jun 9, 2024
1 parent bb45be6 commit 4cf61f4
Show file tree
Hide file tree
Showing 35 changed files with 617 additions and 309 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ public class ConfigurationConstant
public const string DatabaseName = "Gtech.Ebd";

//public const string BaseUrl = "https://ozielguimaraes.dev/api";
public const string BaseUrl = "https://101e-2804-14d-a4ba-8028-c9dc-ca4b-1b7d-d321.ngrok-free.app/api";
public const string BaseUrl = "https://69a4-2804-14d-a4ba-8028-c9dc-ca4b-1b7d-d321.ngrok-free.app/api";
//public const string BaseUrl = "https://192.168.0.64:5005/api";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
using Ebd.Mobile.Views.Chamada;
using Ebd.MobileApp.Network;
using Ebd.MobileApp.Services.Implementations;
using Ebd.MobileApp.Services.Implementations.BottomSheets;
using Ebd.MobileApp.Services.Interfaces.BottomSheets;
using Ebd.MobileApp.ViewModels.Home;
using Ebd.MobileApp.ViewModels.Perfil;
using Ebd.MobileApp.ViewModels.Welcome;
using Ebd.MobileApp.Views.Welcome;

Expand Down Expand Up @@ -49,6 +52,9 @@ public static IServiceCollection ConfigureAndHandleHttpClient(this IServiceColle

public static IServiceCollection ConfigureServices(this IServiceCollection services)
{
services.AddSingleton<IConfiguracoesDoUsuarioService, ConfiguracoesDoUsuarioService>();
services.AddSingleton<IPreferences>(Preferences.Default);

//services.AddSingleton<IApiService, ApiService>();
services.AddSingleton<ILoggerService, LoggerService>();
services.AddSingleton<IDiagnosticService, DiagnosticService>();
Expand All @@ -67,6 +73,9 @@ public static IServiceCollection ConfigureServices(this IServiceCollection servi
services.AddSingleton<ITurmaService, TurmaService>();
services.AddSingleton<IUsuarioService, UsuarioService>();

//BottomSheets
services.AddSingleton<IEscolherTurmaBottomSheetService, EscolherTurmaBottomSheetService>();

return services;
}

Expand Down Expand Up @@ -110,6 +119,10 @@ public static IServiceCollection ConfigureViewModels(this IServiceCollection ser
services.AddTransient<NovoAlunoViewModel>();
services.AddTransient<AdicionarResponsavelViewModel>();

//Perfil
services.AddTransient<PerfilPageViewModel>();


return services;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
<PackageReference Include="Refractored.MvvmHelpers" Version="1.6.2" />
<PackageReference Include="System.Text.Json" Version="8.0.0" />
<PackageReference Include="CommunityToolkit.Maui" Version="7.0.1" />
<PackageReference Include="The49.Maui.BottomSheet" Version="8.0.3" />
</ItemGroup>

<ItemGroup>
Expand Down Expand Up @@ -199,6 +200,12 @@
<MauiXaml Update="Views\NewItemPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Views\Perfil\PerfilPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Views\Turma\EscolherTurmaBottomSheet.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Views\Welcome\WelcomePage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using CommunityToolkit.Maui;
using Controls.UserDialogs.Maui;
using Microsoft.Extensions.Logging;
using The49.Maui.BottomSheet;

namespace Ebd.Mobile;

Expand All @@ -12,6 +13,7 @@ public static MauiApp CreateMauiApp()
builder
.UseMauiApp<App>()
.UseUserDialogs()
.UseBottomSheet()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSansRegular.ttf", "OpenSansRegular");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<style name="Maui.MainTheme" parent="Theme.Material3.DayNight"></style>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ public bool DeleteItems<T>(Expression<Func<T, bool>> predicate)
public IEnumerable<T> FiltrarItens<T>(Query query, int limit = int.MaxValue)
{
return DataBase
?.GetCollection<T>()
?.Find(query: Query.All(Query.Descending), limit: limit)
?.Take(limit);
.GetCollection<T>()
.Find(query: Query.All(Query.Descending), limit: limit)
.Take(limit);
}

public IEnumerable<T> FiltrarItens<T>(Expression<Func<T, bool>> predicate) => DataBase.GetCollection<T>().Find(predicate);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Ebd.Mobile.Services.Implementations
{
public class AlunoService : BaseService, IAlunoService
internal sealed class AlunoService : BaseService, IAlunoService
{
private const string PathToService = "aluno";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
using Ebd.Mobile.Services.Interfaces;
using Ebd.Mobile.Services.Responses;
using Ebd.Mobile.Services.Responses.Avaliacao;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Ebd.Mobile.Services.Implementations
{
public class AvaliacaoService : BaseService, IAvaliacaoService
internal sealed class AvaliacaoService : BaseService, IAvaliacaoService
{
private const string PathToService = "avaliacao";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Ebd.Mobile.Services.Implementations
{
public class BairroService : BaseService, IBairroService
internal sealed class BairroService : BaseService, IBairroService
{
private const string PathToService = "bairro";

Expand Down
Loading

0 comments on commit 4cf61f4

Please sign in to comment.