-
Notifications
You must be signed in to change notification settings - Fork 424
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Media Element Android Layout (#1814)
The most significant changes in the code include the removal of the `WidthRequest` attribute in `MediaElementPage.xaml`, the addition of the `ResizeableActivity = true` attribute in `MainActivity.cs`, and the modification of the `OnFullscreenButtonClick` method in the `MauiMediaElement` class. 1. The `WidthRequest` attribute of the `MediaElement` toolkit was removed from `MediaElementPage.xaml`. This attribute was previously used to set the width of the media element based on the device type (tablet or default). 2. The `Activity` attribute in `MainActivity.cs` was modified to include `ResizeableActivity = true`. This change allows the activity to be resizable. 3. In `MauiMediaElement.android.cs`, the `Android.Util` namespace was added to the import statements. Two new integer variables `playerHeight` and `playerWidth` were added to the `MauiMediaElement` class. These variables are used to store the height and width of the player view. 4. The `OnFullscreenButtonClick` method of the `MauiMediaElement` class was updated. The new code stores the current player view's height and width, retrieves the display metrics, removes the player view from its current layout, and adds it to a new layout with updated parameters. The code for exiting fullscreen mode was also updated to restore the player view to its original size and layout. 5. In `MediaManager.android.cs`, the import statement for `AndroidX.CoordinatorLayout.Widget` was removed. The `LayoutParameters` attribute of the `PlayerView` object was changed from `FrameLayout.LayoutParams` to `RelativeLayout.LayoutParams`. This change aligns with the updates made in the `MauiMediaElement` class, where the player view is now added to a `RelativeLayout` instead of a `FrameLayout`. Co-authored-by: Brandon Minnick <13558917+brminnick@users.noreply.github.com>
- Loading branch information
1 parent
bcd463e
commit 971842b
Showing
4 changed files
with
23 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters