How to open a User control like Keypad in wp7 - windows-phone-7.1

I have a user control in my wp7 application which contains two text boxes and two buttons. I need to show it like the keypad opens. How can I do this?

You can use the transition effects .
SlideTransition sltrans = new SlideTransition();
sltrans.Mode = SlideTransitionMode.SlideUpFadeIn;
ITransition transition = sltrans.GetTransition(yourcontrol);
transition.Begin();
transition.Completed += delegate { transition.Stop(); };
You can set your transition effects to any user control by binding them in code behind.
I think this might suffice your requirement.

Related

How to disable the Input Pane of TextBox in UWP mobile app?

There are TextBox and custom keyboard. I need to disable the input pane when TextBox has to get focus. I tried the TryHide method for show and focus events.
InputPane.GetForCurrentView().TryHide();
But it is a very bad worked solution because InputPane is blinking when a user is taping on TextBox. Then I found a possibility of changing input policy in documentation CoreText​Input​Pane​Display​Policy But the documentation does not explain how to apply this policy.
Using TextBlock is not suitable for me because I need to manipulate with the cursor and select text. Is there a nice solution for this problem?
Microsoft has code sample demonstrated here.
// Create a CoreTextEditContext for our custom edit control.
CoreTextServicesManager manager = CoreTextServicesManager.GetForCurrentView();
_editContext = manager.CreateEditContext();
// Get the Input Pane so we can programmatically hide and show it.
_inputPane = InputPane.GetForCurrentView();
// For demonstration purposes, this sample sets the Input Pane display policy to Manual
// so that it can manually show the software keyboard when the control gains focus and
// dismiss it when the control loses focus. If you leave the policy as Automatic, then
// the system will hide and show the Input Pane for you. Note that on Desktop, you will
// need to implement the UIA text pattern to get expected automatic behavior.
_editContext.InputPaneDisplayPolicy = CoreTextInputPaneDisplayPolicy.Manual;

Open Layers 3 - Initialize Draw Interaction with first node on LineString

I have a map where a user can choose some object/feature on the map and draw a line to another object/feature. When the user selects the feature i would like do add a draw interaction and already set the first point to the selected feature without the user having to click again on the map.
Here is a fiddle: Sample
The commented code below should be executed programmatically without user interaction, after pressing the draw button
geometryFunction: function (c, g) {
if (goog.isDef(g)) {
g.setCoordinates(c);
} else {
// DO THIS AUTOMATICALLY ON PRESSING DRAW
// TO INITIALIZE AND START THE DRAWING PROCESS
c[0][0] = 1174072.754460305;
c[0][1] = 332653.94709708635;
g = new ol.geom.LineString(c);
}
...
}
The current behaviour is that you click on the Draw button and can click on the map to start drawing (but i overwrite the first node with my desired starting location -- in this example near central africa)
Is it possible to click on Draw and the first node is already programmatically set, without having to click on map first?
It is not currently possible to do manually append points to the OpenLayers 3 ol.interaction.Draw, but it would make sense to be able to support it (in my mind). It would be "as-if" the user had clicked.
You should ask the OL3-dev mailing this about adding such a feature to see what they think about it. If they agree and you're willing to work on this, you could provide a pull request. See: https://groups.google.com/forum/#!forum/ol3-dev
If you don't mind using a private method in OL you can do this to achieve what you want.
var event = $.Event('click'); //create a click event in your draw method using JQuery
event.coordinate = [1174072.754460305,332653.94709708635];// set your starting coordinate
draw_interaction.startDrawing_(event);// tell your interaction to start drawing

Get keyboard show event in Unity3d

I am making a game in unity3d for iPad only.
In one screen I need to take text input from user and for that I use Input Field.
I need to make some UI change when user open keyboard by taping Input Field. For that I need keyboard open(show) event. Input Field give me just two event 1. Text Change 2. Lost Focus. But I need get Focus event.
I read official document but can't find any relevant event. I search on internet for event, I get keystroke event but I need keyboard open event before user start typing.
In native iOS app we use UITextFieldDelegate Method - (void)textFieldDidBeginEditing:(UITextField *)textFieldor UIKeyboardDidShowNotification. Is there any way in Unity3d to get this kind of behaviour.
For input field with the new UI there is an isFocused variable.
http://docs.unity3d.com/ScriptReference/UI.InputField.html
http://docs.unity3d.com/ScriptReference/UI.InputField-isFocused.html
#pragma strict
// Required when Using UI elements.
public class Example {
public var mainInputField;
function Update() {
//If the input field is focused, change its color to green.
if (mainInputField.GetComponent.<InputField>().isFocused == true) {
mainInputField.GetComponent.<Image>().color = Color.green;
}
}
}
So if your field gets focused and it returns true you can execute some code. That is, if I understand you correctly.
I can't find anything that lets you know the InputField has been selected but a workaround may be setting the Interactable property to false and having an 'Edit' button near the field. When the 'Edit' button is pressed, you can change the UI elements and set the InputField.interactable = true.

Is it a way to get rid of Return button in iOS keyboard?

I have custom workflow, so I do not need Return button. Is it a way to get rid of it?
I need a Next Done Clear auxiliary buttons, and because I use on keyboard panel also for date picker, I have the only option to place it at inputAccessoryView.
But then I do not need the standard Done or Next button.
Instead of trying to use any hacks maybe you should think about your workflow. Is it really so cool and intuitive that you want to force users to not use established patterns? When the user is done typing, does the user need to do other actions (press any buttons on the screen) or can some action be started? Also remember that the return key is still sent by Bluetooth keyboards.
If there's any other text field, the return button should be "Next". If not, then most likely "Done" is the button to use. It should then either trigger the action that your view is about or simply hide the keyboard.
On the UITextView or UITextField, use the required type for the button
textView.returnKeyType = UIReturnKeyDone;
The whole list:
typedef enum : NSInteger {
UIReturnKeyDefault ,
UIReturnKeyGo ,
UIReturnKeyGoogle ,
UIReturnKeyJoin ,
UIReturnKeyNext ,
UIReturnKeyRoute ,
UIReturnKeySearch ,
UIReturnKeySend ,
UIReturnKeyYahoo ,
UIReturnKeyDone ,
UIReturnKeyEmergencyCall ,
} UIReturnKeyType;
As being mentioned on https://developer.apple.com/library/IOs/documentation/UIKit/Reference/UITextInputTraits_Protocol/index.html#//apple_ref/c/tdef/UIReturnKeyType

Is there a way to create a tabbed picker in iOS? Or somehow combine numpad + picker inputs?

I'm looking for a clean way to enable two interactions within one screen.
For example:
1) User clicks on "Add Activity" button
2) User enters a number of standard units (e.g., 10 meters), and then picks an associated activity from a list (e.g., picklist of: jog, run, walk, crawl)
All I can think of right now is creating two separate entry fields - one that calls up numpad, and another that calls up the picker. Is it possible to created a tabbed numpad so that the user completes numerical entry, then just hits 'Activity Type' above the numpad and the element switches to a picker?
Appreciate any inputs!
Not with a stock keyboard. If all you need is a numpad, you ought to be able to implement a very reasonable keyboard out of a few buttons. Add a couple of "tab" buttons, and show/hide the appropriate view: keyboard or picker.

Resources