Skip to content

Commit

Permalink
fix #32
Browse files Browse the repository at this point in the history
  • Loading branch information
HITGIF committed Nov 4, 2017
1 parent 9da9b4d commit e77e228
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_main);

// final ExtendedEditText t = findViewById(R.id.extendedEditText);
// final TextFieldBoxes tfb = findViewById(R.id.text_field_boxes3);
// final TextFieldBoxes tfb = findViewById(R.id.text_field_boxes2);

final Button darkButton = findViewById(R.id.dark_button);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ protected void onFinishInflate() {

super.onFinishInflate();



this.editText = findEditTextChild();
if (editText == null) return;
this.addView(LayoutInflater.from(getContext()).inflate(R.layout.text_field_boxes_layout, this, false));
Expand Down Expand Up @@ -249,12 +251,15 @@ protected void onFinishInflate() {
this.labelTopMargin = RelativeLayout.LayoutParams.class
.cast(this.floatingLabel.getLayoutParams()).topMargin;

final FrameLayout mainBody = this;

this.panel.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (!isActivated()) activate(true);
setHasFocus(true);
inputMethodManager.showSoftInput(editText, InputMethodManager.SHOW_IMPLICIT);
mainBody.performClick();
}
});

Expand All @@ -264,6 +269,7 @@ public void onClick(View v) {
if (!isActivated()) activate(true);
setHasFocus(true);
inputMethodManager.showSoftInput(editText, InputMethodManager.SHOW_IMPLICIT);
mainBody.performClick();
}
});

Expand All @@ -288,7 +294,7 @@ public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
public void afterTextChanged(Editable editable) {

if (!activated && !editable.toString().isEmpty()) activate(true);
if (activated && editable.toString().isEmpty()) deactivate();
if (activated && editable.toString().isEmpty() && !hasFocus) deactivate();
if (!doNotRemoveError) {
removeError();
updateCounterText();
Expand Down

0 comments on commit e77e228

Please sign in to comment.