I want to show small dots on screen while pressing a button, something like pin code...
switch (view.getId()){
case R.id.buttonNum1:
You can achive by creating ripple effect
create one drawable name like pin_button_ripple in drawable-v21 folder and add bellow code
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?android:colorControlHighlight">
<item android:id="@android:id/mask">
<shape android:shape="oval">
<solid android:color="?android:colorPrimary" />
</shape>
</item>
</ripple>
Now in Layout file set it as a background of button and define click listener in activity
<Button android:id="@+id/btnPinButton" android:layout_width="100dp" android:layout_height="100dp" android:layout_centerInParent="true" android:background="@drawable/pin_button_ripple" android:padding="20dp" android:text="10"/>
You will see the ripple effect in circle shape like we enter Pin number or password via keyboard and showing that effect