MarquisLP / World-Scribe

An Android app for fictional world-building
MIT License
41 stars 7 forks source link

Use .nomedia files to fix Gallery issues #8

Closed MarquisLP closed 6 years ago

MarquisLP commented 6 years ago

The proper way to prevent images from showing up in Android's gallery app is by including a .nomedia file in the appropriate directories.

As such, the Article creation process should be modified to automatically generate this file inside the new Article's directory. Prepending the "." to each image file would no longer be needed, so all functions related to that should be removed.

Additionally, we should also allow the Article Activity to automatically generate a .nomedia file if it's missing from the opened Article's directory.

MarquisLP commented 6 years ago

IMPORTANT NOTE: In order for the .nomedia trick to work on pre-existing images, the user must Force Stop and re-open the Gallery app. If all goes well, images from the app should be gone.

Will need to mention in the Play Store update notes.

MarquisLP commented 6 years ago

Alternatively, the Gallery app should be able to automatically clear out any .nomedia albums if the user leaves the app open for a few seconds.

If that doesn't work, Force Stop should force the Gallery to rescan the folders properly.

MarquisLP commented 6 years ago

The .nomedia file doesn't need to be placed in the same directory as the image — if it's placed in a higher-level directory, then all subfolders will be affected by it.

So in our case, we just need to generate a .nomedia file in the root app folder, "WorldScribe", and that will hide all images from the Gallery app.