--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ownCloud Android client application
+
+ Copyright (C) 2012 Bartek Przybylski
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ -->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical" >
+
+ <com.owncloud.android.ui.ExtendedListView
+ android:id="@+id/list_root"
+ android:layout_width="match_parent"
+ android:layout_height="0dip"
+ android:layout_weight="1"
+ />
+
+ <TextView
+ android:id="@+id/empty_list_view"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:gravity="center_vertical|center_horizontal"
+ android:text="@string/file_list_empty"
+ android:visibility="gone"
+ />
+
+</LinearLayout>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!-- \r
+ ownCloud Android client application\r
+\r
+ Copyright (C) 2012 Bartek Przybylski\r
+ This program is free software: you can redistribute it and/or modify\r
+ it under the terms of the GNU General Public License as published by\r
+ the Free Software Foundation, either version 3 of the License, or\r
+ (at your option) any later version.\r
+\r
+ This program is distributed in the hope that it will be useful,\r
+ but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ GNU General Public License for more details.\r
+\r
+ You should have received a copy of the GNU General Public License\r
+ along with this program. If not, see <http://www.gnu.org/licenses/>.\r
+ -->\r
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"\r
+ android:id="@+id/ListItemLayout"\r
+ android:layout_width="fill_parent"\r
+ android:background="@drawable/list_selector"\r
+ android:orientation="horizontal"\r
+ android:layout_height="56dp">\r
+\r
+ <FrameLayout\r
+ android:layout_width="wrap_content"\r
+ android:layout_height="56dp"\r
+ android:focusable="false"\r
+ android:focusableInTouchMode="false">\r
+ \r
+ <ImageView\r
+ android:id="@+id/imageView2"\r
+ android:layout_width="wrap_content"\r
+ android:layout_height="wrap_content"\r
+ android:src="@drawable/local_file_indicator"/>\r
+\r
+ <ImageView\r
+ android:id="@+id/imageView1"\r
+ android:layout_width="20dp"\r
+ android:layout_height="20dp"\r
+ android:layout_gravity="center_vertical|center"\r
+ android:layout_margin="4dp"\r
+ android:src="@drawable/ic_menu_archive" />\r
+\r
+ <ImageView\r
+ android:id="@+id/imageView3"\r
+ android:layout_width="wrap_content"\r
+ android:layout_height="wrap_content"\r
+ android:layout_gravity="bottom"\r
+ android:layout_weight=".1"\r
+ android:maxHeight="15dip"\r
+ android:src="@drawable/ic_favorite" />\r
+ \r
+ </FrameLayout>\r
+\r\r\r\r
+ <LinearLayout\r
+ android:layout_width="0dp"\r
+ android:layout_height="match_parent"\r
+ android:layout_weight="1"\r
+ android:gravity="center_vertical"\r
+ android:orientation="vertical" >\r
+\r\r
+ <TextView\r
+ android:id="@+id/Filename"\r
+ android:layout_width="wrap_content"\r
+ android:layout_height="wrap_content"\r
+ android:layout_gravity="center_vertical"\r
+ android:layout_marginLeft="4dp"\r
+ android:layout_marginRight="4dp"\r
+ android:ellipsize="middle"\r
+ android:singleLine="true"\r
+ android:text="TextView"\r
+ android:textColor="#303030"\r
+ android:textSize="16dip" />\r
+\r
+ <LinearLayout\r
+ android:layout_width="match_parent"\r
+ android:layout_height="wrap_content"\r
+ android:layout_marginLeft="4dp"\r
+ android:layout_marginRight="4dp"\r
+ android:weightSum="1">\r
+\r
+ <TextView\r
+ android:id="@+id/last_mod"\r
+ android:layout_width="wrap_content"\r
+ android:layout_height="wrap_content"\r
+ android:text="TextView"\r
+ android:layout_weight=".5"\r
+ android:textSize="12dip"/>\r
+\r
+ <TextView\r
+ android:id="@+id/file_size"\r
+ android:layout_width="wrap_content"\r
+ android:layout_height="wrap_content"\r
+ android:gravity="right"\r
+ android:text="TextView"\r
+ android:layout_weight=".5"\r
+ android:textSize="12dip"/>\r
+\r
+ </LinearLayout>\r
+\r
+ </LinearLayout>\r
+\r\r\r\r
+ <ImageView\r
+ android:id="@+id/custom_checkbox"\r
+ android:layout_width="wrap_content"\r
+ android:layout_height="wrap_content"\r
+ android:layout_gravity="center_vertical"\r
+ android:layout_marginLeft="4dp"\r
+ android:layout_marginRight="4dp"\r
+ android:gravity=""\r
+ android:src="@android:drawable/checkbox_off_background" />\r
+\r
+</LinearLayout>\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!-- \r
- ownCloud Android client application\r
-\r
- Copyright (C) 2012 Bartek Przybylski\r
- This program is free software: you can redistribute it and/or modify\r
- it under the terms of the GNU General Public License as published by\r
- the Free Software Foundation, either version 3 of the License, or\r
- (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
-\r
- You should have received a copy of the GNU General Public License\r
- along with this program. If not, see <http://www.gnu.org/licenses/>.\r
- -->\r
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"\r
- android:id="@+id/ListItemLayout"\r
- android:layout_width="fill_parent"\r
- android:background="@drawable/list_selector"\r
- android:orientation="horizontal"\r
- android:layout_height="56dp">\r
-\r
- <FrameLayout\r
- android:layout_width="wrap_content"\r
- android:layout_height="56dp"\r
- android:focusable="false"\r
- android:focusableInTouchMode="false">\r
- \r
- <ImageView\r
- android:id="@+id/imageView2"\r
- android:layout_width="wrap_content"\r
- android:layout_height="wrap_content"\r
- android:src="@drawable/local_file_indicator"/>\r
-\r
- <ImageView\r
- android:id="@+id/imageView1"\r
- android:layout_width="20dp"\r
- android:layout_height="20dp"\r
- android:layout_gravity="center_vertical|center"\r
- android:layout_margin="4dp"\r
- android:src="@drawable/ic_menu_archive" />\r
-\r
- <ImageView\r
- android:id="@+id/imageView3"\r
- android:layout_width="wrap_content"\r
- android:layout_height="wrap_content"\r
- android:layout_gravity="bottom"\r
- android:layout_weight=".1"\r
- android:maxHeight="15dip"\r
- android:src="@drawable/ic_favorite" />\r
- \r
- </FrameLayout>\r
-\r\r\r\r
- <LinearLayout\r
- android:layout_width="0dp"\r
- android:layout_height="match_parent"\r
- android:layout_weight="1"\r
- android:gravity="center_vertical"\r
- android:orientation="vertical" >\r
-\r\r
- <TextView\r
- android:id="@+id/Filename"\r
- android:layout_width="wrap_content"\r
- android:layout_height="wrap_content"\r
- android:layout_gravity="center_vertical"\r
- android:layout_marginLeft="4dp"\r
- android:layout_marginRight="4dp"\r
- android:ellipsize="middle"\r
- android:singleLine="true"\r
- android:text="TextView"\r
- android:textColor="#303030"\r
- android:textSize="16dip" />\r
-\r
- <LinearLayout\r
- android:layout_width="match_parent"\r
- android:layout_height="wrap_content"\r
- android:layout_marginLeft="4dp"\r
- android:layout_marginRight="4dp"\r
- android:weightSum="1">\r
-\r
- <TextView\r
- android:id="@+id/last_mod"\r
- android:layout_width="wrap_content"\r
- android:layout_height="wrap_content"\r
- android:text="TextView"\r
- android:layout_weight=".5"\r
- android:textSize="12dip"/>\r
-\r
- <TextView\r
- android:id="@+id/file_size"\r
- android:layout_width="wrap_content"\r
- android:layout_height="wrap_content"\r
- android:gravity="right"\r
- android:text="TextView"\r
- android:layout_weight=".5"\r
- android:textSize="12dip"/>\r
-\r
- </LinearLayout>\r
-\r
- </LinearLayout>\r
-\r\r\r\r
- <ImageView\r
- android:id="@+id/custom_checkbox"\r
- android:layout_width="wrap_content"\r
- android:layout_height="wrap_content"\r
- android:layout_gravity="center_vertical"\r
- android:layout_marginLeft="4dp"\r
- android:layout_marginRight="4dp"\r
- android:gravity=""\r
- android:src="@android:drawable/checkbox_off_background" />\r
-\r
-</LinearLayout>\r
<string name="main_tit_accsetup">Konto einrichten</string>
<string name="main_wrn_accsetup">Auf Deinem Gerät sind keine ownCloud Konten eingerichtet. Bitte erstelle ein Konto, um diese App zu nutzen.</string>
<string name="actionbar_sync">Aktualisieren</string>
- <string name="actionbar_upload">Datei hochladen</string>
+ <string name="actionbar_upload">Hochladen</string>
<string name="actionbar_upload_from_apps">Inhalt von anderen Apps</string>
<string name="actionbar_upload_files">Dateien</string>
<string name="actionbar_mkdir">Verzeichnis erstellen</string>
<string name="uploader_error_forbidden_content">ownCloud darf den geteilten Inhalt nicht nutzen.</string>
<string name="uploader_info_uploading">Lade hoch</string>
<string name="uploader_btn_create_dir_text">Verzeichnis für hochzuladene Dateien erstellen</string>
+ <string name="file_list_empty">Im ausgewählten Ordner befinden sich noch keine Dateien.\nÜber die Schaltfläche „Hochladen“ können neue Dateien hinzugefügt werden.</string>
<string name="filedetails_select_file">Klicken Sie auf eine Datei für weitere Informationen.</string>
<string name="filedetails_size">Größe:</string>
<string name="filedetails_type">Art:</string>
<string name="about_title">Über</string>
<string name="delete_account">Konto löschen</string>
<string name="create_account">Konto erstellen</string>
- <string name="upload_chooser_title">Dateien hochladen von...</string>
+ <string name="upload_chooser_title">Dateien hochladen von…</string>
<string name="uploader_info_dirname">Verzeichnisname</string>
- <string name="uploader_upload_in_progress_ticker">Hochladen...</string>
+ <string name="uploader_upload_in_progress_ticker">Hochladen…</string>
<string name="uploader_upload_in_progress_content">%1$d%% Hochladen %2$s</string>
<string name="uploader_upload_succeeded_ticker">Hochladen erfolgreich</string>
<string name="uploader_upload_succeeded_content_single">%1$s wurde(n) erfolgreich hochgeladen</string>
<string name="uploader_upload_failed_ticker">Hochladen fehlgeschlagen</string>
<string name="uploader_upload_failed_content_single">Hochladen von %1$s konnte nicht abgeschlossen werden</string>
<string name="uploader_upload_failed_content_multiple">Hochladen fehlgeschlagen: %1$d/%2$d Dateien wurden hochgeladen</string>
- <string name="downloader_download_in_progress_ticker">Herunterladen...</string>
+ <string name="downloader_download_in_progress_ticker">Herunterladen…</string>
<string name="downloader_download_in_progress_content">%1$d%% Herunterladen %2$s</string>
<string name="downloader_download_succeeded_ticker">Herunterladen erfolgreich</string>
<string name="downloader_download_succeeded_content">%1$s wurde erfolgreich heruntergeladen</string>
<item>30</item>
<item>60</item>
</string-array>
- <string name="auth_trying_to_login">Anmeldungsversuch...</string>
+ <string name="auth_trying_to_login">Anmeldungsversuch…</string>
<string name="auth_no_net_conn_title">Keine Netzwerkverbindung</string>
<string name="auth_no_net_conn_message">Es konnte keine Netzwerkverbindung gefunden werden, bitte überprüfe Deine Internetverbindung.</string>
<string name="auth_connect_anyway">Trotzdem verbinden</string>
<string name="auth_nossl_plain_ok_title">Sichere Verbindung nicht verfügbar.</string>
<string name="auth_nossl_plain_ok_message">Die App konnte keine sichere Verbindung zum Server herstellen. Eine nicht sichere Verbindung ist nichtsdestotrotz verfügbar. Möchtest Du fortfahren oder abbrechen?</string>
<string name="auth_connection_established">Verbindung hergestellt</string>
- <string name="auth_testing_connection">Verbindung testen...</string>
+ <string name="auth_testing_connection">Verbindung testen…</string>
<string name="auth_not_configured_title">Falsch konfigurierte ownCloud</string>
<string name="auth_not_configured_message">Es scheint, als wäre Deine ownCloud-Installation nicht richtig konfiguriert. Bitte kontaktiere Deinen Administrator, um weitere Details zu erhalten.</string>
<string name="auth_unknown_error_title">Ein unbekannter Fehler ist aufgetreten!</string>
<string name="uploader_error_forbidden_content">ownCloud no está autorizado para acceder al contenido compartido</string>
<string name="uploader_info_uploading">Subiendo</string>
<string name="uploader_btn_create_dir_text">Crear directorio para subir</string>
+ <string name="file_list_empty">La carpeta seleccionada no contiene ningún archivo.\nPuede añadir ficheros con la opción de menú \"Subir\".</string>
<string name="filedetails_select_file">Pulsá sobre un archivo para mostrar información adicional.</string>
<string name="filedetails_size">Tamaño:</string>
<string name="filedetails_type">Tipo:</string>
<string name="about_title">Acerca de</string>
<string name="delete_account">Eliminar cuenta</string>
<string name="create_account">Crear cuenta</string>
- <string name="upload_chooser_title">Subir desde ...</string>
+ <string name="upload_chooser_title">Subir desde …</string>
<string name="uploader_info_dirname">Nombre del directorio</string>
- <string name="uploader_upload_in_progress_ticker">Subiendo...</string>
+ <string name="uploader_upload_in_progress_ticker">Subiendo…</string>
<string name="uploader_upload_in_progress_content">%1$d%% Subiendo %2$s</string>
<string name="uploader_upload_succeeded_ticker">Subido con éxito</string>
<string name="uploader_upload_succeeded_content_single">%1$s se ha subido con éxito</string>
<string name="uploader_upload_failed_ticker">Error al subir el archivo</string>
<string name="uploader_upload_failed_content_single">No se pudo completar la subida de %1$s </string>
<string name="uploader_upload_failed_content_multiple">Error al subir: %1$d/%2$d archivos fueron subidos</string>
- <string name="downloader_download_in_progress_ticker">Descargando ...</string>
+ <string name="downloader_download_in_progress_ticker">Descargando …</string>
<string name="downloader_download_in_progress_content">%1$d%% descargando %2$s</string>
<string name="downloader_download_succeeded_ticker">Descarga completa</string>
<string name="downloader_download_succeeded_content">%1$s fue descargado con éxito</string>
<item>30</item>
<item>60</item>
</string-array>
- <string name="auth_trying_to_login">Intentado iniciar sesión...</string>
+ <string name="auth_trying_to_login">Intentado iniciar sesión…</string>
<string name="auth_no_net_conn_title">Sin conexión de red</string>
<string name="auth_no_net_conn_message">No se ha detectado una conexión de red, revisá tu conexión a internet e intentá nuevamente.</string>
<string name="auth_connect_anyway">Conectar de todos modos</string>
<string name="auth_nossl_plain_ok_title">Conexión segura no disponible.</string>
<string name="auth_nossl_plain_ok_message">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.</string>
<string name="auth_connection_established">Conexión establecida</string>
- <string name="auth_testing_connection">Probando conexión...</string>
+ <string name="auth_testing_connection">Probando conexión…</string>
<string name="auth_not_configured_title">Configuración de ownCloud en formato incorrecto</string>
<string name="auth_not_configured_message">Parece ser que la instancia de ownCloud no está configurada correctamente. Comunicate con el administrador para más detalles.</string>
<string name="auth_unknown_error_title">¡Ocurrió un error desconocido!</string>
<string name="main_tit_accsetup">Configuración de cuenta</string>
<string name="main_wrn_accsetup">No hay cuentas de ownCloud en tu dispositivo. Para usar esta aplicación, necesitas crear una.</string>
<string name="actionbar_sync">Sincronización de cuenta</string>
- <string name="actionbar_upload">Subir archivo</string>
+ <string name="actionbar_upload">Subir</string>
<string name="actionbar_upload_from_apps">Contenido de otras aplicaciones</string>
<string name="actionbar_upload_files">Archivos</string>
<string name="actionbar_mkdir">Crear directorio</string>
<string name="uploader_error_forbidden_content">ownCloud no está autorizado para acceder al contenido compartido</string>
<string name="uploader_info_uploading">Enviando</string>
<string name="uploader_btn_create_dir_text">Crear directorio para envío</string>
+ <string name="file_list_empty">La carpeta seleccionada no contiene ningún archivo.\nPuede añadir ficheros con la opción de menú \"Subir\".</string>
<string name="filedetails_select_file">Pulsa sobre un archivo para mostrar información adicional.</string>
<string name="filedetails_size">Tamaño:</string>
<string name="filedetails_type">Tipo:</string>
<string name="create_account">Crear cuenta</string>
<string name="upload_chooser_title">Subir</string>
<string name="uploader_info_dirname">Nombre de directorio</string>
- <string name="uploader_upload_in_progress_ticker">Subiendo...</string>
+ <string name="uploader_upload_in_progress_ticker">Subiendo…</string>
<string name="uploader_upload_in_progress_content">%1$d%% Subiendo %2$s</string>
<string name="uploader_upload_succeeded_ticker">Subido con éxito</string>
<string name="uploader_upload_succeeded_content_single">%1$s se ha subido con éxito</string>
<string name="uploader_upload_failed_ticker">Error en la subida</string>
<string name="uploader_upload_failed_content_single">La subida de %1$s no se pudo completar</string>
<string name="uploader_upload_failed_content_multiple">Error de subida: %1$d/%2$d archivos fueron cargados</string>
- <string name="downloader_download_in_progress_ticker">Descargando ...</string>
+ <string name="downloader_download_in_progress_ticker">Descargando …</string>
<string name="downloader_download_in_progress_content">%1$s Descargada de %2$s</string>
<string name="downloader_download_succeeded_ticker">Descarga completa</string>
<string name="downloader_download_succeeded_content">%1$s se ha descargado con éxito</string>
<item>30</item>
<item>60</item>
</string-array>
- <string name="auth_trying_to_login">Intentado iniciar sesión...</string>
+ <string name="auth_trying_to_login">Intentado iniciar sesión…</string>
<string name="auth_no_net_conn_title">Sin conexión de red</string>
<string name="auth_no_net_conn_message">No se ha detectado una conexión de red, chequea tu conexión a internet e intenta nuevamente.</string>
<string name="auth_connect_anyway">Conectar de todos modos</string>
<string name="auth_nossl_plain_ok_title">Conexión segura no disponible.</string>
<string name="auth_nossl_plain_ok_message">La aplicación no pudo establecer una conexión segura al servidor. Aunque no haya una conexión segura disponible, puedes continuar o cancelar.</string>
<string name="auth_connection_established">Conexión establecida</string>
- <string name="auth_testing_connection">Probando conexión...</string>
+ <string name="auth_testing_connection">Probando conexión…</string>
<string name="auth_not_configured_title">Configuración de ownCloud en formato incorrecto</string>
<string name="auth_not_configured_message">Parece que tu instancia de ownCloud no está correctamente configurada. Contacta a tu administrador para más detalles.</string>
<string name="auth_unknown_error_title">Ocurrió un error desconocido</string>
<string name="uploader_error_forbidden_content">ownCloud is not allowed to access the shared content</string>
<string name="uploader_info_uploading">Uploading</string>
<string name="uploader_btn_create_dir_text">Create directory for upload</string>
+ <string name="file_list_empty">There are no files in this folder.\nNew files can be added with the \"Upload\" menu option.</string>
<string name="filedetails_select_file">Tap on a file to display additional information.</string>
<string name="filedetails_size">Size:</string>
<string name="filedetails_type">Type:</string>
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;
@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) {
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);
+ }
+
+
}
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);\r
actionBar.setListNavigationCallbacks(mDirectories, this);\r
setSupportProgressBarIndeterminateVisibility(false); // always AFTER setContentView(...) ; to workaround bug in its implementation\r
- \r
+ \r
Log.d(getClass().toString(), "onCreate() end");\r
}\r
\r
-\r
+ \r
/**\r
* Launches the account creation activity. To use when no ownCloud account is available\r
*/\r
try {\r
pkg = getPackageManager().getPackageInfo(getPackageName(), 0);\r
builder.setMessage("ownCloud android client\n\nversion: " + pkg.versionName );\r
+ //builder.setMessage(String.format(getString(R.string.aboout_message), pkg.versionName));\r
builder.setIcon(android.R.drawable.ic_menu_info_details);\r
dialog = builder.create();\r
} catch (NameNotFoundException e) {\r
if (view == null) {\r
LayoutInflater inflator = (LayoutInflater) mContext\r
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\r
- view = inflator.inflate(R.layout.list_layout, null);\r
+ view = inflator.inflate(R.layout.list_item, null);\r
}\r
if (mFiles != null && mFiles.size() > position) {\r
OCFile file = mFiles.get(position);\r
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];
import java.io.File;
-import com.owncloud.android.ui.ExtendedListView;
import com.owncloud.android.ui.FragmentListView;
import com.owncloud.android.ui.adapter.LocalFileListAdapter;
@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;
}
/**
- * 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
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;
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.
* {@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");
}
- /**
- * 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);