Skip to content

Commit

Permalink
[android] Edit visibility done button in edit category fragment.
Browse files Browse the repository at this point in the history
  • Loading branch information
velichkomarija authored and Polas committed Nov 23, 2020
1 parent d4f54bc commit 1e2f350
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater)
public void onPrepareOptionsMenu(Menu menu)
{
super.onPrepareOptionsMenu(menu);
MenuItem item = menu.findItem(R.id.done);
item.setVisible(mEditText.getEditableText().length() > 0);
setMenuVisibility(mEditText.getEditableText().length() > 0);
}

@Override
Expand Down Expand Up @@ -168,8 +167,7 @@ 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.length() == 0 || s.length() == 1)
getActivity().invalidateOptionsMenu();
setMenuVisibility(s.length() > 1);
}

@Override
Expand Down

0 comments on commit 1e2f350

Please sign in to comment.