Example #1
1
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
    String title = (String) item.getTitle();
    if (title.equals("添加")) {
      final HashMap<String, String> add_journal = new HashMap<String, String>();
      LayoutInflater inflater = LayoutInflater.from(this);
      LinearLayout linearLayout = (LinearLayout) inflater.inflate(R.layout.journal_clickitem, null);
      AlertDialog.Builder builder = new AlertDialog.Builder(Record_Journal.this);
      final EditText titleEditText =
          (EditText) linearLayout.findViewById(R.id.journal_title_editText);
      final EditText contentEditText =
          (EditText) linearLayout.findViewById(R.id.journal_content_editText);
      titleEditText.setEnabled(true);
      contentEditText.setEnabled(true);

      builder.setPositiveButton(
          "保 存",
          new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
              // To change body of implemented methods use File | Settings | File Templates.
              add_journal.put("title", String.valueOf(titleEditText.getText()));
              add_journal.put("body", String.valueOf(contentEditText.getText()));
              String date = String.valueOf(new SimpleDateFormat("yyyy-MM-dd").format(new Date()));
              add_journal.put("time", date);
              add_journal.put("userID", Login.userID);
              if (myJournalNetwork.add(add_journal)) {
                Toast.makeText(Record_Journal.this, "添加成功", Toast.LENGTH_SHORT);
              } else {
                Toast.makeText(Record_Journal.this, "添加失败", Toast.LENGTH_SHORT);
              }
              record_journal_adapter.notifyDataSetChanged();
            }
          });
      builder.setNegativeButton(
          "取 消",
          new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
              // To change body of implemented methods use File | Settings | File Templates.
            }
          });

      builder.setTitle("添加日志").setView(linearLayout);
      builder.show();

    } else if (title.equals("帮助")) {
      Menu_Functions.helpMe(this);
    } else if (title.equals("联系")) {
      Menu_Functions.contactMe(this);
    }
    return super.onOptionsItemSelected(
        item); // To change body of overridden methods use File | Settings | File Templates.
  }
Example #2
0
 void updateButtonStates() {
   boolean active = mDPM.isAdminActive(mDeviceAdminSample);
   if (active) {
     mEnableButton.setEnabled(false);
     mDisableButton.setEnabled(true);
     mPasswordQuality.setEnabled(true);
     mPasswordLength.setEnabled(true);
     mSetPasswordButton.setEnabled(true);
     mPassword.setEnabled(true);
     mResetPasswordButton.setEnabled(true);
     mForceLockButton.setEnabled(true);
     mWipeDataButton.setEnabled(true);
     mWipeAllDataButton.setEnabled(true);
   } else {
     mEnableButton.setEnabled(true);
     mDisableButton.setEnabled(false);
     mPasswordQuality.setEnabled(false);
     mPasswordLength.setEnabled(false);
     mSetPasswordButton.setEnabled(false);
     mPassword.setEnabled(false);
     mResetPasswordButton.setEnabled(false);
     mForceLockButton.setEnabled(false);
     mWipeDataButton.setEnabled(false);
     mWipeAllDataButton.setEnabled(false);
   }
 }
 // Disable editing of text fields
 public void disableTextFields() {
   nameField.setEnabled(false);
   emailField.setEnabled(false);
   phoneField.setEnabled(false);
   addressField.setEnabled(false);
   notesField.setEnabled(false);
 }
  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;
    }
  }
 /** Sets all the buttons related to actions that act on an existing key to enabled or disabled. */
 private void setKeyActionButtonsEnabled(boolean enabled) {
   mPlainText.setEnabled(enabled);
   mCipherText.setEnabled(enabled);
   mSignButton.setEnabled(enabled);
   mVerifyButton.setEnabled(enabled);
   mDeleteButton.setEnabled(enabled);
 }
  private void updateViewsBasedOnPromoCodeChange() {
    Button applyButton = (Button) findViewById(R.id.button_apply_promo);
    EditText promoText = (EditText) findViewById(R.id.edit_text_promo_code);
    if (printOrder.getPromoCode() != null) {
      promoText.setText(printOrder.getPromoCode());
      promoText.setEnabled(false);
      applyButton.setText("Clear");
    } else {
      promoText.setText("");
      promoText.setEnabled(true);
      applyButton.setText("Apply");
    }

    Button payWithCreditCardButton = (Button) findViewById(R.id.button_pay_with_credit_card);
    if (printOrder.getCost(printOrder.getCurrencyCode()).compareTo(BigDecimal.ZERO) <= 0) {
      findViewById(R.id.button_pay_with_paypal).setVisibility(View.GONE);
      payWithCreditCardButton.setText("Checkout for Free!");
      payWithCreditCardButton.setOnClickListener(
          new View.OnClickListener() {
            @Override
            public void onClick(View view) {
              submitOrderForPrinting(null);
            }
          });

    } else {
      findViewById(R.id.button_pay_with_paypal).setVisibility(View.VISIBLE);
      payWithCreditCardButton.setText("Pay with Credit Card");
    }
  }
Example #7
0
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow()
        .setFlags(
            WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);

    if ((getIntent().getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT) != 0) {
      // Here activity is brought to front, not created,
      // so finishing this will get you to the last viewed activity
      finish();
      return;
    }
    setContentView(R.layout.activity_despliega_datos);

    dio = (EditText) findViewById(R.id.dio);
    dio.setEnabled(false);
    fundo = (EditText) findViewById(R.id.fundo);
    fundo.setEnabled(false);
    fundo.setText("EH1");

    if (EIDService.isRunning()) {
      configService();
      // connectToSQL();
    }
  }
 private void refreshView() {
   if (uploadState) {
     uploadSwitchBg.setBackgroundResource(R.drawable.switch_on_bg);
     uploadOn.setVisibility(View.VISIBLE);
     uploadOn.setBackgroundResource(R.drawable.switch_fore_on);
     uploadOff.setVisibility(View.INVISIBLE);
     uploadOff.setBackgroundResource(0);
     uploadText.setEnabled(true);
   } else {
     uploadSwitchBg.setBackgroundResource(R.drawable.switch_off_bg);
     uploadOff.setVisibility(View.VISIBLE);
     uploadOff.setBackgroundResource(R.drawable.switch_fore_on);
     uploadOn.setVisibility(View.INVISIBLE);
     uploadOn.setBackgroundResource(0);
     uploadText.setEnabled(false);
   }
   if (downloadState) {
     downloadSwitchBg.setBackgroundResource(R.drawable.switch_on_bg);
     downloadOn.setVisibility(View.VISIBLE);
     downloadOn.setBackgroundResource(R.drawable.switch_fore_on);
     downloadOff.setVisibility(View.INVISIBLE);
     downloadOff.setBackgroundResource(0);
     downloadText.setEnabled(true);
   } else {
     downloadSwitchBg.setBackgroundResource(R.drawable.switch_off_bg);
     downloadOff.setVisibility(View.VISIBLE);
     downloadOff.setBackgroundResource(R.drawable.switch_fore_on);
     downloadOn.setVisibility(View.INVISIBLE);
     downloadOn.setBackgroundResource(0);
     downloadText.setEnabled(false);
   }
 }
  private void refreshPage(State state) {
    progressBar.setVisibility(View.GONE);
    errorMessage.setVisibility(View.GONE);
    listView.setVisibility(View.GONE);
    switch (state) {
      case LOADING:
        progressBar.setVisibility(View.VISIBLE);
        break;
      case LOADED:
        if (friendListAdapter.isEmpty()) {
          errorMessage.setVisibility(View.VISIBLE);

          errorMessage.setText(R.string.error_no_friends_connected);
          searchText.setEnabled(false);
        } else {
          listView.setVisibility(View.VISIBLE);

          searchText.setEnabled(true);
        }
        break;
      case ERROR:
        errorMessage.setVisibility(View.VISIBLE);
        break;
    }
    refreshMenu();
  }
Example #10
0
        public void run() {

          if (!isAuthenticated) {
            txtUsername.setEnabled(true);
            txtPassword.setEnabled(true);
            //                cbRem.setEnabled (true);
            btnSign.setEnabled(true);
            progressDialog.dismiss();
            new AlertDialog.Builder(LoginActivity.this)
                .setMessage("Login failed. Please try again.")
                .setNeutralButton(
                    "OK",
                    new DialogInterface.OnClickListener() {
                      public void onClick(DialogInterface dialog, int which) {
                        dialog.dismiss();
                      }
                    })
                .show();
          } else {
            InputMethodManager imm =
                (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
            imm.hideSoftInputFromWindow(txtPassword.getWindowToken(), 0);
            Intent loginIntent = new Intent(LoginActivity.this, HomeActivity.class);
            //                Intent loginIntent = new Intent (LoginActivity.this,
            //                        MessagesListActivity.class);
            LoginActivity.this.startActivity(loginIntent);
          }
        }
Example #11
0
 private void enableInput(boolean flag) {
   btnSave.setEnabled(flag);
   et_username.setEnabled(flag);
   et_email.setEnabled(flag);
   et_address.setEnabled(flag);
   et_password.setEnabled(flag);
 }
Example #12
0
  private void fillCtrls() {

    login.setText(prefs.getLogin());
    password.setText(prefs.getPassword());
    anonim.setChecked(prefs.isAnonim());
    View accListYesterdayLine = findViewById(R.id.accListYesterdayLine);
    TextView roleView = (TextView) findViewById(R.id.role);

    // Авторизованы?
    if (AccidentsGeneral.auth.isAuthorized()) {
      loginBtn.setEnabled(false);
      logoutBtn.setEnabled(true);
      anonim.setEnabled(false);
      accListYesterdayLine.setVisibility(View.GONE);
      String format = getString(R.string.mc_auth_role);
      roleView.setText(String.format(format, Role.getName(this)));
      roleView.setVisibility(View.VISIBLE);
      login.setEnabled(false);
      password.setEnabled(false);
    } else {
      //        if (prefs.isAnonim()) {
      loginBtn.setEnabled(true);
      logoutBtn.setEnabled(false);
      anonim.setEnabled(true);
      login.setEnabled(!anonim.isChecked());
      password.setEnabled(!anonim.isChecked());
      accListYesterdayLine.setVisibility(View.VISIBLE);
      roleView.setVisibility(View.GONE);
      enableLoginBtn();
    }
  }
 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();
 }
Example #14
0
  private void initViews() {
    boolean isEditable = transfer.getStatus() != PaymentStatus.COMPLETE;

    recipient.setText(transfer.getRecipient());
    recipient.setEnabled(isEditable);

    amountPay.setValue(transfer.getAmountPayment());
    amountPay.setEnabled(isEditable);

    amountDue.setValue(transfer.getAmountDue());
    amountDue.setEnabled(isEditable);

    comment.setText(transfer.getComment());
    comment.setEnabled(isEditable);

    useCodeProtection.setChecked(transfer.isCodeProtection());
    useCodeProtection.setEnabled(isEditable);

    protectionCode.setText(transfer.getProtectionCode());
    receivePeriod.setText(String.valueOf(transfer.getReceivePeriod()));

    receivePeriod.setEnabled(isEditable);

    paymentButton.setEnabled(isEditable);
  }
Example #15
0
 /** Enables and disables the EditText boxes for width and height of remote desktop. */
 private void setRemoteWidthAndHeight() {
   if (selected.getRdpResType() != Constants.RDP_GEOM_SELECT_CUSTOM) {
     rdpWidth.setEnabled(false);
     rdpHeight.setEnabled(false);
   } else {
     rdpWidth.setEnabled(true);
     rdpHeight.setEnabled(true);
   }
 }
  @Override
  public void onClick(View v) {

    if (v == yes) {
      if (validate()) {
        if (repeatRepRadio.isChecked()) {
          rule.setCount(Integer.parseInt(repeatRepEdit.getText().toString()));
          rule.setUntil(null);
        } else {
          rule.setCount(null);
          rule.setUntil(DateUtil.convertDateToRRULE(repeatUntilDate.getText().toString()));
        }

        dismiss();
      }

    } else if (v == no) {
      cancelClicked = true;
      cancel();
    } else if (v == repeatRepEdit || v == repeatRepRadio || v == repeatRepRow) {

      repeatUntilRadio.setChecked(false);
      repeatRepRadio.setChecked(true);
      repeatRepEdit.setEnabled(true);
      repeatRepEdit.setFocusable(true);
      previousSelectedRadio = repeatRepRadio;

    } else if (v == repeatUntilDate || v == repeatUntilRadio || v == repeatUntilRow) {
      repeatRepRadio.setChecked(false);
      repeatUntilRadio.setChecked(true);
      repeatRepEdit.setEnabled(false);
      DatePickerDialog dialog = null;
      if (!StringUtils.isEmpty(repeatUntilDate.getText().toString())) {
        GregorianCalendar cal =
            DateUtil.getCalendarFromString(repeatUntilDate.getText().toString());
        dialog =
            new DatePickerDialog(
                activity,
                datePickerListener,
                cal.get(Calendar.YEAR),
                cal.get(Calendar.MONTH),
                cal.get(Calendar.DAY_OF_MONTH));
      } else {
        dialog =
            new DatePickerDialog(
                activity,
                datePickerListener,
                eventDate.get(Calendar.YEAR),
                eventDate.get(Calendar.MONTH),
                eventDate.get(Calendar.DAY_OF_MONTH));
      }

      dialog.setOnDismissListener(datePickerDismissListener);

      dialog.show();
    }
  }
  public void init() {

    for (ToggleButton btn : mPathLossButtons) {
      btn.setEnabled(false);
    }

    mMinValue.setEnabled(false);
    mMaxValue.setEnabled(false);
  }
 private void m92b(View view, DeviceConfiguration deviceConfiguration) {
   EditText editText = (EditText) view.findViewById(R.id.editTextResult_analogOutput);
   if (deviceConfiguration.isEnabled()) {
     editText.setText(deviceConfiguration.getName());
     editText.setEnabled(true);
     return;
   }
   editText.setText("NO DEVICE ATTACHED");
   editText.setEnabled(false);
 }
 private void b(View var1, DeviceConfiguration var2) {
   EditText var3 = (EditText) var1.findViewById(R.id.editTextResult_digital_device);
   if (var2.isEnabled()) {
     var3.setText(var2.getName());
     var3.setEnabled(true);
   } else {
     var3.setText("NO DEVICE ATTACHED");
     var3.setEnabled(false);
   }
 }
 /** Convenience function to change UI state based on being logged in */
 public void setLoggedIn(boolean loggedIn) {
   mLoggedIn = loggedIn;
   mLoginEmail.setEnabled(!loggedIn);
   mLoginPassword.setEnabled(!loggedIn);
   if (loggedIn) {
     mSubmit.setText("Log Out of Dropbox");
   } else {
     mSubmit.setText("Log In to Dropbox");
   }
 }
 /* Helper UI functions */
 private void enableCredEntry(boolean toEnable) {
   usernameInput.setEnabled(toEnable);
   passwordInput.setEnabled(toEnable);
   synckeyInput.setEnabled(toEnable);
   if (!toEnable) {
     serverInput.setEnabled(toEnable);
   } else {
     serverInput.setEnabled(serverCheckbox.isChecked());
   }
 }
 /** 全额保底方法 */
 public void setAllSafeEdit(boolean isSafe) {
   if (isSafe) {
     int buyInt = Integer.parseInt(isNull(buyEdit.getText().toString()));
     safeEdit.setText("" + (allAtm - buyInt));
     safeEdit.setEnabled(false);
   } else {
     safeEdit.setText("0");
     safeEdit.setEnabled(true);
   }
 }
 @Override
 public void onCheckedChanged(CompoundButton arg0, boolean arg1) {
   // TODO Auto-generated method stub
   if (arg0.getId() == R.id.checkBox1) {
     if (arg1) {
       especifique.setEnabled(true);
     } else {
       especifique.setEnabled(false);
     }
   }
 }
  public Dialog onCreateDialog(Bundle savedInstanceState) {
    AlertDialog.Builder exerciseInfo = new AlertDialog.Builder(getActivity());
    final View view = getActivity().getLayoutInflater().inflate(R.layout.exercise_info_frag, null);
    exerciseInfo.setView(view);

    name = (EditText) view.findViewById(R.id.exerciseInfoNameField);
    sets = (EditText) view.findViewById(R.id.exerciseInfoSetsField);
    reps = (EditText) view.findViewById(R.id.exerciseInfoRepsField);
    info = (EditText) view.findViewById(R.id.exerciseInfoInfoField);

    // set values of EditTexts
    Bundle bundle = getArguments();
    String timed = bundle.getString("timed");
    name.setText(bundle.getString("name"));
    sets.setText(bundle.getString("sets"));
    if (timed.equals("n")) reps.setText(bundle.getString("reps")); // only if exercise is not timed
    info.setText(bundle.getString("info"));

    // don't want EditTexts to be editable
    name.setEnabled(false);
    sets.setEnabled(false);
    reps.setEnabled(false);
    info.setEnabled(false);

    // google search for "[exercise name] exercise example video"
    findVideo = (Button) view.findViewById(R.id.find_video);
    findVideo.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View view) {
            String urlName = name.getText().toString().replaceAll(" ", "%20");
            Uri uri =
                Uri.parse("http://google.com/#q=" + urlName + "%20exercise%20example%20video");
            Intent intent = new Intent(Intent.ACTION_VIEW, uri);
            startActivity(intent);
          }
        });

    // don't show reps count if it's a timed exercise
    if (timed.equals("y")) {
      TextView repsTitle = (TextView) view.findViewById(R.id.exerciseInfoReps);
      ((LinearLayout) name.getParent()).removeView(repsTitle);
      ((LinearLayout) name.getParent()).removeView(reps);
    }
    // don't show info if it's blank
    if (bundle.getString("info") == null || bundle.getString("info").equals("")) {
      TextView infoTitle = (TextView) view.findViewById(R.id.exerciseInfoInfo);
      ((LinearLayout) name.getParent()).removeView(infoTitle);
      ((LinearLayout) name.getParent()).removeView(info);
    }

    return exerciseInfo.create();
  }
 /**
  * Toggles label buttons from visble to invisible when the button is pressed.
  *
  * @param rootView
  */
 private void toggleLableView(View rootView) {
   if (LABEL_VIEW_TRUE) {
     for (int i = 0; i < label.size(); i++) {
       weightView[i].setEnabled(false);
       weightView[i].setVisibility(drawView.GONE);
       labelButton[i].setEnabled(false);
       labelButton[i].setVisibility(drawView.GONE);
       removeButton[i].setEnabled(false);
       removeButton[i].setVisibility(drawView.GONE);
     }
     qSolution.setEnabled(false);
     grade_increase.setVisibility(View.INVISIBLE);
     grade_decrease.setVisibility(View.INVISIBLE);
     qSolution.setVisibility(drawView.GONE);
     commentsEnter.setEnabled(false);
     commentsEnter.setVisibility(drawView.GONE);
     rootView.findViewById(R.id.process_refresh_labels).setEnabled(false);
     rootView.findViewById(R.id.process_refresh_labels).setVisibility(drawView.GONE);
     Log.d(TAG, "toggleLableView: disabling label view");
     LABEL_VIEW_TRUE = false;
     Log.d(TAG, "dispatchDisplayNextImage: chanigng label view to " + false);
   } else {
     for (int i = 0; i < label.size(); i++) {
       if (Weights.get(i) == 0) {
         weightView[i].setEnabled(false);
         weightView[i].setVisibility(View.VISIBLE);
         labelButton[i].setEnabled(false);
         labelButton[i].setVisibility(View.VISIBLE);
         removeButton[i].setEnabled(false);
         removeButton[i].setVisibility(View.VISIBLE);
         continue;
       }
       grade_increase.setVisibility(View.VISIBLE);
       grade_decrease.setVisibility(View.VISIBLE);
       weightView[i].setEnabled(true);
       weightView[i].setVisibility(View.VISIBLE);
       labelButton[i].setEnabled(true);
       labelButton[i].setVisibility(View.VISIBLE);
       removeButton[i].setEnabled(true);
       removeButton[i].setVisibility(View.VISIBLE);
       Log.d(TAG, "toggleLableView: showing label view");
     }
     qSolution.setEnabled(true);
     qSolution.setVisibility(View.VISIBLE);
     commentsEnter.setEnabled(true);
     commentsEnter.setVisibility(View.VISIBLE);
     rootView.findViewById(R.id.process_refresh_labels).setEnabled(true);
     rootView.findViewById(R.id.process_refresh_labels).setVisibility(View.VISIBLE);
     LABEL_VIEW_TRUE = true;
     Log.d(TAG, "dispatchDisplayNextImage: chanigng label view to " + true);
   }
 }
Example #26
0
  public void disChangeAble() {
    ed_boSung.setEnabled(false);
    ed_giaPhong.setEnabled(false);
    ed_traLoi.setEnabled(false);

    spn_tinhTrang.setEnabled(false);
    spn_cauHoi.setEnabled(false);

    rb_danhGia.setEnabled(false);

    btn_roiPhong.setEnabled(true);
    btn_xoaPhong.setEnabled(true);
  }
 public void edit() {
   notetitleedit.setVisibility(View.VISIBLE);
   notecontenteditText.setVisibility(View.VISIBLE);
   notetitleshowText.setVisibility(View.GONE);
   notecontentshowText.setVisibility(View.GONE);
   notestarttimeselect.setVisibility(View.VISIBLE);
   noteendtimeselect.setVisibility(View.VISIBLE);
   notestarttimeedit.setEnabled(true);
   noteendtimeedit.setEnabled(true);
   notevoiceenable.setClickable(true);
   noteshockenable.setClickable(true);
   notenotificationenable.setEnabled(true);
 }
Example #28
0
 @Override
 public View onCreateView(
     LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
   View view = inflater.inflate(R.layout.host_settings_network, container, false);
   _ipv4IpText = (EditText) view.findViewById(R.id.hostnet_ipv4_ip);
   _ipv4MaskText = (EditText) view.findViewById(R.id.hostnet_ipv4_mask);
   _ipv6IpText = (EditText) view.findViewById(R.id.hostnet_ipv6_ip);
   _ipv6MaskText = (EditText) view.findViewById(R.id.hostnet_ipv6_mask);
   _enabledCheckBox = (CheckBox) view.findViewById(R.id.dhcp_enabled);
   _enabledCheckBox.setOnCheckedChangeListener(
       new OnCheckedChangeListener() {
         @Override
         public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
           _addressText.setEnabled(isChecked);
           _maskText.setEnabled(isChecked);
           _lowerBoundText.setEnabled(isChecked);
           _upperBoundText.setEnabled(isChecked);
         }
       });
   _addressText = (EditText) view.findViewById(R.id.dhcp_address);
   _addressText.setEnabled(false);
   _maskText = (EditText) view.findViewById(R.id.dhcp_mask);
   _maskText.setEnabled(false);
   _lowerBoundText = (EditText) view.findViewById(R.id.dhcp_lowerbound);
   _lowerBoundText.setEnabled(false);
   _upperBoundText = (EditText) view.findViewById(R.id.dhcp_upperbound);
   _upperBoundText.setEnabled(false);
   _okButton = (Button) view.findViewById(R.id.ok_button);
   _okButton.setOnClickListener(
       new OnClickListener() {
         @Override
         public void onClick(View v) {
           new SaveTask().execute();
           getDialog().dismiss();
         }
       });
   _cancelButton = (Button) view.findViewById(R.id.cancel_button);
   _cancelButton.setOnClickListener(
       new OnClickListener() {
         @Override
         public void onClick(View v) {
           getDialog().dismiss();
         }
       });
   mTabHost = (TabHost) view.findViewById(android.R.id.tabhost);
   mTabHost.setup();
   mTabHost.addTab(
       mTabHost.newTabSpec("static").setIndicator("Static").setContent(R.id.staticTab));
   mTabHost.addTab(mTabHost.newTabSpec("dhcp").setIndicator("DHCP").setContent(R.id.dhcpTab));
   return view;
 }
Example #29
0
 @Override
 protected void onResume() {
   super.onResume();
   if (!LocationService.isRunning()) {
     mServiceToggle.setChecked(false);
     mUserNameEntry.setEnabled(true);
     mUserNameEntry.setText(Helpers.getUserId());
   } else {
     mUserNameEntry.setEnabled(false);
     mUserNameEntry.setText(Helpers.getUserId());
     mServiceToggle.setChecked(true);
     mServiceToggle.setEnabled(true);
   }
 }
Example #30
0
 private void adjustView() {
   if (isOwner == false) {
     btnDel.setVisibility(View.INVISIBLE);
     statusChk.setClickable(false);
     tvName.setEnabled(false);
     tvAuthor.setEnabled(false);
     tvPublisher.setEnabled(false);
     tvSummary.setEnabled(false);
     btnSave.setVisibility(View.INVISIBLE);
   } else {
     btnDel.setOnClickListener(this);
     btnSave.setOnClickListener(this);
   }
 }