-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thumbnail for upload #746
Thumbnail for upload #746
Conversation
developNew Conflicts: res/values-fr/strings.xml
@davivel There is one problem left: |
@davivel Bug is fixed. |
@davivel This means if a local file (as File) is listed a different thumbnail is created as if the same file (as OCFile) is shown in owncloud. |
@@ -184,4 +222,12 @@ private int compareNames(File lhs, File rhs) { | |||
} | |||
notifyDataSetChanged(); | |||
} | |||
|
|||
private boolean isImage(File file) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, move this method to BitmapUtils as a static.
The idea of MD5 makes sense, but we will have to consider the impact on performance. I would do it in a separate branch. This code needs some refactoring; there are new methods in ThumbnailsCacheManager almost dupicating exising ones, but for the File Vs. OCFile parameter. We should rewrite it to reuse common code in private methods. |
Hi @tobiasKaminsky |
@purigarcia Ready to be validated |
@@ -234,7 +233,9 @@ private static String getExtension(String filename) { | |||
*/ | |||
public static String unixTimeToHumanReadable(long milliseconds) { | |||
Date date = new Date(milliseconds); | |||
return date.toLocaleString(); | |||
DateFormat df = DateFormat.getDateTimeInstance(); | |||
//return date.toLocaleString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Self-note: remove commented code
return null; | ||
} | ||
|
||
public static class AsyncGlobalDrawable extends BitmapDrawable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, the Global
part is not providing any real meaning.
thumbnail = getBitmapFromDiskCache(imageKey); | ||
|
||
// Not found in disk cache | ||
if (thumbnail == null || ((OCFile)mFile).needsUpdateThumbnail()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, define a local OCFile
variable at the beginning of the method and set it with (OCFile)mFile
; castings are not free.
OK, ready again. Please, @purigarcia , make a quick retest. |
Thumbnails added to Upload activity
See #595