From 7df8a18d6bce6fda4be10939199d1a2b113eecdd Mon Sep 17 00:00:00 2001 From: AndyScherzinger Date: Fri, 11 May 2018 11:50:56 +0200 Subject: [PATCH] butterknife for details fragment + proper empty content handling --- .../android/ui/activity/ToolbarActivity.java | 1 + .../ui/fragment/FileDetailFragment.java | 59 +++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/src/main/java/com/owncloud/android/ui/activity/ToolbarActivity.java b/src/main/java/com/owncloud/android/ui/activity/ToolbarActivity.java index 894a9599f9..452e8b83fd 100644 --- a/src/main/java/com/owncloud/android/ui/activity/ToolbarActivity.java +++ b/src/main/java/com/owncloud/android/ui/activity/ToolbarActivity.java @@ -36,6 +36,7 @@ import android.widget.ProgressBar; import com.owncloud.android.R; import com.owncloud.android.datamodel.FileDataStorageManager; import com.owncloud.android.datamodel.OCFile; +import com.owncloud.android.datamodel.ThumbnailsCacheManager; import com.owncloud.android.utils.ThemeUtils; /** diff --git a/src/main/java/com/owncloud/android/ui/fragment/FileDetailFragment.java b/src/main/java/com/owncloud/android/ui/fragment/FileDetailFragment.java index 8d285e9db6..f37a158547 100644 --- a/src/main/java/com/owncloud/android/ui/fragment/FileDetailFragment.java +++ b/src/main/java/com/owncloud/android/ui/fragment/FileDetailFragment.java @@ -38,6 +38,7 @@ import android.view.View.OnClickListener; import android.view.ViewGroup; import android.widget.ImageButton; import android.widget.ImageView; +import android.widget.LinearLayout; import android.widget.PopupMenu; import android.widget.ProgressBar; import android.widget.TextView; @@ -67,6 +68,10 @@ import java.lang.ref.WeakReference; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.Unbinder; +import butterknife.BindView; +import butterknife.ButterKnife; +import butterknife.Optional; +import butterknife.Unbinder; /** * This Fragment is used to display the details about a file. @@ -123,6 +128,60 @@ public class FileDetailFragment extends FileFragment implements OnClickListener private ToolbarActivity activity; private int activeTab; + @Nullable @BindView(R.id.fdProgressBlock) + View downloadProgressContainer; + + @Nullable @BindView(R.id.fdCancelBtn) + ImageButton cancelButton; + + @Nullable @BindView(R.id.fdProgressBar) + ProgressBar progressBar; + + @Nullable @BindView(R.id.fdProgressText) + TextView progressText; + + @Nullable @BindView(R.id.fdFilename) + TextView fileName; + + @Nullable @BindView(R.id.fdSize) + TextView fileSize; + + @Nullable @BindView(R.id.fdModified) + TextView fileModifiedTimestamp; + + @Nullable @BindView(R.id.fdFavorite) + ImageView favoriteIcon; + + @Nullable @BindView(R.id.overflow_menu) + ImageView overflowMenu; + + @Nullable @BindView(R.id.tab_layout) + TabLayout tabLayout; + + @Nullable @BindView(R.id.pager) + ViewPager viewPager; + + @Nullable @BindView(R.id.empty_list_view_text) + protected TextView emptyContentMessage; + + @Nullable @BindView(R.id.empty_list_view_headline) + protected TextView emptyContentHeadline; + + @Nullable @BindView(R.id.empty_list_icon) + protected ImageView emptyContentIcon; + + @Nullable @BindView(R.id.empty_list_progress) + protected ProgressBar emptyProgressBar; + + private int layout; + private View view; + private boolean previewLoaded; + private Account account; + private Unbinder unbinder; + + public ProgressListener progressListener; + private ToolbarActivity activity; + /** * Public factory method to create new FileDetailFragment instances. *