NoriginMedia/Norigin-Spatial-Navigation

Dynamic RTL switching

karimlaham opened this issue · 2 comments

Is your feature request related to a problem? Please describe.
My app supports dynamic switching of languages, hence necessitates updating the writingDirection prop of the spacial navigation instance
I want to do so without calling init again

Describe the solution you'd like
I would like to add the bellow function to the SpacialNavigation.ts class
bellow is my suggestion

 /**
   * This function updates the writing direction
   * @param rtl whether the writing direction is right-to-left
   */
  updateRtl(rtl: boolean) {
    this.writingDirection = rtl ? WritingDirection.RTL : WritingDirection.LTR;
  }

reference to PR with suggested change: #120