示例#1
0
  private void executarOnClick(TextView posicio) {
    if (CO.p1.equalsIgnoreCase("<buit>")) {
      // no tenim res seleccionat encara
      CO.p1 = (String) posicio.getText();
      posAgafada1 = posicio;
      sounds.playClick();
      // CO.cas1.setText(CO.p1);

      posicio.setBackgroundColor(Color.WHITE);
      posicio.setTextColor(Color.BLACK);
      // posar que no posi blanc, sino alpha 100!!!

      if (CO.imatge != null) {
        // CO.cas1.setText("");
        int indexEntr = CO.vecCaselles.indexOf(posicio);
        int indexSort = CO.sortida.indexOf(CO.p1);

        CO.vecCaselles.elementAt(indexEntr).setBackgroundColor(Color.TRANSPARENT);
        CO.vecCaselles.elementAt(indexEntr).setTextColor(Color.TRANSPARENT);

        vecDraw.elementAt(indexSort).setAlpha(100);

        CO.vecCaselles.elementAt(indexEntr).setBackgroundDrawable(vecDraw.elementAt(indexSort));
      }
    } else if (CO.p2.equalsIgnoreCase("<buit>")) {
      CO.p2 = (String) posicio.getText();
      posAgafada2 = posicio;
    }
  }