I want to display the button vertically with microsoft teams - node.js

I am developing a bot to use with microsoftteams. I am using the button to display the answer options, but if I check with ios or Android it will be displayed side by side. Is there any way to display buttons vertically?
for(var i= 0; i< arrayList.length; i++ ){
var val = arrayList[i].choice;
buttons.push(builder.CardAction.imBack(session, val, val));
}
var card = new builder.HeroCard(session).buttons(buttons);
var msg = new builder.Message(session).addAttachment(card);
builder.Prompts.text(session, msg);

No, unfortunately right now you can't control the layout of the buttons on a card.
Do you mind adding this as a suggestion on UserVoice, with examples of why this level of control would be useful, so others can vote on your idea?

While unfortunately hero cards are bound to the layouts given by their respective channels/viewing devices (ie why you get different views on Teams vs iOS), adaptive cards will allow for greater formatting of layout. At this time however, adaptive cards are not available on Microsoft Teams.

Related

Is there any way to create an array of buttons in Visual Studio 2017 C++/CLI from scratch?

I´m making a project in which I´m connecting two different devices via UDP and I need to create an array of buttons from scratch to represent bits, so if a recieve for example the number 0x8A (1000 1010b) my array of 8 buttons will display 1´s and 0´s depending on the number.
I´ve been reading but most of the tutorials about c++ and GUI uses drag and drop for the elements, but I need the array of buttons for an easy access to each button.
I´m using Visual Studio 2017, the C++/CLI project.
Thanks for your time.
I'm assuming that "from scratch" means "dynamically at runtime".
Based on your example of receiving the number 0x8A, it sounds like you only need 8 buttons. If that's the case, then I'd create the buttons at design time, not at runtime. Creation at runtime is most appropriate when you don't know ahead of time how many there will be, but if you know it will be exactly 8, then creation at design time is most appropriate.
If my inference is incorrect, and you do not know how many buttons until runtime, then we'd need to know which GUI toolkit you're using to give a concrete answer. Other than that, all we can do is give a general outline.
// Keep this around somewhere so you can access the buttons later.
List<ButtonOfSomeSort^>^ buttons = gcnew List<ButtonOfSomeSort^>();
for (int i = 0; i < numButtonsToCreate; i++)
{
ButtonOfSomeSort button = gcnew ButtonOfSomeSort();
// set some properties on the button, such as text, size & position, and click handler.
someContainerControlInYourGUI.Add(button);
buttons.Add(button);
}

Is it possible to create just one xml layout for all products, while the product description changes depending on the product chosen in android?

I'm trying to create a POS Andriod app for my first Android class. For the menu, I implemented a scrollview for our client to choose a product of theirs. When a product is clicked, it goes to another screen wherein the product details (image and description) and 'add to cart' is found. What I did was created that menu screen, and numerous activity screens along with its respective layout xml files for each product offered. My question is, is there a more efficient way to go about this? I mean, is it possible to create just one xml layout for all products, while the product description changes depending on the product chosen? I've tried searching for a guide about this, but I'm not sure if I've been searching for the correct keywords.
Thank you. :)
You can modify contents of the layout with methods like
TextView description = (TextView) findViewById(R.id.description);
description.setText("My cool product");
description.setCompoundDrawablesRelativeWithIntrinsicBounds
(null, R.drawable.product1, null, null);

MvvmCross Using a modal ViewController from a Tab

I've searched on SO & elsewhere for MvvmCross & Modal, but the one existing answer isn't helping us.
We're developing a cross-platform app using MonoTouch & MvvmCross, which seems to be pretty powerful combination. However, we're having a few issues with the navigation, which we're gradually cracking! The current problem is -
The app runs with a TabBarController, and each tab has navigation to further levels - this works fine. The client however wants the "Start" button on one of the tabs to bring up a modal view (which hides everything else, especially the tab bar), which then has its own levels working in the same manner as a UINavigationController, with the ability to pop back to the tabBarController at any time.
We've managed to bring up a single modal view, but we're stuck on loading new views from here and popping back out.
Any help/advice appreciated!
I think what you're looking to do is to customise the presenter so that it wraps your UIViewController within a UINavigationController - and then modally presents that UINavigationController?
To achieve this, the code in the recent Pull request from #DeapSquatter might help -https://github.com/slodge/MvvmCross/pull/9 - I think you can use his modal nav presenter in order to achieve the effect you are looking for:
if (view is IMvxModalTouchView)
{
if (_currentModalViewController != null)
throw new MvxException("Only one modal view controller at a time supported");
var newNav = new UINavigationController();
newNav.PushViewController(view as UIViewController, false);
_currentModalViewController = view as UIViewController;
PresentModalViewController(newNav, true);
return;
}
The architecture of mvvmcross is deliberately extensible and configurable here - while we include a few basic Presenter classes, it's very likely that people are going to want to customise how different views get presented on an app-by-app basis. Beyond the simplest of demo apps, I anticipate that most mvvmcross apps on touch will ship with a custom presenter inside.
Hope that helps
Stuart

Fairly New at Sharepoint Javascript. Need some feedback on custom function

I built this function to find People Pickers by Field Title. Since the picker does not provide and TagName and Tile type of information and custom pages can have multiple people pickers, I used the NOBR tag which displays the title for each picker. This works flawlessly, but I think it can be sped up abit.
Please share your thoughts. Thanks you!!
function resetPickerInput(title){
var result="";
var tags=document.getElementsByTagName("NOBR");
var len=tags.length;
for(var i=0;i<len;i++){
if(tags[i].innerHTML.indexOf(title)>-1){
var div=tags[i].parentNode.parentNode.parentNode.getElementsByTagName("DIV");
var divLen=div.length;
for(var j=0;j<divLen;j++){
if(div[j].name=='upLevelDiv'){
result=div[j];
break;
}
}
}
}
return result;
}
Yes, you are doing it more complicated than you should.
This jQuery example looks very promising (Get Value of People Picker in Sharepoint):
var User = $("textarea[title='People Picker']").val().split("\\");
How do I get text from people picker textarea using javascript only
uses this: $(".ms-inputuserfield #content").each(function(){...
Another example: Hide People Picker control in SharePoint List Forms
Set a People Picker’s Value on a Form – Revisited with jQuery
$(this).find("div[Title='People Picker']").html(userName)
Since you didn't state your version: Retrieve Email Address from sharepoint people picker using javascript a solution for SP2007.

How to get a native keypad in game.?

i have a game developed using LWUIT.now i am implementing full touch in game.it is a multi player game so there are some options like chat and login. when we press on chat we need to enter the characters in the field. my question is
is it possible to invoke the native keypad when we press on the chat button .?
thanks in advance
kris
No. MIDP doesn't include such an API. You can use LWUIT's virtual keyboard (which isn't native) and define any character set you want as explained here:
http://lwuit.blogspot.com/2010/06/pimp-virtualkeyboard-by-chen-fishbein.html
You can show it using the display class.
On Symbian devices if you do not define some jad properties, a touch keypad will be always visible and you won't be able to hide it for more details look here:
http://lwuit.blogspot.com/2009/11/optimized-for-touch.html
Looking at the question again I'm thinking the VKB is probably an overkill for an always on keypad replacement. Just place your content in the center of a BorderLayout and stick a container in the south something like this:
addComponent(BorderLayout.CENTER, myUI);
Container keypad = new Container(new GridLayout(2, 2));
addComponent(BorderLayout.SOUTH, keypad);
Button up = new Button("Up");
Button down = new Button("Down");
Button left = new Button("Left");
Button right = new Button("Right");
up.setFocusable(false);
down.setFocusable(false);
left.setFocusable(false);
right.setFocusable(false);
keypad.addComponent(up);
keypad.addComponent(down);
keypad.addComponent(left);
keypad.addComponent(right);
up.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ev) {
int up = Display.getInstance().getKeyCode(Display.GAME_UP);
Display.getInstance().getCurrentForm().keyPressed(up);
Display.getInstance().getCurrentForm().keyReleased(up);
}
});
The rest and fire are pretty trivial to add (same thing) notice that getKeyCode is deprecated but should work for now since we have no alternative to that API.

Resources