mirror of
https://github.com/nextcloud/android.git
synced 2024-11-21 12:45:32 +03:00
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:
parent
6d5c6f86e5
commit
d4e0f3bdb1
8 changed files with 12 additions and 35 deletions
|
@ -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'
|
||||
}
|
||||
}
|
||||
|
||||
|
|
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -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
|
|
@ -18,4 +18,5 @@
|
|||
-->
|
||||
<resources>
|
||||
<dimen name="file_icon_size">32dp</dimen>
|
||||
<dimen name="file_icon_size_grid">128dp</dimen>
|
||||
</resources>
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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){
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue