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/build.gradle | 14 ++-- 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 +++------------------- 7 files changed, 36 insertions(+), 161 deletions(-) (limited to 'app') diff --git a/app/build.gradle b/app/build.gradle index ef840dfd..72b0264c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -6,8 +6,8 @@ android { applicationId "ml.docilealligator.infinityforreddit" minSdkVersion 21 targetSdkVersion 29 - versionCode 10 - versionName "1.0.9" + versionCode 11 + versionName "1.1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { @@ -33,16 +33,16 @@ repositories { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation 'androidx.appcompat:appcompat:1.1.0-rc01' - implementation 'com.google.android.material:material:1.1.0-alpha09' + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0-alpha10' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'androidx.legacy:legacy-support-v13:1.0.0' testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test:runner:1.2.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' - implementation 'com.google.android.exoplayer:exoplayer:2.9.6' - implementation 'com.google.android.exoplayer:exoplayer-dash:2.9.6' + implementation 'com.google.android.exoplayer:exoplayer:2.10.4' + implementation 'com.google.android.exoplayer:exoplayer-dash:2.10.4' implementation 'androidx.browser:browser:1.0.0' implementation 'com.alexvasilkov:gesture-views:2.5.2' implementation 'androidx.cardview:cardview:1.0.0' @@ -79,6 +79,6 @@ dependencies { implementation 'com.evernote:android-state:1.4.1' annotationProcessor 'com.evernote:android-state-processor:1.4.1' implementation 'androidx.work:work-runtime:2.2.0' - implementation 'androidx.preference:preference:1.1.0-rc01' + implementation 'androidx.preference:preference:1.1.0' implementation 'org.sufficientlysecure:html-textview:3.6' } 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