Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23551] Hyperloop: Android - Objects should have have a `className` parameter

GitHub Issuen/a
TypeImprovement
PriorityHigh
StatusClosed
ResolutionInvalid
Resolution Date2017-11-09T19:25:16.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsHyperloop
Labelsn/a
ReporterBert Grantges
AssigneeJan Vennemann
Created2016-06-23T00:44:52.000+0000
Updated2018-08-06T17:37:02.000+0000

Description

There should be a way to determine the type of a Hyperloop Object in order to type check it if needed. This could be done using the .apiName concept used in Titanium or perhaps a className property on the object.

Comments

  1. Bert Grantges 2016-06-27

    This may already exist, can we confirm that the function isInstanceOf returns the expected ClassName?
  2. Jan Vennemann 2017-11-09

    Already implemented via the instanceof operator.
       ar Activity = require('android.app.Activity');
       var Context = require('android.content.Context');
       var View = require('android.view.View');
       var currentActivity = new Activity(Ti.Android.currentActivity);
       console.log(currentActivity instanceof Activity); // Prints true
       console.log(currentActivity instanceof Context); // Prints true
       console.log(currentActivity instanceof View); // Prints false
       
  3. Eric Merriman 2018-08-06

    Closing as invalid. If incorrect, please reopen.

JSON Source