登录

去注册 忘记密码?

登录

注册

去登录

  • 扫码关注公众号
  • 发送“我爱安卓
  • 即可获取验证码

注册

解锁回答区域

  • 扫码关注公众号
  • 发送“我爱安卓

若你登陆,将永久解锁;
若未登录,仅本机解锁。

解锁回答区域

获取注册验证码

  • 扫码关注公众号
  • 发送“我爱安卓
  • 即可获取验证码

自定义安全键盘 LazyKeyboard

onlyloveyd   2018-07-03 19:06   收藏

LazyKeyboard

利用PopupWindow实现,字母,符号,数字自定义安全键盘

中文版

Installation

Gradle

Step 1. 项目根目录下 build.gradle

allprojects {
    repositories {
	...
	maven { url 'https://jitpack.io' }
    }
}

Step 2. 模块目录下build.gradle添加依赖

dependencies {
    implementation 'com.github.onlyloveyd:LazyKeyboard:v1.3'
}

Basic Usage

Step 1. 添加 SecurityEditText 至界面布局。

   <LinearLayout
        android:id="@+id/container"
        ...">

        <com.gs.keyboard.SecurityEditText
            android:id="@+id/et_security_keyboard"
            android:layout_width="match_parent"
            ... />

        <EditText
            android:id="@+id/et_security_keyboard_two"
            ... />
    </LinearLayout>

Step 2. 初始化 SecurityKeyboard

   SecurityConfigure configure = new SecurityConfigure()
           .setDefaultKeyboardType(KeyboardType.NUMBER)
           .setLetterEnabled(false);
   securityKeyboard = new SecurityKeyboard(binding.loginLayout, configure);

目前支持的自定义选项:

  1. selectedColor 选中键盘类型凸显颜色,默认为0xff66aeff
  2. unSelectedColor 未选中键盘类型凸显颜色,默认为Color.BLACK
  3. isNumberEnabled 是否显示数字键盘,默认为true
  4. isLetterEnabled 是否显示字母键盘,默认为true
  5. isSymbolEnabled 是否显示符号键盘,默认为true
  6. defaultKeyboardType 默认选中的键盘,默认值为KeyboardType.LETTER

Basic Result

letter
symbol
number

项目地址:https://github.com/onlyloveyd/LazyKeyboard