MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / addDrawable

Function addDrawable

packages/core/ui/tab-view/index.android.ts:296–303  ·  view source on GitHub ↗
(is: ImageSource)

Source from the content-addressed store, hash-verified

294
295 if (item.iconSource) {
296 const addDrawable = (is: ImageSource) => {
297 if (is) {
298 // TODO: Make this native call that accepts string so that we don't load Bitmap in JS.
299 result.iconDrawable = new android.graphics.drawable.BitmapDrawable(appResources, is.android);
300 } else {
301 traceMissingIcon(item.iconSource);
302 }
303 };
304 if (item.iconSource.indexOf(RESOURCE_PREFIX) === 0) {
305 result.iconId = androidUtils.resources.getDrawableId(item.iconSource.slice(RESOURCE_PREFIX.length));
306 if (result.iconId === 0) {

Callers 1

createTabItemSpecFunction · 0.85

Calls 1

traceMissingIconFunction · 0.90

Tested by

no test coverage detected