Skip to content

Commit

Permalink
Adjust namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
ShortDevelopment committed Jan 6, 2025
1 parent 7891563 commit e1c9934
Show file tree
Hide file tree
Showing 19 changed files with 36 additions and 31 deletions.
6 changes: 1 addition & 5 deletions NearShare.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.1.32421.90
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NearShare.Droid", "src\NearShare.Droid.csproj", "{081AC55E-14D3-42A9-A742-29818E649650}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NearShare.Android", "src\NearShare.Android.csproj", "{081AC55E-14D3-42A9-A742-29818E649650}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ShortDev.Microsoft.ConnectedDevices", "lib\ShortDev.Microsoft.ConnectedDevices\ShortDev.Microsoft.ConnectedDevices.csproj", "{6EBE41DB-AEFB-45C0-A5E1-8A4352CC4B8E}"
EndProject
Expand All @@ -17,10 +17,6 @@ EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CdpSvcUtil", "utils\CdpSvcUtil\CdpSvcUtil.vcxproj", "{CFABE26A-FBFF-4CF9-8C94-B603B317A223}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{F0E5B489-0FD2-4A7E-B660-C28450479583}"
ProjectSection(SolutionItems) = preProject
dockerfile.test = dockerfile.test
testenvironments.json = testenvironments.json
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ShortDev.Microsoft.ConnectedDevices.Test", "tests\ShortDev.Microsoft.ConnectedDevices.Test\ShortDev.Microsoft.ConnectedDevices.Test.csproj", "{B0DE3385-5FD7-4D05-8296-6E298A3F1BA2}"
EndProject
Expand Down
6 changes: 3 additions & 3 deletions src/App.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Android.Runtime;
using AndroidX.AppCompat.App;
using Google.Android.Material.Color;
using NearShare.Droid.Settings;
using NearShare.Settings;

[assembly: UsesPermission(ManifestPermission.Bluetooth)]
[assembly: UsesPermission(ManifestPermission.BluetoothAdmin)]
Expand All @@ -22,12 +22,12 @@
[assembly: UsesFeature("android.hardware.bluetooth", Required = false)]
[assembly: UsesFeature("android.hardware.bluetooth_le", Required = false)]

namespace NearShare.Droid;
namespace NearShare;

[Application]
public sealed class App : Application
{
public App(IntPtr javaReference, JniHandleOwnership transfer) : base(javaReference, transfer)
public App(nint javaReference, JniHandleOwnership transfer) : base(javaReference, transfer)
{
SentrySdk.Init(options =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Net.NetworkInformation;
using ShortDev.Microsoft.ConnectedDevices.Transports.Bluetooth;

namespace NearShare.Droid;
namespace NearShare.Handlers;

public sealed class AndroidBluetoothHandler(BluetoothAdapter adapter, PhysicalAddress macAddress) : IBluetoothHandler
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using ShortDev.Microsoft.ConnectedDevices.Transports.Network;
using System.Net;

namespace NearShare.Droid;
namespace NearShare.Handlers;

internal sealed class AndroidNetworkHandler(Context context) : INetworkHandler
{
Expand Down
5 changes: 3 additions & 2 deletions src/MainActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
using Google.Android.Material.Card;
using Google.Android.Material.Dialog;
using Google.Android.Material.TextField;
using NearShare.Utils;

namespace NearShare.Droid;
namespace NearShare;

[Activity(Label = "@string/app_name", Theme = "@style/AppTheme", MainLauncher = true, ConfigurationChanges = UIHelper.ConfigChangesFlags)]
public sealed class MainActivity : AppCompatActivity
Expand Down Expand Up @@ -42,7 +43,7 @@ private void ReceiveButton_Click(object? sender, EventArgs e)
}

const int FilePickCode = 0x1;
private void SendButton_Click(object? sender, System.EventArgs e)
private void SendButton_Click(object? sender, EventArgs e)
{
StartActivityForResult(
new Intent(Intent.ActionOpenDocument)
Expand Down
3 changes: 3 additions & 0 deletions src/NearShare.Droid.csproj → src/NearShare.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
<UseAndroidCrypto>true</UseAndroidCrypto>
<AndroidErrorOnCustomJavaObject>false</AndroidErrorOnCustomJavaObject>
</PropertyGroup>
<PropertyGroup>
<RootNamespace>NearShare</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<RunAOTCompilation>False</RunAOTCompilation>
<PublishTrimmed>false</PublishTrimmed>
Expand Down
2 changes: 1 addition & 1 deletion src/QuickSettings/ReceiveTileService.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Android.Content;
using Android.Service.QuickSettings;

namespace NearShare.Droid.QuickSettings;
namespace NearShare.QuickSettings;

[IntentFilter([ActionQsTile])]
[Service(Label = "Receive", Exported = true, Icon = "@drawable/quick_settings_tile_icon", Permission = "android.permission.BIND_QUICK_SETTINGS_TILE")]
Expand Down
5 changes: 3 additions & 2 deletions src/ReceiveActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
using Google.Android.Material.Dialog;
using Google.Android.Material.ProgressIndicator;
using Microsoft.Extensions.Logging;
using NearShare.Droid.Utils;
using NearShare.Droid;
using NearShare.Utils;
using ShortDev.Android.UI;
using ShortDev.Microsoft.ConnectedDevices;
using ShortDev.Microsoft.ConnectedDevices.NearShare;
Expand All @@ -18,7 +19,7 @@
using System.Net.NetworkInformation;
using SystemDebug = System.Diagnostics.Debug;

namespace NearShare.Droid;
namespace NearShare;

[Activity(Label = "@string/app_name", Theme = "@style/AppTheme", ConfigurationChanges = UIHelper.ConfigChangesFlags)]
public sealed class ReceiveActivity : AppCompatActivity
Expand Down
3 changes: 2 additions & 1 deletion src/ReceiveSetupActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
using Android.Views;
using AndroidX.AppCompat.App;
using Google.Android.Material.TextField;
using NearShare.Utils;
using ShortDev.Microsoft.ConnectedDevices;
using System.Diagnostics.CodeAnalysis;
using System.Net.NetworkInformation;

namespace NearShare.Droid;
namespace NearShare;

[Activity(Label = "@string/app_name", Theme = "@style/AppTheme", ConfigurationChanges = UIHelper.ConfigChangesFlags)]
public sealed class ReceiveSetupActivity : AppCompatActivity
Expand Down
5 changes: 3 additions & 2 deletions src/SendActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@
using Google.Android.Material.Color;
using Google.Android.Material.ProgressIndicator;
using Microsoft.Extensions.Logging;
using NearShare.Droid.Utils;
using NearShare.Droid;
using NearShare.Utils;
using ShortDev.Android.UI;
using ShortDev.Microsoft.ConnectedDevices;
using ShortDev.Microsoft.ConnectedDevices.NearShare;
using ShortDev.Microsoft.ConnectedDevices.Transports;
using System.Collections.ObjectModel;
using OperationCanceledException = System.OperationCanceledException;

namespace NearShare.Droid;
namespace NearShare;

[IntentFilter([Intent.ActionProcessText], Categories = [Intent.CategoryDefault, Intent.CategoryBrowsable], DataMimeType = "text/plain", Label = "@string/app_name")]
[IntentFilter([Intent.ActionSend, Intent.ActionSendMultiple], Categories = [Intent.CategoryDefault, Intent.CategoryBrowsable], DataMimeType = "*/*")]
Expand Down
2 changes: 1 addition & 1 deletion src/Settings/ISettingsNavigation.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace NearShare.Droid.Settings;
namespace NearShare.Settings;

internal interface ISettingsNavigation
{
Expand Down
3 changes: 2 additions & 1 deletion src/Settings/SettingsActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
using AndroidX.Activity;
using AndroidX.AppCompat.App;
using AndroidX.Preference;
using NearShare.Utils;

namespace NearShare.Droid.Settings;
namespace NearShare.Settings;

[IntentFilter([TileService.ActionQsTilePreferences])]
[Activity(Label = "@string/app_name", Exported = true, Theme = "@style/AppTheme", ConfigurationChanges = UIHelper.ConfigChangesFlags)]
Expand Down
2 changes: 1 addition & 1 deletion src/Settings/SettingsFragment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using AndroidX.Preference;
using Google.Android.Material.Theme.Overlay;

namespace NearShare.Droid.Settings;
namespace NearShare.Settings;

internal abstract class SettingsFragment : PreferenceFragmentCompat
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Android.Views;
using Google.Android.Material.BottomSheet;

namespace NearShare.Droid.Layout;
namespace NearShare.Utils;

public class BottomSheetBehaviorCallback(Activity activity) : BottomSheetBehavior.BottomSheetCallback
{
Expand Down
5 changes: 3 additions & 2 deletions src/Utils/CdpUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
using Android.Content;
using Android.OS;
using Microsoft.Extensions.Logging;
using NearShare.Droid.Settings;
using NearShare.Handlers;
using NearShare.Settings;
using ShortDev.Microsoft.ConnectedDevices;
using ShortDev.Microsoft.ConnectedDevices.Encryption;
using ShortDev.Microsoft.ConnectedDevices.Transports.Bluetooth;
using ShortDev.Microsoft.ConnectedDevices.Transports.Network;
using System.Net.NetworkInformation;

namespace NearShare.Droid.Utils;
namespace NearShare.Utils;

internal static class CdpUtils
{
Expand Down
2 changes: 1 addition & 1 deletion src/Utils/EdgeToEdgeExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Android.Graphics;
using AndroidX.Activity;

namespace NearShare.Droid.Utils;
namespace NearShare.Utils;

internal static class EdgeToEdgeExtensions
{
Expand Down
4 changes: 2 additions & 2 deletions src/FileUtils.cs → src/Utils/FileUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Microsoft.Win32.SafeHandles;
using ShortDev.Microsoft.ConnectedDevices.NearShare;

namespace NearShare.Droid;
namespace NearShare.Utils;

internal static class FileUtils
{
Expand Down Expand Up @@ -50,7 +50,7 @@ public static (AndroidUri uri, FileStream stream) CreateMediaStoreStream(this Co
public static FileStream OpenFileStream(this ContentResolver resolver, AndroidUri mediaUri)
{
using var fileDescriptor = resolver.OpenFileDescriptor(mediaUri, "rwt") ?? throw new InvalidOperationException("Could not open file descriptor");

SafeFileHandle handle = new(fileDescriptor.DetachFd(), ownsHandle: true);
return new(handle, FileAccess.ReadWrite);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Compat.cs → src/Utils/IntentExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
using Java.Lang;
using System.Collections;

namespace NearShare.Droid;
namespace NearShare.Utils;

internal static class Compat
internal static class IntentExtensions
{
public static IList<T>? GetParcelableArrayListExtra<T>(this Intent @this, string? name) where T : Java.Lang.Object
{
Expand Down
4 changes: 2 additions & 2 deletions src/UIHelper.cs → src/Utils/UIHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
using AndroidX.Browser.CustomTabs;
using AndroidX.Core.App;
using Google.Android.Material.Dialog;
using NearShare.Droid.Settings;
using NearShare.Settings;
using System.Runtime.Versioning;
using AlertDialog = AndroidX.AppCompat.App.AlertDialog;
using CompatToolbar = AndroidX.AppCompat.Widget.Toolbar;

namespace NearShare.Droid;
namespace NearShare.Utils;

internal static class UIHelper
{
Expand Down

0 comments on commit e1c9934

Please sign in to comment.