diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarMenuItem.java b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarMenuItem.java index f9e58017e..4cd534292 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarMenuItem.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarMenuItem.java @@ -665,7 +665,6 @@ public class ActionBarMenuItem extends FrameLayout { return searchContainer.getVisibility() == VISIBLE; } - AnimatorSet searchContainerAnimator; public boolean toggleSearch(boolean openKeyboard) { if (searchContainer == null || (listener != null && !listener.canToggleSearch())) { @@ -678,41 +677,8 @@ public class ActionBarMenuItem extends FrameLayout { return true; } } - ArrayList menuIcons = new ArrayList<>(); - for (int i = 0; i < parentMenu.getChildCount(); i++) { - View view = parentMenu.getChildAt(i); - if (view instanceof ActionBarMenuItem) { - View iconView = ((ActionBarMenuItem) view).getIconView(); - if (iconView != null) { - menuIcons.add(iconView); - } - } - } - - if (searchContainer.getTag() != null) { - searchContainer.setTag(null); - if (searchContainerAnimator != null) { - searchContainerAnimator.removeAllListeners(); - searchContainerAnimator.cancel(); - } - searchContainerAnimator = new AnimatorSet(); - searchContainerAnimator.playTogether(ObjectAnimator.ofFloat(searchContainer, View.ALPHA, searchContainer.getAlpha(), 0f)); - for (int i = 0; i < menuIcons.size(); i++) { - menuIcons.get(i).setAlpha(0f); - searchContainerAnimator.playTogether(ObjectAnimator.ofFloat(menuIcons.get(i), View.ALPHA, menuIcons.get(i).getAlpha(), 1f)); - } - searchContainerAnimator.setDuration(150); - searchContainerAnimator.addListener(new AnimatorListenerAdapter() { - @Override - public void onAnimationEnd(Animator animation) { - searchContainer.setAlpha(0); - for (int i = 0; i < menuIcons.size(); i++) { - menuIcons.get(i).setAlpha(1f); - } - searchContainer.setVisibility(View.GONE); - } - }); - searchContainerAnimator.start(); + if (searchContainer.getVisibility() == VISIBLE) { + searchContainer.setVisibility(GONE); searchField.clearFocus(); setVisibility(VISIBLE); @@ -734,29 +700,8 @@ public class ActionBarMenuItem extends FrameLayout { } return false; } else { - searchContainer.setTag(1); searchContainer.setVisibility(VISIBLE); - searchContainer.setAlpha(0); - if (searchContainerAnimator != null) { - searchContainerAnimator.removeAllListeners(); - searchContainerAnimator.cancel(); - } - searchContainerAnimator = new AnimatorSet(); - searchContainerAnimator.playTogether(ObjectAnimator.ofFloat(searchContainer, View.ALPHA, searchContainer.getAlpha(), 1f)); - for (int i = 0; i < menuIcons.size(); i++) { - searchContainerAnimator.playTogether(ObjectAnimator.ofFloat(menuIcons.get(i), View.ALPHA, menuIcons.get(i).getAlpha(), 0f)); - } - searchContainerAnimator.setDuration(150); - searchContainerAnimator.addListener(new AnimatorListenerAdapter() { - @Override - public void onAnimationEnd(Animator animation) { searchContainer.setAlpha(1f); - for (int i = 0; i < menuIcons.size(); i++) { - menuIcons.get(i).setAlpha(0f); - } - } - }); - searchContainerAnimator.start(); setVisibility(GONE); searchField.setText(""); searchField.requestFocus();