keyboard image coding android studio : my code is image of a keyboard coding when i did the touch on the caps, i had two letters one upper-case and one lower-case
   
      public boolean onTouch(View v, final MotionEvent event) {
                if (event.getAction() == MotionEvent.ACTION_UP) {
           final float x = event.getX();
                    final float y = event.getY();
        if (imagepassword.getDrawable().getConstantState() == getResources().getDrawable( R.drawable.keyboardpfe2).getConstantState()) /*test on an image*/ {
                        if (x > 0 && x < 100 && y > 170 && y < 310) {
                            login.setText(login.getText() + "Q");
                            imagepassword.setImageResource(R.drawable.keyboardpfe);}
        if (imagepassword.getDrawable().getConstantState() == getResources().getDrawable( R.drawable.keyboardpfe).getConstantState()) {
                    if (x > 0 && x < 100 && y > 170 && y < 310) {
                        login.setText(login.getText() + "q");}}
