|
@@ -48,6 +48,7 @@ import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder;
|
|
|
import com.owncloud.android.files.services.FileUploader.FileUploaderBinder;
|
|
|
import com.owncloud.android.services.OperationsService.OperationsServiceBinder;
|
|
|
import com.owncloud.android.ui.activity.ComponentsGetter;
|
|
|
+import com.owncloud.android.ui.fragment.OCFileListFragment;
|
|
|
import com.owncloud.android.utils.DisplayUtils;
|
|
|
import com.owncloud.android.utils.FileStorageUtils;
|
|
|
import com.owncloud.android.utils.MimeTypeUtil;
|
|
@@ -62,6 +63,7 @@ import java.util.Vector;
|
|
|
*/
|
|
|
public class FileListListAdapter extends BaseAdapter implements FilterableListAdapter {
|
|
|
|
|
|
+ public static final int showFilenameColumnThreshold = 4;
|
|
|
private Context mContext;
|
|
|
private Vector<OCFile> mFilesAll = new Vector<OCFile>();
|
|
|
private Vector<OCFile> mFiles = null;
|
|
@@ -71,16 +73,19 @@ public class FileListListAdapter extends BaseAdapter implements FilterableListAd
|
|
|
private FileDataStorageManager mStorageManager;
|
|
|
private Account mAccount;
|
|
|
private ComponentsGetter mTransferServiceGetter;
|
|
|
+ private OCFileListFragment mListFragment;
|
|
|
|
|
|
public FileListListAdapter(
|
|
|
boolean justFolders,
|
|
|
Context context,
|
|
|
- ComponentsGetter transferServiceGetter
|
|
|
+ ComponentsGetter transferServiceGetter,
|
|
|
+ OCFileListFragment listFragment
|
|
|
) {
|
|
|
|
|
|
mJustFolders = justFolders;
|
|
|
mContext = context;
|
|
|
mAccount = AccountUtils.getCurrentOwnCloudAccount(mContext);
|
|
|
+ mListFragment = listFragment;
|
|
|
|
|
|
mTransferServiceGetter = transferServiceGetter;
|
|
|
|
|
@@ -202,9 +207,14 @@ public class FileListListAdapter extends BaseAdapter implements FilterableListAd
|
|
|
case GRID_ITEM:
|
|
|
// filename
|
|
|
fileName = (TextView) view.findViewById(R.id.Filename);
|
|
|
+
|
|
|
name = file.getFileName();
|
|
|
fileName.setText(name);
|
|
|
|
|
|
+ if (mListFragment.getColumnSize() > showFilenameColumnThreshold && viewType == ViewType.GRID_ITEM){
|
|
|
+ fileName.setVisibility(View.GONE);
|
|
|
+ }
|
|
|
+
|
|
|
case GRID_IMAGE:
|
|
|
// sharedIcon
|
|
|
ImageView sharedIconV = (ImageView) view.findViewById(R.id.sharedIcon);
|