Skip to content
Hamsoft Uganda edited this page Aug 17, 2018 · 1 revision

Build the library with Gradle.

Project level grade,

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

app level gradle dependencies , dependencies {
----- implementation 'com.github.hamsoft-uganda:NumericKeyBoard:latest-release' ----
}

Make your activity to implement Nk_board.OnKeyBoard

@Override public void onOnDeletePressed(View v) { //When user clicks clear button }

`@Override`
`public void onKeyPressed(int value) {`
  //When user clicks any key i.e 1,2,3,.....,0
`}`

`@Override`
`public void onOkPressed(View v) {`
  //When user clicks 'Ok' on the keypad
`}`

In the activity's layout, create a fragment where you want the keypad to appear

<fragment android:layout_width="match_parent" android:id="@+id/example_keyboard" android:layout_marginTop="80dp" android:layout_height="wrap_content" android:layout_marginBottom="12dp" tools:layout="@layout/fragment_nk_board" class="com.hamsoftug.numerickeyboard.Nk_board"/>

and specify the layout from this library and com.hamsoftug.numerickeyboard.Nk_board class. See more in this demo example

Clone this wiki locally