Merge branch 'develop2' into imageGrid2

Conflicts:
	owncloud-android-library
	res/layout/list_fragment.xml
	res/values-fr/strings.xml
	src/com/owncloud/android/datamodel/ThumbnailsCacheManager.java
	src/com/owncloud/android/ui/adapter/FileListListAdapter.java
	src/com/owncloud/android/ui/adapter/LocalFileListAdapter.java
	src/com/owncloud/android/ui/fragment/ExtendedListFragment.java
	src/com/owncloud/android/ui/fragment/LocalFileListFragment.java
	src/com/owncloud/android/ui/fragment/OCFileListFragment.java
This commit is contained in:
tobiasKaminsky 2015-01-19 21:02:37 +01:00
parent 6d5c6f86e5
commit d4e0f3bdb1
8 changed files with 12 additions and 35 deletions

View file

@ -3,7 +3,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.14.0'
classpath 'com.android.tools.build:gradle:1.0.0'
}
}

View file

@ -1,6 +1,6 @@
#Wed Oct 15 10:45:44 CEST 2014
#Sun Jan 18 17:01:43 CET 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip

@ -1 +1 @@
Subproject commit 8261865ff24c1bfc05be19ae9364a66dac8f26c3
Subproject commit cbb1c524ea989e649721ab4f8ece760701abf56b

View file

@ -18,4 +18,5 @@
-->
<resources>
<dimen name="file_icon_size">32dp</dimen>
<dimen name="file_icon_size_grid">128dp</dimen>
</resources>

View file

@ -173,26 +173,7 @@ public class ThumbnailsCacheManager {
}
mFile = params[0];
final String imageKey = String.valueOf(mFile.getRemoteId());
// Check disk cache in background thread
thumbnail = getBitmapFromDiskCache(imageKey);
// Not found in disk cache
if (thumbnail == null || mFile.needsUpdateThumbnail()) {
// Use Width of imageView -> no blurry images on big screens
int px = mImageViewReference.get().getWidth();
if (mFile.isDown()){
Bitmap bitmap = BitmapUtils.decodeSampledBitmapFromFile(
mFile.getStoragePath(), px, px);
if (bitmap != null) {
thumbnail = ThumbnailUtils.extractThumbnail(bitmap, px, px);
// Add thumbnail to cache
addBitmapToCache(imageKey, thumbnail);
if (mFile instanceof OCFile) {
thumbnail = doOCFileInBackground();
} else if (mFile instanceof File) {
@ -262,7 +243,7 @@ public class ThumbnailsCacheManager {
private int getThumbnailDimension(){
// Converts dp to pixel
Resources r = MainApp.getAppContext().getResources();
return (int) Math.round(r.getDimension(R.dimen.file_icon_size));
return (int) Math.round(r.getDimension(R.dimen.file_icon_size_grid));
}
private Bitmap doOCFileInBackground() {

View file

@ -302,7 +302,6 @@ public class FileListListAdapter extends BaseAdapter implements ListAdapter {
if (thumbnail != null && !file.needsUpdateThumbnail()){
fileIcon.setImageBitmap(thumbnail);
} else {
// generate new Thumbnail
if (ThumbnailsCacheManager.cancelPotentialWork(file, fileIcon)) {
final ThumbnailsCacheManager.ThumbnailGenerationTask task =
@ -320,15 +319,11 @@ public class FileListListAdapter extends BaseAdapter implements ListAdapter {
);
fileIcon.setImageDrawable(asyncDrawable);
task.execute(file);
}
}
} else {
fileIcon.setImageResource(DisplayUtils.getFileTypeIconId(file.getMimetype(), file.getFileName()));
}
else {
fileIcon.setImageResource(DisplayUtils.getResourceId(file.getMimetype(), file.getFileName()));
}
} else {
// Folder
if (checkIfFileIsSharedWithMe(file)) {
@ -568,8 +563,6 @@ public class FileListListAdapter extends BaseAdapter implements ListAdapter {
mFiles = FileStorageUtils.sortFolder(mFiles);
notifyDataSetChanged();
}
sortDirectory();
}
private CharSequence showRelativeTimestamp(OCFile file){

View file

@ -77,9 +77,11 @@ implements OnItemClickListener, OnEnforceableRefreshListener {
public GridView getGridView() {
return imageView;
}
public void setFooterView(View footer) {
mList.addFooterView(footer, null, false);
mList.invalidate();
// TODO find solution
// mList.addFooterView(footer, null, false);
// mList.invalidate();
}

View file

@ -228,7 +228,7 @@ public class DisplayUtils {
/**
* Converts Unix time to human readable format
* @param miliseconds that have passed since 01/01/1970
* @param milliseconds that have passed since 01/01/1970
* @return The human readable time for the users locale
*/
public static String unixTimeToHumanReadable(long milliseconds) {