Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#59 change theme setting #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion PlutoWallet.Model/AssetsModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public static async Task GetBalanceAsync(SubstrateClientExt client, string subst
{
var accountInfo = await GetNativeBalance(client.SubstrateClient, substrateAddress, token);

amount = (double)accountInfo.Data.Free.Value / Math.Pow(10, endpoint.Decimals);
amount = 0; // (double)accountInfo.Data.Free.Value / Math.Pow(10, endpoint.Decimals);
}
catch
{
Expand Down
10 changes: 9 additions & 1 deletion PlutoWallet/Components/Settings/SettingsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,15 @@
</settings:GenericButton.GestureRecognizers>

</settings:GenericButton>


<settings:GenericButton Title="Switch Theme">
<settings:GenericButton.GestureRecognizers>
<TapGestureRecognizer Tapped="OnSwitchThemeClicked" />

</settings:GenericButton.GestureRecognizers>

</settings:GenericButton>

<settings:GenericButton Title="Log out (Delete private key)">
<settings:GenericButton.GestureRecognizers>
<TapGestureRecognizer Tapped="OnLogOutClicked" />
Expand Down
17 changes: 17 additions & 0 deletions PlutoWallet/Components/Settings/SettingsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,23 @@ async void OnPredefinedLayoutsClicked(System.Object sender, Microsoft.Maui.Contr
await Navigation.PushAsync(new PredefinedLayoutsPage());
}

async void OnSwitchThemeClicked(System.Object sender, Microsoft.Maui.Controls.TappedEventArgs e)
{
//await Navigation.PushAsync(new PredefinedLayoutsPage());
if (Application.Current.UserAppTheme == AppTheme.Dark)
{
Application.Current.UserAppTheme = AppTheme.Light;
}
else if (Application.Current.UserAppTheme == AppTheme.Light)
{
Application.Current.UserAppTheme = AppTheme.Dark;
}
else
{
Application.Current.UserAppTheme = AppTheme.Dark;
}
}

async void OnLogOutClicked(System.Object sender, Microsoft.Maui.Controls.TappedEventArgs e)
{
Preferences.Remove("publicKey");
Expand Down
2 changes: 1 addition & 1 deletion PlutoWallet/PlutoWallet.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0-ios;net8.0-maccatalyst;net8.0-android34.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
Expand All @@ -11,6 +10,7 @@
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WindowsAppSdkDeploymentManagerInitialize>false</WindowsAppSdkDeploymentManagerInitialize>

<!-- Display name -->
<ApplicationTitle>Pluto wallet</ApplicationTitle>
Expand Down
Loading