public void onRadioButtonClicked(View view) {
   boolean checked = ((RadioButton) view).isChecked();
   EditText editItem = (EditText) findViewById(R.id.etEditItem);
   // Check which radio button was clicked
   switch (view.getId()) {
     case R.id.rbPriority3:
       if (checked) {
         itemPriority = CommonConstants.STANDARD_PRIORITY;
         editItem.setTextColor(editItem.getResources().getColor(R.color.standard_priority));
       }
       break;
     case R.id.rbPriority2:
       if (checked) {
         itemPriority = CommonConstants.ELEVATED_PRIORITY;
         editItem.setTextColor(editItem.getResources().getColor(R.color.elevated_priority));
       }
       break;
     case R.id.rbPriority1:
       if (checked) {
         itemPriority = CommonConstants.HIGH_PRIORITY;
         editItem.setTextColor(editItem.getResources().getColor(R.color.high_priority));
       }
       break;
   }
 }
Example #2
0
 private void db()
 {
     dc();
     if (TextUtils.isEmpty(bri.getText()))
     {
         brw = false;
         _mth02CB(brl, bri);
     } else
     if (bri.getText().toString().length() > 50)
     {
         brl.setText(0x7f0600c4);
         brw = false;
         _mth02CA(brl, bri);
     } else
     {
         brw = true;
         _mth02CB(brl, bri);
     }
     if (brw)
     {
         bri.setTextColor(brp);
         bro.setColorFilter(brq);
     } else
     if (TextUtils.isEmpty(bri.getText()))
     {
         bri.setTextColor(brp);
         bro.setColorFilter(brr);
     } else
     {
         bri.setTextColor(brs);
         bro.setColorFilter(brs);
     }
     de();
 }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_edit_item);
    prefs = PreferenceManager.getDefaultSharedPreferences(this);
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
      getSupportActionBar().setDisplayShowHomeEnabled(true);
      actionBar.setLogo(R.mipmap.cp_logo);
      getSupportActionBar().setDisplayUseLogoEnabled(true);
    }
    EditText editItem = (EditText) findViewById(R.id.etEditItem);
    editItem.setText(getIntent().getStringExtra("itemText"));
    editItem.setSelection(editItem.getText().length());

    SimpleDateFormat date = new SimpleDateFormat("MM/d/yyyy");
    dueDate = getIntent().getLongExtra("dueDate", System.currentTimeMillis());
    Button dueDateText = (Button) findViewById(R.id.btCalendar);
    dueDateText.setText(date.format(new Date(dueDate)));

    RadioButton radioButton3 = (RadioButton) findViewById(R.id.rbPriority3);
    radioButton3.setText(prefs.getString("priority_default", "Just do it"));

    RadioButton radioButton2 = (RadioButton) findViewById(R.id.rbPriority2);
    radioButton2.setText(prefs.getString("priority_high", "Get it done!"));

    RadioButton radioButton1 = (RadioButton) findViewById(R.id.rbPriority1);
    radioButton1.setText(prefs.getString("priority_highest", "Life Matter"));

    itemPriority = Integer.parseInt(getIntent().getStringExtra("priority"));
    switch (itemPriority) {
      case CommonConstants.STANDARD_PRIORITY:
        {
          radioButton3.performClick();
          editItem.setTextColor(editItem.getResources().getColor(R.color.standard_priority));
          break;
        }
      case CommonConstants.ELEVATED_PRIORITY:
        {
          radioButton2.performClick();
          editItem.setTextColor(editItem.getResources().getColor(R.color.elevated_priority));
          break;
        }
      case CommonConstants.HIGH_PRIORITY:
        {
          radioButton1.performClick();
          editItem.setTextColor(editItem.getResources().getColor(R.color.high_priority));
          break;
        }
    }
  }
Example #4
0
        public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
          myYear = year;
          myMonth = monthOfYear;
          myDay = dayOfMonth;
          if (editTextDateStart.getText().length() == 0) {
            editTextDateStart.setText(myDay + "/" + myMonth + "/" + myYear);
            editTextDateStart.setTextColor(Color.BLACK);
          }

          if (editTextDateEnd.getText().length() == 0) {
            editTextDateEnd.setText(myDay + "/" + myMonth + "/" + myYear);
            editTextDateEnd.setTextColor(Color.BLACK);
          }
        }
Example #5
0
 @Override
 protected void updateValidity() {
   String x = xVarText.getText().toString();
   String y = yVarText.getText().toString();
   x2.setText(x + "2=");
   y1.setText("1" + "(" + x + ")=");
   y2.setText(y + "2" + "(" + x + ")=");
   String f = FunText.getText().toString();
   if (AndyMath.isValid(
       f, new String[] {xVarText.getText().toString(), yVarText.getText().toString()})) {
     FunText.setTextColor(Color.rgb(0, 127, 0));
   } else {
     FunText.setTextColor(Color.rgb(127, 0, 0));
   }
 }
  /** 사용자 정보를 layout에 그려준다. */
  @Override
  protected void onAttachedToWindow() {
    super.onAttachedToWindow();
    View view = inflate(getContext(), R.layout.kakao_profile_layout, this);

    profile = (NetworkImageView) view.findViewById(R.id.com_kakao_profile_image);
    if (profileImageURL != null) setProfileURL(profileImageURL);
    if (!editable) {
      ImageView editableMark = (ImageView) view.findViewById(R.id.profile_edit);
      editableMark.setVisibility(View.INVISIBLE);
    }

    nicknameText = (EditText) view.findViewById(R.id.com_kakao_profile_nickname);
    if (!editable) {
      nicknameText.setEnabled(false);
      nicknameText.setKeyListener(null);
      if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
        nicknameText.setBackground(null);
      } else {
        nicknameText.setBackgroundDrawable(null);
      }
      nicknameText.setPadding(0, 0, 0, 0);
      nicknameText.setTextColor(getResources().getColor(R.color.com_kakao_profile_text));
    }
    if (nickname != null) nicknameText.setText(nickname);

    userIdText = (TextView) view.findViewById(R.id.com_kakao_profile_userId);
    if (userId != null) userIdText.setText(userId);
  }
Example #7
0
 private void updateCurrentColor(int color) {
   String hexColorString =
       ConvertUtils.toColorString(color, false).toUpperCase(Locale.getDefault());
   hexValView.setText(hexColorString);
   hexValView.setTextColor(hexValDefaultColor);
   hexValView.setBackgroundColor(color);
 }
 @Override
 public void beforeTextChanged(CharSequence s, int start, int count, int after) {
   // TODO Auto-generated method stub
   if (s.length() > 0) {
     edtTxtRecoverEmail.setTextColor(Color.BLACK);
   }
 }
  public void onTextChanged(CharSequence ss, int start, int before, int count) {
    editText.setTextColor(Color.BLACK);

    Editable editable = editText.getText();
    int len = editable.length();
    boolean bOK = false;

    if (checkLength(len)) {
      if (checkData(editable.toString())) bOK = true;
    }
    if (!bOK) {
      int selEndIndex = Selection.getSelectionEnd(editable);
      String str = editable.toString();
      String newStr = str.substring(0, len - 1);
      editText.setText(newStr);
      editable = editText.getText();
      // 新字符串长度
      int newLen = editable.length();
      // 旧光标位置超过字符串长度
      if (selEndIndex > newLen) {
        selEndIndex = newLen;
      }
      // 设置新的光标所在位置
      Selection.setSelection(editable, selEndIndex);

    } else {
      saveData(editable.toString());
    }
  }
Example #10
0
	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);
		
		// Get our GUI elements.
		searchButton = (Button)getSherlockActivity().findViewById(R.id.button_search);
		searchEdit = (EditText)getSherlockActivity().findViewById(R.id.edit_search);
		
		searchEdit.setTextColor(0xfff0641e);

		searchProgress = (ProgressBar)getSherlockActivity().findViewById(R.id.progress_search);
		
		// Create a listener for keyboard "enter" button.
		OnEditorActionListener listener = new OnEditorActionListener() {
		    public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
		        if (actionId == EditorInfo.IME_ACTION_SEARCH) {
		        	// Simulate click on the search button.
		            searchButton.performClick();
		            return true;
		        }
		        return false;
		    }
		};
		// Add our newly created listener to the text field.
		searchEdit.setOnEditorActionListener(listener);
	}
Example #11
0
  private View createNameDialog(String titleText, String value, int identifier) {
    Point windowSize = getWindowSize(mContext.getWindowManager().getDefaultDisplay());
    int five_dip = ConvertToPx(mContext, 5);
    int dialogWidth = windowSize.x - 10 * five_dip;

    LinearLayout mainContainer = new LinearLayout(mContext);
    mainContainer.setOrientation(LinearLayout.VERTICAL);
    mainContainer.addView(getTitleTextView(titleText));
    mainContainer.setBackgroundColor(Color.argb(180, 255, 255, 255));

    LinearLayout.LayoutParams layoutParams =
        new LinearLayout.LayoutParams(dialogWidth, ViewGroup.LayoutParams.WRAP_CONTENT);
    RelativeLayout.LayoutParams verticalDivider_params =
        new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 1);
    layoutParams.gravity = Gravity.CENTER;
    mainContainer.setLayoutParams(layoutParams);

    EditText tv = new EditText(mContext);
    tv.setInputType(InputType.TYPE_TEXT_VARIATION_PERSON_NAME);
    tv.setText(value);
    tv.setEnabled(false);
    tv.setTextColor(Color.BLACK);
    tv.setGravity(Gravity.CENTER);
    layoutParams.setMargins(five_dip, five_dip * 3, five_dip, five_dip);
    tv.setLayoutParams(layoutParams);
    mainContainer.addView(tv);
    mainContainer.addView(getDivider(verticalDivider_params));
    addAlphabets(mainContainer);

    addButtons(mainContainer, identifier);
    edit_PlayerName = tv;
    return mainContainer;
  }
  @Override
  public void onActivityCreated(Bundle aSavedState) {
    super.onActivityCreated(aSavedState);

    setRetainInstance(true);

    mMessage.setBackgroundColor(mPrefs.postBackgroundColor);
    mMessage.setTextColor(mPrefs.postFontColor);

    mExtras = getExtras();
    mReplyType = mExtras.getInt(Constants.EDITING, getArguments().getInt(Constants.EDITING, -1));
    mPostId = mExtras.getInt(Constants.POST_ID, getArguments().getInt(Constants.POST_ID, -1));
    mThreadId = mExtras.getInt(Constants.THREAD_ID, getArguments().getInt(Constants.THREAD_ID, -1));
    if (mReplyType < 0
        || mThreadId < 0
        || (mReplyType != AwfulMessage.TYPE_NEW_REPLY && mPostId < 0)) {
      Log.e(TAG, "MISSING ARGUMENTS!");
      getActivity().finish();
    }

    ((AwfulActivity) getActivity()).registerSyncService(mMessenger, mThreadId);
    getActivity()
        .getSupportLoaderManager()
        .restartLoader(Constants.REPLY_LOADER_ID, null, mReplyDataCallback);
    getActivity()
        .getContentResolver()
        .registerContentObserver(AwfulMessage.CONTENT_URI_REPLY, true, mReplyDataCallback);

    if (((AwfulActivity) getActivity()).isTV()) {
      mTitle.setText(getString(R.string.post_reply));
      mSubmit.setOnClickListener(onSubmitClick);
    }
  }
Example #13
0
 @Override
 @NonNull
 protected LinearLayout makeCenterView() {
   LinearLayout rootLayout = new LinearLayout(activity);
   rootLayout.setLayoutParams(new LinearLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT));
   rootLayout.setOrientation(LinearLayout.VERTICAL);
   blackColorView = new ColorPanelView(activity);
   //noinspection ResourceType
   blackColorView.setId(BLACK_ID);
   blackColorView.setLayoutParams(
       new LinearLayout.LayoutParams(MATCH_PARENT, ConvertUtils.toPx(activity, 30)));
   blackColorView.setPointerDrawable(
       CompatUtils.getDrawable(activity, R.drawable.color_picker_cursor_bottom));
   blackColorView.setLockPointerInBounds(false);
   blackColorView.setOnColorChangedListener(
       new ColorPanelView.OnColorChangedListener() {
         @Override
         public void onColorChanged(ColorPanelView view, int color) {
           updateCurrentColor(color);
         }
       });
   rootLayout.addView(blackColorView);
   multiColorView = new ColorPanelView(activity);
   //noinspection ResourceType
   multiColorView.setId(MULTI_ID);
   multiColorView.setLayoutParams(new LinearLayout.LayoutParams(MATCH_PARENT, 0, 1.0f));
   multiColorView.setPointerDrawable(
       CompatUtils.getDrawable(activity, R.drawable.color_picker_cursor_top));
   multiColorView.setLockPointerInBounds(true);
   multiColorView.setOnColorChangedListener(
       new ColorPanelView.OnColorChangedListener() {
         @Override
         public void onColorChanged(ColorPanelView view, int color) {
           updateCurrentColor(color);
         }
       });
   rootLayout.addView(multiColorView);
   LinearLayout previewLayout = new LinearLayout(activity);
   previewLayout.setOrientation(LinearLayout.HORIZONTAL);
   previewLayout.setGravity(Gravity.CENTER);
   previewLayout.setLayoutParams(
       new LinearLayout.LayoutParams(MATCH_PARENT, ConvertUtils.toPx(activity, 30)));
   hexValView = new EditText(activity);
   hexValView.setLayoutParams(new LinearLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT));
   hexValView.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
   hexValView.setImeOptions(EditorInfo.IME_ACTION_DONE);
   hexValView.setGravity(Gravity.CENTER);
   hexValView.setBackgroundColor(initColor);
   hexValView.setTextColor(Color.BLACK);
   hexValView.setShadowLayer(3, 0, 2, Color.WHITE); // 设置阴影,以便背景色为黑色系列时仍然看得见
   hexValView.setMinEms(6);
   hexValView.setMaxEms(8);
   hexValView.setPadding(0, 0, 0, 0);
   hexValView.setSingleLine(true);
   hexValView.setOnEditorActionListener(this);
   hexValDefaultColor = hexValView.getTextColors();
   previewLayout.addView(hexValView);
   rootLayout.addView(previewLayout);
   return rootLayout;
 }
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.specialcodedialog);

    app = (MyApp) this.getApplication();

    codeField = (EditText) this.findViewById(R.id.SpecialCodeField);
    okButton = (ImageButton) this.findViewById(R.id.specialCodeOkButton);
    okButton.setOnClickListener(this);
    cancelButton = (ImageButton) this.findViewById(R.id.specialCodeCancelButton);
    cancelButton.setOnClickListener(this);
    failText = (TextView) findViewById(R.id.SpecialCodeFail);

    codeField.setTextColor(this.getResources().getColor(R.color.dark_blue));
    codeField.setTextSize(TEXT_CODE_SIZE);

    failText.setTypeface(app.getTextFont());
    failText.setTextColor(this.getResources().getColor(R.color.dark_blue));
    failText.setTextSize(TEXT_FAIL_SIZE);
    failText.setText(DEFAULT_TEXT_FAIL);

    app = (MyApp) this.getApplication();
    currentPlayer = app.getCurrentPlayer();
  }
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    LinearLayout.LayoutParams lp =
        new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
    et = new EditText(getActivity());

    getGame().addGoGameChangeListener(this);

    et.setText(getGame().getActMove().getComment());
    et.setHint(R.string.enter_your_comments_here);
    et.setGravity(Gravity.TOP);
    et.setTextColor(this.getResources().getColor(R.color.text_color_on_board_bg));

    et.addTextChangedListener(
        new TextWatcher() {

          @Override
          public void afterTextChanged(Editable s) {
            getGame().getActMove().setComment(s.toString());
          }

          @Override
          public void beforeTextChanged(CharSequence s, int start, int count, int after) {}

          @Override
          public void onTextChanged(CharSequence s, int start, int before, int count) {}
        });

    et.setLayoutParams(lp);
    return et;
  }
  public void setTextColor(int color) {
    java.lang.reflect.Field[] pickerFields = NumberPicker.class.getDeclaredFields();
    for (java.lang.reflect.Field pf : pickerFields) {
      if (pf.getName().equals("mSelectorWheelPaint")) {
        pf.setAccessible(true);
        try {
          ((Paint) pf.get(this)).setColor(color);
        } catch (Exception e) {
          Log.e(TAG, "Nope", e);
        }
        break;
      }
    }

    final int count = this.getChildCount();
    for (int i = 0; i < count; i++) {
      View child = this.getChildAt(i);
      if (child instanceof EditText) {
        try {
          ((EditText) child).setTextColor(color);
          this.invalidate();
        } catch (IllegalArgumentException e) {
          Log.e(TAG, "Nope", e);
        }
      }
    }
  }
Example #17
0
  @Override
  public void onTextChanged(CharSequence s, int start, int before, int count) {
    // TODO Auto-generated method stub
    try {
      if (s.length() > 0) {

        if (Validate.isEmailAddress(edtTxtRecoverEmail, true)) {
          edtTxtRecoverEmail.setTextColor(Color.BLACK);
          edtTxtRecoverEmail.setBackgroundResource(R.drawable.edit_text_color);
          errorMsg.setVisibility(View.GONE);
        }
        edtTxtRecoverEmail.setTextColor(Color.BLACK);
      }
    } catch (Exception e) {
      PMWF_Log.fnlog(PMWF_Log.ERROR, "Error in textWatcher OnTextChanged", e.toString());
    }
  }
Example #18
0
  public MyEditText(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);

    TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.My_EditText, defStyle, 0);
    mHint = a.getText(R.styleable.My_EditText_text_hint);
    mTextColor = a.getColor(R.styleable.My_EditText_text_color, Color.BLACK);
    mTextSize = a.getDimension(R.styleable.My_EditText_text_size, 15);
    mBgColor = a.getColor(R.styleable.My_EditText_bg_color, Color.parseColor("#aaaaaa"));
    a.recycle();

    // 加载组合控件布局
    LayoutInflater.from(context).inflate(R.layout.my_edittext, this);
    mEditText = (EditText) findViewById(R.id.my_et);
    mDelete = (ImageView) findViewById(R.id.my_delete);

    // 设置组合控件自定义属性
    if (!TextUtils.isEmpty(mHint)) {
      mEditText.setHint(mHint);
    }
    mEditText.setTextSize(mTextSize);
    mEditText.setTextColor(mTextColor);
    mEditText.setBackgroundColor(mBgColor);

    // 删除键监听,点击删除输入框内容
    mDelete.setOnClickListener(
        new OnClickListener() {

          @Override
          public void onClick(View v) {
            mEditText.setText("");
            mDelete.setVisibility(View.GONE);
          }
        });

    // 输入框内容监听,内容为空,隐藏删除键;反之,显示删除键
    mEditText.addTextChangedListener(
        new TextWatcher() {

          @Override
          public void onTextChanged(CharSequence s, int start, int before, int count) {}

          @Override
          public void beforeTextChanged(CharSequence s, int start, int count, int after) {}

          @Override
          public void afterTextChanged(Editable s) {
            if (s != null && s.toString().trim() != null) {
              mDelete.setVisibility(View.VISIBLE);
            } else {
              mDelete.setVisibility(View.GONE);
            }

            if (mWatcher != null) {
              mWatcher.textChange(s);
            }
          }
        });
  }
    @Override
    protected void onPostExecute(final JSONObject result) {
      dialog.dismiss();
      try {
        int[] attrs = {R.attr.font};
        TypedArray ta =
            editText
                .getContext()
                .obtainStyledAttributes(
                    new ColorPreferences(editText.getContext()).getFontStyle().getBaseId(), attrs);
        final String url = result.getJSONObject("data").getString("link");
        LinearLayout layout = new LinearLayout(editText.getContext());
        layout.setOrientation(LinearLayout.VERTICAL);

        final TextView titleBox = new TextView(editText.getContext());
        titleBox.setText(url);
        layout.addView(titleBox);
        titleBox.setTextColor(ta.getColor(0, Color.WHITE));

        final EditText descriptionBox = new EditText(editText.getContext());
        descriptionBox.setHint(R.string.editor_title);
        descriptionBox.setTextColor(ta.getColor(0, Color.WHITE));

        ta.recycle();
        layout.setPadding(16, 16, 16, 16);
        layout.addView(descriptionBox);
        new AlertDialogWrapper.Builder(editText.getContext())
            .setTitle(R.string.editor_title_link)
            .setView(layout)
            .setPositiveButton(
                R.string.editor_action_link,
                new DialogInterface.OnClickListener() {
                  @Override
                  public void onClick(DialogInterface dialog, int which) {
                    dialog.dismiss();
                    String s = "[" + descriptionBox.getText().toString() + "](" + url + ")";
                    int start = Math.max(editText.getSelectionStart(), 0);
                    int end = Math.max(editText.getSelectionEnd(), 0);
                    editText.getText().insert(Math.max(start, end), s);
                  }
                })
            .show();

      } catch (Exception e) {
        new AlertDialogWrapper.Builder(c)
            .setTitle(R.string.err_title)
            .setMessage(R.string.editor_err_msg)
            .setPositiveButton(
                R.string.btn_ok,
                new DialogInterface.OnClickListener() {
                  @Override
                  public void onClick(DialogInterface dialog, int which) {}
                })
            .show();
        e.printStackTrace();
      }
    }
  @Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if (data != null) {
      String phone = data.getStringExtra("phone");
      et_number.setText(phone);
      et_number.setTextColor(getResources().getColor(R.color.textcolor));
    }
  }
  private void build_scroll_view(RaceDetails rd) {
    // Erase the content of the scroll view
    LinearLayout pilot_list = (LinearLayout) findViewById(R.id.pilot_list);
    pilot_list.removeAllViews();

    for (int index = 0; index < main_application.nb_of_pilots; index++) {
      if (rd.isTherePilot(index)) {
        LinearLayout new_horiz_layout = new LinearLayout(this);
        new_horiz_layout.setLayoutParams(
            new LinearLayout.LayoutParams(
                LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT, 1.0f));
        new_horiz_layout.setOrientation(LinearLayout.HORIZONTAL);

        EditText new_text_view = new EditText(this);
        new_text_view.setText(main_application.getPilotName(index));
        new_text_view.setLayoutParams(
            new LinearLayout.LayoutParams(
                LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT, 1.0f));
        new_text_view.setInputType(
            InputType.TYPE_NULL); // The text cannot be edited with the soft keypad
        new_text_view.setFocusable(false); // The text cannot be edited
        new_horiz_layout.addView(new_text_view);

        ImageView new_image_view = new ImageView(this);
        new_image_view.setImageResource(R.drawable.kart);
        new_horiz_layout.addView(new_image_view);

        EditText new_text_view_car_id = new EditText(this);
        if (rd.pilot_to_car_mapping.matching.indexOfKey(index) >= 0) {
          new_text_view_car_id.setText(
              Integer.toString(rd.pilot_to_car_mapping.matching.get(index)));
        } else {
          // This pilot wasn't in the maximum matching, he therefore is assigned to a car number he
          // already got
          // Signal that by writing the car number red.
          new_text_view_car_id.setText(
              Integer.toString(rd.pilot_to_car_mapping.unmatched.get(index)));
          new_text_view_car_id.setTextColor(getResources().getColor(R.color.dark_red));
        }
        new_text_view_car_id.setLayoutParams(
            new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
        new_text_view_car_id.setInputType(
            InputType.TYPE_NULL); // The text cannot be edited with the soft keypad
        new_text_view_car_id.setFocusable(false); // The text cannot be edited
        new_text_view_car_id.setEms(3);
        new_text_view_car_id.setGravity(Gravity.RIGHT);
        new_horiz_layout.addView(new_text_view_car_id);

        pilot_list.addView(new_horiz_layout);
      }
    }

    // Redraw the scroll view
    pilot_list.invalidate();
  }
Example #22
0
 private void setViewEnabled(boolean b) {
   priceView.setEnabled(b);
   priceView.setTextColor(b ? Color.parseColor("#626262") : Color.parseColor("#cccccc"));
   directionPriceView.setTextColor(
       b
           ? getResources().getColor(R.color.trade_main_color)
           : getResources().getColor(R.color.trade_hint_color));
   linearLayout.setEnabled(b);
   addView.setEnabled(b);
   minusView.setEnabled(b);
 }
Example #23
0
  // controlla l'input del dialog
  private boolean validateRetrieveFields() {
    boolean isValid = true;
    String email = retrieveEditText.getText().toString();
    if (email.length() == 0 || !Utils.checkEmail(email)) {
      retrieveEditText.setHintTextColor(Color.RED);
      retrieveEditText.setTextColor(Color.RED);
      isValid = false;
    }

    return isValid;
  }
Example #24
0
  // });
  // }
  private boolean saveChanges() {
    // if fields are empty
    if (TextFullName.getText().toString().isEmpty()
        || TextID.getText().toString().isEmpty()
        || TextEmail.getText().toString().isEmpty()
        || TextDepartment.getText().toString().isEmpty()) {
      Toast.makeText(
              Edit_Settings.this, "Saving Changes FAILED. Complete all fields.", Toast.LENGTH_LONG)
          .show();
      return false;

    } else {
      if ((TextPassword.getText().toString().equals(TextConfirm.getText().toString())) == false) {
        TextPassword.setText("Password *");
        TextPassword.setTextColor(Color.BLUE);
        TextConfirm.setText("Confirm Password *");
        TextConfirm.setTextColor(Color.BLUE);
        Toast.makeText(
                Edit_Settings.this, "Passwords are different, Enter again.", Toast.LENGTH_LONG)
            .show();
        return false;
      } else {
        string_FullName = TextFullName.getText().toString();
        string_email = TextEmail.getText().toString();
        string_ID = TextID.getText().toString();
        string_Department = TextDepartment.getText().toString();
        string_Password = TextPassword.getText().toString();
        ParseUser.getCurrentUser().put("FullName", string_FullName.toString());
        ParseUser.getCurrentUser().put("ID", string_ID.toString());
        ParseUser.getCurrentUser().put("Department", string_Department.toString());
        ParseUser.getCurrentUser().put("Email", string_email.toString());
        ParseUser.getCurrentUser().put("password", string_email.toString());
        ParseUser.getCurrentUser().setUsername(string_email.toString());
        ParseUser.getCurrentUser().setPassword(string_Password.toString());
        ParseUser.getCurrentUser().setEmail(string_email.toString());
        ParseUser.getCurrentUser().saveInBackground();
        Toast.makeText(Edit_Settings.this, "Updated Profile", Toast.LENGTH_LONG).show();
        return true;
      }
    }
  }
  private void initView() {
    TextView titleTextView = (TextView) this.findViewById(R.id.titleTextView);
    titleTextView.setText("微信认证");

    Button backButton = (Button) this.findViewById(R.id.backBtn);
    backButton.setOnClickListener(this);

    confirmBtn = (Button) this.findViewById(R.id.confirmBtn);
    confirmBtn.setOnClickListener(this);

    topTipTextView = (TextView) this.findViewById(R.id.topTipTextView);
    bottomTipTextView = (TextView) this.findViewById(R.id.bottomTipTextView);

    copyTextView = (TextView) this.findViewById(R.id.copyTextView);
    copyTextView.setOnClickListener(this);

    wechatEditText = (EditText) this.findViewById(R.id.wechatEditText);

    if (status < 'd') {
      wechatEditText.setEnabled(true);

      wechatEditText.setTextColor(getResources().getColor(R.color.gray_333333));

      confirmBtn.setVisibility(View.VISIBLE);

      topTipTextView.setVisibility(View.VISIBLE);
      bottomTipTextView.setVisibility(View.GONE);

    } else {
      wechatEditText.setEnabled(false);

      wechatEditText.setTextColor(getResources().getColor(R.color.gray));

      confirmBtn.setVisibility(View.INVISIBLE);

      topTipTextView.setVisibility(View.GONE);
      bottomTipTextView.setVisibility(View.VISIBLE);

      this.setClickableSpan();
    }
  }
Example #26
0
        @Override
        public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
          // sets currentCustomPercent to position of the SeekBar's thumb
          currentCustomPercent = seekBar.getProgress();
          updateCustom(); // update EditTexts for custom tip and total

          if (currentCustomPercent >= THRESHOLD) {
            output.setTextColor(getResources().getColor(R.color.color));
            output.setText(getResources().getText(R.string.spender));
            ;
            customTipTextView.setTextColor(getResources().getColor(R.color.color));
            tipCustomEditText.setTextColor(getResources().getColor(R.color.color));
            totalCustomEditText.setTextColor(getResources().getColor(R.color.color));
            output.setVisibility(TextView.VISIBLE);
          } else {
            output.setVisibility(TextView.INVISIBLE);
            customTipTextView.setTextColor(getResources().getColor(R.color.black));
            tipCustomEditText.setTextColor(getResources().getColor(R.color.black));
            totalCustomEditText.setTextColor(getResources().getColor(R.color.black));
          }
        }
Example #27
0
 private void dd()
 {
     if (bru && brv)
     {
         brh.setTextColor(brp);
         brn.setColorFilter(brq);
         _mth02CB(brk, brh);
         return;
     }
     if (TextUtils.isEmpty(brh.getText()))
     {
         brh.setTextColor(brp);
         brn.setColorFilter(brr);
         return;
     } else
     {
         brh.setTextColor(brs);
         brn.setColorFilter(brs);
         return;
     }
 }
  @Override
  public void onTextChanged(CharSequence s, int start, int before, int count) {
    // TODO Auto-generated method stub
    try {
      if (s.length() > 0) {
        editUserEmailAddress.setTextColor(Color.BLACK);
        /*
         * Toast.makeText(getApplicationContext(), "OnTextChanged",
         * Toast.LENGTH_SHORT).show();
         */

        // for (int i = 0; i < editTexts.length; i++) {
        // if (editTexts[i].getText().length() > 0) {
        // editTexts[i].setBackgroundResource(R.drawable.edit_text_color);
        //
        // }
        //
        // }
        /*
         * if (editUserEmailAddress.getText().length() > 0) {
         * editUserEmailAddress
         * .setBackgroundResource(R.drawable.edit_text_color);
         * editUserEmailAddress.setTextColor(Color.BLACK); }
         *
         * if (Validate.isEmailAddress(editUserEmailAddress, true)) {
         * editUserEmailAddress
         * .setBackgroundResource(R.drawable.edit_text_color);
         * errorMsg.setVisibility(View.GONE); }
         */

        /*
         * if(editUserPassword.getText().length() < 6 ){
         * editUserPassword
         * .setBackgroundResource(R.drawable.error_border);
         * txtErrorMsg.setText("Password should be 6 chars."); return; }
         */

        if (Validate.matchPassword(editUserPassword, editConfirmPsw)) {
          editUserPassword.setBackgroundResource(R.drawable.edit_text_color);
          editConfirmPsw.setBackgroundResource(R.drawable.edit_text_color);
          errorMsg.setVisibility(View.GONE);
          // txtErrorMsg.setText("");

          txtErrorMsg.setText("");
        }
      }
    } catch (Exception e) {
      Log.e("Error in textWatcher OnTextChanged", e.toString());
    }
    // getUserValidated();

  }
Example #29
0
  /** {@inheritDoc} */
  @Override
  @NonNull
  public Dialog onCreateDialog(Bundle savedInstanceState) {
    final EditText editText = new EditText(getContext());
    editText.setText(mText);
    //noinspection deprecation
    editText.setTextColor(getResources().getColor(R.color.textColor));
    editText.selectAll();

    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());

    builder
        .setTitle(mTitle)
        .setMessage(mMessage)
        .setCancelable(true)
        .setView(editText)
        .setPositiveButton(
            android.R.string.ok,
            new DialogInterface.OnClickListener() {
              /**
               * Handler for click event
               *
               * @param dialog Dialog
               * @param whichButton Selected option
               */
              @Override
              public void onClick(DialogInterface dialog, int whichButton) {
                onTextEntered(editText.getText().toString());

                dialog.dismiss();
              }
            })
        .setNegativeButton(
            android.R.string.cancel,
            new DialogInterface.OnClickListener() {
              /**
               * Handler for click event
               *
               * @param dialog Dialog
               * @param whichButton Selected option
               */
              @Override
              public void onClick(DialogInterface dialog, int whichButton) {
                dialog.dismiss();
              }
            });

    AlertDialog dialog = builder.create();
    dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);

    return dialog;
  }
Example #30
0
  @Override
  public void onActivityCreated(Bundle aSavedState) {
    super.onActivityCreated(aSavedState);
    if (DEBUG) Log.e(TAG, "onActivityCreated");

    mMessage.setBackgroundColor(ColorProvider.getBackgroundColor());
    mMessage.setTextColor(ColorProvider.getTextColor());
    getActivity()
        .getContentResolver()
        .registerContentObserver(AwfulThread.CONTENT_URI, true, mThreadObserver);
    refreshLoader();
    refreshThreadInfo();
  }