mirror of
https://github.com/nextcloud/android.git
synced 2024-11-23 21:55:48 +03:00
Add custom folder icon
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
48d66b36c9
commit
662b08a12c
4 changed files with 10 additions and 3 deletions
|
@ -30,7 +30,7 @@ public class MediaFolder {
|
||||||
public static final Integer CUSTOM = 0;
|
public static final Integer CUSTOM = 0;
|
||||||
public static final Integer IMAGE = 1;
|
public static final Integer IMAGE = 1;
|
||||||
public static final Integer VIDEO = 2;
|
public static final Integer VIDEO = 2;
|
||||||
public static final Integer IMAGE_VIDEO = 3;
|
public static final Integer LEGACY = 3;
|
||||||
|
|
||||||
/** name of the folder. */
|
/** name of the folder. */
|
||||||
public String folderName;
|
public String folderName;
|
||||||
|
|
|
@ -181,7 +181,7 @@ public class FolderSyncActivity extends FileActivity implements FolderSyncAdapte
|
||||||
final List<MediaFolder> mediaFolders = MediaProvider.getImageFolders(getContentResolver(),
|
final List<MediaFolder> mediaFolders = MediaProvider.getImageFolders(getContentResolver(),
|
||||||
perFolderMediaItemLimit, FolderSyncActivity.this);
|
perFolderMediaItemLimit, FolderSyncActivity.this);
|
||||||
Log_OC.w(TAG, "Picture Folders: " + mediaFolders.size());
|
Log_OC.w(TAG, "Picture Folders: " + mediaFolders.size());
|
||||||
mediaFolders.addAll(MediaProvider.getVideoFolders(getContentResolver(),perFolderMediaItemLimit));
|
mediaFolders.addAll(MediaProvider.getVideoFolders(getContentResolver(), perFolderMediaItemLimit));
|
||||||
Log_OC.w(TAG, "Picture+Video Folders: " + mediaFolders.size());
|
Log_OC.w(TAG, "Picture+Video Folders: " + mediaFolders.size());
|
||||||
|
|
||||||
//TODO properly merge image and video lists to remove duplicates
|
//TODO properly merge image and video lists to remove duplicates
|
||||||
|
|
|
@ -91,11 +91,15 @@ public class FolderSyncAdapter extends SectionedRecyclerViewAdapter<FolderSyncAd
|
||||||
@Override
|
@Override
|
||||||
public void onBindHeaderViewHolder(final MainViewHolder holder, final int section) {
|
public void onBindHeaderViewHolder(final MainViewHolder holder, final int section) {
|
||||||
holder.title.setText(mSyncFolderItems.get(section).getFolderName());
|
holder.title.setText(mSyncFolderItems.get(section).getFolderName());
|
||||||
|
|
||||||
if (MediaFolder.VIDEO == mSyncFolderItems.get(section).getType()) {
|
if (MediaFolder.VIDEO == mSyncFolderItems.get(section).getType()) {
|
||||||
holder.type.setImageResource(R.drawable.ic_video_18dp);
|
holder.type.setImageResource(R.drawable.ic_video_18dp);
|
||||||
} else {
|
} else if (MediaFolder.IMAGE == mSyncFolderItems.get(section).getType()) {
|
||||||
holder.type.setImageResource(R.drawable.ic_image_18dp);
|
holder.type.setImageResource(R.drawable.ic_image_18dp);
|
||||||
|
} else {
|
||||||
|
holder.type.setImageResource(R.drawable.ic_folder_star_18dp);
|
||||||
}
|
}
|
||||||
|
|
||||||
holder.syncStatusButton.setVisibility(View.VISIBLE);
|
holder.syncStatusButton.setVisibility(View.VISIBLE);
|
||||||
holder.syncStatusButton.setTag(section);
|
holder.syncStatusButton.setTag(section);
|
||||||
holder.syncStatusButton.setOnClickListener(new View.OnClickListener() {
|
holder.syncStatusButton.setOnClickListener(new View.OnClickListener() {
|
||||||
|
|
|
@ -678,6 +678,9 @@
|
||||||
<string name="privacy">Privacy</string>
|
<string name="privacy">Privacy</string>
|
||||||
<string name="file_not_found">File not found!</string>
|
<string name="file_not_found">File not found!</string>
|
||||||
|
|
||||||
|
<!-- Auto upload -->
|
||||||
|
<string name="autoupload_custom_folder">Setup a custom folder</string>
|
||||||
|
|
||||||
<string name="folder_sync_folders">Configure folders</string>
|
<string name="folder_sync_folders">Configure folders</string>
|
||||||
|
|
||||||
<string name="empty" translatable="false"/>
|
<string name="empty" translatable="false"/>
|
||||||
|
|
Loading…
Reference in a new issue