Project: titanium
Issue TIMOB-23266: Android: Hyperloop: Allow requiring java package to access types
Currently, when we want to use a {{View}} with Hyperloop, we need to require it the following way: *Android*: {code:javascript} var View = require("android.view.View"); {code} Now if we want to use another class from the {{android.view}} package e.g. {{Menu}}, we need to do: {code:javascript} var Menu = require("android.view.Menu"); {code} The approach is to make it possible to require frameworks like we do it in Swift/Objective-C and expose the available classes automatically: {code:javascript} var androidViewPackage = require("android.view.*"); var view = new androidViewPackage.View(); var menu = new androidViewPackage.Menu(); {code} Or using ES6 syntax: {code:javascript} import { View, Menu } from 'android.view.*'; var view = new View(); var menu = new Menu(); {code}
Story points: 8