From cf84a6d431cbf979587722eb725bd736cb487209 Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Thu, 19 Sep 2019 21:58:40 +0800 Subject: Delete something related to downloading videos. --- app/src/main/AndroidManifest.xml | 17 ++-- .../CommentAndPostRecyclerViewAdapter.java | 18 +---- .../infinityforreddit/ParsePost.java | 6 +- .../ml/docilealligator/infinityforreddit/Post.java | 33 +------- .../infinityforreddit/PostRecyclerViewAdapter.java | 18 +---- .../infinityforreddit/ViewVideoActivity.java | 91 +++------------------- 6 files changed, 29 insertions(+), 154 deletions(-) (limited to 'app/src') diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index e31b13d7..210a9216 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -2,6 +2,15 @@ + + + + + + + - - - - - - \ No newline at end of file diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/CommentAndPostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/CommentAndPostRecyclerViewAdapter.java index ac80f670..ada28849 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/CommentAndPostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/CommentAndPostRecyclerViewAdapter.java @@ -431,13 +431,8 @@ class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter= Build.VERSION_CODES.Q) { - request.setDestinationInExternalPublicDir(Environment.DIRECTORY_PICTURES, mGifOrVideoFileName); - } else { - String path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES).toString(); - File directory = new File(path + "/Infinity/"); - boolean saveToInfinityFolder = true; - if(!directory.exists()) { - if(!directory.mkdir()) { - saveToInfinityFolder = false; - } - } else { - if(directory.isFile()) { - if(!directory.delete() && !directory.mkdir()) { - saveToInfinityFolder = false; - } - } - } - - if(saveToInfinityFolder) { - request.setDestinationInExternalPublicDir(Environment.DIRECTORY_PICTURES + "/Infinity/", mGifOrVideoFileName); - } else { - request.setDestinationInExternalPublicDir(Environment.DIRECTORY_PICTURES, mGifOrVideoFileName); - } - } - - DownloadManager manager = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE); - - if(manager == null) { - Toast.makeText(this, R.string.download_failed, Toast.LENGTH_SHORT).show(); - return; - } - - manager.enqueue(request); - Toast.makeText(this, R.string.download_started, Toast.LENGTH_SHORT).show(); + isDownloading = false; } @Override -- cgit v1.2.3