Skip to content

Commit 73c2ab2

Browse files
committed
chore: code cleanup
1 parent 6bb1398 commit 73c2ab2

28 files changed

+398
-213
lines changed

UI/Navigation/src/.editorconfig

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
; This file is for unifying the coding style for different editors and IDEs.
2+
; More information at http://editorconfig.org
3+
4+
# This file is the top-most EditorConfig file
5+
root = true
6+
7+
##########################################
8+
# Common Settings
9+
##########################################
10+
11+
[*]
12+
indent_style = tab
13+
end_of_line = crlf
14+
trim_trailing_whitespace = true
15+
insert_final_newline = true
16+
charset = utf-8
17+
18+
##########################################
19+
# File Extension Settings
20+
##########################################
21+
22+
[*.{yml,yaml}]
23+
indent_size = 2
24+
25+
[.vsconfig]
26+
indent_size = 2
27+
end_of_line = lf
28+
29+
[*.sln]
30+
indent_style = tab
31+
indent_size = 2
32+
33+
[*.{csproj,proj,projitems,shproj}]
34+
indent_size = 2
35+
36+
[*.{json,slnf}]
37+
indent_size = 2
38+
end_of_line = lf
39+
40+
[*.{props,targets}]
41+
indent_size = 2
42+
43+
[*.xaml]
44+
indent_size = 4
45+
charset = utf-8-bom
46+
47+
[*.xml]
48+
indent_size = 2
49+
end_of_line = lf
50+
51+
[*.plist]
52+
indent_size = 2
53+
indent_style = tab
54+
end_of_line = lf
55+
56+
[*.manifest]
57+
indent_size = 2
58+
59+
[*.appxmanifest]
60+
indent_size = 2
61+
62+
[*.{json,css,webmanifest}]
63+
indent_size = 2
64+
end_of_line = lf
65+
66+
[web.config]
67+
indent_size = 2
68+
end_of_line = lf
69+
70+
[*.sh]
71+
indent_size = 2
72+
end_of_line = lf
73+
74+
[*.cs]
75+
# EOL should be normalized by Git. See https://github.com/dotnet/format/issues/1099
76+
end_of_line = unset
77+
78+
# See https://github.com/dotnet/roslyn/issues/20356#issuecomment-310143926
79+
trim_trailing_whitespace = false
80+
81+
tab_width = 4
82+
indent_size = 4
83+
84+
# Sort using and Import directives with System.* appearing first
85+
dotnet_sort_system_directives_first = true
86+
87+
# Avoid "this." and "Me." if not necessary
88+
dotnet_style_qualification_for_field = false:suggestion
89+
dotnet_style_qualification_for_property = false:suggestion
90+
dotnet_style_qualification_for_method = false:suggestion
91+
dotnet_style_qualification_for_event = false:suggestion
92+
93+
#### Naming styles ####
94+
95+
# Naming rules
96+
97+
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
98+
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
99+
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
100+
101+
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
102+
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
103+
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
104+
105+
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
106+
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
107+
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
108+
109+
# Symbol specifications
110+
111+
dotnet_naming_symbols.interface.applicable_kinds = interface
112+
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
113+
dotnet_naming_symbols.interface.required_modifiers =
114+
115+
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
116+
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
117+
dotnet_naming_symbols.types.required_modifiers =
118+
119+
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
120+
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
121+
dotnet_naming_symbols.non_field_members.required_modifiers =
122+
123+
# Naming styles
124+
125+
dotnet_naming_style.begins_with_i.required_prefix = I
126+
dotnet_naming_style.begins_with_i.required_suffix =
127+
dotnet_naming_style.begins_with_i.word_separator =
128+
dotnet_naming_style.begins_with_i.capitalization = pascal_case
129+
130+
dotnet_naming_style.pascal_case.required_prefix =
131+
dotnet_naming_style.pascal_case.required_suffix =
132+
dotnet_naming_style.pascal_case.word_separator =
133+
dotnet_naming_style.pascal_case.capitalization = pascal_case
134+
135+
dotnet_naming_style.pascal_case.required_prefix =
136+
dotnet_naming_style.pascal_case.required_suffix =
137+
dotnet_naming_style.pascal_case.word_separator =
138+
dotnet_naming_style.pascal_case.capitalization = pascal_case
139+
dotnet_style_operator_placement_when_wrapping = beginning_of_line
140+
dotnet_style_coalesce_expression = true:suggestion
141+
dotnet_style_null_propagation = true:suggestion
142+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
143+
dotnet_style_prefer_auto_properties = true:silent
144+
dotnet_style_object_initializer = true:suggestion
145+
dotnet_style_collection_initializer = true:suggestion
146+
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
147+
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
148+
dotnet_style_prefer_conditional_expression_over_return = true:silent
149+
dotnet_style_explicit_tuple_names = true:suggestion
150+
dotnet_style_prefer_inferred_tuple_names = true:suggestion
151+
152+
csharp_indent_labels = one_less_than_current
153+
csharp_using_directive_placement = outside_namespace:silent
154+
csharp_prefer_simple_using_statement = true:suggestion
155+
csharp_prefer_braces = true:silent
156+
csharp_style_namespace_declarations = file_scoped:warning
157+
csharp_style_prefer_method_group_conversion = true:silent
158+
csharp_style_prefer_top_level_statements = true:silent
159+
csharp_style_prefer_primary_constructors = true:suggestion
160+
csharp_style_expression_bodied_methods = false:silent
161+
csharp_style_expression_bodied_constructors = false:silent
162+
csharp_style_expression_bodied_operators = false:silent
163+
csharp_style_expression_bodied_properties = true:silent
164+
csharp_style_expression_bodied_indexers = true:silent
165+
csharp_style_expression_bodied_accessors = true:silent
166+
csharp_style_expression_bodied_lambdas = true:silent
167+
csharp_style_expression_bodied_local_functions = false:silent

UI/Navigation/src/Navigation.sln

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
44
VisualStudioVersion = 17.10.35013.160
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Navigation", "Navigation\Navigation.csproj", "{AF5523B7-BCCF-42B4-A070-0C33277191D4}"
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Navigation", "Navigation\Navigation.csproj", "{AF5523B7-BCCF-42B4-A070-0C33277191D4}"
77
EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B2FBCD5C-9643-442D-BF19-2E0E6D2C26A9}"
99
ProjectSection(SolutionItems) = preProject
10+
.editorconfig = .editorconfig
1011
.gitignore = .gitignore
1112
Directory.Build.props = Directory.Build.props
1213
Directory.Build.targets = Directory.Build.targets

UI/Navigation/src/Navigation/App.xaml.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using Uno.Resizetizer;
2-
31
namespace Navigation;
42
public partial class App : Application
53
{
Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,2 @@
1-
global using System.Collections.Immutable;
2-
global using CommunityToolkit.Mvvm.ComponentModel;
3-
global using CommunityToolkit.Mvvm.Input;
4-
global using Microsoft.Extensions.DependencyInjection;
5-
global using Microsoft.Extensions.Hosting;
6-
global using Microsoft.Extensions.Logging;
7-
global using Navigation.Models;
1+
global using Navigation.Models;
82
global using Navigation.Presentation;
9-
global using ApplicationExecutionState = Windows.ApplicationModel.Activation.ApplicationExecutionState;
Lines changed: 19 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,32 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using Android.App;
61
using Android.Content;
7-
using Android.OS;
82
using Android.Runtime;
9-
using Android.Views;
10-
using Android.Widget;
11-
using Com.Nostra13.Universalimageloader.Core;
12-
using Microsoft.UI.Xaml.Media;
133

144
namespace Navigation.Droid;
155
[global::Android.App.ApplicationAttribute(
16-
Label = "@string/ApplicationName",
17-
Icon = "@mipmap/icon",
18-
LargeHeap = true,
19-
HardwareAccelerated = true,
20-
Theme = "@style/AppTheme"
6+
Label = "@string/ApplicationName",
7+
Icon = "@mipmap/icon",
8+
LargeHeap = true,
9+
HardwareAccelerated = true,
10+
Theme = "@style/AppTheme"
2111
)]
2212
public class Application : Microsoft.UI.Xaml.NativeApplication
2313
{
24-
public Application(IntPtr javaReference, JniHandleOwnership transfer)
25-
: base(() => new App(), javaReference, transfer)
26-
{
27-
ConfigureUniversalImageLoader();
28-
}
14+
public Application(IntPtr javaReference, JniHandleOwnership transfer)
15+
: base(() => new App(), javaReference, transfer)
16+
{
17+
ConfigureUniversalImageLoader();
18+
}
2919

30-
private static void ConfigureUniversalImageLoader()
31-
{
32-
// Create global configuration and initialize ImageLoader with this config
33-
ImageLoaderConfiguration config = new ImageLoaderConfiguration
34-
.Builder(Context)
35-
.Build();
20+
private static void ConfigureUniversalImageLoader()
21+
{
22+
// Create global configuration and initialize ImageLoader with this config
23+
ImageLoaderConfiguration config = new ImageLoaderConfiguration
24+
.Builder(Context)
25+
.Build();
3626

37-
ImageLoader.Instance.Init(config);
27+
ImageLoader.Instance.Init(config);
3828

39-
ImageSource.DefaultImageLoader = ImageLoader.Instance.LoadImageAsync;
40-
}
29+
ImageSource.DefaultImageLoader = ImageLoader.Instance.LoadImageAsync;
30+
}
4131
}
4232

UI/Navigation/src/Navigation/Platforms/Android/MainActivity.Android.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
using Android.App;
2-
using Android.Content.PM;
3-
using Android.OS;
42
using Android.Views;
5-
using Android.Widget;
63

74
namespace Navigation.Droid;
85
[Activity(
9-
MainLauncher = true,
10-
ConfigurationChanges = global::Uno.UI.ActivityHelper.AllConfigChanges,
11-
WindowSoftInputMode = SoftInput.AdjustNothing | SoftInput.StateHidden
6+
MainLauncher = true,
7+
ConfigurationChanges = global::Uno.UI.ActivityHelper.AllConfigChanges,
8+
WindowSoftInputMode = SoftInput.AdjustNothing | SoftInput.StateHidden
129
)]
1310
public class MainActivity : Microsoft.UI.Xaml.ApplicationActivity
1411
{
Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
1-
using Uno.UI.Runtime.Skia;
2-
31
namespace Navigation;
42
public class Program
53
{
6-
[STAThread]
7-
public static void Main(string[] args)
8-
{
9-
var host = SkiaHostBuilder.Create()
10-
.App(() => new App())
11-
.UseX11()
12-
.UseLinuxFrameBuffer()
13-
.UseMacOS()
14-
.UseWindows()
15-
.Build();
4+
[STAThread]
5+
public static void Main(string[] args)
6+
{
7+
var host = SkiaHostBuilder.Create()
8+
.App(() => new App())
9+
.UseX11()
10+
.UseLinuxFrameBuffer()
11+
.UseMacOS()
12+
.UseWindows()
13+
.Build();
1614

17-
host.Run();
18-
}
15+
host.Run();
16+
}
1917
}

UI/Navigation/src/Navigation/Platforms/MacCatalyst/Main.maccatalyst.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
namespace Navigation.MacCatalyst;
44
public class EntryPoint
55
{
6-
// This is the main entry point of the application.
7-
public static void Main(string[] args)
8-
{
9-
// if you want to use a different Application Delegate class from "AppDelegate"
10-
// you can specify it here.
11-
UIApplication.Main(args, null, typeof(App));
12-
}
6+
// This is the main entry point of the application.
7+
public static void Main(string[] args)
8+
{
9+
// if you want to use a different Application Delegate class from "AppDelegate"
10+
// you can specify it here.
11+
UIApplication.Main(args, null, typeof(App));
12+
}
1313
}

UI/Navigation/src/Navigation/Platforms/WebAssembly/Program.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ namespace Navigation;
22

33
public class Program
44
{
5-
private static App? _app;
5+
private static App? _app;
66

7-
public static int Main(string[] args)
8-
{
9-
Microsoft.UI.Xaml.Application.Start(_ => _app = new App());
7+
public static int Main(string[] args)
8+
{
9+
Microsoft.UI.Xaml.Application.Start(_ => _app = new App());
1010

11-
return 0;
12-
}
11+
return 0;
12+
}
1313
}

UI/Navigation/src/Navigation/Platforms/iOS/Main.iOS.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
namespace Navigation.iOS;
44
public class EntryPoint
55
{
6-
// This is the main entry point of the application.
7-
public static void Main(string[] args)
8-
{
9-
// if you want to use a different Application Delegate class from "AppDelegate"
10-
// you can specify it here.
11-
UIApplication.Main(args, null, typeof(App));
12-
}
6+
// This is the main entry point of the application.
7+
public static void Main(string[] args)
8+
{
9+
// if you want to use a different Application Delegate class from "AppDelegate"
10+
// you can specify it here.
11+
UIApplication.Main(args, null, typeof(App));
12+
}
1313
}

0 commit comments

Comments
 (0)