LazyKeyboard Documentation

repository·master·Indexed 19 days ago

https://github.com/onlyloveyd/lazykeyboard

A security-focused Android keyboard library providing specialized input modes (Letter, Number, and Symbol) through a custom SecurityEditText component. Includes configuration options for keyboard backgrounds, chooser colors, and key previews.

Tokens
872
Snippets
3
Records
4
Agent score
16%

What's inside LazyKeyboard

  1. Install LazyKeyboard via Gradle

    master

    To use LazyKeyboard in your Android project, follow these two steps:

    1. Add the JitPack repository to your root build.gradle file inside the allprojects block.
    2. Add the LazyKeyboard dependency to your app-level dependencies block.
    // Step 1: Add to root build.gradle
    allprojects {
        repositories {
            ...
            maven { url 'https://jitpack.io' }
        }
    }
    
    // Step 2: Add to dependencies
    dependencies {
        implementation 'com.github.onlyloveyd:LazyKeyboard:v1.5'
    }
  2. Use SecurityEditText in your layout

    master

    To implement the security keyboard, replace standard EditText components with com.gs.keyboard.SecurityEditText in your XML layout files. This component provides the specialized keyboard interface (Letter, Number, and Symbol modes).

    <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>
  3. Configure SecurityEditText attributes

    master

    You can customize the appearance and behavior of the SecurityEditText using the following XML attributes:

    AttributeDescription
    chooserSelectedColorThe text color of the currently selected keyboard type
    chooserUnselectedColorThe text color of the unselected keyboard types
    chooserBackgroundThe background color/drawable of the keyboard type selection area
    keyboardBackgroundThe background color/drawable of the keyboard itself
    isKeyPreviewBoolean determining whether to show a preview layout when a key is tapped
  4. Configure KeyboardAttribute for custom appearance

    master

    The KeyboardAttribute class is used to define the visual properties and behavior of the security keyboard. You can customize the colors of the chooser (the selection interface), the backgrounds for both the chooser and the keyboard, and whether key previews are enabled.

    Note: This class is package-private within com.gs.keyboard, so it is intended to be used by components within the same package or via a provided constructor if exposed by the library's public API.

    KeyboardAttribute attributes = new KeyboardAttribute(
        chooserSelectedColor,    // ColorStateList for selected state
        chooserUnselectedColor,  // ColorStateList for unselected state
        chooserBackground,       // Drawable for chooser background
        keyboardBackground,      // Drawable for keyboard background
        isKeyPreview             // boolean to enable/disable key preview
    );