public final void ob(int paramInt) {
   boolean bool;
   if (paramInt > 0) {
     bool = true;
     iTV.setClickable(bool);
     iTV.setEnabled(bool);
     if (au.aOj().size() <= 0) {
       break label87;
     }
     iTX.setClickable(bool);
     iTX.setEnabled(bool);
   }
   for (; ; ) {
     dii.setClickable(bool);
     dii.setEnabled(bool);
     iTY.setClickable(bool);
     iTY.setEnabled(bool);
     return;
     bool = false;
     break;
     label87:
     iTW.setClickable(bool);
     iTW.setEnabled(bool);
   }
 }
Beispiel #2
0
 private void configureStatus() {
   doneStatus.setImageDrawable(getContext().getResources().getDrawable(selectStatusImage()));
   if (config.isEditMode()) {
     doneStatus.setClickable(isSelected());
   } else {
     doneStatus.setClickable(config.isAllowChangeStatus());
   }
 }
 public void enableFilterButtons() {
   for (ImageButton b : mBottomPanelButtons) {
     b.setEnabled(true);
     b.setClickable(true);
     b.setAlpha(1.0f);
   }
 }
 public void disableFilterButtons() {
   for (ImageButton b : mBottomPanelButtons) {
     b.setEnabled(false);
     b.setClickable(false);
     b.setAlpha(0.4f);
   }
 }
Beispiel #5
0
 private void setBtnListenerOrDisable(
     ImageButton btn, Button.OnClickListener onClickListener, String intentName) {
   if (isIntentAvailable(getActivity(), intentName)) {
     btn.setOnClickListener(onClickListener);
   } else {
     btn.setImageResource(R.drawable.ic_action_camera);
     btn.setClickable(false);
   }
 }
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_main, container, false);

    distanceText = (TextView) rootView.findViewById(R.id.main_infor_bar_distance);
    heightText = (TextView) rootView.findViewById(R.id.main_infor_bar_max_height);
    startButton = (Button) rootView.findViewById(R.id.button_start);
    stopButton = (Button) rootView.findViewById(R.id.button_stop);
    pictureButton = (Button) rootView.findViewById(R.id.button_takePic);
    noticeButton = (ImageButton) rootView.findViewById(R.id.button_notice);
    pictureButton.setClickable(false);
    noticeButton.setClickable(false);
    startButton.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            startButton.setVisibility(View.GONE);
            stopButton.setVisibility(View.VISIBLE);
            startRoute();
          }
        });
    stopButton.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            routeRecorder.cancelLocationUpdates();
            startButton.setVisibility(View.VISIBLE);
            stopButton.setVisibility(View.GONE);
            stopRoute();
          }
        });
    pictureButton.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            try {
              File imgFile = createImageFile();
              takePictureAndSave(imgFile);
            } catch (IOException e) {
              Log.e(TAG, e.getMessage());
            }
          }
        });
    noticeButton.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            // TODO: create method for opening a dialogue in which the user can input text to create
            // notice
          }
        });
    return rootView;
  }
 // Lowers score, time, flashes red
 public void badClick(View v) {
   if (vibrateEnabled) {
     vibrate.vibrate(400);
   }
   ImageButton altbutton = (ImageButton) findViewById(R.id.badIcon);
   altbutton.setVisibility(View.GONE);
   altbutton.setClickable(false);
   userScore = userScore - 3;
   scoreText = (TextView) findViewById(R.id.player1score);
   scoreText.setText(String.valueOf(userScore));
   timerValue = timerValue - 2000;
 }
Beispiel #8
0
 // Check if everything is quoted to unlock the button to the next test
 public void activateNext() {
   if (this.quotation_image1 == true
       && this.quotation_image2 == true
       && this.quotation_image3 == true
       && quotation_image4 == true
       && quotation_image5 == true
       && quotation_image6 == true) {
     btest1_next.setEnabled(true);
     btest1_next.setClickable(true);
     btest1_next.setImageResource(R.drawable.next);
   }
 }
  private void advanceWizardSubFragment(Fragment fragment) {
    idx = 0;
    for (Fragment f : subFragments) {
      if (fragment.getClass().getSimpleName().equals(f.getClass().getSimpleName())) {
        ((WizardListener) subFragments.get(0)).onSubFragmentInitialized();
        break;
      }
      idx++;
    }

    Log.d(LOG, "subfragments size: " + subFragments.size());

    if (idx == 0) {
      subFragmentNext.setClickable(true);
    } else if (idx == subFragments.size() - 1) {
      subFragmentNext.setClickable(false);
    }

    try {
      ((WizardListener) subFragments.get(idx - 1)).onSubFragmentCompleted();
    } catch (ArrayIndexOutOfBoundsException e) {
    }

    FragmentTransaction ft = ((WizardListener) a).returnFragmentManager().beginTransaction();
    ft.replace(R.id.wizard_sub_fragments_root, fragment);
    ft.addToBackStack(null);
    ft.commit();

    for (int i = 0; i < subFragmentProgress.getChildCount(); i++) {
      int dot = R.drawable.progress_inactive;
      if (i == idx) {
        dot = R.drawable.progress_active;
      }

      ((ImageView) subFragmentProgress.getChildAt(i))
          .setImageDrawable(getResources().getDrawable(dot));
    }
  }
 @Override
 public void onGetPlayresult(Boolean obj) {
   if (obj) {
     mPostButton.setClickable(true);
     try {
       mStatusButton.setImageResource(R.drawable.video_btn_pause);
       mMusicPlayService.pause();
       //				mIsPlayOnLocal = false;
       postGetPositionInfo();
     } catch (RemoteException e) {
       e.printStackTrace();
     }
   } else {
   }
 }
Beispiel #11
0
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
    if (convertView == null) {
      convertView = LayoutInflater.from(context).inflate(R.layout.plato_item, parent, false);
      ViewHolder viewHolder = new ViewHolder();
      viewHolder.nombre = (TextView) convertView.findViewById(R.id.txtNombrePlato);
      viewHolder.precio = (TextView) convertView.findViewById(R.id.txtprecioPlato);
      convertView.setTag(viewHolder);
    }
    ViewHolder holder = (ViewHolder) convertView.getTag();
    final Plato currentPlato = this.platos.get(position);
    holder.nombre.setText(currentPlato.getNombre());
    holder.precio.setText(Double.toString(currentPlato.getPrecio()));
    ImageButton informacion = (ImageButton) convertView.findViewById(R.id.btnInfoPlato);
    informacion.setFocusable(false);
    informacion.setClickable(false);
    observer = this.observer;
    informacion.setOnClickListener(
        new View.OnClickListener() {
          private Plato dataPlato = currentPlato;
          private Observer dataObserver = observer;

          @Override
          public void onClick(View v) {
            Log.i("Mensaje", "Se selecciona un plato");
            Intent intent = new Intent(context, PlatoView.class);

            intent.putExtra("id", currentPlato.getId());
            intent.putExtra("nombre", currentPlato.getNombre());
            intent.putExtra("foto", currentPlato.getPhotoPath());
            intent.putExtra("precio", currentPlato.getPrecio());
            intent.putExtra("path", currentPlato.getPhotoPath());
            intent.putExtra("catComidaRapida", currentPlato.catComidaRapida);
            intent.putExtra("catPiqueo", currentPlato.catPiqueo);
            intent.putExtra("catDesayuno", currentPlato.catDesayuno);
            intent.putExtra("catAlmuerzo", currentPlato.catAlmuerzo);
            intent.putExtra("idRestaurante", currentPlato.idRestaurante);

            context.startActivity(intent);
          }
        });

    return convertView;
  }
 public void beginTouZhu() {
   int iZhuShu = getZhuShu();
   ShellRWSharesPreferences pre =
       new ShellRWSharesPreferences(FootballSixSemiFinal.this, "addInfo");
   String sessionIdStr = pre.getUserLoginInfo("sessionid");
   if (sessionIdStr == null || sessionIdStr.equals("")) {
     Intent intentSession = new Intent(FootballSixSemiFinal.this, UserLogin.class);
     startActivityForResult(intentSession, 0);
     liucb_btn_touzhu.setClickable(true);
   } else {
     if (isTouZhu()) {
       alert1("请至少选择一注!");
     } else if (iZhuShu * 2 > 20000) {
       DialogExcessive();
     } else {
       String sTouzhuAlert = "";
       sTouzhuAlert = getTouzhuAlert();
       alert(sTouzhuAlert, getFormatZhuma());
     }
   }
 }
Beispiel #13
0
  /** Sets listener for OtherButtonAction */
  protected void addOtherListener() {

    if (mCardHeader.getOtherButtonClickListener() != null) {
      if (mImageButtonOther != null) {
        mImageButtonOther.setOnClickListener(
            new OnClickListener() {
              @Override
              public void onClick(View v) {
                if (mCardHeader.getOtherButtonClickListener() != null)
                  mCardHeader
                      .getOtherButtonClickListener()
                      .onButtonItemClick(mCardHeader.getParentCard(), v);
              }
            });
      }
    } else {
      if (mImageButtonOther != null) {
        mImageButtonOther.setClickable(false);
      }
    }
  }
 public void beginTouZhu() {
   int iZhuShu = getZhuShu(); // 注数是注数*倍数的结果
   RWSharedPreferences pre = new RWSharedPreferences(FootballSFLottery.this, "addInfo");
   sessionid = pre.getStringValue("sessionid");
   if (sessionid == null || sessionid.equals("")) {
     Intent intentSession = new Intent(FootballSFLottery.this, UserLogin.class);
     startActivityForResult(intentSession, 0);
     sfc_btn_touzhu.setClickable(true);
   } else {
     if (isTouZhu()) {
       Toast.makeText(FootballSFLottery.this, "请至少选择一注!", Toast.LENGTH_SHORT).show();
     } else if (iZhuShu * 2 > 20000) {
       DialogExcessive();
     } else {
       String sTouzhuAlert = "";
       //				sTouzhuAlert = getTouzhuAlertText();
       //				alert(sTouzhuAlert, getFormatZhuma());
       initBetPojo();
       toorderdetail();
     }
   }
 }
  private void OnClickListeners() {
    mBtnOpenSideBar.setClickable(true);
    mBtnOpenSideBar.setOnClickListener(
        new OnClickListener() {

          @Override
          public void onClick(View v) {

            openSideBar();
          }
        });

    mRlTitle.setOnClickListener(
        new OnClickListener() {

          @Override
          public void onClick(View v) {
            if (mSideBarOpened) {
              closeSideBar();
            }
          }
        });
  }
  public void badCreate() {
    if (destroyBomb != null) {
      destroyBomb.cancel();
    }
    DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
    int width = displayMetrics.widthPixels;
    int height = displayMetrics.heightPixels;
    ImageButton altbutton = (ImageButton) findViewById(R.id.badIcon);
    altbutton.setVisibility(View.VISIBLE);
    altbutton.setClickable(true);
    Random r2 = new Random();
    int Button2H = r2.nextInt(width - 400);
    int Button2W = r2.nextInt(height - 400);
    altbutton.setX(Button2H);
    altbutton.setY(Button2W);
    destroyBomb =
        new CountDownTimer(3000, 1000) {
          public void onTick(long millisUntilFinished) {}

          public void onFinish() {
            destroyBad();
          }
        }.start();
  }
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.map_main);
    floorMapView = (FloorMapView) findViewById(R.id.floormapview);
    mapView = (PtolemyMapView) floorMapView.getMapView();
    configureFloorMapView(floorMapView);

    ActionBar.setTitle(this, ACTIVITY_TITLE);

    // Set up meOverlay:
    // Show user
    meOverlay = new XPSOverlay(mapView);
    mapView.getOverlays().add(meOverlay);

    // Start Location data
    LocationSetter.getInstance(this, meOverlay).resume();

    final ImageButton compassButton =
        (ImageButton) getLayoutInflater().inflate(R.layout.menu_nav_button, null);
    compassButton.setImageResource(R.drawable.ic_menu_compass);
    compassButton.setContentDescription(getString(R.string.centre));
    final Context c = this;
    compassButton.setOnClickListener(
        new OnClickListener() {
          public void onClick(View v) {
            final APGeoPoint gp =
                LocationSetter.getInstance(PtolemyMapActivity.this, null).getPoint(c);
            if (gp != null) {
              mapView
                  .getController()
                  .animateTo(
                      gp,
                      new Runnable() {
                        @Override
                        public void run() {
                          floorMapView.updateToFloor(gp.getFloor());
                        }
                      });
            }
          }
        });

    final ImageButton searchButton =
        (ImageButton) getLayoutInflater().inflate(R.layout.menu_nav_button, null);
    searchButton.setImageResource(R.drawable.ic_menu_search);
    searchButton.setContentDescription(getString(R.string.search));
    searchButton.setOnClickListener(
        new OnClickListener() {
          public void onClick(View v) {
            onSearchRequested();
          }
        });

    final ImageButton bookmarksButton =
        (ImageButton) getLayoutInflater().inflate(R.layout.menu_nav_button, null);
    bookmarksButton.setImageResource(R.drawable.ic_menu_bookmark);
    bookmarksButton.setContentDescription(getString(R.string.bookmarks));
    bookmarksButton.setOnClickListener(
        new OnClickListener() {
          public void onClick(View v) {
            startActivityForResult(
                new Intent(v.getContext(), BookmarksActivity.class), BOOKMARKS_RESULT);
          }
        });

    final ImageButton nearestButton =
        (ImageButton) getLayoutInflater().inflate(R.layout.menu_nav_button, null);
    nearestButton.setImageResource(R.drawable.ic_menu_goto);
    nearestButton.setContentDescription(getString(R.string.bookmarks));
    nearestButton.setOnClickListener(
        new OnClickListener() {
          public void onClick(View v) {

            Intent intent = new Intent(v.getContext(), NearbyActivity.class);
            LocationSetter setter = LocationSetter.getInstance(v.getContext(), null);
            APGeoPoint p = setter.getPoint(v.getContext());
            if (p != null) {
              intent.putExtra(NearbyActivity.LAT, p.getLatitudeE6());
              intent.putExtra(NearbyActivity.LON, p.getLongitudeE6());
              intent.putExtra(NearbyActivity.FLOOR, p.getFloor());
            }
            startActivityForResult(intent, NEAREST_RESULT);
          }
        });

    ActionBar.setButtons(
        this, new View[] {compassButton, nearestButton, searchButton, bookmarksButton});

    athenaFilterButton = (PlaceFilterButton) findViewById(R.id.athena_filter_btn);
    setupFilterButton(athenaFilterButton, PlaceType.ATHENA);
    athenaFilterButton.setChecked(Config.getFilter(this, PlaceType.ATHENA));

    classroomFilterButton = (PlaceFilterButton) findViewById(R.id.classroom_filter_btn);
    setupFilterButton(classroomFilterButton, PlaceType.CLASSROOM);
    classroomFilterButton.setChecked(Config.getFilter(this, PlaceType.CLASSROOM));

    brMaleFilterButton = (PlaceFilterButton) findViewById(R.id.br_male_filter_btn);
    setupFilterButton(brMaleFilterButton, PlaceType.MTOILET);
    brMaleFilterButton.setChecked(Config.getFilter(this, PlaceType.MTOILET));

    brFemaleFilterButton = (PlaceFilterButton) findViewById(R.id.br_female_filter_btn);
    setupFilterButton(brFemaleFilterButton, PlaceType.FTOILET);
    brFemaleFilterButton.setChecked(Config.getFilter(this, PlaceType.FTOILET));

    if (!handleIntent(getIntent())) {
      mapView.getController().setCenter(Config.DEFAULT_POINT);
    }

    if (!Config.isTourTaken(this)) {
      // Prevent user from clicking a button until the first
      // tutorial page comes up.
      compassButton.setClickable(false);
      searchButton.setClickable(false);
      bookmarksButton.setClickable(false);
      new Thread(
              new Runnable() {
                public void run() {
                  try {
                    Thread.sleep(1000);
                  } catch (InterruptedException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                  }
                  PtolemyMapActivity.this.runOnUiThread(
                      new Runnable() {
                        public void run() {
                          startActivityForResult(
                              new Intent(PtolemyMapActivity.this, TourActivity.class),
                              TUTORIAL_INTRO_RESULT);
                          compassButton.setClickable(true);
                          searchButton.setClickable(true);
                          bookmarksButton.setClickable(true);
                        }
                      });
                }
              })
          .start();
    }
    APGeoPoint point = Config.getLocation(this);
    mapView.getController().setCenter(new GeoPoint(point.getLatitudeE6(), point.getLongitudeE6()));
    floorMapView.getSeekBar().setFloor(point.getFloor());
  }
Beispiel #18
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.test1);
    btest1_image1 = (ImageButton) findViewById(R.id.test1_image1);
    btest1_validate1 = (ImageButton) findViewById(R.id.test1_validate1);
    btest1_validate1.setEnabled(false);
    btest1_validate1.setClickable(false);
    btest1_validate1.setImageResource(R.drawable.validate_grey);
    btest1_refuse1 = (ImageButton) findViewById(R.id.test1_refuse1);
    btest1_refuse1.setEnabled(false);
    btest1_refuse1.setClickable(false);
    btest1_refuse1.setImageResource(R.drawable.refuse_grey);
    btest1_image2 = (ImageButton) findViewById(R.id.test1_image2);
    btest1_image2.setEnabled(false);
    btest1_image2.setClickable(false);
    btest1_validate2 = (ImageButton) findViewById(R.id.test1_validate2);
    btest1_validate2.setEnabled(false);
    btest1_validate2.setClickable(false);
    btest1_validate2.setImageResource(R.drawable.validate_grey);
    btest1_refuse2 = (ImageButton) findViewById(R.id.test1_refuse2);
    btest1_refuse2.setEnabled(false);
    btest1_refuse2.setClickable(false);
    btest1_refuse2.setImageResource(R.drawable.refuse_grey);
    btest1_image3 = (ImageButton) findViewById(R.id.test1_image3);
    btest1_image3.setEnabled(false);
    btest1_image3.setClickable(false);
    btest1_validate3 = (ImageButton) findViewById(R.id.test1_validate3);
    btest1_validate3.setEnabled(false);
    btest1_validate3.setClickable(false);
    btest1_validate3.setImageResource(R.drawable.validate_grey);
    btest1_refuse3 = (ImageButton) findViewById(R.id.test1_refuse3);
    btest1_refuse3.setEnabled(false);
    btest1_refuse3.setClickable(false);
    btest1_refuse3.setImageResource(R.drawable.refuse_grey);
    btest1_image4 = (ImageButton) findViewById(R.id.test1_image4);
    btest1_image4.setEnabled(false);
    btest1_image4.setClickable(false);
    btest1_validate4 = (ImageButton) findViewById(R.id.test1_validate4);
    btest1_validate4.setEnabled(false);
    btest1_validate4.setClickable(false);
    btest1_validate4.setImageResource(R.drawable.validate_grey);
    btest1_refuse4 = (ImageButton) findViewById(R.id.test1_refuse4);
    btest1_refuse4.setEnabled(false);
    btest1_refuse4.setClickable(false);
    btest1_refuse4.setImageResource(R.drawable.refuse_grey);
    btest1_image5 = (ImageButton) findViewById(R.id.test1_image5);
    btest1_image5.setEnabled(false);
    btest1_image5.setClickable(false);
    btest1_validate5 = (ImageButton) findViewById(R.id.test1_validate5);
    btest1_validate5.setEnabled(false);
    btest1_validate5.setClickable(false);
    btest1_validate5.setImageResource(R.drawable.validate_grey);
    btest1_refuse5 = (ImageButton) findViewById(R.id.test1_refuse5);
    btest1_refuse5.setEnabled(false);
    btest1_refuse5.setClickable(false);
    btest1_refuse5.setImageResource(R.drawable.refuse_grey);
    btest1_image6 = (ImageButton) findViewById(R.id.test1_image6);
    btest1_image6.setEnabled(false);
    btest1_image6.setClickable(false);
    btest1_validate6 = (ImageButton) findViewById(R.id.test1_validate6);
    btest1_validate6.setEnabled(false);
    btest1_validate6.setClickable(false);
    btest1_validate6.setImageResource(R.drawable.validate_grey);
    btest1_refuse6 = (ImageButton) findViewById(R.id.test1_refuse6);
    btest1_refuse6.setEnabled(false);
    btest1_refuse6.setClickable(false);
    btest1_refuse6.setImageResource(R.drawable.refuse_grey);
    btest1_next = (ImageButton) findViewById(R.id.test1_bnext);
    btest1_next.setEnabled(false);
    btest1_next.setClickable(false);
    btest1_next.setImageResource(R.drawable.next_grey);

    test1_layout1 = (LinearLayout) findViewById(R.id.test1_layout1);
    test1_layout1.setBackgroundColor(getResources().getColor(R.color.yellow));
    test1_layout2 = (LinearLayout) findViewById(R.id.test1_layout2);
    test1_layout3 = (LinearLayout) findViewById(R.id.test1_layout3);
    test1_layout4 = (LinearLayout) findViewById(R.id.test1_layout4);
    test1_layout5 = (LinearLayout) findViewById(R.id.test1_layout5);
    test1_layout6 = (LinearLayout) findViewById(R.id.test1_layout6);

    btest1_help = (ImageButton) findViewById(R.id.test1_bhelp);
    tuto_bt1 = (Button) findViewById(R.id.tuto_bt1);
    tuto_bt1.setBackgroundColor(getResources().getColor(R.color.yellow));

    // Image 1
    btest1_image1.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            Intent intent = new Intent(Test1.this, Test1_image.class);
            intent.putExtra("key", 1);
            startActivity(intent);
            test1_layout1.setBackgroundColor(Color.TRANSPARENT);
            Config.compt.setTest1_1(1);
          }
        });

    btest1_validate1.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            test1_layout1.setBackgroundColor(getResources().getColor(R.color.green));
            quotation_image1 = true;
            // cote la question 1 comme juste
            q1 = 1;
            activateNext();
          }
        });
    btest1_refuse1.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            test1_layout1.setBackgroundColor(getResources().getColor(R.color.red));
            quotation_image1 = true;
            // cote la question 1 comme fausse
            q1 = 0;
            activateNext();
          }
        });

    // Image 2
    btest1_image2.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            Intent intent = new Intent(Test1.this, Test1_image.class);
            intent.putExtra("key", 2);
            test1_layout2.setBackgroundColor(Color.TRANSPARENT);
            startActivity(intent);
            Config.compt.setTest1_2(1);
          }
        });
    btest1_validate2.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            // Au click sur le bouton, on affiche un calque vert sur l'image
            test1_layout2.setBackgroundColor(getResources().getColor(R.color.green));
            quotation_image2 = true;
            q2 = 1;
            activateNext();
          }
        });
    btest1_refuse2.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            // Au click sur le bouton, on affiche un calque rouge sur l'image
            test1_layout2.setBackgroundColor(getResources().getColor(R.color.red));
            quotation_image2 = true;
            q2 = 0;
            activateNext();
          }
        });

    // Image 3
    btest1_image3.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            Intent intent = new Intent(Test1.this, Test1_image.class);
            intent.putExtra("key", 3);
            test1_layout3.setBackgroundColor(Color.TRANSPARENT);
            startActivity(intent);
            Config.compt.setTest1_3(1);
          }
        });
    btest1_validate3.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            // Au click sur le bouton, on affiche un calque vert sur l'image
            test1_layout3.setBackgroundColor(getResources().getColor(R.color.green));
            quotation_image3 = true;
            q3 = 1;
            activateNext();
          }
        });
    btest1_refuse3.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            // Au click sur le bouton, on affiche un calque rouge sur l'image
            test1_layout3.setBackgroundColor(getResources().getColor(R.color.red));
            quotation_image3 = true;
            q3 = 0;
            activateNext();
          }
        });

    // Image 4
    btest1_image4.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            Intent intent = new Intent(Test1.this, Test1_image.class);
            intent.putExtra("key", 4);
            test1_layout4.setBackgroundColor(Color.TRANSPARENT);
            startActivity(intent);
            Config.compt.setTest1_4(1);
          }
        });
    btest1_validate4.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            // Au click sur le bouton, on affiche un calque vert sur l'image A MODIFIER
            test1_layout4.setBackgroundColor(getResources().getColor(R.color.green));
            quotation_image4 = true;
            q4 = 1;
            activateNext();
          }
        });
    btest1_refuse4.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            // Au click sur le bouton, on affiche un calque rouge sur l'image A MODIFIER
            test1_layout4.setBackgroundColor(getResources().getColor(R.color.red));
            quotation_image4 = true;
            q4 = 0;
            activateNext();
          }
        });

    // Image 5
    btest1_image5.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            Intent intent = new Intent(Test1.this, Test1_image.class);
            intent.putExtra("key", 5);
            test1_layout5.setBackgroundColor(Color.TRANSPARENT);
            startActivity(intent);
            Config.compt.setTest1_5(1);
          }
        });
    btest1_validate5.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            // Au click sur le bouton, on affiche un calque vert sur l'image A MODIFIER
            test1_layout5.setBackgroundColor(getResources().getColor(R.color.green));
            quotation_image5 = true;
            q5 = 1;
            activateNext();
          }
        });
    btest1_refuse5.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            // Au click sur le bouton, on affiche un calque rouge sur l'image A MODIFIER
            test1_layout5.setBackgroundColor(getResources().getColor(R.color.red));
            quotation_image5 = true;
            q5 = 0;
            activateNext();
          }
        });

    // Image 6
    btest1_image6.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            Intent intent = new Intent(Test1.this, Test1_image.class);
            intent.putExtra("key", 6);
            test1_layout6.setBackgroundColor(Color.TRANSPARENT);
            startActivity(intent);
            Config.compt.setTest1_6(1);
          }
        });
    btest1_validate6.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            // Au click sur le bouton, on affiche un calque vert sur l'image A MODIFIER
            test1_layout6.setBackgroundColor(getResources().getColor(R.color.green));
            quotation_image6 = true;
            q6 = 1;
            activateNext();
          }
        });
    btest1_refuse6.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            // Au click sur le bouton, on affiche un calque rouge sur l'image A MODIFIER
            test1_layout6.setBackgroundColor(getResources().getColor(R.color.red));
            quotation_image6 = true;
            q6 = 0;
            activateNext();
          }
        });
    btest1_next.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            // Au click sur le bouton, on passe au test suivant et on envoie le score a la gestion
            // des points

            gestPts.setT1(q1 + q2 + q3 + q4 + q5 + q6);
            Intent itest2 = new Intent(Test1.this, Test2.class);
            startActivity(itest2);
          }
        });
    btest1_help.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            alertDialog = new AlertDialog.Builder(Test1.this).create();
            alertDialog.setTitle(getResources().getString(R.string.help_test1_title));
            String admin = getResources().getString(R.string.help_admin);
            String quote = getResources().getString(R.string.help_quote);

            /*String t1 = getResources().getString(R.string.tuto_test1_text1);
            String t2 = getResources().getString(R.string.tuto_test1_text2);
            String t3 = getResources().getString(R.string.tuto_test1_text3);
            String t4 = getResources().getString(R.string.tuto_test1_text4);

            alertDialog.setMessage(ration + " : " + t1 + admin + " : " + t2 + instruct + " : " + t3 + quote + " : " + t4);*/

            tv_test1 = new TextView(Test1.this);

            Spannable st1_1 =
                getTextWithImages(
                    alertDialog.getContext(), getResources().getString(R.string.help_test1_text1));
            Spannable st1_2 =
                getTextWithImages(
                    alertDialog.getContext(), getResources().getString(R.string.help_test1_text2));

            tv_test1.setText(TextUtils.concat(admin, st1_1, quote, st1_2));
            alertDialog.setView(tv_test1, 20, 20, 20, 20);

            alertDialog.setButton(
                AlertDialog.BUTTON_NEUTRAL,
                "OK",
                new DialogInterface.OnClickListener() {
                  public void onClick(DialogInterface dialog, int which) {
                    dialog.dismiss();
                  }
                });
            alertDialog.show();
          }
        });
  } // Fin d'instance
Beispiel #19
0
 // Deal with the color and the unlocking of buttons and pictures
 public void activatePictures() {
   // Au click sur le bouton, on débloque les boutons valider et refuser et on affiche le suivant
   // en Jaune
   if (Config.compt.getTest1_1() == 1) {
     btest1_validate1.setEnabled(true);
     btest1_validate1.setClickable(true);
     btest1_validate1.setImageResource(R.drawable.validate);
     btest1_refuse1.setEnabled(true);
     btest1_refuse1.setClickable(true);
     btest1_refuse1.setImageResource(R.drawable.refuse);
     btest1_image2.setEnabled(true);
     btest1_image2.setClickable(true);
     if (Config.compt.getTest1_2() == 0) {
       test1_layout2.setBackgroundColor(getResources().getColor(R.color.yellow));
     }
   }
   if (Config.compt.getTest1_2() == 1) {
     btest1_validate2.setEnabled(true);
     btest1_validate2.setClickable(true);
     btest1_validate2.setImageResource(R.drawable.validate);
     btest1_refuse2.setEnabled(true);
     btest1_refuse2.setClickable(true);
     btest1_refuse2.setImageResource(R.drawable.refuse);
     btest1_image3.setEnabled(true);
     btest1_image3.setClickable(true);
     if (Config.compt.getTest1_3() == 0) {
       test1_layout3.setBackgroundColor(getResources().getColor(R.color.yellow));
     }
   }
   if (Config.compt.getTest1_3() == 1) {
     btest1_validate3.setEnabled(true);
     btest1_validate3.setClickable(true);
     btest1_validate3.setImageResource(R.drawable.validate);
     btest1_refuse3.setEnabled(true);
     btest1_refuse3.setClickable(true);
     btest1_refuse3.setImageResource(R.drawable.refuse);
     btest1_image4.setEnabled(true);
     btest1_image4.setClickable(true);
     if (Config.compt.getTest1_4() == 0) {
       test1_layout4.setBackgroundColor(getResources().getColor(R.color.yellow));
     }
   }
   if (Config.compt.getTest1_4() == 1) {
     btest1_validate4.setEnabled(true);
     btest1_validate4.setClickable(true);
     btest1_validate4.setImageResource(R.drawable.validate);
     btest1_refuse4.setEnabled(true);
     btest1_refuse4.setClickable(true);
     btest1_refuse4.setImageResource(R.drawable.refuse);
     btest1_image5.setEnabled(true);
     btest1_image5.setClickable(true);
     if (Config.compt.getTest1_5() == 0) {
       test1_layout5.setBackgroundColor(getResources().getColor(R.color.yellow));
     }
   }
   if (Config.compt.getTest1_5() == 1) {
     btest1_validate5.setEnabled(true);
     btest1_validate5.setClickable(true);
     btest1_validate5.setImageResource(R.drawable.validate);
     btest1_refuse5.setEnabled(true);
     btest1_refuse5.setClickable(true);
     btest1_refuse5.setImageResource(R.drawable.refuse);
     btest1_image6.setEnabled(true);
     btest1_image6.setClickable(true);
     if (Config.compt.getTest1_6() == 0) {
       test1_layout6.setBackgroundColor(getResources().getColor(R.color.yellow));
     }
   }
   if (Config.compt.getTest1_6() == 1) {
     btest1_validate6.setEnabled(true);
     btest1_validate6.setClickable(true);
     btest1_validate6.setImageResource(R.drawable.validate);
     btest1_refuse6.setEnabled(true);
     btest1_refuse6.setClickable(true);
     btest1_refuse6.setImageResource(R.drawable.refuse);
   }
 }
 public void destroyBad() {
   ImageButton altbutton = (ImageButton) findViewById(R.id.badIcon);
   altbutton.setVisibility(View.GONE);
   altbutton.setClickable(false);
 }