Background
Sometimes, you wish to put some placeholders to be shown only on the IDE, in layout files.
As an example, you can use this:
<ImageView tools:src="@tools:sample/avatars" ... />
And get this in the preview:
Such files are not part of the APK you get when you build your app, so it's safe to use just for developing.
This is what I was told from here:
With sample data in 3.0, you can now have placeholder images that are not part of the compiled apk. You just need a sampledata directory in your project with a subdirectory containing all the images you want to use as placeholders. You can refer those images from "tools" attributes. Also, there are predefined stock images like @sample/avatars or @sample/background/scenic
The problem
I can't find how to add more of such images into the project (so that they will only be used in the IDE, and not a part of the APK), and if there is a way to put other resources, other than images.
In fact I can't find the docs of this feature.
What I tried
I tried to put an image on "res/sampledata" and tried on "res/sample", but I wasn't able to reach it in both cases.
The questions
- What's even the name of this feature?
- How can I put the image file into the project, and use it as a placeholder this way ? In which folder?
- Is it possible to add more images to be used this way?
- Is it possible to add other resources? Layouts? Strings?
- Are there more capabilities of this new feature?