@Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_forget_password);
    iv_logo = (ImageView) this.findViewById(R.id.iv_logo);
    img_background = (ImageView) this.findViewById(R.id.img_background);
    resizeLogo();
    fontManager = FontManager.getInstance(getAssets());
    ed_email = (EditText) this.findViewById(R.id.ed_email);
    ed_email
        .getBackground()
        .setColorFilter(getResources().getColor(R.color.ed_underline), PorterDuff.Mode.SRC_ATOP);
    ed_new_password = (EditText) this.findViewById(R.id.ed_new_password);
    ed_new_password
        .getBackground()
        .setColorFilter(getResources().getColor(R.color.ed_underline), PorterDuff.Mode.SRC_ATOP);
    ed_repassword = (EditText) this.findViewById(R.id.ed_repassword);
    ed_repassword
        .getBackground()
        .setColorFilter(getResources().getColor(R.color.ed_underline), PorterDuff.Mode.SRC_ATOP);

    ed_email.setTypeface(fontManager.getFont(FontManager.ROBOTO_LIGHT));
    ed_new_password.setTypeface(fontManager.getFont(FontManager.ROBOTO_LIGHT));
    ed_repassword.setTypeface(fontManager.getFont(FontManager.ROBOTO_LIGHT));

    btn_update_password = (Button) this.findViewById(R.id.btn_update_password);
    btn_update_password = (Button) this.findViewById(R.id.btn_update_password);
    btn_update_password.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            String email = ed_email.getText().toString().trim();
            String password = ed_new_password.getText().toString();
            String repassword = ed_repassword.getText().toString();
            if (verifyInputs(email, password, repassword)) {
              v.startAnimation(animFade);
              update_password(email, password);
            }
          }
        });
    btn_update_password.setTypeface(fontManager.getFont(FontManager.ROBOTO_MEDIUM));
    iv_back = (ImageView) this.findViewById(R.id.iv_back);
    iv_back.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            onBackPressed();
          }
        });
    ll_parent = (CoordinatorLayout) this.findViewById(R.id.ll_parent);
    ll_parent.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            hideSoftKeyboard();
          }
        });
    mValidator = Validator.getInstance();
    animFade = AnimationUtils.loadAnimation(ForgetPassword.this, R.anim.fade);
  }
  /*
   * (non-Javadoc)
   *
   * @see com.aviary.android.feather.effects.AbstractEffectPanel#onActivate()
   */
  @Override
  public void onActivate() {
    super.onActivate();

    createTypeFace();

    onAddTopText();
    onAddBottomText();

    ((ImageViewDrawableOverlay) mImageView).setOnDrawableEventListener(this);
    ((ImageViewDrawableOverlay) mImageView).setOnLayoutListener(this);

    mInputManager =
        (InputMethodManager)
            getContext().getBaseContext().getSystemService(Context.INPUT_METHOD_SERVICE);
    editTopButton.setOnClickListener(this);
    editBottomButton.setOnClickListener(this);

    editTopText.setVisibility(View.VISIBLE);
    editBottomText.setVisibility(View.VISIBLE);
    editTopText.getBackground().setAlpha(0);
    editBottomText.getBackground().setAlpha(0);

    clearButtonTop.setOnClickListener(this);
    clearButtonBottom.setOnClickListener(this);

    getContentView().setVisibility(View.VISIBLE);
    contentReady();
  }
 public void initEditView() {
   // 处理回车键输入和返回键关闭
   input = (EditText) findViewById(R.id.editText1);
   input.getBackground().setAlpha(222);
   input.setOnKeyListener(
       new OnKeyListener() {
         @Override
         public boolean onKey(View v, int keyCode, KeyEvent event) {
           System.out.println("yzj111 onKey");
           // TODO Auto-generated method stub
           if (keyCode == KeyEvent.KEYCODE_ENTER) {
             System.out.println("yzj enter");
             try {
               test00TuringAndTrans();
             } catch (JSONException e) {
               e.printStackTrace();
             }
             return true;
           } else if (keyCode == KeyEvent.KEYCODE_BACK) {
             closeSelf();
           }
           return false;
         }
       });
   input.setInputType(InputType.TYPE_CLASS_TEXT);
   InputMethodManager imm =
       (InputMethodManager) tempContext.getSystemService(Context.INPUT_METHOD_SERVICE);
   imm.showSoftInput(this, 0);
 }
  @Override
  public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);

    mEditText = (EditText) view.findViewById(R.id.date_button);
    mEditText
        .getBackground()
        .setColorFilter(
            new PorterDuffColorFilter(
                getResources().getColor(R.color.fog), PorterDuff.Mode.MULTIPLY));
    mEditText.addTextChangedListener(
        new TextWatcher() {
          @Override
          public void beforeTextChanged(CharSequence s, int start, int count, int after) {}

          @Override
          public void onTextChanged(CharSequence s, int start, int before, int count) {
            if (s == null || s.length() == 0) clearAnswer();
            else setAnswer(s.toString());
          }

          @Override
          public void afterTextChanged(Editable s) {}
        });

    recoverAnswer();
  }
示例#5
0
 public TextBoxBase(ComponentContainer container, EditText textview, int resourceId) {
   super(container, resourceId);
   view = textview;
   // Listen to focus changes
   view.setOnFocusChangeListener(this);
   defaultTextBoxDrawable = view.getBackground();
   fontTypeface = Component.TYPEFACE_DEFAULT;
 }
 private void setBackgroundLayout() {
   EditText editText = (EditText) findViewById(R.id.ideaMessage);
   editText.setBackgroundResource(R.drawable.sticky);
   GradientDrawable drawable = (GradientDrawable) editText.getBackground();
   drawable.setColor(
       Color.parseColor(
           ColorSticky.getColorCode(board.sections().get(customActionBar.selectedIndex()).id())));
   editText.invalidate();
 }
  private void initFeedbackViewElements() {
    mEtFeedback = (EditText) mLayoutBody.findViewById(R.id.wootric_et_feedback);
    Drawable etFeedbackBackground = mEtFeedback.getBackground();
    etFeedbackBackground.setColorFilter(mColorBlack, PorterDuff.Mode.SRC_ATOP);
    etFeedbackBackground.setAlpha(26);
    mEtFeedback.setOnFocusChangeListener(onEtFeedbackFocusChanged());
    mEtFeedback.addTextChangedListener(etFeedbackTextWatcher());

    TextView mBtnEditScore = (TextView) mLayoutBody.findViewById(R.id.wootric_btn_edit_score);
    mBtnEditScore.setOnClickListener(onEditScoreClick());

    mFeedbackViews = new View[] {mBtnEditScore, mEtFeedback};
  }
示例#8
0
  /**
   * Creates a new TextBoxBase component
   *
   * @param container container that the component will be placed in
   * @param textview the underlying EditText object that maintains the text
   */
  public TextBoxBase(ComponentContainer container, EditText textview) {
    super(container);

    view = textview;

    // Listen to focus changes
    view.setOnFocusChangeListener(this);

    defaultTextBoxDrawable = view.getBackground();

    // Add a transformation method to provide input validation
    /*
     * TODO(user): see comment above) setTransformationMethod(new
     * ValidationTransformationMethod());
     */

    // Adds the component to its designated container
    container.$add(this);

    container.setChildWidth(this, ComponentConstants.TEXTBOX_PREFERRED_WIDTH);

    TextAlignment(Component.ALIGNMENT_NORMAL);
    // Leave the nice default background color. Users can change it to
    // "none" if they like
    //
    // TODO(user): if we make a change here we also need to change the
    // default property value.
    // Eventually I hope to simplify this so it has to be changed in one
    // location
    // only). Maybe we need another color value which would be
    // 'SYSTEM_DEFAULT' which
    // will not attempt to explicitly initialize with any of the properties
    // with any
    // particular value.
    // BackgroundColor(Component.COLOR_NONE);
    Enabled(true);
    fontTypeface = Component.TYPEFACE_DEFAULT;
    TextViewUtil.setFontTypeface(view, fontTypeface, bold, italic);
    FontSize(Component.FONT_DEFAULT_SIZE);
    Hint("");
    Text("");
    TextColor(Component.COLOR_BLACK);
  }
  @Override
  public View getViewWithAlpha(int alphaValue) {

    if (view != null) {

      LinearLayout layout = (LinearLayout) view.findViewById(R.id.brick_nxt_motor_action_layout);
      Drawable background = layout.getBackground();
      background.setAlpha(alphaValue);

      TextView textLegoMotorActionLabel =
          (TextView) view.findViewById(R.id.lego_motor_action_label);
      TextView textLegoMotorActionSpeed =
          (TextView) view.findViewById(R.id.lego_motor_action_speed);
      TextView textLegoMotorActionPercent =
          (TextView) view.findViewById(R.id.lego_motor_action_percent);
      TextView textLegoMotorActionLabelSpeedView =
          (TextView) view.findViewById(R.id.motor_action_speed_text_view);
      EditText editSpeed = (EditText) view.findViewById(R.id.motor_action_speed_edit_text);

      textLegoMotorActionLabel.setTextColor(
          textLegoMotorActionLabel.getTextColors().withAlpha(alphaValue));
      textLegoMotorActionSpeed.setTextColor(
          textLegoMotorActionSpeed.getTextColors().withAlpha(alphaValue));
      textLegoMotorActionPercent.setTextColor(
          textLegoMotorActionPercent.getTextColors().withAlpha(alphaValue));
      textLegoMotorActionLabelSpeedView.setTextColor(
          textLegoMotorActionLabelSpeedView.getTextColors().withAlpha(alphaValue));
      Spinner motorSpinner = (Spinner) view.findViewById(R.id.lego_motor_action_spinner);
      ColorStateList color =
          textLegoMotorActionLabelSpeedView.getTextColors().withAlpha(alphaValue);
      motorSpinner.getBackground().setAlpha(alphaValue);
      if (adapterView != null) {
        ((TextView) adapterView.getChildAt(0)).setTextColor(color);
      }
      editSpeed.setTextColor(editSpeed.getTextColors().withAlpha(alphaValue));
      editSpeed.getBackground().setAlpha(alphaValue);

      this.alphaValue = (alphaValue);
    }

    return view;
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    // setSupportActionBar(toolbar);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
      Window window = getWindow();
      window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
      window.setStatusBarColor(getResources().getColor(R.color.primary_dark));
    }

    Resources res = getResources();
    registerFirstName
        .getBackground()
        .setColorFilter(res.getColor(R.color.primary_light), PorterDuff.Mode.SRC_ATOP);
    registerLastName
        .getBackground()
        .setColorFilter(res.getColor(R.color.primary_light), PorterDuff.Mode.SRC_ATOP);
    registerPassword
        .getBackground()
        .setColorFilter(res.getColor(R.color.primary_light), PorterDuff.Mode.SRC_ATOP);
    registerEmail
        .getBackground()
        .setColorFilter(res.getColor(R.color.primary_light), PorterDuff.Mode.SRC_ATOP);
    loginEmail
        .getBackground()
        .setColorFilter(res.getColor(R.color.primary_light), PorterDuff.Mode.SRC_ATOP);
    loginPassword
        .getBackground()
        .setColorFilter(res.getColor(R.color.primary_light), PorterDuff.Mode.SRC_ATOP);

    // Animation to blend over from the login choice view to registerButton or login view
    animationDuration = res.getInteger(android.R.integer.config_shortAnimTime);

    // Remember the currently shown layout/view
    activeView = loginChoiceView;

    // The user can decide to login (with registerEmail and password)...
    chooseLoginButton.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View view) {
            showView(loginView);
          }
        });

    // ... or to registerButton with a new account
    chooseRegisterButton.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View view) {
            showView(registerView);
          }
        });

    // REGISTER LAYOUT
    registerButton.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View view) {
            // Check if first and last name are entered
            if (TextUtils.isEmpty(registerFirstName.getText().toString())
                || TextUtils.isEmpty(registerLastName.getText().toString())) {
              Toast.makeText(
                      getApplication().getApplicationContext(),
                      getResources().getString(R.string.first_last_mandatory),
                      Toast.LENGTH_SHORT)
                  .show();
            }
            // Check the validity of the entered email address using Regex
            else if (!validate(registerEmail.getText().toString())) {
              Toast.makeText(
                      getApplication().getApplicationContext(),
                      getResources().getString(R.string.email_invalid),
                      Toast.LENGTH_SHORT)
                  .show();
            } else
              registerUser(
                  registerFirstName.getText().toString(),
                  registerLastName.getText().toString(),
                  registerEmail.getText().toString(),
                  registerPassword.getText().toString());
          }
        });

    // LOGIN LAYOUT
    loginButton.setOnClickListener(
        new View.OnClickListener() {

          @Override
          public void onClick(View view) {
            loginUser(loginEmail.getText().toString(), loginPassword.getText().toString());
          }
        });

    // SKIP login
    findViewById(R.id.skip)
        .setOnClickListener(
            new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                setResult(RESULT_SKIPPED);
                finish();
              }
            });
  }
示例#11
0
  private void initMyGroupView() {
    ll = (LinearLayout) findViewById(R.id.l1);
    DisplayMetrics metric = new DisplayMetrics();
    getWindowManager().getDefaultDisplay().getMetrics(metric);
    /**
     * *******************************************************************************************
     */
    mvg = new MyViewGroup(NewSMSActivity.this);
    mvg.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, 70));
    //		mvg.setBackgroundColor(Color.GREEN);
    etMess = new EditText(NewSMSActivity.this);
    etMess.setFilters(new InputFilter[] {new InputFilter.LengthFilter(15)});
    etMess.setSelection(etMess.getText().length());
    etMess.setGravity(Gravity.CENTER_VERTICAL);
    etMess.setMinWidth(100);
    etMess.setHeight(60);
    etMess.setTag("edit");
    etMess.getBackground().setAlpha(0);
    etMess.setId(extiTextId);
    etMess.addTextChangedListener(
        new TextWatcher() {
          @Override
          public void onTextChanged(CharSequence s, int start, int before, int count) {

            if (isNum(s.toString())) {
              if (s.length() >= 1) {
                boolean bool = false;
                // length() == 15直接生成按钮
                if (s.length() == 15) {
                  bool = true;
                }
                // 字数没有满足15个验证是否有空格
                if (!bool) {
                  String c = s.toString().substring(start, start + count);
                  for (int i = 0; i < chars.length; i++) {
                    if (chars[i].equals(c)) {
                      bool = true;
                      break;
                    }
                  }
                }
                // bool == true 生成Button
                if (bool) {
                  createView1(s.toString(), s.toString());
                  etMess.setText("");
                }
                // 检测输入框数据是否已经换行
                final View child = mvg.getChildAt(mvg.getChildCount() - 1);
                autoHeight(child);
              }
            } else {
              adapter.getFilter().filter(s);
              queryListView.setVisibility(View.VISIBLE);
            }
          }

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

          @Override
          public void afterTextChanged(Editable s) {}
        });
    mvg.addView(etMess);
    ll.addView(mvg);
    etMess.setOnFocusChangeListener(
        new OnFocusChangeListener() {
          @Override
          public void onFocusChange(View v, boolean hasFocus) {
            if (!hasFocus) {
              if (isNum(etMess.getText().toString().trim())) {
                createView1(etMess.getText().toString().trim(), etMess.getText().toString().trim());
                etMess.setText("");
              } else {
                etMess.setText("");
                queryListView.setVisibility(View.INVISIBLE);
              }
            }
          }
        });
  }
示例#12
0
  private void initializeFields() {
    fontManager = FontManager.getInstance(getAssets());
    pref =
        getSharedPreferences(GNLConstants.SharedPreference.SHARED_PREF_NAME, Context.MODE_PRIVATE);
    prefEditor = pref.edit();
    iv_logo = (ImageView) this.findViewById(R.id.iv_logo);
    img_background = (ImageView) this.findViewById(R.id.img_background);
    ed_fname = (EditText) this.findViewById(R.id.ed_fname);
    ed_fname
        .getBackground()
        .setColorFilter(getResources().getColor(R.color.ed_underline), PorterDuff.Mode.SRC_ATOP);
    ed_lname = (EditText) this.findViewById(R.id.ed_lname);
    ed_lname
        .getBackground()
        .setColorFilter(getResources().getColor(R.color.ed_underline), PorterDuff.Mode.SRC_ATOP);
    ed_email = (EditText) this.findViewById(R.id.ed_email);
    ed_email
        .getBackground()
        .setColorFilter(getResources().getColor(R.color.ed_underline), PorterDuff.Mode.SRC_ATOP);
    ed_password = (EditText) this.findViewById(R.id.ed_password);
    ed_password
        .getBackground()
        .setColorFilter(getResources().getColor(R.color.ed_underline), PorterDuff.Mode.SRC_ATOP);
    ed_repassword = (EditText) this.findViewById(R.id.ed_repassword);
    ed_repassword
        .getBackground()
        .setColorFilter(getResources().getColor(R.color.ed_underline), PorterDuff.Mode.SRC_ATOP);

    ed_fname.setTypeface(fontManager.getFont(FontManager.ROBOTO_LIGHT));
    ed_lname.setTypeface(fontManager.getFont(FontManager.ROBOTO_LIGHT));
    ed_email.setTypeface(fontManager.getFont(FontManager.ROBOTO_LIGHT));
    ed_password.setTypeface(fontManager.getFont(FontManager.ROBOTO_LIGHT));
    ed_repassword.setTypeface(fontManager.getFont(FontManager.ROBOTO_LIGHT));

    btn_signup = (Button) this.findViewById(R.id.btn_signup);
    btn_signup.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            fname = ed_fname.getText().toString().trim();
            lname = ed_lname.getText().toString().trim();
            email = ed_email.getText().toString().trim();
            password = ed_password.getText().toString();
            repassword = ed_repassword.getText().toString();
            if (verifyInputs(fname, lname, email, password, repassword)) {
              v.startAnimation(animFade);
              register(fname, lname, email, password);
            }
          }
        });
    btn_signup.setTypeface(fontManager.getFont(FontManager.ROBOTO_MEDIUM));
    iv_back = (ImageView) this.findViewById(R.id.iv_back);
    iv_back.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            onBackPressed();
          }
        });
    ll_parent = (CoordinatorLayout) this.findViewById(R.id.ll_parent);
    ll_parent.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            hideSoftKeyboard();
          }
        });
    mValidator = Validator.getInstance();
    animFade = AnimationUtils.loadAnimation(Register.this, R.anim.fade);
  }
示例#13
0
  @Override
  public void onCreate(Bundle savedInstanceState) {

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

    // DB 접근용, DB 메니져 생성
    albaDBManager = new AlbaDBManager();

    // 유틸 클레스 생성
    utilClass = new UtilClass();

    // 인텐트 얻음
    intent = getIntent();
    // 아이템 정보 얻음
    if (intent.getSerializableExtra(AlbaLibrary.KEY_INTENT_ALBA_PUT_ITEM_MODEL) != null) {
      albaItemModel =
          (AlbaItemModel) intent.getSerializableExtra(AlbaLibrary.KEY_INTENT_ALBA_PUT_ITEM_MODEL);
    }

    // 플레그 획득
    if (intent.getSerializableExtra(AlbaLibrary.KEY_INTENT_ALBA_INSERT_FLAG) != null) {
      insert_flag = intent.getBooleanExtra(AlbaLibrary.KEY_INTENT_ALBA_INSERT_FLAG, true);
    }

    // View 연결
    buttonSetColor = (Button) findViewById(R.id.albaEditButtonSetColor);
    buttonSetWorkDay = (Button) findViewById(R.id.alblEditSetWorkDayButton);
    textViewStartTime = (TextView) findViewById(R.id.albaEditStartTimeTextView);
    textViewEndTime = (TextView) findViewById(R.id.albaEditEndTimeTextView);
    editTextEditAlbaName = (EditText) findViewById(R.id.albaEditNameEditText);
    editTextEditAlbaPay = (EditText) findViewById(R.id.albaEditPayEditText);
    linearLayoutSetWorkDay = (LinearLayout) findViewById(R.id.albaEditLinearLayout01);

    // 일정 입력 숨김
    linearLayoutSetWorkDay.setVisibility(View.INVISIBLE);

    // 밑줄 색상변경
    editTextEditAlbaName
        .getBackground()
        .setColorFilter(getResources().getColor(R.color.color_baseBlue), PorterDuff.Mode.SRC_ATOP);

    // 수정시 버튼 색상
    if (!insert_flag) {
      // 모델에서 컬러 정보 얻음
      colorCode = albaItemModel.getAlba_color();
    }
    // 버튼 색 변경
    buttonSetColor.setBackgroundColor(Color.parseColor(colorCode));

    // onClickListener
    textViewStartTime.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View view) {
            // 시간 설정 다이얼로그 생성
            new TimePickerDialog(
                    AlbaEditActivity.this,
                    new TimePickerDialog.OnTimeSetListener() {
                      @Override
                      public void onTimeSet(TimePicker timePicker, int hour, int min) {
                        // 시간 재설정(String 생성)
                        startTime = utilClass.getStringTime(hour, min);
                        startTimeHour = hour;
                        startTimeMin = min;

                        textViewStartTime.setText(startTime);
                      }
                    },
                    startTimeHour,
                    startTimeMin,
                    false)
                .show();
          }
        });

    // 시간 설정 다이얼로그 생성
    textViewEndTime.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View view) {
            new TimePickerDialog(
                    AlbaEditActivity.this,
                    new TimePickerDialog.OnTimeSetListener() {
                      @Override
                      public void onTimeSet(TimePicker timePicker, int hour, int min) {
                        endTime = utilClass.getStringTime(hour, min);
                        endTimeHour = hour;
                        endTimeMin = min;

                        textViewEndTime.setText(endTime);
                      }
                    },
                    endTimeHour,
                    endTimeMin,
                    false)
                .show();
          }
        });

    buttonSetColor.setOnClickListener(
        new View.OnClickListener() {

          // 커러 배열을 얻음
          int[] mColor = colorChoice(getApplicationContext());

          @Override
          public void onClick(View v) {
            // ColorPickerDialog 생성
            ColorPickerDialog colorcalendar =
                ColorPickerDialog.newInstance(
                    R.string.regialba_color_title,
                    mColor,
                    Color.parseColor(colorCode),
                    4,
                    Utils.isTablet(getApplicationContext())
                        ? ColorPickerDialog.SIZE_LARGE
                        : ColorPickerDialog.SIZE_SMALL);

            // 리스너 설정
            colorcalendar.setOnColorSelectedListener(
                new ColorPickerSwatch.OnColorSelectedListener() {

                  @Override
                  public void onColorSelected(int color) {
                    // 선택한 값을 받아서 컬러 코드 저장 변수에 반환
                    // String으로 변환
                    colorCode = String.format("#%06X", (0xFFFFFF & color));
                    // 버튼색 갱신
                    buttonSetColor.setBackgroundColor(color);
                  }
                });
            // ColorPickerDialog 창을 팝업
            colorcalendar.show(getSupportFragmentManager(), "cal");
          }
        });

    if (insert_flag == false) {
      // 수정일 경우

      // MemoModel 얻음
      albaDBModel = albaDBManager.getAlbaModelByDBID(albaItemModel.getAlba_dbID());

      editTextEditAlbaName.setText(albaDBModel.alba_name);
      // 리스너 연결

      // DB에서 값 가져옴
      startTime = albaDBModel.alba_startTime;
      endTime = albaDBModel.alba_endTime;
      pay = albaDBModel.alba_pay;

      // 시급 설정
      editTextEditAlbaPay.setText("" + pay);

      // 일정 입력 표시
      linearLayoutSetWorkDay.setVisibility(View.VISIBLE);

    } else {
      // no action

    }

    // 시간 입력
    // String 토크나이저로 시간 분리
    StringTokenizer stStart = new StringTokenizer(startTime, AlbaLibrary.TOKENIZER_SEPARATER);
    startTimeHour = Integer.parseInt(stStart.nextToken());
    startTimeMin = Integer.parseInt(stStart.nextToken());

    StringTokenizer stEnd = new StringTokenizer(endTime, AlbaLibrary.TOKENIZER_SEPARATER);
    endTimeHour = Integer.parseInt(stEnd.nextToken());
    endTimeMin = Integer.parseInt(stEnd.nextToken());

    textViewStartTime.setText(startTime);
    textViewEndTime.setText(endTime);
  }
示例#14
0
  private void populateFields(Bundle savedInstanceState) {

    EditText mTitleText = (EditText) findViewById(R.id.title);
    EditText mBodyText = (EditText) findViewById(R.id.body);
    EditText mBody2Text = (EditText) findViewById(R.id.body2);

    String transPrefs = getString(R.string.prefs_note_trans);
    String transPrefsVal = NotePrefsDb.getStringValue(this, transPrefs, "255");
    int newVal = Integer.valueOf(transPrefsVal);

    if (newVal < 255) {

      int newColor = Color.argb(255, newVal, newVal, newVal);

      mTitleText.getBackground().setColorFilter(newColor, PorterDuff.Mode.MULTIPLY);
      mBodyText.getBackground().setColorFilter(newColor, PorterDuff.Mode.MULTIPLY);
      mBody2Text.getBackground().setColorFilter(newColor, PorterDuff.Mode.MULTIPLY);

      if (newVal <= 127) {
        mTitleText.setTextColor(Color.WHITE);
        mBodyText.setTextColor(Color.WHITE);
        mBody2Text.setTextColor(Color.WHITE);
      }
    }

    // if we're doing an edit note, not a create note
    if (mRowId != null) {

      String linkifyPrefs = getString(R.string.prefs_linkify);
      Boolean linkifyPrefsVal = NotePrefsDb.getBooleanValue(this, linkifyPrefs, true);

      if (linkifyPrefsVal) {
        mBodyText.setAutoLinkMask(Linkify.ALL);
      }

      Note note = NoteHelper.getNote(NoteEdit.this, mRowId);

      if (savedInstanceState == null) {
        mTitleText.setText(note.getTitle());
        mBodyText.setText(note.getBody());
        mBody2Text.setText(note.getBody());
      } else {
        mTitleText.setText((String) savedInstanceState.getSerializable(NoteDb.KEY_TITLE));
        mBodyText.setText((String) savedInstanceState.getSerializable(NoteDb.KEY_BODY));
        mBody2Text.setText((String) savedInstanceState.getSerializable(NoteDb.KEY_BODY));
      }

      if (isEditable == false) {

        mTitleText.setFocusable(false);
        mTitleText.setCursorVisible(false);

        mBodyText.setFocusable(false);
        mBodyText.setCursorVisible(false);

        mBody2Text.setVisibility(View.GONE);

      } else {

        mBodyText.setVisibility(View.GONE);
      }

    } else {

      mBodyText.setFocusable(false);
      mBodyText.setCursorVisible(false);
      mBodyText.setVisibility(View.GONE);
    }

    // length filter
    int maxLength = 40;
    InputFilter[] FilterArray = new InputFilter[1];
    FilterArray[0] = new InputFilter.LengthFilter(maxLength);
    mTitleText.setFilters(FilterArray);
  }