Skip to content

Commit

Permalink
Improve readability and add CreateWindow method
Browse files Browse the repository at this point in the history
Enhanced code readability by removing unnecessary spaces in various files, including conditional statements and XML files. Added an override method `CreateWindow` in `App.xaml.cs` to handle window creation with `AppShell`. Updated `splash.svg` to include a DOCTYPE declaration and adjusted formatting. Added a debug statement in `SwitchView.cs` to log changes in the `IsToggled` property.
  • Loading branch information
IeuanWalker committed Nov 19, 2024
1 parent bd5bff1 commit f6f93bc
Show file tree
Hide file tree
Showing 15 changed files with 137 additions and 136 deletions.
1 change: 1 addition & 0 deletions Demo/App/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ public App()
{
InitializeComponent();
}

protected override Window CreateWindow(IActivationState? activationState) => new(new AppShell());
}
6 changes: 3 additions & 3 deletions Demo/App/Controls/CustomSwitchExamples/Theme2Switch.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ void CustomSwitch_SwitchPanUpdate(CustomSwitch customSwitch, SwitchPanUpdatedEve
double t = e.Percentage * 0.01;

KnobContent.TranslationX = -(e.TranslateX + e.XRef);
if (e.IsToggled)
if(e.IsToggled)
{
if (e.Percentage >= 50)
if(e.Percentage >= 50)
{
MoonImg.Opacity = (e.Percentage - 50) * 2 * 0.01;
Stars.Opacity = (e.Percentage - 50) * 2 * 0.01;
Expand All @@ -55,7 +55,7 @@ void CustomSwitch_SwitchPanUpdate(CustomSwitch customSwitch, SwitchPanUpdatedEve
}
else
{
if (e.Percentage <= 50)
if(e.Percentage <= 50)
{
MoonImg.Opacity = (100 - (e.Percentage * 2)) * 0.01;
Stars.Opacity = (100 - (e.Percentage * 2)) * 0.01;
Expand Down
2 changes: 1 addition & 1 deletion Demo/App/Controls/SwitchViewExamples/BorderSwitch.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ protected override void IsToggledChanged()

void StyleSwitch()
{
if (IsToggled)
if(IsToggled)
{
SwitchBackground.StrokeShape = new RoundRectangle
{
Expand Down
2 changes: 1 addition & 1 deletion Demo/App/Pages/CustomSwitchPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public CustomSwitchPage()

async void Switch_OnToggled(object sender, ToggledEventArgs e)
{
if (_viewModel.EnableEvents)
if(_viewModel.EnableEvents)
{
await Application.Current!.Windows[0].Page!.DisplayAlert("Switch toggled (Event)", $"New value: {e.Value}", "OK").ConfigureAwait(false);
}
Expand Down
2 changes: 1 addition & 1 deletion Demo/App/Pages/SwitchViewPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public SwitchViewPage()

async void Switch_OnToggled(object sender, ToggledEventArgs e)
{
if (_viewModel.EnableEvents)
if(_viewModel.EnableEvents)
{
await Application.Current!.Windows[0].Page!.DisplayAlert("Switch toggled (Event)", $"New value: {e.Value}", "OK").ConfigureAwait(false);
}
Expand Down
4 changes: 2 additions & 2 deletions Demo/App/Platforms/Android/AndroidManifest.xml
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" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
10 changes: 5 additions & 5 deletions Demo/App/Platforms/Tizen/tizen-manifest.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="maui-application-id-placeholder" version="0.0.0" api-version="7" xmlns="http://tizen.org/ns/packages">
<profile name="common" />
<profile name="common"/>
<ui-application appid="maui-application-id-placeholder" exec="App.dll" multiple="false" nodisplay="false" taskmanage="true" type="dotnet" launch_mode="single">
<label>maui-application-title-placeholder</label>
<icon>maui-appicon-placeholder</icon>
<metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" />
<metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true"/>
</ui-application>
<shortcut-list />
<shortcut-list/>
<privileges>
<privilege>http://tizen.org/privilege/internet</privilege>
</privileges>
<dependencies />
<provides-appdefined-privileges />
<dependencies/>
<provides-appdefined-privileges/>
</manifest>
4 changes: 2 additions & 2 deletions Demo/App/Resources/AppIcon/appicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions Demo/App/Resources/AppIcon/appiconfg.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit f6f93bc

Please sign in to comment.