From: David A. Velasco Date: Thu, 22 Oct 2015 07:10:10 +0000 (+0200) Subject: Merge pull request #1177 from owncloud/notification_coloring X-Git-Tag: oc-android-1.9^2~44 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/08443f90c58f014a25cc86007844a45e829f4d3a?hp=dffd81e00cfe3cb843411a4753a76ecf7a923b5f Merge pull request #1177 from owncloud/notification_coloring Add ownCloud color to notifications for lollipop --- diff --git a/res/values-cs-rCZ/strings.xml b/res/values-cs-rCZ/strings.xml index f702afa7..5147a57a 100644 --- a/res/values-cs-rCZ/strings.xml +++ b/res/values-cs-rCZ/strings.xml @@ -71,6 +71,7 @@ před pár sekundami Žádný obsah. Nahrajte něco! Načítání... + Nebyla nalezena aplikace pro tento typ souboru! V tomto adresáři nejsou žádné soubory. Více informací získáte klepnutím na soubor. Velikost: diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml index 8a75e6d5..562ee84e 100644 --- a/res/values-de/strings.xml +++ b/res/values-de/strings.xml @@ -71,6 +71,7 @@ Gerade eben Alles leer. Lade etwas hoch! Lade… + Es wurden keine Apps für den Dateityp gefunden! Es befinden sich keine Dateien in diesem Ordner. Klicken Sie auf eine Datei für weitere Informationen. Größe: diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml index 1ae5c990..1f630851 100644 --- a/res/values-es/strings.xml +++ b/res/values-es/strings.xml @@ -71,6 +71,7 @@ hace segundos No hay nada aquí. ¡Suba algo! Cargando... + ¡No se encontró una aplicación para el tipo de archivo! No hay archivos en esta carpeta. Pulsa sobre un archivo para mostrar información adicional. Tamaño: diff --git a/res/values-ia/strings.xml b/res/values-ia/strings.xml index efb3d3d5..3685fdff 100644 --- a/res/values-ia/strings.xml +++ b/res/values-ia/strings.xml @@ -37,6 +37,7 @@ Cancellar Error Error Incognite + A proposito Cambiar contrasigno Deler conto Nomine de dossier diff --git a/res/values-ko/strings.xml b/res/values-ko/strings.xml index 41cd97d0..1876c657 100644 --- a/res/values-ko/strings.xml +++ b/res/values-ko/strings.xml @@ -71,6 +71,7 @@ 초 지남 내용이 없습니다. 업로드할 수 있습니다! 불러오는 중... + 파일 형식을 열 수 있는 앱이 없습니다! 이 폴더에 파일이 없습니다. 파일을 누르면 추가 정보가 표시됩니다. 크기: diff --git a/res/values-nl/strings.xml b/res/values-nl/strings.xml index 88eef421..5d35f019 100644 --- a/res/values-nl/strings.xml +++ b/res/values-nl/strings.xml @@ -72,6 +72,7 @@ Download hier: %2$s seconden geleden Er bevindt zich hier niets. Upload een bestand! Laden... + Geen app gevonden voor het bestandstype! Er staan geen bestanden in deze map. Druk op een bestand om extra informatie weer te geven Grootte: diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml index a0128b5a..4bb799a0 100644 --- a/res/values-ru/strings.xml +++ b/res/values-ru/strings.xml @@ -72,6 +72,7 @@ несколько секунд назад Здесь ничего нет. Загрузите что-нибудь! Загрузка... + Не найдено приложений для этого типа файла. В этом каталоге нет файлов. Нажмите на файл для отображения дополнительной информации. Размер: diff --git a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java index 20bcdce4..240d146f 100644 --- a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java +++ b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java @@ -1541,6 +1541,7 @@ public class FileDisplayActivity extends HookActivity OCFile syncedFile = operation.getLocalFile(); onTransferStateChanged(syncedFile, true, true); invalidateOptionsMenu(); + refreshShowDetails(); } } } diff --git a/src/com/owncloud/android/ui/fragment/FileDetailFragment.java b/src/com/owncloud/android/ui/fragment/FileDetailFragment.java index d4b1ffdd..b2e6464c 100644 --- a/src/com/owncloud/android/ui/fragment/FileDetailFragment.java +++ b/src/com/owncloud/android/ui/fragment/FileDetailFragment.java @@ -22,6 +22,7 @@ package com.owncloud.android.ui.fragment; import android.accounts.Account; +import android.graphics.Bitmap; import android.os.Bundle; import android.view.LayoutInflater; import android.view.Menu; @@ -35,9 +36,11 @@ import android.widget.ImageView; import android.widget.ProgressBar; import android.widget.TextView; +import com.owncloud.android.MainApp; import com.owncloud.android.R; import com.owncloud.android.datamodel.FileDataStorageManager; import com.owncloud.android.datamodel.OCFile; +import com.owncloud.android.datamodel.ThumbnailsCacheManager; import com.owncloud.android.files.FileMenuFilter; import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder; import com.owncloud.android.files.services.FileUploader.FileUploaderBinder; @@ -339,7 +342,7 @@ public class FileDetailFragment extends FileFragment implements OnClickListener // set file details setFilename(file.getFileName()); - setFiletype(file.getMimetype(), file.getFileName()); + setFiletype(file); setFilesize(file.getFileLength()); setTimeModified(file.getModificationTimestamp()); @@ -393,18 +396,54 @@ public class FileDetailFragment extends FileFragment implements OnClickListener /** * Updates the MIME type in view - * @param mimetype MIME type to set - * @param filename Name of the file, to deduce the icon to use in case the MIME type is not precise enough + * @param file : An {@link OCFile} */ - private void setFiletype(String mimetype, String filename) { + private void setFiletype(OCFile file) { + String mimetype = file.getMimetype(); TextView tv = (TextView) getView().findViewById(R.id.fdType); if (tv != null) { + // mimetype MIME type to set String printableMimetype = DisplayUtils.convertMIMEtoPrettyPrint(mimetype); tv.setText(printableMimetype); } + ImageView iv = (ImageView) getView().findViewById(R.id.fdIcon); + if (iv != null) { - iv.setImageResource(MimetypeIconUtil.getFileTypeIconId(mimetype, filename)); + Bitmap thumbnail; + iv.setTag(file.getFileId()); + + if (file.isImage()) { + String tagId = String.valueOf(file.getRemoteId()); + thumbnail = ThumbnailsCacheManager.getBitmapFromDiskCache(tagId); + + if (thumbnail != null && !file.needsUpdateThumbnail()) { + iv.setImageBitmap(thumbnail); + } else { + // generate new Thumbnail + if (ThumbnailsCacheManager.cancelPotentialWork(file, iv)) { + final ThumbnailsCacheManager.ThumbnailGenerationTask task = + new ThumbnailsCacheManager.ThumbnailGenerationTask( + iv, mContainerActivity.getStorageManager(), mAccount + ); + if (thumbnail == null) { + thumbnail = ThumbnailsCacheManager.mDefaultImg; + } + final ThumbnailsCacheManager.AsyncDrawable asyncDrawable = + new ThumbnailsCacheManager.AsyncDrawable( + MainApp.getAppContext().getResources(), + thumbnail, + task + ); + iv.setImageDrawable(asyncDrawable); + task.execute(file); + } + } + } else { + // Name of the file, to deduce the icon to use in case the MIME type is not precise enough + String filename = file.getFileName(); + iv.setImageResource(MimetypeIconUtil.getFileTypeIconId(mimetype, filename)); + } } }