Skip to content

Commit 8497807

Browse files
Add an option to download the entire gallery in PostOptionsBottomSheetFragment.
1 parent db09315 commit 8497807

File tree

4 files changed

+303
-173
lines changed

4 files changed

+303
-173
lines changed

app/src/main/java/ml/docilealligator/infinityforreddit/bottomsheetfragments/PostOptionsBottomSheetFragment.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,16 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
133133
});
134134
}
135135

136+
if (mPost.getPostType() == Post.GALLERY_TYPE) {
137+
binding.downloadAllTextViewPostOptionsBottomSheetFragment.setVisibility(View.VISIBLE);
138+
binding.downloadAllTextViewPostOptionsBottomSheetFragment.setOnClickListener(view -> {
139+
JobInfo jobInfo = DownloadMediaService.constructGalleryDownloadAllImagesJobInfo(mBaseActivity, 5000000, mPost);
140+
((JobScheduler) mBaseActivity.getSystemService(Context.JOB_SCHEDULER_SERVICE)).schedule(jobInfo);
141+
142+
dismiss();
143+
});
144+
}
145+
136146
binding.addToPostFilterTextViewPostOptionsBottomSheetFragment.setOnClickListener(view -> {
137147
Intent intent = new Intent(mBaseActivity, PostFilterPreferenceActivity.class);
138148
intent.putExtra(PostFilterPreferenceActivity.EXTRA_POST, mPost);

0 commit comments

Comments
 (0)