private void InitState() {
    // title
    String sSubTitle = utils.GetResStr(R.string.titleDefaultAppointment);

    // date values
    dateStart = Calendar.getInstance();
    dateEndOn = Calendar.getInstance();

    dataRow.SetDuration(prefs.iMinutesDuration);

    // INSERT MODE
    if (GetStartMode() == StartMode.NEW) {
      sSubTitle = utils.GetResStr(R.string.titleNewAppointment);
      btnDelete.setVisibility(View.INVISIBLE);

      // initialize data
      SetStartDateByAgendaView(dateStart);
      updateStartDateTimeForNewAppointment(dateStart);
      SetStartTimeForDayAgendaView(dateStart);

      chkAllDay.setChecked(false);
      chkAlarm.setChecked(true);

      // repeat data
      iRepeatType = 0; // none
      iRepeatEvery = 1;
      dateEndOn.setTimeInMillis(0); // no end date
    }

    // EDIT MODE
    if (GetStartMode() == StartMode.EDIT) {
      sSubTitle = utils.GetResStr(R.string.titleEditAppointment);

      dateStart.setTimeInMillis(dataRow.GetStartDate().getTimeInMillis());

      btnDelete.setVisibility(View.VISIBLE);
      edSubject.setText(dataRow.GetSubject());
      chkAllDay.setChecked(dataRow.GetAllDay());
      chkAlarm.setChecked(dataRow.GetAlarm());

      // repeat data
      iRepeatType = dataRow.GetRepeat().GetRepeatTypeAsInt();
      iRepeatEvery = dataRow.GetRepeat().GetEvery();
      dateEndOn.setTimeInMillis(dataRow.GetRepeat().GetEndOnDate().getTimeInMillis());
    }

    restoreStateFromFreezeIfRequired();

    SetActivityTitle(sSubTitle);
    UpdateStartDateTimeView();

    UpdateRepeatInfo();

    // set focus to subject
    edSubject.requestFocus();
    if (GetStartMode() == StartMode.EDIT) edSubject.setSelection(edSubject.length());
  }
 @Override
 protected void restoreStateFromFreeze() {
   edSubject.setText(freeze.getString("subject"));
   chkAlarm.setChecked(freeze.getBoolean("alarm"));
   dateStart.setTimeInMillis(freeze.getLong("dateStart"));
   chkAllDay.setChecked(freeze.getBoolean("allday"));
   iRepeatType = freeze.getInt("repeatType");
   iRepeatEvery = freeze.getInt("repeatEvery");
   dateEndOn.setTimeInMillis(freeze.getLong("dateEndOn"));
 }
예제 #3
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_setup4);
    mCheck = (CheckBox) findViewById(R.id.cb_protect);

    boolean protect = mPref.getBoolean("protect", false);
    // 当check发生改变时,回掉此方法
    if (protect) {
      mCheck.setText("防盗保护已经开启");
      mCheck.setChecked(true);
    } else {
      mCheck.setText("防盗保护没有开启");
      mCheck.setChecked(false);
    }
    mCheck.setOnCheckedChangeListener(
        new CompoundButton.OnCheckedChangeListener() {
          @Override
          public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            if (isChecked) {
              mCheck.setText("防盗保护已经开启");
              mPref.edit().putBoolean("protect", true).commit();
            } else {
              mCheck.setText("防盗保护没有开启");
              mPref.edit().putBoolean("protect", false).commit();
            }
          }
        });
  }
예제 #4
0
  @Override
  public boolean onChildClick(
      ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {
    final IndexItem e =
        (IndexItem)
            ((DownloadIndexAdapter) getListAdapter()).getChild(groupPosition, childPosition);
    String key = e.getFileName();
    final CheckBox ch = (CheckBox) v.findViewById(R.id.check_download_item);

    if (ch.isChecked()) {
      ch.setChecked(!ch.isChecked());
      entriesToDownload.remove(key);
      if (entriesToDownload.isEmpty()) {
        int x = getListView().getScrollX();
        int y = getListView().getScrollY();
        findViewById(R.id.DownloadButton).setVisibility(View.GONE);
        getListView().scrollTo(x, y);
      }
      return true;
    }

    final DownloadEntry entry = e.createDownloadEntry(DownloadIndexActivity.this);
    if (entry != null) {
      // if(!fileToUnzip.exists()){
      // builder.setMessage(MessageFormat.format(getString(R.string.download_question), baseName,
      // extractDateAndSize(e.getValue())));
      entriesToDownload.put(e.getFileName(), entry);
      int x = getListView().getScrollX();
      int y = getListView().getScrollY();
      findViewById(R.id.DownloadButton).setVisibility(View.VISIBLE);
      getListView().scrollTo(x, y);
      ch.setChecked(!ch.isChecked());
    }
    return true;
  }
  // Other
  // ==============================================================================================
  private void displayOptions() {
    final AlertDialog.Builder alertDialog = new AlertDialog.Builder(FlightControlsActivity.this);
    LayoutInflater inflater = getLayoutInflater();
    View convertView = (View) inflater.inflate(R.layout.popup_flight_options, null);
    alertDialog.setView(convertView);
    alertDialog.setTitle("Options:");
    alertDialog.setPositiveButton(
        "Continue",
        new DialogInterface.OnClickListener() {
          @Override
          public void onClick(DialogInterface dialog, int which) {}
        });

    final AlertDialog alert = alertDialog.create();
    alert.show();

    final CheckBox chkDirectional = (CheckBox) alert.findViewById(R.id.chkDirectional);
    final CheckBox chkRotation = (CheckBox) alert.findViewById(R.id.chkRotation);
    final CheckBox chkAltitude = (CheckBox) alert.findViewById(R.id.chkAltitude);

    chkDirectional.setOnCheckedChangeListener(this);
    chkRotation.setOnCheckedChangeListener(this);
    chkAltitude.setOnCheckedChangeListener(this);

    chkDirectional.setChecked(controls_directional);
    chkRotation.setChecked(controls_rotation);
    chkAltitude.setChecked(controls_altitude);
  }
 private void updatePlayerAbilitiesCheckBoxes() {
   PlayerAbilities abilities = EditorActivity.level.getPlayer().getAbilities();
   flyingBox.setChecked(abilities.flying);
   invulnerableBox.setChecked(abilities.invulnerable);
   instaBuildBox.setChecked(abilities.instabuild);
   mayFlyBox.setChecked(abilities.mayFly);
 }
예제 #7
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);
  }
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View res = inflater.inflate(R.layout.fr_settings_chat, container, false);

    final CheckBox sendByEnter = (CheckBox) res.findViewById(R.id.sendByEnter);
    sendByEnter.setChecked(messenger().isSendByEnterEnabled());
    View.OnClickListener listener =
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            messenger().changeSendByEnter(!messenger().isSendByEnterEnabled());
            sendByEnter.setChecked(messenger().isSendByEnterEnabled());
          }
        };
    sendByEnter.setOnClickListener(listener);
    res.findViewById(R.id.sendByEnterCont).setOnClickListener(listener);

    final CheckBox markDown = (CheckBox) res.findViewById(R.id.markdown);
    markDown.setChecked(messenger().isMarkdownEnabled());
    View.OnClickListener markDownListener =
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            messenger().changeMarkdown(!messenger().isMarkdownEnabled());
            markDown.setChecked(messenger().isMarkdownEnabled());
          }
        };
    markDown.setOnClickListener(markDownListener);
    res.findViewById(R.id.markdownCont).setOnClickListener(markDownListener);

    return res;
  }
예제 #9
0
 @Override
 public void onClick(View v) {
   switch (v.getId()) {
     case R.id.btn_sub:
       String extend_msg = et_extend_msg.getText().toString();
       String refund_amount = et_pay_price.getText().toString();
       if (Double.valueOf(refund_amount) > Double.valueOf(goods_pay_price)) {
         Toast.makeText(E3_Activity_Returns.this, "金额输入错误", Toast.LENGTH_LONG).show();
       } else {
         loadingPDialog.show();
         HttpUtils.refund(
             res, order_id, rec_id, refund_type, refund_amount, goods_num, extend_msg);
       }
       break;
     case R.id.ll_check_1:
       check_1.setChecked(true);
       check_2.setChecked(false);
       refund_type = "1";
       break;
     case R.id.ll_check_2:
       check_2.setChecked(true);
       check_1.setChecked(false);
       refund_type = "2";
       break;
     case R.id.iv_back:
       this.finish();
       break;
     default:
       break;
   }
 }
예제 #10
0
  public void onPrepareDialog(int id, Dialog dialog) {
    switch (id) {
      case EDIT_STEP:
        ((EditText) dialog.findViewById(R.id.nameEdit)).setText(modifiedStep.name);
        ((EditText) dialog.findViewById(R.id.nameEdit)).clearFocus();

        ((EditText) dialog.findViewById(R.id.durationEdit))
            .setText(
                String.format("%d:%02d", modifiedStep.duration / 60, modifiedStep.duration % 60));
        ((EditText) dialog.findViewById(R.id.durationEdit)).clearFocus();

        CheckBox agitateCB = (CheckBox) dialog.findViewById(R.id.agitateCheckbox);
        agitateCB.setOnCheckedChangeListener(this);

        agitateEdit = (EditText) dialog.findViewById(R.id.agitateEdit);
        if (modifiedStep.agitateEvery == -1) {
          agitateEdit.setText("");
          agitateEdit.setEnabled(false);
          agitateCB.setChecked(true);
        } else {
          agitateEdit.setText(String.format("%d", modifiedStep.agitateEvery));
          agitateEdit.setEnabled(true);
          agitateCB.setChecked(false);
        }
        agitateEdit.clearFocus();

        CheckBox cb = (CheckBox) dialog.findViewById(R.id.pourCheck);
        if (modifiedStep.pourFor > 0) {
          cb.setChecked(true);
        } else {
          cb.setChecked(false);
        }
        break;
    }
  }
  /** 初始化 Views */
  private void initViews() {
    mEtIDNumber = (EditText) findViewById(R.id.id_EtIDNumber);
    mEtPassword = (EditText) findViewById(R.id.id_EtPassword);
    mEtVerifyCode = (EditText) findViewById(R.id.id_EtVerifyCode);
    mImgVerifyCode = (ImageView) findViewById(R.id.id_ImgVerifyCode);
    mBtnLogin = (Button) findViewById(R.id.id_BtnLogin);
    mTvLoginBack = (TextView) findViewById(R.id.id_tvLoginBack);
    mCbRememberPsd = (CheckBox) findViewById(R.id.id_cBRememberPsd);
    mTvRememberPsd = (TextView) findViewById(R.id.id_tvRememberPsd);
    mCbRememberIDNumber = (CheckBox) findViewById(R.id.id_cBRememberIDNumber);
    mTvRememberIDNumber = (TextView) findViewById(R.id.id_tvRememberIDNumber);

    // 读取保存的密码
    SharedPreferences mSharedPreferences = getSharedPreferences("data", Activity.MODE_PRIVATE);
    boolean rememberPsd = mSharedPreferences.getBoolean("rememberPsd", false);
    boolean rememberIDNumber = mSharedPreferences.getBoolean("rememberIDNumber", false);
    if (rememberPsd) {
      String IDNumber = mSharedPreferences.getString("IDNumber", "");
      String password = mSharedPreferences.getString("password", "");
      mEtIDNumber.setText(IDNumber);
      mEtPassword.setText(password);
      // 将焦点置于填写验证码
      mEtVerifyCode.requestFocus();
      // 并将记住账号和记住密码默认打勾
      mCbRememberIDNumber.setChecked(true);
      mCbRememberPsd.setChecked(true);
    } else if (rememberIDNumber) {
      String IDNumber = mSharedPreferences.getString("IDNumber", "");
      mEtIDNumber.setText(IDNumber);
      // 将焦点置于填写验证码
      mEtPassword.requestFocus();
      // 并将记住账号默认打勾
      mCbRememberIDNumber.setChecked(true);
    }
  }
  @Override
  public void onItemClick(AdapterView<?> parent, View v, int position, long id) {

    CheckBox checkbox = (CheckBox) v.findViewWithTag(position);
    if (checkbox.isChecked()) checkbox.setChecked(false);
    else checkbox.setChecked(true);

    // Gets the Cursor object currently bound to the ListView
    final Cursor cursor = mAdapter.getCursor();

    // Moves to the Cursor row corresponding to the ListView item that was
    // clicked
    cursor.moveToPosition(position);

    // Creates a contact lookup Uri from contact ID and lookup_key
    final Uri uri =
        Contacts.getLookupUri(
            cursor.getLong(ContactsQuery.ID), cursor.getString(ContactsQuery.LOOKUP_KEY));

    // Notifies the parent activity that the user selected a contact. In a
    // two-pane layout, the
    // parent activity loads a ContactDetailFragment that displays the
    // details for the selected
    // contact. In a single-pane layout, the parent activity starts a new
    // activity that
    // displays contact details in its own Fragment.
    mOnContactSelectedListener.onContactSelected(uri);

    // If two-pane layout sets the selected item to checked so it remains
    // highlighted. In a
    // single-pane layout a new activity is started so this is not needed.

  }
예제 #13
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_settings);
    mEtTextToType = (EditText) findViewById(R.id.et_text_to_be_typed);
    mCbClearText = (CheckBox) findViewById(R.id.cb_clear_text);
    mCbPerformAction = (CheckBox) findViewById(R.id.cb_perform_action);

    if (savedInstanceState == null) {
      Bundle localeBundle =
          getIntent().getBundleExtra(com.twofortyfouram.locale.Intent.EXTRA_BUNDLE);
      if (localeBundle != null) {
        String text = localeBundle.getString(Constants.EXTRA_TEXT);
        if (text != null) {
          mEtTextToType.setText(text);
        }
        boolean clearText = localeBundle.getBoolean(Constants.EXTRA_CLEAR_BEFORE, false);
        mCbClearText.setChecked(clearText);
        boolean performAction = localeBundle.getBoolean(Constants.EXTRA_END_WITH_ACTION, false);
        mCbPerformAction.setChecked(performAction);
      }
    }

    if (!TaskerPlugin.Setting.hostSupportsOnFireVariableReplacement(this)) {
      mEtTextToType.setHint(R.string.variable_replacement_not_ok);
    }

    if (!isKeyboardEnabled()) {
      showDialogKeyboardNotEnabled();
    }
  }
  public void loadSettings() {
    // if does not exist load default
    SharedPreferences settings = getActivity().getSharedPreferences(PREF_TITLE, 0);
    StringBuilder sb = new StringBuilder();
    et_serv.setText(settings.getString(PREF_URL, DEFAULT_URL));
    et_user.setText(settings.getString(PREF_USER, DEFAULT_USER));
    et_pass.setText(settings.getString(PREF_PASS, DEFAULT_PASS));
    et_thread.setText(sb.append(settings.getInt(PREF_THREAD, DEFAULT_THREAD)).toString());
    sb.setLength(0);
    sb_throttle.setProgress((int) (settings.getFloat(PREF_THROTTLE, DEFAULT_THROTTLE) * 100));
    et_scanTime.setText(sb.append(settings.getLong(PREF_SCANTIME, DEFAULT_SCANTIME)).toString());
    sb.setLength(0);
    et_retryPause.setText(
        sb.append(settings.getLong(PREF_RETRYPAUSE, DEFAULT_RETRYPAUSE)).toString());
    cb_service.setChecked(settings.getBoolean(PREF_BACKGROUND, DEFAULT_BACKGROUND));
    cb_donate.setChecked(settings.getBoolean(PREF_DONATE, DEFAULT_DONATE));

    if (settings.getInt(PREF_PRIORITY, DEFAULT_PRIORITY) == Thread.MIN_PRIORITY) {
      spn_priority.setSelection(0);
    }
    if (settings.getInt(PREF_PRIORITY, DEFAULT_PRIORITY) == Thread.NORM_PRIORITY) {
      spn_priority.setSelection(1);
    }
    if (settings.getInt(PREF_PRIORITY, DEFAULT_PRIORITY) == Thread.MAX_PRIORITY) {
      spn_priority.setSelection(2);
    }

    Toast.makeText(getActivity(), "Settings Loaded", Toast.LENGTH_SHORT).show();
  }
 @Override
 public boolean onContextItemSelected(android.view.MenuItem item) {
   switch (item.getItemId()) {
     case R.id.add_to_watch:
       /*
        * Implement code to toggle watch of this novel
        */
       CheckBox checkBox = (CheckBox) findViewById(R.id.novel_is_watched);
       if (checkBox.isChecked()) {
         checkBox.setChecked(false);
       } else {
         checkBox.setChecked(true);
       }
       return true;
     case R.id.download_novel:
       /*
        * Implement code to download novel synopsis
        */
       AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
       if (info.position > -1) {
         PageModel novel = listItems.get(info.position);
         ArrayList<PageModel> novels = new ArrayList<PageModel>();
         novels.add(novel);
         touchedForDownload = novel.getTitle() + "'s information";
         executeDownloadTask(novels);
       }
       return true;
     default:
       return super.onContextItemSelected(item);
   }
 }
  @Override
  public boolean onChildClick(
      ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {
    final IndexItem e =
        (IndexItem)
            ((DownloadIndexAdapter) getListAdapter()).getChild(groupPosition, childPosition);
    final CheckBox ch = (CheckBox) v.findViewById(R.id.check_download_item);

    if (ch.isChecked()) {
      ch.setChecked(!ch.isChecked());
      getEntriesToDownload().remove(e);
      updateDownloadButton(true);
      return true;
    }

    List<DownloadEntry> download =
        e.createDownloadEntry(getClientContext(), type, new ArrayList<DownloadEntry>());
    if (download.size() > 0) {
      // if(!fileToUnzip.exists()){
      // builder.setMessage(MessageFormat.format(getString(R.string.download_question), baseName,
      // extractDateAndSize(e.getValue())));
      getEntriesToDownload().put(e, download);
      updateDownloadButton(true);
      ch.setChecked(!ch.isChecked());
    }
    return true;
  }
  @Override
  public void onViewCreated(View view, Bundle savedInstanceState) {

    preferences = PreferenceManager.getDefaultSharedPreferences(getActivity());
    editor = preferences.edit();

    wishFriendCheck = (CheckBox) getActivity().findViewById(R.id.wish_friend_check);

    String status =
        preferences.getString(GlobalConstant.KEY_WISH_FRIENDS_SERVICE, GlobalConstant.KEY_OFF);

    if (status.equals(GlobalConstant.KEY_ON)) wishFriendCheck.setChecked(true);
    else wishFriendCheck.setChecked(false);

    wishFriendCheck.setOnClickListener(
        new View.OnClickListener() {

          @Override
          public void onClick(View v) {
            if (wishFriendCheck.isChecked()) {
              MessageUtilities.confirmUser(
                  getActivity(),
                  "Do you really want to start auto wish your friend from contact list ?",
                  yesStopClick,
                  noStopClick);
            } else {
              editor.putString(GlobalConstant.KEY_WISH_FRIENDS_SERVICE, GlobalConstant.KEY_OFF);
              editor.commit();
              Toast.makeText(getActivity(), "Friend wisher is disabled now", Toast.LENGTH_SHORT)
                  .show();
            }
            DualPaneSettingsRefresher.refreshListAdapter(getActivity());
          }
        });
  }
 public void resetPopupwindow() {
   mEtMinAge.setText("");
   mEtMaxAge.setText("");
   mCbNewly.setChecked(false);
   mCbNearest.setChecked(false);
   mCbMan.setChecked(false);
   mCbWomen.setChecked(false);
 }
예제 #19
0
  public void clickListItem() {
    if (mCheckbox.isChecked()) {
      mCheckbox.setChecked(false);

    } else {
      mCheckbox.setChecked(true);
    }
  }
예제 #20
0
  public void setValue(int flags) {
    during.setChecked((flags & Task.NOTIFY_AT_DEADLINE) > 0);
    after.setChecked((flags & Task.NOTIFY_AFTER_DEADLINE) > 0);

    if ((flags & Task.NOTIFY_MODE_NONSTOP) > 0) mode.setSelection(2);
    else if ((flags & Task.NOTIFY_MODE_FIVE) > 0) mode.setSelection(1);
    else mode.setSelection(0);
  }
예제 #21
0
  @Override
  public void onClick(View v) {
    if (mPlaybackService == null) return;
    if (v == mVideoSurface || v == playButton) {
      if (mPlaybackService != null) {
        MyMediaPlayer.PLAYBACK_STATE state = mPlaybackService.getPlaybackState();
        switch (state) {
          case PAUSED:
            mPlaybackService.resumePlayback();
            mediaControllerLayout.setVisibility(View.VISIBLE);
            playButton.setImageResource(R.drawable.ic_media_pause);
            //                    mPauseImage.setImageResource(R.drawable.ic_media_pause);
            break;
          case PLAYING:
            mPlaybackService.pausePlayback();
            mediaControllerLayout.setVisibility(View.VISIBLE);
            playButton.setImageResource(R.drawable.ic_media_play);
            //                    mPauseImage.setImageResource(R.drawable.ic_media_play);
            break;
          default:
            pickVideo();
            break;
        }
      }
    } else if (v == mNextButton_slider) {

      mPlaybackService.setNextPic();

      Leg.i(TAG, "mNextButton_slider ====================== ");

    } else if (v == mPreviousButton_slider) {
      Leg.i(TAG, "mPreviousButton_slider ====================== ");
      mPlaybackService.setPreviousPic();

    } else if (v == mPlay_pauseButton_slider) {
      mPlaybackService.setpausePlayback();

    } else if (v == slidingMenu_open || v == slidingMenu_open_image || v == slidingMenu_open_text) {
      pickVideo();
      showContent();

    } else if (v == slidingMenu_repeat
        || v == slidingMenu_repeat_image
        || v == slidingMenu_repeat_text) {
      switchLooping();
    } else if (v == slidingMenu_about
        || v == slidingMenu_about_image
        || v == slidingMenu_about_text) {
      openAboutDialog();

    } else if (v == sliding_floatwindow || v == sliding_floatwindow_text) {
      if (sliding_checkbox_floatwindow.isChecked()) {
        sliding_checkbox_floatwindow.setChecked(false);
      } else {
        sliding_checkbox_floatwindow.setChecked(true);
      }
    }
  }
예제 #22
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.word_showcase_layout);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setTitle("Back");
    databaseManager = new DatabaseManager(this);
    apiRequests = new ApiRequests();

    setButtons();

    switcher = (ViewSwitcher) findViewById(R.id.viewSwitcher);

    // get the intent
    Intent intent = getIntent();

    word = new Word();
    mainText = (TextView) findViewById(R.id.word_showcase_text);
    descriptionText = (TextView) findViewById(R.id.word_showcase_description_text);

    /*caller used for identifying what activity called this so
    the back button goes to the right place
     */
    caller = intent.getStringExtra("parent");

    // if the parent was the OCR activity, get the OCR result and display the text
    if (caller.equals("OCR")) {
      word.setText(getOCRText());
      Log.d(DolchListActivity.TAG, word.getText());
      mainText.setText(word.getText());
    }
    // if parent was vocab builder set text to the passed in word in the intent
    else if (caller.equals("vocab")) {
      word.setText(intent.getStringExtra("word"));
      mainText.setText(word.getText());
    } else {
      // else get word from intent extra
      word.setText(intent.getStringExtra("word"));
      mainText.setText(word.getText());
    }

    // getting word status to set favourite star to checked/unchecked
    try {
      if (databaseManager.wordSaved(word.getText())) {
        starCheckBox.setChecked(true);
      } else {
        starCheckBox.setChecked(false);
      }
    } catch (SQLException e) {
      e.printStackTrace();
    }

    // if no description leave blank
    descriptionText.setText("");

    new getWordThread().execute();
  }
예제 #23
0
 private void setTagInterested(int interested) {
   if (interested == 1) {
     mType = TAG_INTERESTED;
     mInterestedCb.setChecked(true);
   } else if (interested == 0) {
     mType = TAG_NOT_INTERESTED;
     mInterestedCb.setChecked(false);
   }
 }
  private void fillView(@Nonnull View root, @Nonnull final Context context) {
    root.setTag(tag);

    final CalculatorPlotter plotter = Locator.getInstance().getPlotter();

    final TextView expressionTextView =
        (TextView) root.findViewById(R.id.cpp_plot_function_expression_textview);
    expressionTextView.setText(plotFunction.getXyFunction().getExpressionString());

    final CheckBox pinnedCheckBox =
        (CheckBox) root.findViewById(R.id.cpp_plot_function_pinned_checkbox);
    pinnedCheckBox.setOnCheckedChangeListener(
        new CompoundButton.OnCheckedChangeListener() {
          @Override
          public void onCheckedChanged(CompoundButton buttonView, boolean pin) {
            if (pin) {
              if (!plotFunction.isPinned()) {
                plotFunction = plotter.pin(plotFunction);
              }
            } else {
              if (plotFunction.isPinned()) {
                plotFunction = plotter.unpin(plotFunction);
              }
            }
          }
        });
    pinnedCheckBox.setChecked(plotFunction.isPinned());

    final CheckBox visibleCheckBox =
        (CheckBox) root.findViewById(R.id.cpp_plot_function_visible_checkbox);
    visibleCheckBox.setOnCheckedChangeListener(
        new CompoundButton.OnCheckedChangeListener() {
          @Override
          public void onCheckedChanged(CompoundButton buttonView, boolean show) {
            if (show) {
              if (!plotFunction.isVisible()) {
                plotFunction = plotter.show(plotFunction);
              }
            } else {
              if (plotFunction.isVisible()) {
                plotFunction = plotter.hide(plotFunction);
              }
            }
          }
        });
    visibleCheckBox.setChecked(plotFunction.isVisible());

    final ImageButton settingsButton =
        (ImageButton) root.findViewById(R.id.cpp_plot_function_settings_button);
    settingsButton.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            CalculatorPlotFunctionSettingsActivity.startActivity(context, plotFunction);
          }
        });
  }
 private void clearBonusBoxes() {
   // intentionally not blocking the score from updating with modifyingCheckBoxes flag
   CheckBox bbox1 = (CheckBox) findViewById(R.id.bonuscheck1);
   CheckBox bbox2 = (CheckBox) findViewById(R.id.bonuscheck2);
   CheckBox bbox3 = (CheckBox) findViewById(R.id.bonuscheck3);
   bbox1.setChecked(false);
   bbox2.setChecked(false);
   bbox3.setChecked(false);
 }
 private void m133a(MotorConfiguration motorConfiguration, CheckBox checkBox) {
   if (motorConfiguration.getName().equals("NO DEVICE ATTACHED")
       || motorConfiguration.getType() == ConfigurationType.NOTHING) {
     checkBox.setChecked(true);
     checkBox.performClick();
     return;
   }
   checkBox.setChecked(true);
 }
예제 #27
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    this.setContentView(R.layout.poicategory);

    if (mPoiManager == null) mPoiManager = new PoiManager(this);

    mTitle = (EditText) findViewById(R.id.Title);
    mHidden = (CheckBox) findViewById(R.id.Hidden);
    mIcon = (ImageView) findViewById(R.id.ImageIcon);
    mMinZoom = (EditText) findViewById(R.id.MinZoom);

    Bundle extras = getIntent().getExtras();
    if (extras == null) extras = new Bundle();
    int id = extras.getInt("id", PoiPoint.EMPTY_ID());

    if (id < 0) {
      mPoiCategory = new PoiCategory();
      mTitle.setText(extras.getString("title"));
      mHidden.setChecked(false);
      mIcon.setImageResource(mPoiCategory.IconId);
      mMinZoom.setText("14");
    } else {
      mPoiCategory = mPoiManager.getPoiCategory(id);

      if (mPoiCategory == null) finish();

      mTitle.setText(mPoiCategory.Title);
      mHidden.setChecked(mPoiCategory.Hidden);
      mIcon.setImageResource(mPoiCategory.IconId);
      mMinZoom.setText(Integer.toString(mPoiCategory.MinZoom));
    }

    ((Button) findViewById(R.id.saveButton))
        .setOnClickListener(
            new OnClickListener() {
              public void onClick(View v) {
                doSaveAction();
              }
            });
    ((Button) findViewById(R.id.discardButton))
        .setOnClickListener(
            new OnClickListener() {
              public void onClick(View v) {
                PoiCategoryActivity.this.finish();
              }
            });
    mIcon.setOnClickListener(
        new OnClickListener() {

          public void onClick(View v) {
            doSelectIcon();
          }
        });
  }
 @TargetApi(Build.VERSION_CODES.GINGERBREAD)
 void initNfcBox() {
   if (mNfcAdapter.isEnabled()) {
     useNFCBox.setChecked(true);
     useNFC = true;
   } else {
     useNFCBox.setChecked(false);
     useNFC = false;
   }
 }
예제 #29
0
 // this function's purpose is making checkBox only display the status,
 // and can not be set.
 public void onClick(View arg0) {
   if (arg0 instanceof CheckBox) {
     CheckBox chk = (CheckBox) arg0;
     if (chk.isChecked()) {
       chk.setChecked(false);
     } else {
       chk.setChecked(true);
     }
   }
 }
예제 #30
0
    public void bindMilestone(Milestones milestone) {
      mMilestone = milestone;

      mMilestoneTitle.setText(mMilestone.getGoal());

      if (mMilestone.getIsCompleted().equals("false")) {
        mIsCompletedCheckBox.setChecked(false);
      } else {
        mIsCompletedCheckBox.setChecked(true);
      }
    }