Android Open Source - beeline Decimal Locale Key Listener






From Project

Back to project page beeline.

License

The source code is released under:

GNU General Public License

If you think the Android project beeline listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package net.datag.beeline;
/*from w  ww  . ja  v  a 2  s  . c  om*/
import java.text.DecimalFormatSymbols;

import android.text.InputType;
import android.text.method.DigitsKeyListener;

/**
 * This class is a workaround for Android issue #2626 <https://code.google.com/p/android/issues/detail?id=2626>
 *
 */
public class DecimalLocaleKeyListener extends DigitsKeyListener {
  private final char[] acceptedCharacters = new char[] {
      '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-',
      new DecimalFormatSymbols().getDecimalSeparator()
  };

  @Override
  protected char[] getAcceptedChars() {
    return acceptedCharacters;
  }

  public int getInputType() {
    return InputType.TYPE_CLASS_NUMBER | InputType.TYPE_CLASS_TEXT;
  }
}




Java Source Code List

net.datag.beeline.DecimalLocaleKeyListener.java
net.datag.beeline.EntryActivity.java
net.datag.beeline.LocationEntryContract.java
net.datag.beeline.LocationEntryDbHelper.java
net.datag.beeline.MainActivity.java
net.datag.beeline.Utilities.java