Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(core): Added support for style direction property (ltr/rtl)#10691

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
CatchABus wants to merge16 commits intoNativeScript:main
base:main
Choose a base branch
Loading
fromCatchABus:feat/css-direction

Conversation

CatchABus
Copy link
Contributor

@CatchABusCatchABus commentedFeb 5, 2025
edited
Loading

PR Checklist

What is the current behavior?

Right now, core has no support for enforcing a layout direction.

What is the new behavior?

Added cssdirection inherited property for a minimal RTL support.
This property will use the native APIs of each platform which means that enforcing a layout direction will automatically provide the default native direction experience.

For example, iOS UINavigationBar will align back button to the right in the case of RTL.

The following cases will additionally be affected by layout direction:

  • Navigation transition
    • The regularslide transition will slide to the right in the case of RTL direction
    • The regularflip transition will flip to the left in the case of RTL direction (it used to and will flip to the right in the case of LTR)
  • Corrected the iOS button text alignment. Core demands that the default is center just like android
  • Added support forstart andend values tohorizontalAlignment property in order for views to be able to align based on layout direction
  • TheLabel default or initial text alignment shall respect the layout direction
  • AddedhasRtlSupport helper function to determine whether an app supports RTL (it's always true for iOS)
  • Regarding iOS horizontal ScrollView, the initial scrollbar position will align to the end in the case of RTL direction (this was a default on android)
  • Added missing iOSFlexboxLayout layout direction support for flex alignment and direction

Few things to consider:

  • Text alignment does not supportstart andend values yet. It's doable but will require extra workaround for iOS since it only providesleft andright for aligning to each side. For the time being, users can rely ontext-align: initial the default of which isleft for LTR andright for RTL
  • Android does not support RTL by default. Users will have to append theandroid:supportsRtl="true" flag to Application tag inAndroidManifest.xml in order to support it

NativeScript app templates shall not support RTL by default since it adds extra burden to layout and processing and it's a feature meant for a small number of languages.
User is responsible to enable RTL in one's own app usingandroid:supportsRtl="true".

This PR adds a set a features to have as many needs as possible based on#7094#9465 requests.
Fixes/Implements/Closes#6051#6156.

vallemar reacted with hooray emoji
@kefahB
Copy link
Contributor

Hello@CatchABus,

Maybe we can consider add flag like ´rtl´to the NS cli, this will add extra stuff for android and maybe IOS.

Yes it is for a small number of language, but if NS gain full support for arabic and asiatic languages, it will be a new huge market.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Android align-text bug with Arabic characters
2 participants
@CatchABus@kefahB

[8]ページ先頭

©2009-2025 Movatter.jp