Picture of tsn
Registered 4 years 358 days
tsn Wednesday, 1 July 2020, 09:19 AM
UI controls
Dear Innovaphone,

Could you please clarify if there is any way to use the same UI controls as I can see in myApps launcher?

Please find attached a screenshot where I highlighted some controls like:
- card
- group
- group manipulator
- hamburger menu

Thanks in advance,
Sergey
ui-controls.png

Picture of Daniel Deterding (innovaphone)
Moderator Registered 15 years 179 days
Daniel Deterding (innovaphone) Wednesday, 1 July 2020, 11:35 AM
Re: UI controls
Hi Sergey,

sadly there is no UI library with these controls.
But feel free to inspect the HTML and Javascript code to Copy&Paste these controls for your App smile

Greetings,
Daniel
Picture of tsn
Registered 4 years 358 days
tsn Wednesday, 1 July 2020, 11:40 AM
Re: UI controls
Hi Daniel,

Thank you for the quick reply. I've already checked this way and it requires a lot of work to figure out how this UI is organized and how I can get only parts I want to use.

Maybe if you have someone from your side who can prepare some samples with these controls I can reuse this code.

Also, maybe you can suggest what other options to organize UI available for innovaphone platform?

Best regards,
Sergey
Picture of Daniel Deterding (innovaphone)
Moderator Registered 15 years 179 days
Daniel Deterding (innovaphone) Wednesday, 1 July 2020, 01:33 PM
Re: UI controls
I always create a js file with my own ui elements which I use in my app.
These elements are always based on the innovaphone.ui1.* elements, which you all find inside your local sdk/web1 folder.

Here is a simple example for a button "class", which uses already existing elements and methods.
The innovaphone.ui1.nodePrototype which you see at the bottom is important to integrate into the "framework" of the ui1 elements:

manufacturer.SampleApp.Button = manufacturer.SampleApp.Button || function (style, translationId, onClick, cancelButton, svgSymbolCode) {
var that = this;

this.createNode("button", "text-align:center; padding:5px 20px 5px 20px; display:flex; overflow:hidden; align-items:center; " + style, null, "button");
this.container.setAttribute("type", "submit");
this.setNoSelect();
this.container.disabled = true;
if (cancelButton) {
this.addClass("button-cancel");
noSubmit();
}
if (svgSymbolCode) {
this.add(new innovaphone.ui1.SvgInline("flex:0 0 auto; width:15px; height:15px; margin-right:10px", "0 0 20 20", svgSymbolCode));
}
var text = this.add(new innovaphone.ui1.Div("flex:1 1 auto")).addTranslation(innovaphone.MyPortal.texts, translationId);

function enable() {
if (that.container.disabled) {
that.addEvent("click", that.onClick);
that.remClass("button-disabled");
that.container.disabled = false;
that.setStyle("cursor", "pointer");
}
}

function disable() {
if (!that.container.disabled) {
that.remEvent("click", that.onClick);
that.addClass("button-disabled");
that.container.disabled = true;
that.setStyle("cursor", "default");
}
}

function noSubmit() {
that.container.setAttribute("type", "button");
}

function setTranslation(translationId) {
innovaphone.MyPortal.texts.clear(text);
text.addTranslation(innovaphone.MyPortal.texts, translationId);
}

function setOnClick(fncOnClick) {
if (!that.container.disabled) {
that.remEvent("click", that.onClick);
that.addEvent("click", fncOnClick);
}
that.XonClick= fncOnClick;
}

this.enable = enable;
this.disable = disable;
this.noSubmit = noSubmit;
this.XonClick= onClick;
this.setTranslation = setTranslation;
this.setOnClick = setOnClick;

enable();
};
manufacturer.SampleApp.Button.prototype = innovaphone.ui1.nodePrototype;

Greetings,
Daniel

Edit: sorry, the Forum removes the indentations inside the code sad
Picture of tsn
Registered 4 years 358 days
tsn Wednesday, 1 July 2020, 03:05 PM
Re: UI controls
Hi Daniel,

Thank you for this example. I'll try to get something I can reuse from existing UI lib.

Best regards,
Sergey
← You can define your color theme preference here