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

Rename old Xamarin -> MAUI android resource/provider #4211

Merged
merged 3 commits into from
Jan 20, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ static void DataUpdated(CMDeviceMotion data, NSError error)
// the quaternion returned by the MotionManager refers to a frame where the X axis points north ("iOS frame")
var q = new Quaternion((float)field.x, (float)field.y, (float)field.z, (float)field.w);

// in Xamarin, the reference frame is defined such that Y points north and Z is vertical,
// so we first rotate by 90 degrees around the Z axis, in order to get from the Xamarin frame to the iOS frame
// In MAUI, the reference frame is defined such that Y points north and Z is vertical,
jamesmontemagno marked this conversation as resolved.
Show resolved Hide resolved
// so we first rotate by 90 degrees around the Z axis, in order to get from the MAUI frame to the iOS frame
jamesmontemagno marked this conversation as resolved.
Show resolved Hide resolved
var qz90 = Quaternion.CreateFromAxisAngle(Vector3.UnitZ, (float)(Math.PI / 2.0));

// on top of this rotation, we apply the actual quaternion obtained from the MotionManager,
// so that the final quaternion will take us from the earth frame in Xamarin convention to the phone frame
// so that the final quaternion will take us from the earth frame in MAUI convention to the phone frame
jamesmontemagno marked this conversation as resolved.
Show resolved Hide resolved
q = Quaternion.Multiply(qz90, q);
var rotationData = new OrientationSensorData(q.X, q.Y, q.Z, q.W);
OnChanged(rotationData);
Expand Down
6 changes: 3 additions & 3 deletions src/Essentials/src/Types/FileProvider.android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ namespace Microsoft.Maui.Essentials
{
[ContentProvider(
new[] { "${applicationId}.fileProvider" },
Name = "xamarin.essentials.fileProvider",
Name = "microsoft.maui.essentials.fileProvider",
Exported = false,
GrantUriPermissions = true)]
[MetaData(
"android.support.FILE_PROVIDER_PATHS", // IMPORTANT: This string doesn't change with AndroidX
Resource = "@xml/xamarin_essentials_fileprovider_file_paths")]
Resource = "@xml/microsoft_maui_essentials_fileprovider_file_paths")]
public class FileProvider : ContentFileProvider
{
internal static bool AlwaysFailExternalMediaAccess { get; set; } = false;
Expand Down Expand Up @@ -64,7 +64,7 @@ internal static bool IsFileInPublicLocation(string filename)
var file = new Java.IO.File(filename);
filename = file.CanonicalPath;

// the shared paths from the "xamarin_essentials_fileprovider_file_paths.xml" resource
// the shared paths from the "microsoft_maui_essentials_fileprovider_file_paths.xml" resource
var publicLocations = new List<string>
{
#if __ANDROID_29__
Expand Down