MCPcopy Index your code
hub / github.com/NativeScript/firebase / getResourceId

Function getResourceId

packages/firebase-ui/index.android.ts:605–618  ·  view source on GitHub ↗
(res: string = '')

Source from the content-addressed store, hash-verified

603});
604
605function getResourceId(res: string = '') {
606 const context = Utils.android.getApplicationContext();
607 if (!context) return java.lang.Integer.valueOf(0);
608 if (typeof res === 'string' && res.startsWith('res://')) {
609 const packageName = context.getPackageName();
610 try {
611 const className = java.lang.Class.forName(`${packageName}.R$drawable`);
612 return java.lang.Integer.valueOf(parseInt(String(className.getDeclaredField(res.replace('res://', '')).get(null))));
613 } catch (e) {
614 return java.lang.Integer.valueOf(0);
615 }
616 }
617 return java.lang.Integer.valueOf(0);
618}
619
620export class UI implements IUI {
621 _native: com.firebase.ui.auth.AuthUI;

Callers

nothing calls this directly

Calls 2

valueOfMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…