Remove duplicated default folder icon func from MimeTypeUtil

Signed-off-by: Alper Ozturk <alperozturk@lions-macbook.local>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
Alper Ozturk 2023-10-03 14:51:46 +02:00 committed by alperozturk
parent 3aa9c8aa32
commit 9870a80e87
No known key found for this signature in database
GPG key ID: 4E577DC593B59BDF
5 changed files with 8 additions and 12 deletions

View file

@ -83,6 +83,7 @@ import java.util.List;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import androidx.core.content.ContextCompat;
import androidx.core.content.res.ResourcesCompat;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import kotlin.text.Charsets;
@ -899,8 +900,7 @@ public final class ThumbnailsCacheManager {
} else {
if (mFile != null) {
if (mFile.isDirectory()) {
imageView.setImageDrawable(MimeTypeUtil.getDefaultFolderIcon(mContext,
viewThemeUtils));
imageView.setImageDrawable(ContextCompat.getDrawable(mContext, R.drawable.folder));
} else {
if (MimeTypeUtil.isVideo(mFile)) {
imageView.setImageBitmap(ThumbnailsCacheManager.mDefaultVideo);

View file

@ -80,6 +80,7 @@ import java.util.List;
import java.util.Locale;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.RecyclerView;
/**
@ -271,8 +272,7 @@ public class ActivityListAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
.into(imageView);
} else {
if (MimeTypeUtil.isFolder(previewObject.getMimeType())) {
imageView.setImageDrawable(MimeTypeUtil.getDefaultFolderIcon(context,
viewThemeUtils));
imageView.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.folder));
} else {
imageView.setImageDrawable(MimeTypeUtil.getFileTypeIcon(previewObject.getMimeType(),
"",

View file

@ -54,6 +54,7 @@ import java.util.concurrent.Executors;
import androidx.annotation.NonNull;
import androidx.annotation.VisibleForTesting;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.RecyclerView;
/**
@ -243,7 +244,7 @@ public class LocalFileListAdapter extends RecyclerView.Adapter<RecyclerView.View
Context context,
ViewThemeUtils viewThemeUtils) {
if (file.isDirectory()) {
thumbnailView.setImageDrawable(MimeTypeUtil.getDefaultFolderIcon(context, viewThemeUtils));
thumbnailView.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.folder));
} else {
thumbnailView.setImageResource(R.drawable.file);

View file

@ -48,6 +48,7 @@ import java.util.ArrayList;
import java.util.List;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.RecyclerView;
import static com.owncloud.android.datamodel.OCFile.PATH_SEPARATOR;
@ -219,8 +220,7 @@ public class TrashbinListAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
private void setThumbnail(TrashbinFile file, ImageView thumbnailView) {
if (file.isFolder()) {
thumbnailView.setImageDrawable(MimeTypeUtil.getDefaultFolderIcon(context,
viewThemeUtils));
thumbnailView.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.folder));
} else {
if ((MimeTypeUtil.isImage(file) || MimeTypeUtil.isVideo(file)) && file.getRemoteId() != null) {
// Thumbnail in cache?

View file

@ -134,11 +134,6 @@ public final class MimeTypeUtil {
return determineIconIdByMimeTypeList(possibleMimeTypes);
}
public static Drawable getDefaultFolderIcon(Context context,
ViewThemeUtils viewThemeUtils) {
return ContextCompat.getDrawable(context, R.drawable.folder);
}
/**
* Returns a single MIME type of all the possible, by inspection of the file extension, and taking into account the
* MIME types known by ownCloud first.