From 10b661744aa45fb675be0d1d7d9406e60ef07c21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kilian=20Pe=CC=81risset?= Date: Tue, 21 Jan 2020 18:09:50 +0100 Subject: [PATCH 1/8] Fixed onBackPressed bug (inactive button) + Refactored and optimized the code --- .../ui/activity/FileDisplayActivity.java | 59 ++++----- .../ui/fragment/ExtendedListFragment.java | 118 ++++++++++-------- 2 files changed, 94 insertions(+), 83 deletions(-) diff --git a/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java b/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java index 053926f197..c60716660c 100644 --- a/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java +++ b/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java @@ -803,29 +803,26 @@ public class FileDisplayActivity extends FileActivity final View mSearchEditFrame = searchView .findViewById(androidx.appcompat.R.id.search_edit_frame); - searchView.setOnCloseListener(new SearchView.OnCloseListener() { - @Override - public boolean onClose() { - if (TextUtils.isEmpty(searchView.getQuery().toString())) { - searchView.onActionViewCollapsed(); - setDrawerIndicatorEnabled(isDrawerIndicatorAvailable()); // order matters - getSupportActionBar().setDisplayHomeAsUpEnabled(true); - mDrawerToggle.syncState(); + searchView.setOnCloseListener(() -> { + if (TextUtils.isEmpty(searchView.getQuery().toString())) { + searchView.onActionViewCollapsed(); + setDrawerIndicatorEnabled(isDrawerIndicatorAvailable()); // order matters + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + mDrawerToggle.syncState(); - if (getListOfFilesFragment() != null) { - getListOfFilesFragment().setSearchFragment(false); - getListOfFilesFragment().refreshDirectory(); - } - } else { - searchView.post(new Runnable() { - @Override - public void run() { - searchView.setQuery("", true); - } - }); + if (getListOfFilesFragment() != null) { + getListOfFilesFragment().setSearchFragment(false); + getListOfFilesFragment().refreshDirectory(); } - return true; + } else { + searchView.post(new Runnable() { + @Override + public void run() { + searchView.setQuery("", true); + } + }); } + return true; }); ViewTreeObserver vto = mSearchEditFrame.getViewTreeObserver(); @@ -1141,22 +1138,28 @@ public class FileDisplayActivity extends FileActivity } } + /* + * BackPressed priority/hierarchy: + * 1. close search view if opened + * 2. close drawer if opened + * 3. close FAB if open (only if drawer isn't open) + * 4. navigate up (only if drawer and FAB aren't open) + */ @Override public void onBackPressed() { boolean isDrawerOpen = isDrawerOpen(); boolean isSearchOpen = isSearchOpen(); - /* - * BackPressed priority/hierarchy: - * 1. close search view if opened - * 2. close drawer if opened - * 3. close FAB if open (only if drawer isn't open) - * 4. navigate up (only if drawer and FAB aren't open) - */ + OCFileListFragment listOfFiles = getListOfFilesFragment(); if (isSearchOpen && searchView != null) { searchView.setQuery("", true); searchView.onActionViewCollapsed(); + searchView.clearFocus(); + + // Remove the list to the original state + listOfFiles.performSearch("", true); + setDrawerIndicatorEnabled(isDrawerIndicatorAvailable()); } else if (isDrawerOpen) { // close drawer first @@ -1164,7 +1167,7 @@ public class FileDisplayActivity extends FileActivity } else { // all closed - OCFileListFragment listOfFiles = getListOfFilesFragment(); + listOfFiles = getListOfFilesFragment(); if (mDualPane || getSecondFragment() == null) { OCFile currentDir = getCurrentDir(); if (currentDir == null || currentDir.getParentId() == FileDataStorageManager.ROOT_PARENT_ID) { diff --git a/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java b/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java index 4a8bd71819..573429fe18 100644 --- a/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java +++ b/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java @@ -45,9 +45,11 @@ import android.view.ScaleGestureDetector; import android.view.View; import android.view.ViewGroup; import android.view.ViewTreeObserver; +import android.view.inputmethod.InputMethodManager; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.GridView; +import android.widget.ImageButton; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ProgressBar; @@ -60,6 +62,7 @@ import com.nextcloud.client.preferences.AppPreferences; import com.nextcloud.client.preferences.AppPreferencesImpl; import com.owncloud.android.MainApp; import com.owncloud.android.R; +import com.owncloud.android.datamodel.OCFile; import com.owncloud.android.lib.common.utils.Log_OC; import com.owncloud.android.lib.resources.files.SearchRemoteOperation; import com.owncloud.android.ui.EmptyRecyclerView; @@ -135,7 +138,8 @@ public class ExtendedListFragment extends Fragment implements private EmptyRecyclerView mRecyclerView; - protected SearchView searchView; + public SearchView searchView; + public ImageView closeButton; private Handler handler = new Handler(Looper.getMainLooper()); private float mScale = AppPreferencesImpl.DEFAULT_GRID_COLUMN; @@ -191,6 +195,7 @@ public class ExtendedListFragment extends Fragment implements public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { final MenuItem item = menu.findItem(R.id.action_search); searchView = (SearchView) MenuItemCompat.getActionView(item); + closeButton = searchView.findViewById(androidx.appcompat.R.id.search_close_btn); searchView.setOnQueryTextListener(this); searchView.setOnCloseListener(this); ThemeUtils.themeSearchView(searchView, true, requireContext()); @@ -216,20 +221,30 @@ public class ExtendedListFragment extends Fragment implements } } - searchView.setOnQueryTextFocusChangeListener(new View.OnFocusChangeListener() { - @Override - public void onFocusChange(View v, final boolean hasFocus) { + searchView.setOnQueryTextFocusChangeListener((v, hasFocus) -> handler.postDelayed(() -> { + if (getActivity() != null && !(getActivity() instanceof FolderPickerActivity) + && !(getActivity() instanceof UploadFilesActivity)) { + setFabVisible(false); + } + }, 100)); - handler.postDelayed(new Runnable() { - @Override - public void run() { - if (getActivity() != null && !(getActivity() instanceof FolderPickerActivity) - && !(getActivity() instanceof UploadFilesActivity)) { - setFabVisible(!hasFocus); + // On close -> empty field, show keyboard and + closeButton.setOnClickListener(view -> { + searchView.setQuery("", true); + searchView.onActionViewExpanded(); + theTextArea.requestFocus(); - } - } - }, 100); + + InputMethodManager inputMethodManager = + (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE); + + + if (inputMethodManager != null) { + inputMethodManager.showSoftInput(searchView, + InputMethodManager.SHOW_FORCED); +/* inputMethodManager.toggleSoftInputFromWindow( + searchView.getApplicationWindowToken(), + InputMethodManager.SHOW_FORCED, 0);*/ } }); @@ -274,6 +289,15 @@ public class ExtendedListFragment extends Fragment implements } public boolean onQueryTextChange(final String query) { + // After 300 ms, set the query + + + if (query.isEmpty()) { + closeButton.setVisibility(View.INVISIBLE); + } else { + closeButton.setVisibility(View.VISIBLE); + } + if (getFragmentManager() != null && getFragmentManager(). findFragmentByTag(FileDisplayActivity.TAG_SECOND_FRAGMENT) instanceof ExtendedListFragment) { performSearch(query, false); @@ -285,58 +309,42 @@ public class ExtendedListFragment extends Fragment implements @Override public boolean onQueryTextSubmit(String query) { - performSearch(query, true); + performSearch(query, false); return true; } - private void performSearch(final String query, boolean isSubmit) { + public void performSearch(final String query, boolean isBackPressed) { handler.removeCallbacksAndMessages(null); - RecyclerView.Adapter adapter = getRecyclerView().getAdapter(); - if (!TextUtils.isEmpty(query)) { - int delay = 500; - - if (isSubmit) { - delay = 0; - } - - if (adapter instanceof OCFileListAdapter) { - handler.postDelayed(new Runnable() { - @Override - public void run() { - EventBus.getDefault().post(new SearchEvent(query, - SearchRemoteOperation.SearchType.FILE_SEARCH, - SearchEvent.UnsetType.NO_UNSET)); - - } - }, delay); - } else if (adapter instanceof LocalFileListAdapter) { - handler.postDelayed(new Runnable() { - @Override - public void run() { - LocalFileListAdapter localFileListAdapter = (LocalFileListAdapter) adapter; - localFileListAdapter.filter(query); - } - }, delay); - } - - if (searchView != null && delay == 0) { - searchView.clearFocus(); - } - } else { - Activity activity; - if ((activity = getActivity()) != null) { - if (activity instanceof FileDisplayActivity) { + Activity activity = getActivity(); + if (activity != null) { + if (activity instanceof FileDisplayActivity) { + if (isBackPressed && TextUtils.isEmpty(query)) { FileDisplayActivity fileDisplayActivity = (FileDisplayActivity) activity; fileDisplayActivity.resetSearchView(); fileDisplayActivity.updateListOfFilesFragment(true); - } else if (activity instanceof UploadFilesActivity) { - LocalFileListAdapter localFileListAdapter = (LocalFileListAdapter) adapter; - localFileListAdapter.filter(query); - } else if (activity instanceof FolderPickerActivity) { - ((FolderPickerActivity) activity).refreshListOfFilesFragment(true); + } else { + handler.post(() -> { + if (adapter instanceof OCFileListAdapter) { + EventBus.getDefault().post(new SearchEvent(query, + SearchRemoteOperation.SearchType.FILE_SEARCH, + SearchEvent.UnsetType.NO_UNSET)); + } else if (adapter instanceof LocalFileListAdapter) { + LocalFileListAdapter localFileListAdapter = (LocalFileListAdapter) adapter; + localFileListAdapter.filter(query); + } + }); + + if (searchView != null) { + searchView.clearFocus(); + } } + } else if (activity instanceof UploadFilesActivity) { + LocalFileListAdapter localFileListAdapter = (LocalFileListAdapter) adapter; + localFileListAdapter.filter(query); + } else if (activity instanceof FolderPickerActivity) { + ((FolderPickerActivity) activity).refreshListOfFilesFragment(true); } } } From 938e4a6f44f0af34892a1127d5eeb8bedd895746 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kilian=20Pe=CC=81risset?= Date: Wed, 22 Jan 2020 18:58:43 +0100 Subject: [PATCH 2/8] Added translations to prepare pre-search + Fixed fab bug --- .../ui/fragment/ExtendedListFragment.java | 19 +++---------------- src/main/res/values-de/strings.xml | 1 + src/main/res/values-es/strings.xml | 5 +---- src/main/res/values-fr/strings.xml | 16 +++++++--------- src/main/res/values-it/strings.xml | 1 + src/main/res/values/strings.xml | 1 + 6 files changed, 14 insertions(+), 29 deletions(-) diff --git a/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java b/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java index 573429fe18..65551a52ca 100644 --- a/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java +++ b/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java @@ -49,7 +49,6 @@ import android.view.inputmethod.InputMethodManager; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.GridView; -import android.widget.ImageButton; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ProgressBar; @@ -62,7 +61,6 @@ import com.nextcloud.client.preferences.AppPreferences; import com.nextcloud.client.preferences.AppPreferencesImpl; import com.owncloud.android.MainApp; import com.owncloud.android.R; -import com.owncloud.android.datamodel.OCFile; import com.owncloud.android.lib.common.utils.Log_OC; import com.owncloud.android.lib.resources.files.SearchRemoteOperation; import com.owncloud.android.ui.EmptyRecyclerView; @@ -221,30 +219,23 @@ public class ExtendedListFragment extends Fragment implements } } - searchView.setOnQueryTextFocusChangeListener((v, hasFocus) -> handler.postDelayed(() -> { + searchView.setOnQueryTextFocusChangeListener((v, hasFocus) -> handler.postDelayed(() -> { if (getActivity() != null && !(getActivity() instanceof FolderPickerActivity) && !(getActivity() instanceof UploadFilesActivity)) { - setFabVisible(false); + setFabVisible(!hasFocus); } }, 100)); - // On close -> empty field, show keyboard and closeButton.setOnClickListener(view -> { searchView.setQuery("", true); searchView.onActionViewExpanded(); theTextArea.requestFocus(); - InputMethodManager inputMethodManager = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE); - if (inputMethodManager != null) { - inputMethodManager.showSoftInput(searchView, - InputMethodManager.SHOW_FORCED); -/* inputMethodManager.toggleSoftInputFromWindow( - searchView.getApplicationWindowToken(), - InputMethodManager.SHOW_FORCED, 0);*/ + inputMethodManager.showSoftInput(searchView, InputMethodManager.SHOW_FORCED); } }); @@ -316,7 +307,6 @@ public class ExtendedListFragment extends Fragment implements public void performSearch(final String query, boolean isBackPressed) { handler.removeCallbacksAndMessages(null); RecyclerView.Adapter adapter = getRecyclerView().getAdapter(); - Activity activity = getActivity(); if (activity != null) { if (activity instanceof FileDisplayActivity) { @@ -336,9 +326,6 @@ public class ExtendedListFragment extends Fragment implements } }); - if (searchView != null) { - searchView.clearFocus(); - } } } else if (activity instanceof UploadFilesActivity) { LocalFileListAdapter localFileListAdapter = (LocalFileListAdapter) adapter; diff --git a/src/main/res/values-de/strings.xml b/src/main/res/values-de/strings.xml index b0107d0b00..a7ccca4f18 100644 --- a/src/main/res/values-de/strings.xml +++ b/src/main/res/values-de/strings.xml @@ -555,6 +555,7 @@ ihrer Fotos & Videos Kalender & Kontakte Synchronisiere mit DAVx5 + Eine Datei suchen (mindestens 2 Zeichen) Nutzer und Gruppen suchen Alle auswählen Vorlage auswählen diff --git a/src/main/res/values-es/strings.xml b/src/main/res/values-es/strings.xml index 4780da45f3..1544d441a8 100644 --- a/src/main/res/values-es/strings.xml +++ b/src/main/res/values-es/strings.xml @@ -473,9 +473,7 @@ movido a la carpeta de la app Agregar cuenta Sincronizar calendario y contactos - DAVx5 (antes conocido como DAVdroid) no ha podido resolver la dirección del servidor para la cuenta. Ni F-Droid ni Google Play están instalados - Configurar DAVx5 (antes conocido como DAVdroid) (v1.3.0+) para la cuenta actual Sincronización de calendario y contactos configurada Acerca de Detalles @@ -554,7 +552,7 @@ Subida automática para sus fotos & vídeos Calendario y contactos - Sincronizar con DAVx5 + Buscar archivo (mínimo 2 caracteres) Buscar usuarios y grupos Seleccionar todo Escoge plantilla @@ -657,7 +655,6 @@ Películas Música Imágenes - La plataforma autoalojada de productividad que te entrega el control.\n\nCaracterísticas:\n* Interfaz sencilla y modernal, adaptada al tema de tu servidor\n* Subida de archivos a tu servidor Nextcloud\n*Compártelos con otros\n*Mantén sincronizados tus archivos y carpetas favoritos\n*Búsqueda en todas las carpetas de tu servidor\n*Subida autoática para fotos y vídeos hechos con tu dispositivo\n*Manténte informado con notificaciones\n*Soporte de múltiples cuentas\n* Acceso seguro a tus datos con huella dactilar o PIN\n*Integración con DAVx5 (antes conocido como DAVdroid) para configurar fácilmente la sincronización de calendarios y contactos\n\nPor favor, informa de todos los problemas en https://github.com/nextcloud/android/issues y habla de esta app en https://help.nextcloud.com/c/clients/android\n\n¿Nuevo en Nextcloud? Nextcloud es un servidor privado de sincronización de archivos, para compartir y comunicarse. Es software libre y puedes alojarlo tú mismo o pagar a una compañía para que lo haga por ti. De esta forma, tú controlas tus fotos, tus datos de calendario y contactos, tus documentos y todo lo demás.\n\nDescubre Nextcloud en https://nextcloud.com La plataforma de productividad autoalojada que te mantiene al mando.\nEsta es la versión oficial de desarrollo, que incluye una muestra diaria de cualquier funcionalidad sin probar, lo que puede causar inestabilidad y pérdida de datos. Esta app es para usuarios que desean probar, e informar de los fallos que ocurran. ¡No la uses para tu trabajo productivo!\n\nTanto la versión normal como la oficial de desarrollo están disponibles en F-Droid y pueden estar instaladas al mismo tiempo. La plataforma de productividad autoalojada que te mantiene al mando La plataforma de productividad autoalojada que te mantiene al mando (versión de prueba para desarrolladores) diff --git a/src/main/res/values-fr/strings.xml b/src/main/res/values-fr/strings.xml index 08698f14cc..56b992bbc3 100644 --- a/src/main/res/values-fr/strings.xml +++ b/src/main/res/values-fr/strings.xml @@ -1,5 +1,5 @@ - + Application Android %1$s À propos de version %1$s @@ -307,7 +307,7 @@ Attention la suppression est irréversible. Nettoyage… Mise à jour du chemin de stockage Le dossier de données existe déjà. Choisissez une des options suivantes : - Le dossier Nextcloud existe déjà + Le dossier Infomaniak Drive existe déjà De l\'espace suplémentaire est nécessaire Impossible de lire le fichier source Le fichier de destination n\'est pas modifiable @@ -337,7 +337,7 @@ Attention la suppression est irréversible. Caractères interdits : / \\ < > : \" | ? * Le nom du fichier contient au moins un caractère invalide Nom du fichier - Il s\'agit d\'une fonctionnalité de Nextcloud, merci de mettre à jour. + Il s\'agit d\'une fonctionnalité d\'Infomaniak Drive, merci de mettre à jour. Sécurisez et contrôlez vos données Collaboration & et échange de fichiers sécurisés Messagerie web, Agenda et Contacts faciles d\'utilisation @@ -474,10 +474,8 @@ Attention la suppression est irréversible. conservé dans le dossier original déplacé vers le dossier de l\'application Ajouter un compte - Synchroniser les contacts du calendrier& - L\'adresse du serveur pour le compte n\'a pas pu être résolu pour DAVx5 (autrefois connu comme DAVdroid) + Synchroniser les contacts du calendrier Ni Google Play Store ou F-Droid ne sont installés - Configurer DAVx5 (autrefois connu comme DAVdroid) (v1.3.0+) pour le compte actuel Synchronisation de l\'agenda & des contacts configurée À propos Préférences @@ -556,7 +554,7 @@ Attention la suppression est irréversible. Téléversement automatique pour vos photos & vidéos Agenda & Contacts - Synchroniser avec DAVx5 + Rechercher un fichier (2 caractères minimum) Rechercher parmi les utilisateurs et groupes Tout sélectionner Sélectionnez un modèle @@ -617,7 +615,7 @@ Attention la suppression est irréversible. Partagé avec vous par %1$s L\'ajout du partage a échoué Se connecter avec un fournisseur - Autoriser %1$s à accéder à votre compte Nextcloud %2$s ? + Autoriser %1$s à accéder à votre compte Infomaniak Drive %2$s ? Trier par Le plus récent en premier Le plus ancien en premier @@ -659,7 +657,6 @@ Attention la suppression est irréversible. Vidéos Musique Images - La plateforme de productivité auto-hébergée qui vous redonne le contrôle.\n\nFonctionalités: \n* Intuitif, interface moderne, adaptée au thème de votre serveur.\n* Envoyez des fichiers sur votre serveur Nextcloud\n* Partagez avec d\'autres personnes\n* Gardez vos fichiers et dossiers préférés synchronisés\n* Recherchez dans tous les dossiers de votre serveur\n* Envoi automatique des photos et vidéos prises par votre appareil\n* Restez à jour avec les notifications\n* Supporte plusieurs comptes simultanément\n* Accès sécurisé avec votre empreinte digitale ou un PIN\n* Intégration avec DAVx5 (ancien nom : DAVdroid) pour configurer facilement l\'agenda&et synchroniser les contacts\n\nMerci de signaler les problèmes sur https://github.com/nextcloud/android/issues et discutez ce cette application sur https://help.nextcloud.com/c/clients/android\n\nNouveau sur Nextcloud? Nextcloud est un serveur privé de synchronisation de fichiers&de partage et de communications. C\'est un logiciel libre, et vous pouvez l\'héberger vous même ou payer une entreprise pour le faire à votre place. De cette façon, vous avez le contrôle de vos photos, votre agenda et vos données de contacts, vos documents et tout le reste.\n\nApprenez en plus sur Nextcloud sur https://nextcloud.com La plateforme de productivité auto-hébergée qui vous permet de garder le contrôle.\nCeci est la version officielle de développement, qui présente chaque jour quelques-unes des fonctionnalités non-testées les plus récentes, causant parfois des instabilités ou des pertes de données. Cette application s\'adresse aux utilisateurs volontaires souhaitant tester et rapporter les problèmes qui peuvent arriver. Ne l\'utilisez jamais pour un environnement de production!\n\nLes versions officielles et en développement sont disponibles sur F-droid, et peuvent être utilisées en même temps. La plateforme de productivité auto-hébergée qui vous permet de garder le contrôle La plateforme de productivité auto-hébergée qui vous permet de garder le contrôle (version de développement en démonstration) @@ -823,4 +820,5 @@ Attention la suppression est irréversible. %d sélectionné %d sélectionnés + diff --git a/src/main/res/values-it/strings.xml b/src/main/res/values-it/strings.xml index 67d55dcb31..3a9f2cddae 100644 --- a/src/main/res/values-it/strings.xml +++ b/src/main/res/values-it/strings.xml @@ -555,6 +555,7 @@ per e tue foto e i video Calendario e contatti Sincronizza con DAVx5 + Cerca file (minimo 2 caratteri) Cerca utenti e gruppi Seleziona tutto Seleziona modello diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index d95d86704b..533f8fd506 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -523,6 +523,7 @@ Awaiting charge Search + Search for file (minimum 2 characters) This is a Nextcloud feature, please upgrade. Learn more Auto upload From 579140b7c4835675203d0d7f2e18d0a6f195f653 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kilian=20Pe=CC=81risset?= Date: Thu, 23 Jan 2020 15:54:09 +0100 Subject: [PATCH 3/8] Cleaned a bit the code + Fixed cross display bug --- .../ui/activity/FileDisplayActivity.java | 18 +++++------------- .../ui/fragment/ExtendedListFragment.java | 15 ++++++++------- 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java b/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java index c60716660c..2dfbe64333 100644 --- a/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java +++ b/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java @@ -790,13 +790,10 @@ public class FileDisplayActivity extends FileActivity //focus the SearchView if (!TextUtils.isEmpty(searchQuery)) { - searchView.post(new Runnable() { - @Override - public void run() { - searchView.setIconified(false); - searchView.setQuery(searchQuery, true); - searchView.clearFocus(); - } + searchView.post(() -> { + searchView.setIconified(false); + searchView.setQuery(searchQuery, true); + searchView.clearFocus(); }); } @@ -815,12 +812,7 @@ public class FileDisplayActivity extends FileActivity getListOfFilesFragment().refreshDirectory(); } } else { - searchView.post(new Runnable() { - @Override - public void run() { - searchView.setQuery("", true); - } - }); + searchView.post(() -> searchView.setQuery("", true)); } return true; }); diff --git a/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java b/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java index 65551a52ca..9c090a2cbf 100644 --- a/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java +++ b/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java @@ -219,23 +219,26 @@ public class ExtendedListFragment extends Fragment implements } } - searchView.setOnQueryTextFocusChangeListener((v, hasFocus) -> handler.postDelayed(() -> { + searchView.setOnQueryTextFocusChangeListener((v, hasFocus) -> handler.post(() -> { if (getActivity() != null && !(getActivity() instanceof FolderPickerActivity) && !(getActivity() instanceof UploadFilesActivity)) { setFabVisible(!hasFocus); + if (TextUtils.isEmpty(searchView.getQuery())) { + closeButton.setVisibility(View.INVISIBLE); + } } - }, 100)); + })); closeButton.setOnClickListener(view -> { searchView.setQuery("", true); + searchView.requestFocus(); searchView.onActionViewExpanded(); - theTextArea.requestFocus(); InputMethodManager inputMethodManager = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE); if (inputMethodManager != null) { - inputMethodManager.showSoftInput(searchView, InputMethodManager.SHOW_FORCED); + inputMethodManager.showSoftInput(searchView, InputMethodManager.SHOW_IMPLICIT); } }); @@ -282,11 +285,9 @@ public class ExtendedListFragment extends Fragment implements public boolean onQueryTextChange(final String query) { // After 300 ms, set the query - + closeButton.setVisibility(View.VISIBLE); if (query.isEmpty()) { closeButton.setVisibility(View.INVISIBLE); - } else { - closeButton.setVisibility(View.VISIBLE); } if (getFragmentManager() != null && getFragmentManager(). From 00e3ce6217b7e855f864ead23e47bede652e1b01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kilian=20Pe=CC=81risset?= Date: Fri, 31 Jan 2020 14:54:11 +0100 Subject: [PATCH 4/8] Removed translations (unneeded for this fix branch) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 938e4a6f44f0af34892a1127d5eeb8bedd895746. Signed-off-by: Kilian Périsset --- gradle.properties | 1 + .../ui/fragment/ExtendedListFragment.java | 6 ++++++ src/main/res/values-de/strings.xml | 1 - src/main/res/values-es/strings.xml | 5 ++++- src/main/res/values-fr/strings.xml | 16 +++++++++------- src/main/res/values-it/strings.xml | 1 - src/main/res/values/strings.xml | 1 - 7 files changed, 20 insertions(+), 11 deletions(-) diff --git a/gradle.properties b/gradle.properties index 9dc90e1aa7..bf50260bbc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,3 +6,4 @@ android.enableJetifier=true android.useAndroidX=true android.debug.obsoleteApi=true +org.gradle.jvmargs=-Xmx2048M -XX\:MaxHeapSize\=32g diff --git a/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java b/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java index 9c090a2cbf..e007452804 100644 --- a/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java +++ b/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java @@ -49,6 +49,7 @@ import android.view.inputmethod.InputMethodManager; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.GridView; +import android.widget.ImageButton; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ProgressBar; @@ -61,6 +62,7 @@ import com.nextcloud.client.preferences.AppPreferences; import com.nextcloud.client.preferences.AppPreferencesImpl; import com.owncloud.android.MainApp; import com.owncloud.android.R; +import com.owncloud.android.datamodel.OCFile; import com.owncloud.android.lib.common.utils.Log_OC; import com.owncloud.android.lib.resources.files.SearchRemoteOperation; import com.owncloud.android.ui.EmptyRecyclerView; @@ -229,6 +231,7 @@ public class ExtendedListFragment extends Fragment implements } })); + // On close -> empty field, show keyboard and closeButton.setOnClickListener(view -> { searchView.setQuery("", true); searchView.requestFocus(); @@ -327,6 +330,9 @@ public class ExtendedListFragment extends Fragment implements } }); + if (searchView != null) { + searchView.clearFocus(); + } } } else if (activity instanceof UploadFilesActivity) { LocalFileListAdapter localFileListAdapter = (LocalFileListAdapter) adapter; diff --git a/src/main/res/values-de/strings.xml b/src/main/res/values-de/strings.xml index a7ccca4f18..b0107d0b00 100644 --- a/src/main/res/values-de/strings.xml +++ b/src/main/res/values-de/strings.xml @@ -555,7 +555,6 @@ ihrer Fotos & Videos Kalender & Kontakte Synchronisiere mit DAVx5 - Eine Datei suchen (mindestens 2 Zeichen) Nutzer und Gruppen suchen Alle auswählen Vorlage auswählen diff --git a/src/main/res/values-es/strings.xml b/src/main/res/values-es/strings.xml index 1544d441a8..4780da45f3 100644 --- a/src/main/res/values-es/strings.xml +++ b/src/main/res/values-es/strings.xml @@ -473,7 +473,9 @@ movido a la carpeta de la app Agregar cuenta Sincronizar calendario y contactos + DAVx5 (antes conocido como DAVdroid) no ha podido resolver la dirección del servidor para la cuenta. Ni F-Droid ni Google Play están instalados + Configurar DAVx5 (antes conocido como DAVdroid) (v1.3.0+) para la cuenta actual Sincronización de calendario y contactos configurada Acerca de Detalles @@ -552,7 +554,7 @@ Subida automática para sus fotos & vídeos Calendario y contactos - Buscar archivo (mínimo 2 caracteres) + Sincronizar con DAVx5 Buscar usuarios y grupos Seleccionar todo Escoge plantilla @@ -655,6 +657,7 @@ Películas Música Imágenes + La plataforma autoalojada de productividad que te entrega el control.\n\nCaracterísticas:\n* Interfaz sencilla y modernal, adaptada al tema de tu servidor\n* Subida de archivos a tu servidor Nextcloud\n*Compártelos con otros\n*Mantén sincronizados tus archivos y carpetas favoritos\n*Búsqueda en todas las carpetas de tu servidor\n*Subida autoática para fotos y vídeos hechos con tu dispositivo\n*Manténte informado con notificaciones\n*Soporte de múltiples cuentas\n* Acceso seguro a tus datos con huella dactilar o PIN\n*Integración con DAVx5 (antes conocido como DAVdroid) para configurar fácilmente la sincronización de calendarios y contactos\n\nPor favor, informa de todos los problemas en https://github.com/nextcloud/android/issues y habla de esta app en https://help.nextcloud.com/c/clients/android\n\n¿Nuevo en Nextcloud? Nextcloud es un servidor privado de sincronización de archivos, para compartir y comunicarse. Es software libre y puedes alojarlo tú mismo o pagar a una compañía para que lo haga por ti. De esta forma, tú controlas tus fotos, tus datos de calendario y contactos, tus documentos y todo lo demás.\n\nDescubre Nextcloud en https://nextcloud.com La plataforma de productividad autoalojada que te mantiene al mando.\nEsta es la versión oficial de desarrollo, que incluye una muestra diaria de cualquier funcionalidad sin probar, lo que puede causar inestabilidad y pérdida de datos. Esta app es para usuarios que desean probar, e informar de los fallos que ocurran. ¡No la uses para tu trabajo productivo!\n\nTanto la versión normal como la oficial de desarrollo están disponibles en F-Droid y pueden estar instaladas al mismo tiempo. La plataforma de productividad autoalojada que te mantiene al mando La plataforma de productividad autoalojada que te mantiene al mando (versión de prueba para desarrolladores) diff --git a/src/main/res/values-fr/strings.xml b/src/main/res/values-fr/strings.xml index 56b992bbc3..08698f14cc 100644 --- a/src/main/res/values-fr/strings.xml +++ b/src/main/res/values-fr/strings.xml @@ -1,5 +1,5 @@ - + Application Android %1$s À propos de version %1$s @@ -307,7 +307,7 @@ Attention la suppression est irréversible. Nettoyage… Mise à jour du chemin de stockage Le dossier de données existe déjà. Choisissez une des options suivantes : - Le dossier Infomaniak Drive existe déjà + Le dossier Nextcloud existe déjà De l\'espace suplémentaire est nécessaire Impossible de lire le fichier source Le fichier de destination n\'est pas modifiable @@ -337,7 +337,7 @@ Attention la suppression est irréversible. Caractères interdits : / \\ < > : \" | ? * Le nom du fichier contient au moins un caractère invalide Nom du fichier - Il s\'agit d\'une fonctionnalité d\'Infomaniak Drive, merci de mettre à jour. + Il s\'agit d\'une fonctionnalité de Nextcloud, merci de mettre à jour. Sécurisez et contrôlez vos données Collaboration & et échange de fichiers sécurisés Messagerie web, Agenda et Contacts faciles d\'utilisation @@ -474,8 +474,10 @@ Attention la suppression est irréversible. conservé dans le dossier original déplacé vers le dossier de l\'application Ajouter un compte - Synchroniser les contacts du calendrier + Synchroniser les contacts du calendrier& + L\'adresse du serveur pour le compte n\'a pas pu être résolu pour DAVx5 (autrefois connu comme DAVdroid) Ni Google Play Store ou F-Droid ne sont installés + Configurer DAVx5 (autrefois connu comme DAVdroid) (v1.3.0+) pour le compte actuel Synchronisation de l\'agenda & des contacts configurée À propos Préférences @@ -554,7 +556,7 @@ Attention la suppression est irréversible. Téléversement automatique pour vos photos & vidéos Agenda & Contacts - Rechercher un fichier (2 caractères minimum) + Synchroniser avec DAVx5 Rechercher parmi les utilisateurs et groupes Tout sélectionner Sélectionnez un modèle @@ -615,7 +617,7 @@ Attention la suppression est irréversible. Partagé avec vous par %1$s L\'ajout du partage a échoué Se connecter avec un fournisseur - Autoriser %1$s à accéder à votre compte Infomaniak Drive %2$s ? + Autoriser %1$s à accéder à votre compte Nextcloud %2$s ? Trier par Le plus récent en premier Le plus ancien en premier @@ -657,6 +659,7 @@ Attention la suppression est irréversible. Vidéos Musique Images + La plateforme de productivité auto-hébergée qui vous redonne le contrôle.\n\nFonctionalités: \n* Intuitif, interface moderne, adaptée au thème de votre serveur.\n* Envoyez des fichiers sur votre serveur Nextcloud\n* Partagez avec d\'autres personnes\n* Gardez vos fichiers et dossiers préférés synchronisés\n* Recherchez dans tous les dossiers de votre serveur\n* Envoi automatique des photos et vidéos prises par votre appareil\n* Restez à jour avec les notifications\n* Supporte plusieurs comptes simultanément\n* Accès sécurisé avec votre empreinte digitale ou un PIN\n* Intégration avec DAVx5 (ancien nom : DAVdroid) pour configurer facilement l\'agenda&et synchroniser les contacts\n\nMerci de signaler les problèmes sur https://github.com/nextcloud/android/issues et discutez ce cette application sur https://help.nextcloud.com/c/clients/android\n\nNouveau sur Nextcloud? Nextcloud est un serveur privé de synchronisation de fichiers&de partage et de communications. C\'est un logiciel libre, et vous pouvez l\'héberger vous même ou payer une entreprise pour le faire à votre place. De cette façon, vous avez le contrôle de vos photos, votre agenda et vos données de contacts, vos documents et tout le reste.\n\nApprenez en plus sur Nextcloud sur https://nextcloud.com La plateforme de productivité auto-hébergée qui vous permet de garder le contrôle.\nCeci est la version officielle de développement, qui présente chaque jour quelques-unes des fonctionnalités non-testées les plus récentes, causant parfois des instabilités ou des pertes de données. Cette application s\'adresse aux utilisateurs volontaires souhaitant tester et rapporter les problèmes qui peuvent arriver. Ne l\'utilisez jamais pour un environnement de production!\n\nLes versions officielles et en développement sont disponibles sur F-droid, et peuvent être utilisées en même temps. La plateforme de productivité auto-hébergée qui vous permet de garder le contrôle La plateforme de productivité auto-hébergée qui vous permet de garder le contrôle (version de développement en démonstration) @@ -820,5 +823,4 @@ Attention la suppression est irréversible. %d sélectionné %d sélectionnés - diff --git a/src/main/res/values-it/strings.xml b/src/main/res/values-it/strings.xml index 3a9f2cddae..67d55dcb31 100644 --- a/src/main/res/values-it/strings.xml +++ b/src/main/res/values-it/strings.xml @@ -555,7 +555,6 @@ per e tue foto e i video Calendario e contatti Sincronizza con DAVx5 - Cerca file (minimo 2 caratteri) Cerca utenti e gruppi Seleziona tutto Seleziona modello diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index 533f8fd506..d95d86704b 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -523,7 +523,6 @@ Awaiting charge Search - Search for file (minimum 2 characters) This is a Nextcloud feature, please upgrade. Learn more Auto upload From 4ec55ea6771071979338a529e47d7e08dde993d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kilian=20Pe=CC=81risset?= Date: Fri, 31 Jan 2020 14:55:06 +0100 Subject: [PATCH 5/8] Removed gradle heap-size property (fail) --- gradle.properties | 2 -- 1 file changed, 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index bf50260bbc..e22ec2e3f2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,5 +5,3 @@ NC_TEST_SERVER_PASSWORD=test android.enableJetifier=true android.useAndroidX=true android.debug.obsoleteApi=true - -org.gradle.jvmargs=-Xmx2048M -XX\:MaxHeapSize\=32g From badc7c92da460ecfecb5959189192f7f6987821b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kilian=20Pe=CC=81risset?= Date: Fri, 31 Jan 2020 14:59:54 +0100 Subject: [PATCH 6/8] Formated the code of ExtendedListFragment.java (In order to avoid issues) --- .../ui/fragment/ExtendedListFragment.java | 61 +++++++++---------- 1 file changed, 29 insertions(+), 32 deletions(-) diff --git a/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java b/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java index e007452804..2d466a7d64 100644 --- a/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java +++ b/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java @@ -49,7 +49,6 @@ import android.view.inputmethod.InputMethodManager; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.GridView; -import android.widget.ImageButton; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ProgressBar; @@ -62,7 +61,6 @@ import com.nextcloud.client.preferences.AppPreferences; import com.nextcloud.client.preferences.AppPreferencesImpl; import com.owncloud.android.MainApp; import com.owncloud.android.R; -import com.owncloud.android.datamodel.OCFile; import com.owncloud.android.lib.common.utils.Log_OC; import com.owncloud.android.lib.resources.files.SearchRemoteOperation; import com.owncloud.android.ui.EmptyRecyclerView; @@ -94,11 +92,11 @@ import androidx.recyclerview.widget.RecyclerView; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; public class ExtendedListFragment extends Fragment implements - OnItemClickListener, - OnEnforceableRefreshListener, - SearchView.OnQueryTextListener, - SearchView.OnCloseListener, - Injectable { + OnItemClickListener, + OnEnforceableRefreshListener, + SearchView.OnQueryTextListener, + SearchView.OnCloseListener, + Injectable { protected static final String TAG = ExtendedListFragment.class.getSimpleName(); @@ -294,7 +292,7 @@ public class ExtendedListFragment extends Fragment implements } if (getFragmentManager() != null && getFragmentManager(). - findFragmentByTag(FileDisplayActivity.TAG_SECOND_FRAGMENT) instanceof ExtendedListFragment) { + findFragmentByTag(FileDisplayActivity.TAG_SECOND_FRAGMENT) instanceof ExtendedListFragment) { performSearch(query, false); return true; } else { @@ -371,7 +369,7 @@ public class ExtendedListFragment extends Fragment implements mScale = preferences.getGridColumns(); setGridViewColumns(1f); - mScaleGestureDetector = new ScaleGestureDetector(MainApp.getAppContext(),new ScaleListener()); + mScaleGestureDetector = new ScaleGestureDetector(MainApp.getAppContext(), new ScaleListener()); getRecyclerView().setOnTouchListener((view, motionEvent) -> { mScaleGestureDetector.onTouchEvent(motionEvent); @@ -494,7 +492,7 @@ public class ExtendedListFragment extends Fragment implements int top = mTops.remove(mTops.size() - 1); Log_OC.v(TAG, "Setting selection to position: " + firstPosition + "; top: " - + top + "; index: " + index); + + top + "; index: " + index); scrollToPosition(firstPosition); } @@ -505,7 +503,7 @@ public class ExtendedListFragment extends Fragment implements if (mRecyclerView != null) { int visibleItemCount = linearLayoutManager.findLastCompletelyVisibleItemPosition() - - linearLayoutManager.findFirstCompletelyVisibleItemPosition(); + linearLayoutManager.findFirstCompletelyVisibleItemPosition(); linearLayoutManager.scrollToPositionWithOffset(position, (visibleItemCount / 2) * mHeightCell); } } @@ -581,7 +579,7 @@ public class ExtendedListFragment extends Fragment implements /** * Sets the 'visibility' state of the FAB contained in the fragment. - * + *

* When 'false' is set, FAB visibility is set to View.GONE programmatically. * * @param visible Desired visibility for the FAB. @@ -601,7 +599,7 @@ public class ExtendedListFragment extends Fragment implements /** * Sets the 'visibility' state of the FAB contained in the fragment. - * + *

* When 'false' is set, FAB is greyed out * * @param enabled Desired visibility for the FAB. @@ -624,8 +622,7 @@ public class ExtendedListFragment extends Fragment implements } /** - /** - * Set message for empty list view. + * /** Set message for empty list view. */ public void setMessageForEmptyList(String message) { if (mEmptyListContainer != null && mEmptyListMessage != null) { @@ -687,50 +684,50 @@ public class ExtendedListFragment extends Fragment implements if (searchType == SearchType.NO_SEARCH) { setMessageForEmptyList( - R.string.file_list_empty_headline, - R.string.file_list_empty, - R.drawable.ic_list_empty_folder, - true + R.string.file_list_empty_headline, + R.string.file_list_empty, + R.drawable.ic_list_empty_folder, + true ); } else if (searchType == SearchType.FILE_SEARCH) { setMessageForEmptyList(R.string.file_list_empty_headline_server_search, - R.string.file_list_empty, R.drawable.ic_search_light_grey); + R.string.file_list_empty, R.drawable.ic_search_light_grey); } else if (searchType == SearchType.FAVORITE_SEARCH) { setMessageForEmptyList(R.string.file_list_empty_favorite_headline, - R.string.file_list_empty_favorites_filter_list, R.drawable.ic_star_light_yellow); + R.string.file_list_empty_favorites_filter_list, R.drawable.ic_star_light_yellow); } else if (searchType == SearchType.VIDEO_SEARCH) { setMessageForEmptyList(R.string.file_list_empty_headline_server_search_videos, - R.string.file_list_empty_text_videos, R.drawable.ic_list_empty_video); + R.string.file_list_empty_text_videos, R.drawable.ic_list_empty_video); } else if (searchType == SearchType.PHOTO_SEARCH) { setMessageForEmptyList(R.string.file_list_empty_headline_server_search_photos, - R.string.file_list_empty_text_photos, R.drawable.ic_list_empty_image); + R.string.file_list_empty_text_photos, R.drawable.ic_list_empty_image); } else if (searchType == SearchType.RECENTLY_MODIFIED_SEARCH) { setMessageForEmptyList(R.string.file_list_empty_headline_server_search, - R.string.file_list_empty_recently_modified, R.drawable.ic_list_empty_recent); + R.string.file_list_empty_recently_modified, R.drawable.ic_list_empty_recent); } else if (searchType == SearchType.RECENTLY_ADDED_SEARCH) { setMessageForEmptyList(R.string.file_list_empty_headline_server_search, - R.string.file_list_empty_recently_added, R.drawable.ic_list_empty_recent); + R.string.file_list_empty_recently_added, R.drawable.ic_list_empty_recent); } else if (searchType == SearchType.REGULAR_FILTER) { setMessageForEmptyList(R.string.file_list_empty_headline_search, - R.string.file_list_empty_search, R.drawable.ic_search_light_grey); + R.string.file_list_empty_search, R.drawable.ic_search_light_grey); } else if (searchType == SearchType.FAVORITE_SEARCH_FILTER) { setMessageForEmptyList(R.string.file_list_empty_headline_server_search, - R.string.file_list_empty_favorites_filter, R.drawable.ic_star_light_yellow); + R.string.file_list_empty_favorites_filter, R.drawable.ic_star_light_yellow); } else if (searchType == SearchType.VIDEO_SEARCH_FILTER) { setMessageForEmptyList(R.string.file_list_empty_headline_server_search_videos, - R.string.file_list_empty_text_videos_filter, R.drawable.ic_list_empty_video); + R.string.file_list_empty_text_videos_filter, R.drawable.ic_list_empty_video); } else if (searchType == SearchType.PHOTOS_SEARCH_FILTER) { setMessageForEmptyList(R.string.file_list_empty_headline_server_search_photos, - R.string.file_list_empty_text_photos_filter, R.drawable.ic_list_empty_image); + R.string.file_list_empty_text_photos_filter, R.drawable.ic_list_empty_image); } else if (searchType == SearchType.RECENTLY_MODIFIED_SEARCH_FILTER) { setMessageForEmptyList(R.string.file_list_empty_headline_server_search, - R.string.file_list_empty_recently_modified_filter, R.drawable.ic_list_empty_recent); + R.string.file_list_empty_recently_modified_filter, R.drawable.ic_list_empty_recent); } else if (searchType == SearchType.RECENTLY_ADDED_SEARCH_FILTER) { setMessageForEmptyList(R.string.file_list_empty_headline_server_search, - R.string.file_list_empty_recently_added_filter, R.drawable.ic_list_empty_recent); + R.string.file_list_empty_recently_added_filter, R.drawable.ic_list_empty_recent); } else if (searchType == SearchType.SHARED_FILTER) { setMessageForEmptyList(R.string.file_list_empty_shared_headline, - R.string.file_list_empty_shared, R.drawable.ic_list_empty_shared); + R.string.file_list_empty_shared, R.drawable.ic_list_empty_shared); } } }); From f794f230b54f26b48fd0b28729432c864888a999 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Tue, 4 Feb 2020 09:36:40 +0100 Subject: [PATCH 7/8] formatting Signed-off-by: tobiasKaminsky --- .../ui/fragment/ExtendedListFragment.java | 39 ++++++++++++------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java b/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java index 2d466a7d64..ba23592a82 100644 --- a/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java +++ b/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java @@ -691,43 +691,56 @@ public class ExtendedListFragment extends Fragment implements ); } else if (searchType == SearchType.FILE_SEARCH) { setMessageForEmptyList(R.string.file_list_empty_headline_server_search, - R.string.file_list_empty, R.drawable.ic_search_light_grey); + R.string.file_list_empty, + R.drawable.ic_search_light_grey); } else if (searchType == SearchType.FAVORITE_SEARCH) { setMessageForEmptyList(R.string.file_list_empty_favorite_headline, - R.string.file_list_empty_favorites_filter_list, R.drawable.ic_star_light_yellow); + R.string.file_list_empty_favorites_filter_list, + R.drawable.ic_star_light_yellow); } else if (searchType == SearchType.VIDEO_SEARCH) { setMessageForEmptyList(R.string.file_list_empty_headline_server_search_videos, - R.string.file_list_empty_text_videos, R.drawable.ic_list_empty_video); + R.string.file_list_empty_text_videos, + R.drawable.ic_list_empty_video); } else if (searchType == SearchType.PHOTO_SEARCH) { setMessageForEmptyList(R.string.file_list_empty_headline_server_search_photos, - R.string.file_list_empty_text_photos, R.drawable.ic_list_empty_image); + R.string.file_list_empty_text_photos, + R.drawable.ic_list_empty_image); } else if (searchType == SearchType.RECENTLY_MODIFIED_SEARCH) { setMessageForEmptyList(R.string.file_list_empty_headline_server_search, - R.string.file_list_empty_recently_modified, R.drawable.ic_list_empty_recent); + R.string.file_list_empty_recently_modified, + R.drawable.ic_list_empty_recent); } else if (searchType == SearchType.RECENTLY_ADDED_SEARCH) { setMessageForEmptyList(R.string.file_list_empty_headline_server_search, - R.string.file_list_empty_recently_added, R.drawable.ic_list_empty_recent); + R.string.file_list_empty_recently_added, + R.drawable.ic_list_empty_recent); } else if (searchType == SearchType.REGULAR_FILTER) { setMessageForEmptyList(R.string.file_list_empty_headline_search, - R.string.file_list_empty_search, R.drawable.ic_search_light_grey); + R.string.file_list_empty_search, + R.drawable.ic_search_light_grey); } else if (searchType == SearchType.FAVORITE_SEARCH_FILTER) { setMessageForEmptyList(R.string.file_list_empty_headline_server_search, - R.string.file_list_empty_favorites_filter, R.drawable.ic_star_light_yellow); + R.string.file_list_empty_favorites_filter, + R.drawable.ic_star_light_yellow); } else if (searchType == SearchType.VIDEO_SEARCH_FILTER) { setMessageForEmptyList(R.string.file_list_empty_headline_server_search_videos, - R.string.file_list_empty_text_videos_filter, R.drawable.ic_list_empty_video); + R.string.file_list_empty_text_videos_filter, + R.drawable.ic_list_empty_video); } else if (searchType == SearchType.PHOTOS_SEARCH_FILTER) { setMessageForEmptyList(R.string.file_list_empty_headline_server_search_photos, - R.string.file_list_empty_text_photos_filter, R.drawable.ic_list_empty_image); + R.string.file_list_empty_text_photos_filter, + R.drawable.ic_list_empty_image); } else if (searchType == SearchType.RECENTLY_MODIFIED_SEARCH_FILTER) { setMessageForEmptyList(R.string.file_list_empty_headline_server_search, - R.string.file_list_empty_recently_modified_filter, R.drawable.ic_list_empty_recent); + R.string.file_list_empty_recently_modified_filter, + R.drawable.ic_list_empty_recent); } else if (searchType == SearchType.RECENTLY_ADDED_SEARCH_FILTER) { setMessageForEmptyList(R.string.file_list_empty_headline_server_search, - R.string.file_list_empty_recently_added_filter, R.drawable.ic_list_empty_recent); + R.string.file_list_empty_recently_added_filter, + R.drawable.ic_list_empty_recent); } else if (searchType == SearchType.SHARED_FILTER) { setMessageForEmptyList(R.string.file_list_empty_shared_headline, - R.string.file_list_empty_shared, R.drawable.ic_list_empty_shared); + R.string.file_list_empty_shared, + R.drawable.ic_list_empty_shared); } } }); From 8184dbf1ff7247b1cc45e2b2dadf075806e56480 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kilian=20Pe=CC=81risset?= Date: Tue, 4 Feb 2020 18:20:31 +0100 Subject: [PATCH 8/8] Change variables accessibility --- .../owncloud/android/ui/fragment/ExtendedListFragment.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java b/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java index 2d466a7d64..444a534adc 100644 --- a/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java +++ b/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java @@ -136,8 +136,8 @@ public class ExtendedListFragment extends Fragment implements private EmptyRecyclerView mRecyclerView; - public SearchView searchView; - public ImageView closeButton; + protected SearchView searchView; + private ImageView closeButton; private Handler handler = new Handler(Looper.getMainLooper()); private float mScale = AppPreferencesImpl.DEFAULT_GRID_COLUMN;