xml layout design with coloured background - android-layout

I have to enter the details in the username field with autocomplete text view,after getting the correct username the keypad should be closed automatically ,i wrote the code until getting the username with keypad & i am facing trouble to write the code for the keypad to be closed automatically ,please help me with this

Your question is very poorly written, and the title is unrelated.
Here's another stackoverflow answer that goes over how to manually dismiss the android soft-input keyboard.
Close/hide the Android Soft Keyboard

Related

What is the purpose setFocusable(true) in android studio?

I'm new to android studio. I was a bit confused with the following code.
EditText emailEt;
if(!Patterns.EMAIL_ADDRESS.matcher(email).matches()){
emailEt.setError("Invalid email address");
emailEt.setFocusable(true);
}
What is the purpose of this setFocusable() method?
what will happen if the boolean value passed was set to false?
If you're not sure of what focusable is, here's a brief explanation.
If there's a form in a view, there can be 2 cases -
The keyboard comes up automatically, or when you hit the next/enter key on the keyboard the next input field is selected automatically for receiving the input
You need to manually press an input field to bring the keyboard for typing. And on hitting enter, the keyboard might just go away.
The above phenomenon is called Focusing.
Getting back to question, if you want the case (1) to occur, then you set setFocusable() to true, else if you want case (2) to occur, you can set it to false.
Reference the below docs for more info
setFocusable - View | Android Developers
android:focusable - View | Android Developers
difference between focusable and clickable - StackOverflow
I don't think it is much useful but it helps in request focus to next edit text when the next button is pressed android keyboard

termbox-go - Reading data from the console

I am very new to Go and went through some of the basic examples and literature around Go Lang. Currently I am working on a project where I need to create a terminal application. After reading around termbox-go we have decided to use the termbox-go as the base library for the development.
The application is very simple where the user will be provided with a set of menus as follows
Main Menu
---------
01) Menu 1
02) Menu 2
03) Menu 3
99) Quit
Please enter your selection : __
I am able to get the layout and all everything done after looking through the examples. But it no where I am not seeing any examples of where the selection is read from the terminal. The user will hit "Enter" key after the selection is done.
Can anyone can share an example which shows how to achieve the above.
Also is there any examples where the user screen has multiple input areas where user can move using up and down key and enter the values - as below
Enter Name : _____________
Enter DOB : ______________
Enter City: ______________
Any examples or pointers are highly appreciated.
Thanks
As for how users could enter text you could check out this example https://github.com/nsf/termbox-go/blob/master/_demos/editbox.go
In the example nothing happens when you press Enter but that's just because it's not handled in the main loop. Also you could expand this example with multiple edit boxes and map the up/down arrows to change which box has focus.

Dialog menu not receiving Enter key

I’m currently writing an MFC dialog app which has a menu. The menu displays correctly and the menu entries work correctly via mouse, accelerators, and hotkeys (e.g., to quit: Ctrl+Q or Alt+F,Q).
Unfortunately, the Enter key doesn’t seem to work. That is, pressing Alt+F will open the File menu and pressing ↑ will highlight the Quit entry, but pressing Enter will not select it.
I know that using menus in dialog apps can be a bit tricky, but I’ve done this successfully before. However, that was a long time ago with a customized VS wizard, so I am trying to remember how to do this from scratch. I tried checking my old code, but could not find anything in reference to VK_RETURN. (No, there’s nothing special in PreTranslateMessage.)
These two questions are related, but they want the dialog to receive the key, I need the menu to get it.
Does anyone know what the problem is and how to fix it?

Watermark effect on TextBox in Windows Phone [duplicate]

This question already has answers here:
Why there is no PlaceHolder like property in XAML TextBox
(4 answers)
Closed 8 years ago.
How do I create text box with watermark effect in windows phone?
I have two text boxes
Username
Password
Now I want that in first text box, Username by default written in light weight and If I write in that text box, it should be disappear. How to solve it?
You need to use PhoneTextBox from windows phone toolkit for this.
You can download it from here.
You can also directly add it to your project by typing the following into your package manager console :
PM> Install-Package WPtoolkit
Now, add a reference of toolkit inside "phone:PhoneApplicationPage" tag in the xaml page as follows:
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
Finally, use PhoneTextBox control.
<toolkit:PhoneTextBox Hint="Username"/>

Entering text in Windows 8 in C#/MonoGame app

I'm writing a WinRT game for Windows 8, in C#, using the excellent MonoGame. I've reached the part where the user has achieved a high score and needs to enter their name. This is causing me more pain than I'd anticipated so I thought I'd ask for help.
First of all, is there a simple "enter some text" function that I can call, similar to Guide.BeginShowKeyboardInput in Windows Phone 7, or the ancient InputBox command in VB? I'm using Windows.UI.Popups.MessageDialog for displaying simple dialog messages, but can't find any similar thing for requesting text from the user.
Failing that, is there a way I can easily use a little piece of XAML to present a textbox for the user to use?
If neither of these are possible, I guess I'll have to wire this all up myself... I then would plan to intercept keystrokes and display the required text on screen myself. As I don't have a physical tablet (just the simulator) I'm struggling to start with this. How can I:
Detect whether the device has a physical keyboard, so I know whether or not to display the on screen keyboard?
If there is no physical keyboard, how can I show and hide the on screen keyboard?
Some of these sound like they should be easy to answer, but I've yet to track down answers to any of them.
Many thanks!
Adam.
Hey there is such a way to do this in monogame. There is a new template that allows you to create a XAML + Game game which allows you to use the game class you a used to with the xaml bits as well. These links should get you started. The monogame team rocks.
There are the three game types listed there. You want XAML + Game there is a template for it now if you get the proper version of monogame.
https://github.com/mono/MonoGame/wiki/Windows-8-Project-Types
let me know if you need more help
This is not a cross platform solution but you could use a FlyOut and place the controls for data entry on the window. FlyOut guidelines are here and UI Controls for text input guidelines are here. I have also used MessageDialog in a MonoGame for asking the user simple questions (up to 3 options) or to get a Yes|No response. You can get details of that class here.

Resources