@Override
  protected void resetResult() {
    super.resetResult();

    // banktransfer
    bankTransferNameEditText.setText("");
    ibanEdtiText.setText("");
    bicEditText.setText("");

    // transfer entry
    for (int i = 0; i < tranGroup.getChildCount(); i++) {
      RadioButton radioButton = (RadioButton) tranGroup.getChildAt(i);
      radioButton.setEnabled(true);
    }
    tranGroup.clearCheck();
    result = "";
    // sim
    simTopUpNameEdit.setText("");
    phoneNumberEdit.setText("");
    operatorText.setText("");
    // card
    beneficiaryNameEditText.setText("");
    cardNumberEditText.setText("");
    expandFocusResultChange("");
    account = null;
  }
  public void updateSettings() {
    sp_sellto_system.setOnItemSelectedListener(null);
    sp_buyfrom_system.setOnItemSelectedListener(null);

    Task.Market req = EveDatabase.getDefaultRequiredPrice();
    Task.Market prod = EveDatabase.GetDefaultProducedPrice();

    if (req.order == Task.Market.Order.BUY) {
      rg_buyfrom_source.check(R.id.rb_buyfrom_buy);
    } else {
      rg_buyfrom_source.check(R.id.rb_buyfrom_sell);
    }
    if (prod.order == Task.Market.Order.BUY) {
      rg_sellto_source.check(R.id.rb_sellto_buy);
    } else {
      rg_sellto_source.check(R.id.rb_sellto_sell);
    }
    updateSystem(sp_sellto_system, prod.system);
    updateSystem(sp_buyfrom_system, req.system);

    sp_sellto_system.setOnItemSelectedListener(new SystemSelectedListener(false));
    sp_buyfrom_system.setOnItemSelectedListener(new SystemSelectedListener(true));
    ed_default_me.setValue(EveDatabase.getDefaultME(null));
    ed_default_te.setValue(EveDatabase.getDefaultTE(null));
  }
  public void prevactivity_skipping(View view) {

    if (skip_pressed == true) {
      SharedPreferences.Editor editor = sharedpreferences.edit();
      editor.putString("Radiobuttonteaming1", "NA");
      editor.putString("Radiobuttonteaming2", "NA");
      editor.putString("Teamingskipped", "skipped");
      editor.commit();
      Intent intent = new Intent(this, RecordSkipping.class);
      intent.putExtra("activity", "prevskipping");
      intent.putExtra("TesterName", user_name);
      startActivity(intent);
    } else {
      rgrp1 = (RadioGroup) findViewById(R.id.rgrp1);
      radioButtonID1 = rgrp1.getCheckedRadioButtonId();

      rgrp2 = (RadioGroup) findViewById(R.id.rgrp2);
      radioButtonID2 = rgrp2.getCheckedRadioButtonId();
      //            if (radioButtonID1 == -1 || radioButtonID2 == -1)
      //                Toast.makeText(getBaseContext(), "Please select one option from each type
      // !", Toast.LENGTH_LONG).show();
      //            else {
      SharedPreferences.Editor editor = sharedpreferences.edit();
      editor.putInt("teamingidround1", radioButtonID1);
      editor.putInt("teamingidround2", radioButtonID2);
      editor.putString("Teamingskipped", "notskipped");
      editor.commit();
      Intent intent = new Intent(this, RecordSkipping.class);
      intent.putExtra("activity", "prevskipping");
      intent.putExtra("TesterName", user_name);
      startActivity(intent);
      // }
    }
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_simple_drawer);

    mDrawer = (DrawerLayout) findViewById(R.id.simple_navigation_drawer);
    mDrawer.setDrawerListener(
        new DrawerLayout.DrawerListener() { // 监听DrawerLayout的侧滑
          @Override
          public void onDrawerSlide(View drawerView, float slideOffset) {}

          @Override
          public void onDrawerOpened(View drawerView) {
            Toast.makeText(SimpleDrawerActivity.this, "onDrawerOpened", Toast.LENGTH_SHORT).show();
          }

          @Override
          public void onDrawerClosed(View drawerView) {
            Toast.makeText(SimpleDrawerActivity.this, "onDrawerClosed", Toast.LENGTH_SHORT).show();
          }

          @Override
          public void onDrawerStateChanged(int newState) {}
        });

    RadioGroup scrimColorGroup = (RadioGroup) findViewById(R.id.rg_scrim_color);
    scrimColorGroup.setOnCheckedChangeListener(this);

    RadioGroup openDrawerGroup = (RadioGroup) findViewById(R.id.rg_open_drawer);
    openDrawerGroup.setOnCheckedChangeListener(this);
  }
  private void initControls(QuestionDataParceable q) {

    buttonAdd = (Button) findViewById(R.id.buttonOk);
    editContentQuestion = (EditText) findViewById(R.id.editContentQuestion);
    editLevel = (EditText) findViewById(R.id.editLevel);
    editA = (EditText) findViewById(R.id.editA);
    editB = (EditText) findViewById(R.id.editB);
    editC = (EditText) findViewById(R.id.editC);
    editD = (EditText) findViewById(R.id.editD);
    radioGroup = (RadioGroup) findViewById(R.id.radioGroup);
    idOptionA = ((findViewById(R.id.radioButtonA)).getId());
    idOptionB = ((findViewById(R.id.radioButtonB)).getId());
    idOptionC = ((findViewById(R.id.radioButtonC)).getId());
    idOptionD = ((findViewById(R.id.radioButtonD)).getId());

    if (q != null) {
      editContentQuestion.setText(q.name);
      editA.setText(q.answers[0]);
      editB.setText(q.answers[1]);
      editC.setText(q.answers[2]);
      editD.setText(q.answers[3]);
      editLevel.setText(Integer.toString(q.level));
      buttonAdd.setText(R.string.value_add_question_activity_change_question);
      buttonAdd.setOnClickListener(new listenerButtonOk("upgrade"));

      if (q.answers[0].equals(q.goodAnswer)) radioGroup.check(idOptionA);
      if (q.answers[1].equals(q.goodAnswer)) radioGroup.check(idOptionB);
      if (q.answers[2].equals(q.goodAnswer)) radioGroup.check(idOptionC);
      if (q.answers[3].equals(q.goodAnswer)) radioGroup.check(idOptionD);
    } else buttonAdd.setOnClickListener(new listenerButtonOk("add"));
  }
示例#6
0
 @Override
 public void setOnLongClickListener(OnLongClickListener l) {
   mButtons.setOnLongClickListener(l);
   for (int i = 0; i < mButtons.getChildCount(); i++) {
     mButtons.getChildAt(i).setOnLongClickListener(l);
   }
 }
 @Override
 public void reset() {
   RadioButton radio = (RadioButton) view.findViewById(view.getCheckedRadioButtonId());
   if (radio != null) {
     radio.setTextColor(mColor);
   }
 }
 private void togglePickerOptions() {
   if (mModel.recurrenceState == RecurrenceModel.STATE_NO_RECURRENCE) {
     mFreqSpinner.setEnabled(false);
     mEndSpinner.setEnabled(false);
     mIntervalPreText.setEnabled(false);
     mInterval.setEnabled(false);
     mIntervalPostText.setEnabled(false);
     mMonthRepeatByRadioGroup.setEnabled(false);
     mEndCount.setEnabled(false);
     mPostEndCount.setEnabled(false);
     mEndDateTextView.setEnabled(false);
     mRepeatMonthlyByNthDayOfWeek.setEnabled(false);
     mRepeatMonthlyByNthDayOfMonth.setEnabled(false);
     for (Button button : mWeekByDayButtons) {
       button.setEnabled(false);
     }
   } else {
     mView.findViewById(R.id.options).setEnabled(true);
     mFreqSpinner.setEnabled(true);
     mEndSpinner.setEnabled(true);
     mIntervalPreText.setEnabled(true);
     mInterval.setEnabled(true);
     mIntervalPostText.setEnabled(true);
     mMonthRepeatByRadioGroup.setEnabled(true);
     mEndCount.setEnabled(true);
     mPostEndCount.setEnabled(true);
     mEndDateTextView.setEnabled(true);
     mRepeatMonthlyByNthDayOfWeek.setEnabled(true);
     mRepeatMonthlyByNthDayOfMonth.setEnabled(true);
     for (Button button : mWeekByDayButtons) {
       button.setEnabled(true);
     }
   }
   updateDoneButtonState();
 }
        public void onClick(View v) {
          Restaurant r = new Restaurant();
          EditText name = (EditText) findViewById(R.id.name);
          EditText address = (EditText) findViewById(R.id.addr);

          r.setName(name.getText().toString());
          r.setAddress(address.getText().toString());

          RadioGroup types = (RadioGroup) findViewById(R.id.types);

          switch (types.getCheckedRadioButtonId()) {
            case R.id.sit_down:
              r.setType("sit_down");
              break;

            case R.id.take_out:
              r.setType("take_out");
              break;

            case R.id.delivery:
              r.setType("delivery");
              break;
          }

          adapter.add(r);
        }
示例#10
0
  @Override
  public void onClick(View v) {
    switch (v.getId()) {
      case R.id.okbtn:
        LoginActivity.isSound = isbgSoundCb.isChecked();
        // Log.d("tong", "isbgSoundCb 1 :" + LoginActivity.isSound);
        Constants.isGameSound = isoundCb.isChecked();
        LoginActivity.isSave = isautologinCb.isChecked();

        if (isoundCb.isChecked() != LoginActivity.isSave) {
          SharedPreferences spf = c.getPreferences(Activity.MODE_PRIVATE);
          SharedPreferences.Editor edit = spf.edit();
          edit.putBoolean("isautoLogin", isautologinCb.isChecked());
          edit.commit();
        }

        View sv = findViewById(rg.getCheckedRadioButtonId());
        int index = rg.indexOfChild(sv);
        // ClientThread.sendMsg("update$" + emailtx.getText().toString() + "$"
        //			+ schooltx.getText().toString() + "$" + index);
        this.cancel();
        break;

      case R.id.cancelbtn:
        this.dismiss();
        break;
    }
  }
  /**
   * 情報を保存する.
   *
   * @param outState バンドル
   * @param activity アクティビティ
   */
  private void saveInfo(final Bundle outState, final IRKitSettingActivity activity) {

    View root = getView();
    if (root == null) {
      return;
    }

    EditText ssidText = (EditText) root.findViewById(R.id.inputSSID);
    EditText passwordText = (EditText) root.findViewById(R.id.inputPassword);
    RadioGroup radioGroup = (RadioGroup) root.findViewById(R.id.radioGroupSecurity);

    if (activity != null) {
      activity.setSSID(ssidText.getText().toString().trim());
      activity.setPassword(passwordText.getText().toString());
      WiFiSecurityType type = null;
      int typeId = radioGroup.getCheckedRadioButtonId();
      switch (typeId) {
        case R.id.radioButton1:
          type = WiFiSecurityType.NONE;
          break;
        case R.id.radioButton2:
          type = WiFiSecurityType.WEP;
          break;
        case R.id.radioButton3:
        default:
          type = WiFiSecurityType.WPA2;
          break;
      }
      activity.setSecType(type);
    } else {
      outState.putString(KEY_SSID, ssidText.getText().toString().trim());
      outState.putString(KEY_TYPE, passwordText.getText().toString());
      outState.putInt(KEY_TYPE, radioGroup.getCheckedRadioButtonId());
    }
  }
示例#12
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.setupdialog);
    isbgSoundCb = (CheckBox) findViewById(R.id.isbgSoundCb);
    isoundCb = (CheckBox) findViewById(R.id.isSoundCba);
    isautologinCb = (CheckBox) findViewById(R.id.issavecb);

    isbgSoundCb.setChecked(LoginActivity.isSound);
    isautologinCb.setChecked(LoginActivity.isSave);
    isoundCb.setChecked(Constants.isGameSound);

    emailtx = (EditText) findViewById(R.id.emailtx);
    schooltx = (EditText) findViewById(R.id.shcooltx);
    rg = (RadioGroup) findViewById(R.id.genderrg);
    if (Constants.player != null) {
      emailtx.setText(Constants.player.email);
      schooltx.setText(Constants.player.school);
      rg.check(rg.getChildAt(Constants.player.gender).getId());
    } else {
      emailtx.setVisibility(View.GONE);
      schooltx.setVisibility(View.GONE);
      rg.setVisibility(View.GONE);
    }

    okbtn = (Button) findViewById(R.id.okbtn);
    cancelbtn = (Button) findViewById(R.id.cancelbtn);
    okbtn.setOnClickListener(this);
    cancelbtn.setOnClickListener(this);
  }
  private void initializeViews() {
    WindowManager.LayoutParams lpWindow = new WindowManager.LayoutParams();
    lpWindow.flags = WindowManager.LayoutParams.FLAG_DIM_BEHIND;
    lpWindow.dimAmount = 0.8f;
    getWindow().setAttributes(lpWindow);

    setContentView(R.layout.select_box_dialog);

    Button.class.cast(findViewById(R.id.confirm)).setOnClickListener(confirmClickListener);

    RadioGroup select_group = RadioGroup.class.cast(findViewById(R.id.select_group));
    select_group.setOnCheckedChangeListener(radio_group_listener);
    for (Map.Entry<Object, String> elem : select_list.entrySet()) {
      RadioButton radio_button = new RadioButton(this.getContext());
      radio_button.setButtonDrawable(R.drawable.ui_radio_blue);
      radio_button.setText(elem.getValue());
      radio_button.setId(ServerList.ServerInfo.ServerName.class.cast(elem.getKey()).ordinal());
      if (checked_index == ServerList.ServerInfo.ServerName.class.cast(elem.getKey()).ordinal()) {
        radio_button.setChecked(true);
      }
      select_group.addView(radio_button);
    }
    TextView.class.cast(findViewById(R.id.message)).setText(this.message);
    if (this.message.equals("")) {
      TextView.class.cast(findViewById(R.id.message)).setVisibility(View.GONE);
    }
  }
示例#14
0
  private void startActivity() {

    Intent intent = new Intent(this, MapActivity.class);
    if (null != findViewById(R.id.radio_group)) {
      RadioGroup radioGroup = (RadioGroup) this.findViewById(R.id.radio_group);
      switch (radioGroup.getCheckedRadioButtonId()) {
        case R.id.btn_service:
          intent.putExtra("type", "service");
          break;
        case R.id.btn_shopping:
          intent.putExtra("type", "trade");
          break;
        case R.id.btn_food:
          intent.putExtra("type", "food");
          break;
        case R.id.btn_drink:
          intent.putExtra("type", "drink");
          break;
        case R.id.btn_live:
          intent.putExtra("type", "live");
          break;
      }
    }
    startActivity(intent);
    overridePendingTransition(R.anim.zoom_enter, R.anim.zoom_exit); // 淡出淡入动画效果
  }
示例#15
0
  public void onClickAdd(View v) {

    // prepare parameters
    int floorId = floorGroup.getCheckedRadioButtonId();
    int roomId;
    try {
      roomId = Integer.parseInt(roomNbr.getText().toString());
    } catch (NumberFormatException e) {
      roomId = 0;
    }
    int capacity = capacityGroup.getCheckedRadioButtonId();

    editor = new RoomEditor();
    switch (editor.generateNewRoom(this, floorId, roomId, capacity)) {
      case RoomEditor.ROOM_CREATED:
        finish();
        startActivity(new Intent(this, FloorChooserActivity.class));
        Toast.makeText(this, R.string.room_successfully_created, Toast.LENGTH_SHORT).show();
        break;
      case RoomEditor.ROOM_EXISTS:
        Toast.makeText(this, R.string.room_already_exists, Toast.LENGTH_SHORT).show();
        break;
      case RoomEditor.ROOM_FAIL:
        Toast.makeText(this, R.string.empty_fields, Toast.LENGTH_SHORT).show();
        break;
      default:
        Toast.makeText(this, "An error occured...", Toast.LENGTH_SHORT).show();
        break;
    }
  }
  @Override
  public void onCheckedChanged(RadioGroup radioGroup, int checkedId) {
    for (int i = 0; i < rgs.getChildCount(); i++) {
      if (rgs.getChildAt(i).getId() == checkedId) {
        Fragment fragment = fragments.get(i);
        FragmentTransaction ft = obtainFragmentTransaction(i);

        getCurrentFragment().onPause(); // 暂停当前tab
        // getCurrentFragment().onStop(); // 暂停当前tab

        if (fragment.isAdded()) {
          // fragment.onStart(); // 启动目标tab的onStart()
          fragment.onResume(); // 启动目标tab的onResume()
        } else {
          ft.add(fragmentContentId, fragment);
        }
        showTab(i); // 显示目标tab
        ft.commit();

        // 如果设置了切换tab额外功能功能接口
        if (null != onRgsExtraCheckedChangedListener) {
          onRgsExtraCheckedChangedListener.OnRgsExtraCheckedChanged(radioGroup, checkedId, i);
        }
      }
    }
  }
示例#17
0
 @Override
 public void onClick(View view) {
   if (!Util.isNetworkConnected(getActivity())) {
     showToastMsg("当前未联网,请检查网络设置");
     return;
   }
   switch (view.getId()) {
     case R.id.iv_publish:
       // 发布新的旅行
       if (radioGroup.getCheckedRadioButtonId() == R.id.tab1) {
         Intent publishTogetherIntent =
             new Intent(getActivity(), PublishTogetherStep1Activity.class);
         startActivity(publishTogetherIntent);
       } else if (radioGroup.getCheckedRadioButtonId() == R.id.tab2) {
         Intent publishCustomIntent = new Intent(getActivity(), PublishCustomTourActivity.class);
         startActivity(publishCustomIntent);
       }
       break;
     case R.id.layout_search:
       Intent intent = new Intent(getActivity(), SearchActivity.class);
       startActivity(intent);
       break;
     case R.id.tv_right:
       Intent intent1 = new Intent(getActivity(), CityListActivity.class);
       startActivityForResult(intent1, 1);
       break;
   }
 }
示例#18
0
  /**
   * Updates the selected tool, and optionally notify listeners.
   *
   * @param tool selected tool.
   * @param notifyListeners true to notify listeners, false otherwise.
   */
  private void setTool(EditorTools tool, boolean notifyListeners) {
    if (mMissionProxy != null
        && mMissionProxy.getItems().size() > 0
        && tool != EditorTools.TRASH
        && tool != EditorTools.SELECTOR
        && tool != EditorTools.NONE) {

      MissionItemProxy lastMissionItem =
          mMissionProxy.getItems().get(mMissionProxy.getItems().size() - 1);
      switch (lastMissionItem.getMissionItem().getType()) {
        case LAND:
        case RETURN_TO_LAUNCH:
          tool = EditorTools.NONE;
          mEditorRadioGroup.clearCheck();
          Toast.makeText(
                  getActivity(), getString(R.string.editor_err_land_rtl_added), Toast.LENGTH_SHORT)
              .show();
          break;

        default:
          break;
      }
    }

    this.tool = tool;
    if (tool == EditorTools.NONE) {
      mEditorRadioGroup.clearCheck();
    }

    if (listener != null && notifyListeners) {
      listener.editorToolChanged(this.tool);
    }
  }
  public void onSubmit(View v) {
    RadioButton rb1 = (RadioButton) radioGroup1.findViewById(radioGroup1.getCheckedRadioButtonId());
    Toast.makeText(CreditsDebits.this, rb1.getText(), Toast.LENGTH_SHORT).show();

    RadioButton rb2 = (RadioButton) radioGroup2.findViewById(radioGroup2.getCheckedRadioButtonId());
    Toast.makeText(CreditsDebits.this, rb2.getText(), Toast.LENGTH_SHORT).show();
  }
示例#20
0
  private void setInitState(int state) {
    if (state >= SETTING_BASE_EXT) {
      mSettingBase = SETTING_BASE_EXT;
      CheckBox checkExtDisplay = (CheckBox) findViewById(R.id.wfd_power_saving_ext_display);
      checkExtDisplay.setChecked(true);
    } else {
      mSettingBase = SETTING_BASE_NORMAL;
    }
    Elog.v(TAG, "setInitState = " + state + " mSettingBase:" + mSettingBase);

    if (state >= mSettingBase) {
      state = state - mSettingBase;
    } else {
      Elog.d(TAG, "Invalid state:" + state + " mSettingBase:" + mSettingBase);
    }
    if (state == 0) {
      mRgPower.check(R.id.Wfd_Power_Style_0);
    } else if (state == 1) {
      mRgPower.check(R.id.Wfd_Power_Style_1);
    } else if (state == 2) {
      //   mRgPower.check(R.id.Wfd_Power_Style_2);
      // } else if(state == 3) {
      mRgPower.check(R.id.Wfd_Power_Style_3);
    } else {
      Elog.w(TAG, "Wrong input resolution info");
    }
  }
示例#21
0
  private ContentValues getContent() {
    ContentValues content = new ContentValues();
    EditText aux;

    Long id = getId();
    if (id != -1) {
      content.put("_id", id);
    }

    // date
    DatePicker dp = (DatePicker) findViewById(R.id.date);
    GregorianCalendar date = new GregorianCalendar(dp.getYear(), dp.getMonth(), dp.getDayOfMonth());
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
    content.put("date", sdf.format(date.getTime()));

    // km
    aux = (EditText) findViewById(R.id.km);
    content.put("odometer", Float.parseFloat(aux.getText().toString()));

    // liters
    aux = (EditText) findViewById(R.id.liters);
    content.put("liters", Float.parseFloat(aux.getText().toString()));

    // type
    RadioGroup aux2 = (RadioGroup) findViewById(R.id.type);
    RadioButton aux3 = (RadioButton) findViewById(aux2.getCheckedRadioButtonId());
    content.put("fuel", aux3.getText().toString());

    return content;
  }
  private void updateSettings() {
    sp_sellto_system.setOnItemSelectedListener(null);
    sp_buyfrom_system.setOnItemSelectedListener(null);

    Market req = database.getDefaultRequiredMarket();
    Market prod = database.getDefaultProducedMarket();

    if (req.order == Market.Order.BUY) {
      rg_buyfrom_source.check(R.id.rb_buyfrom_buy);
    } else {
      rg_buyfrom_source.check(R.id.rb_buyfrom_sell);
    }
    if (prod.order == Market.Order.BUY) {
      rg_sellto_source.check(R.id.rb_sellto_buy);
    } else {
      rg_sellto_source.check(R.id.rb_sellto_sell);
    }
    updateSystem(sp_sellto_system, prod.system);
    updateSystem(sp_buyfrom_system, req.system);

    ed_sellto_broker.setValue(prod.broker);
    ed_sellto_tax.setValue(prod.transaction);
    ed_buyfrom_broker.setValue(req.broker);
    ed_buyfrom_tax.setValue(req.transaction);

    sp_sellto_system.setOnItemSelectedListener(new SystemSelectedListener(false));
    sp_buyfrom_system.setOnItemSelectedListener(new SystemSelectedListener(true));
    ed_default_me.setValue(database.getDefaultME(null));
    ed_default_te.setValue(database.getDefaultTE(null));
  }
示例#23
0
 public void startPvE(View v) {
   RadioButton Easy = (RadioButton) findViewById(R.id.Easy);
   RadioButton Normal = (RadioButton) findViewById(R.id.Normal);
   RadioButton Hard = (RadioButton) findViewById(R.id.Hard);
   RadioButton Player = (RadioButton) findViewById(R.id.Player);
   RadioButton AI = (RadioButton) findViewById(R.id.AI);
   int checkedId = Difficulty.getCheckedRadioButtonId();
   int checkedSh = Shot.getCheckedRadioButtonId();
   // find which radioButton is checked by id
   if (checkedId == Easy.getId() && checkedSh == Player.getId()) {
     Intent intent = new Intent(MainConfig.this, Easy.class);
     startActivity(intent);
   } else if (checkedId == Normal.getId() && checkedSh == Player.getId()) {
     Intent intent = new Intent(MainConfig.this, Normal.class);
     startActivity(intent);
   } else if (checkedId == Hard.getId() && checkedSh == Player.getId()) {
     Intent intent = new Intent(MainConfig.this, Hard.class);
     startActivity(intent);
   } else if (checkedId == Easy.getId() && checkedSh == AI.getId()) {
     Intent intent = new Intent(MainConfig.this, EasyAI.class);
     startActivity(intent);
   } else if (checkedId == Normal.getId() && checkedSh == AI.getId()) {
     Intent intent = new Intent(MainConfig.this, NormalAI.class);
     startActivity(intent);
   } else if (checkedId == Hard.getId() && checkedSh == AI.getId()) {
     /*Toast.makeText(getApplicationContext(), "choice: Hard+AI",
     Toast.LENGTH_SHORT).show();*/
     Intent intent = new Intent(MainConfig.this, HardAI.class);
     startActivity(intent);
   }
 }
示例#24
0
  private boolean validar() {

    if (miembrohogar.EdadAnios > 5) {

      if (rgOcupacion.getCheckedRadioButtonId() == -1) {

        Toast.makeText(getBaseContext(), "Ocupación es Requerida", Toast.LENGTH_LONG).show();
        return false;

      } else {

        if (conecciondb.getCodigoOcupacionesById(rgOcupacion.getCheckedRadioButtonId()) == 5
            || conecciondb.getCodigoOcupacionesById(rgOcupacion.getCheckedRadioButtonId()) == 11
            || conecciondb.getCodigoOcupacionesById(rgOcupacion.getCheckedRadioButtonId()) == 12) {
          // Es Femenina , Responder Sexo
          if (rgMotivoNoTrabajo.getCheckedRadioButtonId() == -1) {

            Toast.makeText(
                    getBaseContext(), "Motivo de No Trabajo es Obligatorio", Toast.LENGTH_LONG)
                .show();
            return false;

          } else {
            return true;
          }

        } else {
          return true;
        }
      }

    } else {
      return true;
    }
  }
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    this.game = new Game(new Team(teamAName), new Team(teamBName), MAX_TOSSUPS);

    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    Button back = (Button) findViewById(R.id.backbutton);
    back.setOnClickListener(prevButtonClicked);
    Button forward = (Button) findViewById(R.id.forwardbutton);
    forward.setOnClickListener(nextButtonClicked);

    RadioGroup lhs = (RadioGroup) findViewById(R.id.teamaradiogroup);
    lhs.setOnCheckedChangeListener(teamPointsSelected);
    RadioGroup rhs = (RadioGroup) findViewById(R.id.teambradiogroup);
    rhs.setOnCheckedChangeListener(teamPointsSelected);

    CheckBox bbox1 = (CheckBox) findViewById(R.id.bonuscheck1);
    CheckBox bbox2 = (CheckBox) findViewById(R.id.bonuscheck2);
    CheckBox bbox3 = (CheckBox) findViewById(R.id.bonuscheck3);
    bbox1.setOnCheckedChangeListener(bonusBoxChecked);
    bbox2.setOnCheckedChangeListener(bonusBoxChecked);
    bbox3.setOnCheckedChangeListener(bonusBoxChecked);

    Spinner spinnerA = (Spinner) findViewById(R.id.teamaplayerspinner);
    spinnerA.setOnItemSelectedListener(playerSpinnerSelected);
    Spinner spinnerB = (Spinner) findViewById(R.id.teambplayerspinner);
    spinnerB.setOnItemSelectedListener(playerSpinnerSelected);
    this.updatePlayerSpinner();

    TextView teamAName = (TextView) findViewById(R.id.teama);
    TextView teamBName = (TextView) findViewById(R.id.teamb);
    teamAName.setOnClickListener(teamANameClicked);
    teamBName.setOnClickListener(teamBNameClicked);
  }
示例#26
0
  private void init(Context context, View contentview, String[] items) {
    /** 用数据初始化ui */
    radioGroup = (RadioGroup) contentview.findViewById(R.id.filter_layout);
    radioGroup.clearCheck();
    if (items == null) return;
    for (int i = 0; i < items.length; i++) {

      RadioButton radioButton =
          (RadioButton) LayoutInflater.from(context).inflate(R.layout.line_popupwindow_rbt, null);
      radioButton.setId(rbtIds[i]);
      radioButton.setText(items[i]);

      radioGroup.addView(radioButton, -1, radioGroup.getLayoutParams());

      if (items[i].equals(outCbx.getText())) {
        outCbx.setTag(i);
        radioButton.setChecked(true);
      }
    }
    radioGroup.setOnCheckedChangeListener(
        new RadioGroup.OnCheckedChangeListener() {
          @Override
          public void onCheckedChanged(RadioGroup group, int checkedId) {
            dismiss();
          }
        });
  }
 void initGroupRole() {
   groupRole = (LinearLayout) findViewById(R.id.group_role);
   //
   mQRConn = (RadioGroup) findViewById(R.id.qrconn);
   mQRConn.setOnCheckedChangeListener(
       new RadioGroup.OnCheckedChangeListener() {
         public void onCheckedChanged(RadioGroup group, int checkedId) {
           if (checkedId == R.id.leader) {
             doLeader();
           } else if (checkedId == R.id.member) {
             doMember();
           }
         }
       });
   //
   mAutoConn = (RadioGroup) findViewById(R.id.autoconn);
   mAutoConn.setOnCheckedChangeListener(
       new RadioGroup.OnCheckedChangeListener() {
         public void onCheckedChanged(RadioGroup group, int checkedId) {
           if (checkedId == R.id.autofind) {
             Closed = true;
             if (connMgrService != null) {
               connMgrService.onConnectorDestroy();
             }
             finish();
             Intent intent = new Intent(Router.ACTION_CONNECTION_MANAGEMENT);
             startActivity(intent);
           }
         }
       });
 }
示例#28
0
  private void initData() {
    uid = PrefUtils.getString(CreateGroupActivity.this, "uid", "");
    rg_group.check(R.id.rb_100);

    rg_group.setOnCheckedChangeListener(
        new OnCheckedChangeListener() {
          @Override
          public void onCheckedChanged(RadioGroup group, int checkedId) {
            switch (checkedId) {
              case R.id.rb_100:
                num = "100";
                break;
              case R.id.rb_200:
                num = "200";
                break;
              case R.id.rb_500:
                num = "500";
                break;
              case R.id.rb_1000:
                num = "1000";
                break;
            }
          }
        });

    et_group_intro.addTextChangedListener(this);
    et_group_name.addTextChangedListener(this);
  }
  private void refreshIndicator(int pageNo) {
    int firstPageCount = ((GiftKeyBoardAdapter) mAdapter).getFirstPageCount();
    //		int secondPageCount = ((GiftKeyBoardAdapter)mAdapter).getSecondPageCount();

    if (!forChat) {
      int index = 0;
      if (pageNo < firstPageCount) {
        index = 0;
      } else {
        index = 1;
      }

      if (index == 0) {
        mRadioGroup.check(0);

      } else {
        mRadioGroup.check(1);
      }
      mIndicator.setCurrentItem(pageNo);

      initUserPageSendGift(index);

      mIndicatorForChat.setVisibility(View.GONE);
    } else {
      mIndicatorForChat.setCurrentItem(pageNo);
      mIndicator.setVisibility(View.GONE);
    }
  }
  public void generateTransferEntrys() {

    for (int i = 0; i < tranGroup.getChildCount(); i++) {
      RadioButton radioButton = (RadioButton) tranGroup.getChildAt(i);
      radioButton.setOnCheckedChangeListener(this);
    }
  }