Skip to content

[Android] Fix controls RTL issues#13672

Merged
jsuarezruiz merged 4 commits intomainfrom
fix-2255
Mar 23, 2023
Merged

[Android] Fix controls RTL issues#13672
jsuarezruiz merged 4 commits intomainfrom
fix-2255

Conversation

@jsuarezruiz
Copy link
Copy Markdown
Contributor

@jsuarezruiz jsuarezruiz commented Mar 3, 2023

Description of Change

Fix controls RTL issues.

Android Picker
android-picker-rtl

To test the changes can use the .NET MAUI Gallery, navigate to the Picker samples and change the FlowDirection.

Issues Fixed

Fixes #2255

@jsuarezruiz jsuarezruiz added t/bug Something isn't working legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor labels Mar 3, 2023
@jsuarezruiz jsuarezruiz changed the title Fix controls RTL issues [Android] Fix controls RTL issues Mar 13, 2023
@jsuarezruiz jsuarezruiz marked this pull request as ready for review March 13, 2023 12:16
@jsuarezruiz jsuarezruiz requested a review from PureWeen March 13, 2023 12:16
@jsuarezruiz
Copy link
Copy Markdown
Contributor Author

Let's split this changes in different PRs by platforms. This one covers Android, we will need another one to cover all the issues with iOS.

@github-actions
Copy link
Copy Markdown
Contributor

Thank you for your pull request. We are auto-formatting your source code to follow our code guidelines.

Copy link
Copy Markdown
Contributor

@hartez hartez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to know why we're using GetEffectiveFlowDirection instead of using the inherited flow direction like we do everywhere else in Android.

{
public static void UpdateFlowDirection(this ListView platformView, IView view)
{
switch (view.GetEffectiveFlowDirection())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to use GetEffectiveFlowDirection() here? The flow direction of the parent should be available for the ListView.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FlowDirection's value here is MatchParent, and it uses the Inherit value of LayoutDirection which leaves the ListView UI unchanged.

@jsuarezruiz jsuarezruiz requested a review from hartez March 20, 2023 10:23
Copy link
Copy Markdown
Contributor

@hartez hartez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like this is over-complicating things.

@jsuarezruiz jsuarezruiz requested a review from hartez March 22, 2023 09:18
@github-actions
Copy link
Copy Markdown
Contributor

Thank you for your pull request. We are auto-formatting your source code to follow our code guidelines.

@jsuarezruiz jsuarezruiz merged commit ecb13b4 into main Mar 23, 2023
@jsuarezruiz jsuarezruiz deleted the fix-2255 branch March 23, 2023 15:20
mattleibow pushed a commit that referenced this pull request Mar 26, 2023
* [create-pull-request] automated change (#14151)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Rui Marinho <me@ruimarinho.net>

* [Android] Fix controls RTL issues (#13672)

* Fix Android Picker RTL issues

* More changes

* Auto-format source code

---------

Co-authored-by: GitHub Actions Autoformatter <autoformat@example.com>

* Run templates on Android and iOS (#13662)

Introduces a new Microsoft.Maui.IntegrationTests project to serve as
a runner for the template tests, and any future integration tests that
build or deploy a MAUI project.

This should simplify test parameters for the template tests by moving
parameter "generation" out of yaml/cake and into test method attributes.

Failure debugging should also be improved dramatically by these changes.
Individual template failures will now be easier to spot as each test
configuration will produce a test result that is uploaded to the Azure
Pipelines test tab. These new test results will also contain isolated
logs and attachments for binlogs and other files that can be directly
downloaded on a per-test basis.

Template running is driven by xharness. On Android an Instrumentation
class that launches the main Activity is added to the template
before it is installed. On iOS we wait for the launch command to time
out, as an app crash will cause xharness to return early.

* Update template tests to use net8.0

* [Housekeeping] Added Gallery sample to validate that colors changes from Converters (#14161)

* Added sample to the gallery to validate that colors changes from Converter

* Update src/Controls/samples/Controls.Sample/Converters/BoolToCustomValueConverter.cs

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>

---------

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>

* [Essentials] Remove lock from SecureStorage (#13940)

Removes the lock from SecureStorage usage on Android, and marks GetAsync
and SetAsync as async methods.  This should reduce the likelyhood of
synchronization issues when using SecureStorage from other async code.

The [EncryptedSharedPreferences][0] class provides a thin implementation
of [SharedPreferences][1], which contains locking / data access
synchronization logic.

Rather than creating a `SharedPreferences` instance for every operation,
we will now reuse the first instance that is created.

[0]: https://developer.android.com/reference/androidx/security/crypto/EncryptedSharedPreferences
[1]: https://android.googlesource.com/platform/frameworks/base.git/+/master/core/java/android/app/SharedPreferencesImpl.java

* Make sure that we have valid values for setting the ContentSize of the ScrollView on iOS (#14176)

* [iOS] Don't set constrains for orientation if they are 0

* Simplify the ContentSize/Orientation stuff a bit and add comments

* Auto-format source code

---------

Co-authored-by: Rui Marinho <me@ruimarinho.net>
Co-authored-by: GitHub Actions Autoformatter <autoformat@example.com>

* Always print template creation output

* Bump template creation timeout

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Rui Marinho <me@ruimarinho.net>
Co-authored-by: Javier Suárez <javiersuarezruiz@hotmail.com>
Co-authored-by: GitHub Actions Autoformatter <autoformat@example.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
Co-authored-by: E.Z. Hart <hartez@users.noreply.github.com>
@github-actions github-actions bot locked and limited conversation to collaborators Dec 12, 2023
@samhouts samhouts added the fixed-in-8.0.0-preview.3.8149 Look for this fix in 8.0.0-preview.3.8149! label Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

fixed-in-8.0.0-preview.3.8149 Look for this fix in 8.0.0-preview.3.8149! legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor platform/android t/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Not all controls are currently working with RTL

4 participants