nativescript-custom-bottomsheet
Version:
Nativescript Custom Bottomsheet is a plugin that enable the show a custom beautiful actionsheet/bottomsheet.
26 lines • 1.39 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
var app = require("tns-core-modules/application");
var utils = require("tns-core-modules/utils/utils");
var CustomBottomsheet = (function () {
function CustomBottomsheet() {
}
CustomBottomsheet.prototype.show = function (options) {
var itemList = new java.util.ArrayList();
options.items.forEach(function (val) {
var item = new com.eljo.skhye05.custombottomsheet.CustomBottomSheetItem(val.title, utils.ad.resources.getDrawableId(val.icon));
itemList.add(item);
});
var bottomSheetFragment = new com.eljo.skhye05.custombottomsheet.CustomBottomSheetFragment(utils.ad.resources.getDrawableId(options.icon), options.title, itemList);
bottomSheetFragment.setOnItemClickListener(new com.eljo.skhye05.custombottomsheet.CustomBottomSheetFragment.OnItemClickListener({
onClick: function (position) {
options.onItemTap(position, options.items[position]);
bottomSheetFragment.dismiss();
}
}));
bottomSheetFragment.show(app.android.foregroundActivity.getSupportFragmentManager(), bottomSheetFragment.getTag());
};
return CustomBottomsheet;
}());
exports.CustomBottomsheet = CustomBottomsheet;
//# sourceMappingURL=custom-bottomsheet.android.js.map
;