From c843e268d006fb069c408cf00cc3a87384d66fa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Sch=C3=BCller?= Date: Mon, 1 Jun 2020 20:15:50 +0200 Subject: [PATCH 1/2] update library and more (#160) (#161) * download files with friendly name (not video ID) * Update Picasso library FIX : add extension in downloaded filename. download files with friendly name (not video ID) * Update Gradle Add 0.75x and 1.25x to play speed Co-authored-by: jmgfr <13685004+jmgfr@users.noreply.github.com> --- app/build.gradle | 5 +- .../peertube/activity/AccountActivity.java | 2 +- .../peertube/adapter/ChannelAdapter.java | 4 +- .../peertube/adapter/VideoAdapter.java | 4 +- .../fragment/VideoMenuSpeedFragment.java | 10 ++++ .../fragment/VideoMetaDataFragment.java | 2 +- .../schueller/peertube/intents/Intents.java | 7 ++- ...ragment_video_options_speed_popup_menu.xml | 57 +++++++++++++++++++ app/src/main/res/values-ar/strings.xml | 2 + app/src/main/res/values-bn/strings.xml | 2 + app/src/main/res/values-fi/strings.xml | 2 + app/src/main/res/values-fr/strings.xml | 2 + app/src/main/res/values-nl/strings.xml | 2 + app/src/main/res/values-zh-rCN/strings.xml | 2 + app/src/main/res/values-zh-rTW/strings.xml | 2 + app/src/main/res/values/strings.xml | 2 + build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 4 +- 18 files changed, 100 insertions(+), 13 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 1850d25..39d5a45 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -35,10 +35,10 @@ android { implementation 'com.squareup.retrofit2:retrofit:2.5.0' // image downloading and caching library - implementation 'com.squareup.picasso:picasso:2.5.2' + implementation 'com.squareup.picasso:picasso:2.71828' // json decoder/encoder - implementation 'com.google.code.gson:gson:2.8.5' + implementation 'com.google.code.gson:gson:2.8.6' implementation 'com.squareup.retrofit2:converter-gson:2.5.0' // Torrents and WebRTC @@ -79,5 +79,4 @@ android { dependencies { implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta6' implementation 'androidx.appcompat:appcompat:1.1.0' - implementation 'androidx.constraintlayout:constraintlayout:1.1.3' } diff --git a/app/src/main/java/net/schueller/peertube/activity/AccountActivity.java b/app/src/main/java/net/schueller/peertube/activity/AccountActivity.java index 0c70e66..4c4b5cf 100644 --- a/app/src/main/java/net/schueller/peertube/activity/AccountActivity.java +++ b/app/src/main/java/net/schueller/peertube/activity/AccountActivity.java @@ -200,7 +200,7 @@ public class AccountActivity extends CommonActivity { Avatar avatar = account.getAvatar(); if (avatar != null) { String avatarPath = avatar.getPath(); - Picasso.with(AccountActivity.this) + Picasso.get() .load(APIUrlHelper.getUrl(AccountActivity.this) + avatarPath) .into(accountAvatar); } diff --git a/app/src/main/java/net/schueller/peertube/adapter/ChannelAdapter.java b/app/src/main/java/net/schueller/peertube/adapter/ChannelAdapter.java index 082256b..ed4f2ea 100644 --- a/app/src/main/java/net/schueller/peertube/adapter/ChannelAdapter.java +++ b/app/src/main/java/net/schueller/peertube/adapter/ChannelAdapter.java @@ -70,7 +70,7 @@ public class ChannelAdapter extends RecyclerView.Adapter setVideoSpeed(0.5f, speed05Icon)); + speed075.setOnClickListener(v -> setVideoSpeed(0.75f, speed075Icon)); speed10.setOnClickListener(v -> setVideoSpeed(1.0f, speed10Icon)); + speed125.setOnClickListener(v -> setVideoSpeed(1.25f, speed125Icon)); speed15.setOnClickListener(v -> setVideoSpeed(1.5f, speed15Icon)); speed20.setOnClickListener(v -> setVideoSpeed(2.0f, speed20Icon)); @@ -84,7 +92,9 @@ public class VideoMenuSpeedFragment extends BottomSheetDialogFragment { private void setVideoSpeed(Float speed, TextView icon) { speed05Icon.setText(""); + speed075Icon.setText(""); speed10Icon.setText(""); + speed125Icon.setText(""); speed15Icon.setText(""); speed20Icon.setText(""); diff --git a/app/src/main/java/net/schueller/peertube/fragment/VideoMetaDataFragment.java b/app/src/main/java/net/schueller/peertube/fragment/VideoMetaDataFragment.java index d58eab7..17558af 100644 --- a/app/src/main/java/net/schueller/peertube/fragment/VideoMetaDataFragment.java +++ b/app/src/main/java/net/schueller/peertube/fragment/VideoMetaDataFragment.java @@ -165,7 +165,7 @@ public class VideoMetaDataFragment extends Fragment { ImageView avatarView = activity.findViewById(R.id.avatar); String baseUrl = APIUrlHelper.getUrl(context); String avatarPath = avatar.getPath(); - Picasso.with(context) + Picasso.get() .load(baseUrl + avatarPath) .into(avatarView); } diff --git a/app/src/main/java/net/schueller/peertube/intents/Intents.java b/app/src/main/java/net/schueller/peertube/intents/Intents.java index 29ea9c3..acbede1 100644 --- a/app/src/main/java/net/schueller/peertube/intents/Intents.java +++ b/app/src/main/java/net/schueller/peertube/intents/Intents.java @@ -25,10 +25,13 @@ import android.content.pm.PackageManager; import android.net.Uri; import android.os.Build; import android.os.Environment; +import android.webkit.MimeTypeMap; import android.webkit.URLUtil; + import com.github.se_bastiaan.torrentstream.TorrentOptions; +import net.schueller.peertube.R; import net.schueller.peertube.helper.APIUrlHelper; import net.schueller.peertube.model.Video; @@ -66,12 +69,14 @@ public class Intents { public static void Download(Context context, Video video) { String url = video.getFiles().get(0).getFileDownloadUrl(); + String destFilename = video.getName() + "." + MimeTypeMap.getFileExtensionFromUrl(URLUtil.guessFileName(url,null,null)); + //Toast.makeText(context, destFilename, Toast.LENGTH_LONG).show(); DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url)); request.setDescription(video.getDescription()); request.setTitle(video.getName()); request.allowScanningByMediaScanner(); request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED); - request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, URLUtil.guessFileName(url, null, null)); + request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, destFilename); // get download service and enqueue file DownloadManager manager = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE); diff --git a/app/src/main/res/layout/fragment_video_options_speed_popup_menu.xml b/app/src/main/res/layout/fragment_video_options_speed_popup_menu.xml index ca15827..7d0d3c7 100644 --- a/app/src/main/res/layout/fragment_video_options_speed_popup_menu.xml +++ b/app/src/main/res/layout/fragment_video_options_speed_popup_menu.xml @@ -35,6 +35,35 @@ + + + + + + + + + + + + + + + عنوان خادوم PeerTube حدد الخادوم الخادوم الحالي + 0.75x + 1.25x \ No newline at end of file diff --git a/app/src/main/res/values-bn/strings.xml b/app/src/main/res/values-bn/strings.xml index 9ee4ace..366cf0c 100644 --- a/app/src/main/res/values-bn/strings.xml +++ b/app/src/main/res/values-bn/strings.xml @@ -322,4 +322,6 @@ না পিয়ারটিউব সার্ভার URL সার্ভার নির্বাচন করুন + 0.75x + 1.25x \ No newline at end of file diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml index 14b911f..34f6f80 100644 --- a/app/src/main/res/values-fi/strings.xml +++ b/app/src/main/res/values-fi/strings.xml @@ -298,4 +298,6 @@ nauru kirgiisi turkmeeni + 1.25x + 0.75x \ No newline at end of file diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index bace293..fa70f15 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -310,4 +310,6 @@ zhuang zoulou Serveur actuel + 0.75x + 1.25x \ No newline at end of file diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 9e7027d..c34fd93 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -300,4 +300,6 @@ PeerTube-server-url Server kiezen Huidige server + 0.75x + 1.25x \ No newline at end of file diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index fbef971..f390210 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -99,4 +99,6 @@ 语言 + 0.75倍速 + 1.25倍速 \ No newline at end of file diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index df9a5a2..d1c9a28 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -299,4 +299,6 @@ PeerTube 伺服器 URL 選取伺服器 目前的伺服器 + 1.25x + 0.75x \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 6c975a4..9cefc3c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -332,5 +332,7 @@ dislike 1.0.0-alpha.7 Current Server + 0.75x + 1.25x \ No newline at end of file diff --git a/build.gradle b/build.gradle index bf2442a..e4e9daa 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.6.3' + classpath 'com.android.tools.build:gradle:4.0.0' // NOTE: Do not place your application dependencies here; they belong diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a214327..8ff5dc2 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Sat May 16 15:51:28 CEST 2020 +#Mon Jun 01 12:58:36 CEST 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip From 5ed35c9173982e89af8cb43f2a24b3e3a6181a8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Sch=C3=BCller?= Date: Mon, 1 Jun 2020 20:16:38 +0200 Subject: [PATCH 2/2] Release v1.0.35 (#162) * update library and more (#160) * download files with friendly name (not video ID) * Update Picasso library FIX : add extension in downloaded filename. download files with friendly name (not video ID) * Update Gradle Add 0.75x and 1.25x to play speed * Release v1.0.35 Co-authored-by: jmgfr <13685004+jmgfr@users.noreply.github.com> Co-authored-by: Stefan Schueller --- CHANGELOG.md | 5 +++++ app/build.gradle | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 417bb82..0939ec1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +### Version 1.0.35 Tag: v1.0.35 (2020-06-01) + * Gradle und Lib updates (Android Studio 4) (@jmgfr) + * Friendly name for downloaded files (@jmgfr) + * Add 0.5x and 1.25x to video speed menu (@jmgfr) + ### Version 1.0.34 Tag: v1.0.34 (2020-05-16) * Gradle updates diff --git a/app/build.gradle b/app/build.gradle index 39d5a45..5062d0a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -6,8 +6,8 @@ android { applicationId "net.schueller.peertube" minSdkVersion 21 targetSdkVersion 28 - versionCode 1034 - versionName "1.0.34" + versionCode 1035 + versionName "1.0.35" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" ext { libVersions = [ @@ -70,6 +70,7 @@ android { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } + buildToolsVersion '28.0.3' applicationVariants.all { variant -> variant.resValue "string", "versionName", variant.versionName