Skip to content

Light/Dark mode support for Android #4

@sree-yml

Description

@sree-yml

When your dictionary has root nodes like light and dark. Then it should write token into

value and value-night folder respectively. Also, trim the light and dark from the name itself.

The current behavior is attached below, this won't help in supporting night mode.


<?xml version="1.0" encoding="utf-8"?>
<resources>

    <color name="light_primary">#ff59a4d0</color>
    <color name="light_surface">#ffffffff</color>
    <color name="light_on_surface">#ff000000</color>

    <color name="dark_primary">#ff778994</color>
    <color name="dark_surface">#ff000000</color>
    <color name="dark_on_surface">#ffffffff</color>


</resources>

Expected output

value
- exported_color.xml
value -night
- exported_color.xml

 The content inside the  value folder 
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <color name="primary">#ff59a4d0</color>
    <color name="surface">#ffffffff</color>
    <color name="on_surface">#ff000000</color>
</resources>

The content inside the value-night folder

<?xml version="1.0" encoding="utf-8"?>
<resources>
      <color name="primary">#ff778994</color>
      <color name="surface">#ff000000</color>
     <color name="on_surface">#ffffffff</color>
</resources>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions