AdamMc331
AdamMc331

Reputation: 16730

Is there a keypad widget for Android?

I'm working on a checkbook app, and I'd like to use a small widget like a TimePickerDialog or DatePickerDialog but one that acts like a keypad so the user can enter an account or transaction balance. I know I can use an EditText but I would like to be able to implement a keypad.

Does Android have any predefined UI elements to support this? I have tried to find some, but without luck. I did find an interesting article to implement my own using a GridLayout, but wondered if someone was aware of any Android classes that could already do this.

The GridLayout method: http://code.tutsplus.com/tutorials/android-user-interface-design-creating-a-numeric-keypad-with-gridlayout--mobile-8677

Upvotes: 2

Views: 3063

Answers (2)

scottt
scottt

Reputation: 8381

If you specify android:inputType="numberDecimal" in the XML for your EditText, you'll get a keypad. If you decide that you need a more specialized keyboard, there's a very good tutorial here.

Upvotes: 2

Snehal Masne
Snehal Masne

Reputation: 3429

Some tips:

  1. Read this tutorial: Creating an Input Method
  2. Clone this repo: LatinIME

Upvotes: 1

Related Questions