revert check for specific fragment while search, as contactBackup does not have a search

This commit is contained in:
tobiasKaminsky 2017-05-03 13:35:22 +02:00
parent 9f7cd59682
commit a304f1b0a0
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7

View file

@ -5,16 +5,16 @@
* Copyright (C) 2017 Mario Danic * Copyright (C) 2017 Mario Danic
* Copyright (C) 2012 Bartek Przybylski * Copyright (C) 2012 Bartek Przybylski
* Copyright (C) 2012-2016 ownCloud Inc. * Copyright (C) 2012-2016 ownCloud Inc.
* * <p>
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2, * it under the terms of the GNU General Public License version 2,
* as published by the Free Software Foundation. * as published by the Free Software Foundation.
* * <p>
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* * <p>
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
@ -282,24 +282,14 @@ public class ExtendedListFragment extends Fragment
} }
public boolean onQueryTextChange(final String query) { public boolean onQueryTextChange(final String query) {
if (getFragmentManager().findFragmentByTag(FileDisplayActivity.TAG_SECOND_FRAGMENT) performSearch(query, false);
instanceof ExtendedListFragment){ return true;
performSearch(query, false);
return true;
} else {
return false;
}
} }
@Override @Override
public boolean onQueryTextSubmit(String query) { public boolean onQueryTextSubmit(String query) {
if (getFragmentManager().findFragmentByTag(FileDisplayActivity.TAG_SECOND_FRAGMENT) performSearch(query, true);
instanceof ExtendedListFragment){ return true;
performSearch(query, true);
return true;
} else {
return false;
}
} }
private void performSearch(final String query, boolean isSubmit) { private void performSearch(final String query, boolean isSubmit) {
@ -476,7 +466,7 @@ public class ExtendedListFragment extends Fragment
* Calculates the position of the item that will be used as a reference to * Calculates the position of the item that will be used as a reference to
* reposition the visible items in the list when the device is turned to * reposition the visible items in the list when the device is turned to
* other position. * other position.
* * <p>
* The current policy is take as a reference the visible item in the center * The current policy is take as a reference the visible item in the center
* of the screen. * of the screen.
* *
@ -581,9 +571,9 @@ public class ExtendedListFragment extends Fragment
/** /**
* Disables swipe gesture. * Disables swipe gesture.
* * <p>
* Sets the 'enabled' state of the refresh layouts contained in the fragment. * Sets the 'enabled' state of the refresh layouts contained in the fragment.
* * <p>
* When 'false' is set, prevents user gestures but keeps the option to refresh programatically, * When 'false' is set, prevents user gestures but keeps the option to refresh programatically,
* *
* @param enabled Desired state for capturing swipe gesture. * @param enabled Desired state for capturing swipe gesture.
@ -596,7 +586,7 @@ public class ExtendedListFragment extends Fragment
/** /**
* Sets the 'visibility' state of the FAB contained in the fragment. * Sets the 'visibility' state of the FAB contained in the fragment.
* * <p>
* When 'false' is set, FAB visibility is set to View.GONE programmatically, * When 'false' is set, FAB visibility is set to View.GONE programmatically,
* *
* @param enabled Desired visibility for the FAB. * @param enabled Desired visibility for the FAB.