From: David A. Velasco Date: Wed, 17 Oct 2012 17:22:40 +0000 (+0200) Subject: Added help text in background of empty files list X-Git-Tag: oc-android-1.4.3~146 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/d0f7de3ce01c71edcc6c5ed2c9cb95abe4377ef7?ds=inline;hp=-c Added help text in background of empty files list --- d0f7de3ce01c71edcc6c5ed2c9cb95abe4377ef7 diff --git a/res/layout/list_fragment.xml b/res/layout/list_fragment.xml new file mode 100644 index 00000000..4d7a2374 --- /dev/null +++ b/res/layout/list_fragment.xml @@ -0,0 +1,40 @@ + + + + + + + + + diff --git a/res/layout/list_item.xml b/res/layout/list_item.xml new file mode 100644 index 00000000..ddad38c1 --- /dev/null +++ b/res/layout/list_item.xml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/res/layout/list_layout.xml b/res/layout/list_layout.xml deleted file mode 100644 index ddad38c1..00000000 --- a/res/layout/list_layout.xml +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml index 3cb4c89f..45a23efc 100644 --- a/res/values-de/strings.xml +++ b/res/values-de/strings.xml @@ -15,7 +15,7 @@ Konto einrichten Auf Deinem Gerät sind keine ownCloud Konten eingerichtet. Bitte erstelle ein Konto, um diese App zu nutzen. Aktualisieren - Datei hochladen + Hochladen Inhalt von anderen Apps Dateien Verzeichnis erstellen @@ -62,6 +62,7 @@ ownCloud darf den geteilten Inhalt nicht nutzen. Lade hoch Verzeichnis für hochzuladene Dateien erstellen + Im ausgewählten Ordner befinden sich noch keine Dateien.\nÜber die Schaltfläche „Hochladen“ können neue Dateien hinzugefügt werden. Klicken Sie auf eine Datei für weitere Informationen. Größe: Art: @@ -80,9 +81,9 @@ Über Konto löschen Konto erstellen - Dateien hochladen von... + Dateien hochladen von… Verzeichnisname - Hochladen... + Hochladen… %1$d%% Hochladen %2$s Hochladen erfolgreich %1$s wurde(n) erfolgreich hochgeladen @@ -90,7 +91,7 @@ Hochladen fehlgeschlagen Hochladen von %1$s konnte nicht abgeschlossen werden Hochladen fehlgeschlagen: %1$d/%2$d Dateien wurden hochgeladen - Herunterladen... + Herunterladen… %1$d%% Herunterladen %2$s Herunterladen erfolgreich %1$s wurde erfolgreich heruntergeladen @@ -121,14 +122,14 @@ 30 60 - Anmeldungsversuch... + Anmeldungsversuch… Keine Netzwerkverbindung Es konnte keine Netzwerkverbindung gefunden werden, bitte überprüfe Deine Internetverbindung. Trotzdem verbinden Sichere Verbindung nicht verfügbar. Die App konnte keine sichere Verbindung zum Server herstellen. Eine nicht sichere Verbindung ist nichtsdestotrotz verfügbar. Möchtest Du fortfahren oder abbrechen? Verbindung hergestellt - Verbindung testen... + Verbindung testen… Falsch konfigurierte ownCloud Es scheint, als wäre Deine ownCloud-Installation nicht richtig konfiguriert. Bitte kontaktiere Deinen Administrator, um weitere Details zu erhalten. Ein unbekannter Fehler ist aufgetreten! diff --git a/res/values-es-rAR/strings.xml b/res/values-es-rAR/strings.xml index facd6a27..b8a5de87 100644 --- a/res/values-es-rAR/strings.xml +++ b/res/values-es-rAR/strings.xml @@ -62,6 +62,7 @@ ownCloud no está autorizado para acceder al contenido compartido Subiendo Crear directorio para subir + La carpeta seleccionada no contiene ningún archivo.\nPuede añadir ficheros con la opción de menú \"Subir\". Pulsá sobre un archivo para mostrar información adicional. Tamaño: Tipo: @@ -80,9 +81,9 @@ Acerca de Eliminar cuenta Crear cuenta - Subir desde ... + Subir desde … Nombre del directorio - Subiendo... + Subiendo… %1$d%% Subiendo %2$s Subido con éxito %1$s se ha subido con éxito @@ -90,7 +91,7 @@ Error al subir el archivo No se pudo completar la subida de %1$s Error al subir: %1$d/%2$d archivos fueron subidos - Descargando ... + Descargando … %1$d%% descargando %2$s Descarga completa %1$s fue descargado con éxito @@ -122,14 +123,14 @@ 30 60 - Intentado iniciar sesión... + Intentado iniciar sesión… Sin conexión de red No se ha detectado una conexión de red, revisá tu conexión a internet e intentá nuevamente. Conectar de todos modos Conexión segura no disponible. La aplicación no pudo establecer una conexión segura al servidor. Aunque no haya una conexión segura disponible, podés continuar o cancelar. Conexión establecida - Probando conexión... + Probando conexión… Configuración de ownCloud en formato incorrecto Parece ser que la instancia de ownCloud no está configurada correctamente. Comunicate con el administrador para más detalles. ¡Ocurrió un error desconocido! diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml index 2fc35d8f..785905c5 100644 --- a/res/values-es/strings.xml +++ b/res/values-es/strings.xml @@ -15,7 +15,7 @@ Configuración de cuenta No hay cuentas de ownCloud en tu dispositivo. Para usar esta aplicación, necesitas crear una. Sincronización de cuenta - Subir archivo + Subir Contenido de otras aplicaciones Archivos Crear directorio @@ -62,6 +62,7 @@ ownCloud no está autorizado para acceder al contenido compartido Enviando Crear directorio para envío + La carpeta seleccionada no contiene ningún archivo.\nPuede añadir ficheros con la opción de menú \"Subir\". Pulsa sobre un archivo para mostrar información adicional. Tamaño: Tipo: @@ -82,7 +83,7 @@ Crear cuenta Subir Nombre de directorio - Subiendo... + Subiendo… %1$d%% Subiendo %2$s Subido con éxito %1$s se ha subido con éxito @@ -90,7 +91,7 @@ Error en la subida La subida de %1$s no se pudo completar Error de subida: %1$d/%2$d archivos fueron cargados - Descargando ... + Descargando … %1$s Descargada de %2$s Descarga completa %1$s se ha descargado con éxito @@ -122,14 +123,14 @@ 30 60 - Intentado iniciar sesión... + Intentado iniciar sesión… Sin conexión de red No se ha detectado una conexión de red, chequea tu conexión a internet e intenta nuevamente. Conectar de todos modos Conexión segura no disponible. La aplicación no pudo establecer una conexión segura al servidor. Aunque no haya una conexión segura disponible, puedes continuar o cancelar. Conexión establecida - Probando conexión... + Probando conexión… Configuración de ownCloud en formato incorrecto Parece que tu instancia de ownCloud no está correctamente configurada. Contacta a tu administrador para más detalles. Ocurrió un error desconocido diff --git a/res/values/strings.xml b/res/values/strings.xml index f4b735a4..66931826 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -65,6 +65,7 @@ ownCloud is not allowed to access the shared content Uploading Create directory for upload + There are no files in this folder.\nNew files can be added with the \"Upload\" menu option. Tap on a file to display additional information. Size: Type: diff --git a/src/com/owncloud/android/ui/FragmentListView.java b/src/com/owncloud/android/ui/FragmentListView.java index 54ada01d..95292bb7 100644 --- a/src/com/owncloud/android/ui/FragmentListView.java +++ b/src/com/owncloud/android/ui/FragmentListView.java @@ -1,6 +1,8 @@ package com.owncloud.android.ui; import com.actionbarsherlock.app.SherlockFragment; +import com.owncloud.android.R; +import com.owncloud.android.ui.fragment.LocalFileListFragment; import android.os.Bundle; import android.view.LayoutInflater; @@ -33,10 +35,15 @@ public class FragmentListView extends SherlockFragment implements @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - mList = new ExtendedListView(getActivity()); + //mList = new ExtendedListView(getActivity()); + View v = inflater.inflate(R.layout.list_fragment, null); + mList = (ExtendedListView)(v.findViewById(R.id.list_root)); mList.setOnItemClickListener(this); mList.setOnItemLongClickListener(this); - return mList; + mList.setEmptyView(v.findViewById(R.id.empty_list_view)); + mList.setDivider(getResources().getDrawable(R.drawable.uploader_list_separator)); + mList.setDividerHeight(1); + return v; } public void onItemClick(AdapterView arg0, View arg1, int arg2, long arg3) { @@ -48,4 +55,28 @@ public class FragmentListView extends SherlockFragment implements return false; } + + /** + * 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 other position. + * + * THe current policy is take as a reference the visible item in the center of the screen. + * + * @return The position in the list of the visible item in the center of the screen. + */ + protected int getReferencePosition() { + return (mList.getFirstVisiblePosition() + mList.getLastVisiblePosition()) / 2; + } + + + /** + * Sets the visible part of the list from the reference position. + * + * @param position Reference position previously returned by {@link LocalFileListFragment#getReferencePosition()} + */ + protected void setReferencePosition(int position) { + mList.setAndCenterSelection(position); + } + + } diff --git a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java index 6519a666..33a6a694 100644 --- a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java +++ b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java @@ -187,11 +187,11 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST); actionBar.setListNavigationCallbacks(mDirectories, this); setSupportProgressBarIndeterminateVisibility(false); // always AFTER setContentView(...) ; to workaround bug in its implementation - + Log.d(getClass().toString(), "onCreate() end"); } - + /** * Launches the account creation activity. To use when no ownCloud account is available */ @@ -553,6 +553,7 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements try { pkg = getPackageManager().getPackageInfo(getPackageName(), 0); builder.setMessage("ownCloud android client\n\nversion: " + pkg.versionName ); + //builder.setMessage(String.format(getString(R.string.aboout_message), pkg.versionName)); builder.setIcon(android.R.drawable.ic_menu_info_details); dialog = builder.create(); } catch (NameNotFoundException e) { diff --git a/src/com/owncloud/android/ui/adapter/FileListListAdapter.java b/src/com/owncloud/android/ui/adapter/FileListListAdapter.java index 49fa7a0c..87172898 100644 --- a/src/com/owncloud/android/ui/adapter/FileListListAdapter.java +++ b/src/com/owncloud/android/ui/adapter/FileListListAdapter.java @@ -106,7 +106,7 @@ public class FileListListAdapter extends BaseAdapter implements ListAdapter { if (view == null) { LayoutInflater inflator = (LayoutInflater) mContext .getSystemService(Context.LAYOUT_INFLATER_SERVICE); - view = inflator.inflate(R.layout.list_layout, null); + view = inflator.inflate(R.layout.list_item, null); } if (mFiles != null && mFiles.size() > position) { OCFile file = mFiles.get(position); diff --git a/src/com/owncloud/android/ui/adapter/LocalFileListAdapter.java b/src/com/owncloud/android/ui/adapter/LocalFileListAdapter.java index d5db6489..82031542 100644 --- a/src/com/owncloud/android/ui/adapter/LocalFileListAdapter.java +++ b/src/com/owncloud/android/ui/adapter/LocalFileListAdapter.java @@ -90,7 +90,7 @@ public class LocalFileListAdapter extends BaseAdapter implements ListAdapter { if (view == null) { LayoutInflater inflator = (LayoutInflater) mContext .getSystemService(Context.LAYOUT_INFLATER_SERVICE); - view = inflator.inflate(R.layout.list_layout, null); + view = inflator.inflate(R.layout.list_item, null); } if (mFiles != null && mFiles.length > position) { File file = mFiles[position]; diff --git a/src/com/owncloud/android/ui/fragment/LocalFileListFragment.java b/src/com/owncloud/android/ui/fragment/LocalFileListFragment.java index 46775b98..9ff4564c 100644 --- a/src/com/owncloud/android/ui/fragment/LocalFileListFragment.java +++ b/src/com/owncloud/android/ui/fragment/LocalFileListFragment.java @@ -19,7 +19,6 @@ package com.owncloud.android.ui.fragment; import java.io.File; -import com.owncloud.android.ui.ExtendedListView; import com.owncloud.android.ui.FragmentListView; import com.owncloud.android.ui.adapter.LocalFileListAdapter; @@ -77,13 +76,10 @@ public class LocalFileListFragment extends FragmentListView { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { Log.i(TAG, "onCreateView() start"); - super.onCreateView(inflater, container, savedInstanceState); - getListView().setDivider(getResources().getDrawable(R.drawable.uploader_list_separator)); - getListView().setDividerHeight(1); + View v = super.onCreateView(inflater, container, savedInstanceState); getListView().setChoiceMode(ListView.CHOICE_MODE_MULTIPLE); - Log.i(TAG, "onCreateView() end"); - return getListView(); + return v; } @@ -120,29 +116,6 @@ public class LocalFileListFragment extends FragmentListView { /** - * 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 other position. - * - * THe current policy is take as a reference the visible item in the center of the screen. - * - * @return The position in the list of the visible item in the center of the screen. - */ - private int getReferencePosition() { - return (getListView().getFirstVisiblePosition() + getListView().getLastVisiblePosition()) / 2; - } - - - /** - * Sets the visible part of the list from the reference position. - * - * @param position Reference position previously returned by {@link LocalFileListFragment#getReferencePosition()} - */ - private void setReferencePosition(int position) { - ((ExtendedListView)getListView()).setAndCenterSelection(position); - } - - - /** * Checks the file clicked over. Browses inside if it is a directory. Notifies the container activity in any case. */ @Override diff --git a/src/com/owncloud/android/ui/fragment/OCFileListFragment.java b/src/com/owncloud/android/ui/fragment/OCFileListFragment.java index afac9551..e6f7b133 100644 --- a/src/com/owncloud/android/ui/fragment/OCFileListFragment.java +++ b/src/com/owncloud/android/ui/fragment/OCFileListFragment.java @@ -19,7 +19,6 @@ package com.owncloud.android.ui.fragment; import com.owncloud.android.datamodel.DataStorageManager; import com.owncloud.android.datamodel.OCFile; -import com.owncloud.android.ui.ExtendedListView; import com.owncloud.android.ui.FragmentListView; import com.owncloud.android.ui.activity.TransferServiceGetter; import com.owncloud.android.ui.adapter.FileListListAdapter; @@ -27,11 +26,8 @@ import com.owncloud.android.ui.adapter.FileListListAdapter; import android.app.Activity; import android.os.Bundle; import android.util.Log; -import android.view.LayoutInflater; import android.view.View; -import android.view.ViewGroup; import android.widget.AdapterView; -import com.owncloud.android.R; /** * A Fragment that lists all files and folders in a given path. @@ -67,22 +63,6 @@ public class OCFileListFragment extends FragmentListView { * {@inheritDoc} */ @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { - Log.i(TAG, "onCreateView() start"); - super.onCreateView(inflater, container, savedInstanceState); - getListView().setDivider(getResources().getDrawable(R.drawable.uploader_list_separator)); - getListView().setDividerHeight(1); - - Log.i(TAG, "onCreateView() end"); - return getListView(); - } - - - /** - * {@inheritDoc} - */ - @Override public void onActivityCreated(Bundle savedInstanceState) { Log.i(TAG, "onActivityCreated() start"); @@ -111,29 +91,6 @@ public class OCFileListFragment extends FragmentListView { } - /** - * 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 other position. - * - * THe current policy is take as a reference the visible item in the center of the screen. - * - * @return The position in the list of the visible item in the center of the screen. - */ - private int getReferencePosition() { - return (getListView().getFirstVisiblePosition() + getListView().getLastVisiblePosition()) / 2; - } - - - /** - * Sets the visible part of the list from the reference position. - * - * @param position Reference position previously returned by {@link OCFileListFragment#getReferencePosition()} - */ - private void setReferencePosition(int position) { - ((ExtendedListView)getListView()).setAndCenterSelection(position); - } - - @Override public void onItemClick(AdapterView l, View v, int position, long id) { OCFile file = (OCFile) mAdapter.getItem(position);