Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds an option to allow add resources to Android res/ directory #2580

Closed
wants to merge 3 commits into from

Conversation

DexerBR
Copy link
Contributor

@DexerBR DexerBR commented Apr 18, 2022

Related to kivy/buildozer#1428

Reference: https://developer.android.com/guide/topics/resources/providing-resources

PRs it can cover (at least partially) :
#2330
#2200
#1922
#2299
#2570
#2322

Maybe related issues:
#1964
#2298
#2614

Important notes:

  • It is important that the user defined resource folder follows the file structure of the Android documentation linked above.
  • If not followed, p4a will perform the copy/overwrite, according to the documentation:
    • Only folders will be copied to res/ directory.
    • Only files will be copied to each of the folders (existing or to be created) in the res/ directory.

Copy/overwrite process steps:

  • Clean android resources directory (res)
  • Create default/required p4a res directories (I believe this still needs to be defined)
    • Current default res directories:

      • drawable
      • drawable-mdpi
      • drawable-hdpi
      • drawable-xhdpi
      • drawable-xxhdpi
      • layout
      • mipmap
      • mipmap-anydpi-v26
      • values
      • xml
    • Currently in p4a, some of these directories are required by later code, but the directory is not created if it doesn't exist.

    • I'm not sure if they all need to stay or if it would be nice to include others by default (Although they are not needed by p4a at the moment).

  • Copy default/required p4a files (currently, many of them are copied on demand along the code. It might be interesting to keep this in one place).
  • Finally, copy directories and files (overwrite where applicable) according to user defined folder (via add-res argument) in res folder.

❗Note: Later arguments that change files in the resource folder, such as icon_fg, icon_bg, may override the add-res argument, if the user decides to put an icon in the "custom resource folder", and then pass another file to the icon_fg argument, for example. Changes in this behavior may also need to be evaluated.

Some things need tweaking, but overall, the templating process needs an update.

@DexerBR DexerBR changed the title [WIP] Adds an option to allow add resources to Android res/ directory Adds an option to allow add resources to Android res/ directory Jul 30, 2022
@RobertFlatt RobertFlatt mentioned this pull request Oct 10, 2022
@misl6
Copy link
Member

misl6 commented Nov 5, 2022

Superseded by #2684

Thank you!

@misl6 misl6 closed this Nov 5, 2022
@DexerBR DexerBR deleted the android_add_resources branch November 5, 2022 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants