From 134d5754905c2e330c122be8f177949aa8787520 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 26 May 2022 14:31:17 +0000 Subject: [PATCH 001/202] Bump gradle from 7.2.0 to 7.2.1 Bumps gradle from 7.2.0 to 7.2.1. --- updated-dependencies: - dependency-name: com.android.tools.build:gradle dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index facc3448f..738ae3345 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.2.0' + classpath 'com.android.tools.build:gradle:7.2.1' classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21' // NOTE: Do not place your application dependencies here; they belong From 7eb68c83e637d3349789ab1713dc13ac3c92a1ca Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Jun 2022 14:42:30 +0000 Subject: [PATCH 002/202] Bump actions/setup-python from 3 to 4 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 3 to 4. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/tg-bot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tg-bot.yml b/.github/workflows/tg-bot.yml index 7ca78bb81..ac605cb01 100644 --- a/.github/workflows/tg-bot.yml +++ b/.github/workflows/tg-bot.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/checkout@v3 - uses: gradle/wrapper-validation-action@v1 - - uses: actions/setup-python@v3 + - uses: actions/setup-python@v4 with: python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified From 155de893b75e904d74936fc0a9321cc44fa1cd91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D5=B1=D5=BC=D6=85=D5=BC=E1=83=A7=5F=D5=BD=D5=BC=C4=B8?= =?UTF-8?q?=D5=BC=D6=85=D5=A1=D5=BC?= <87353286+TheAnonyUnknown@users.noreply.github.com> Date: Fri, 24 Jun 2022 09:44:23 +0530 Subject: [PATCH 003/202] Revert "Bump actions/setup-python from 3 to 4" --- .github/workflows/tg-bot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tg-bot.yml b/.github/workflows/tg-bot.yml index 961d4d403..17659ca55 100644 --- a/.github/workflows/tg-bot.yml +++ b/.github/workflows/tg-bot.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/checkout@v3 - uses: gradle/wrapper-validation-action@v1 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v3 with: python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified From b184157b2a4af0a98824bce4cd63094d835c6a90 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 24 Jun 2022 14:50:17 +0000 Subject: [PATCH 004/202] Bump actions/setup-python from 3 to 4 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 3 to 4. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/tg-bot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tg-bot.yml b/.github/workflows/tg-bot.yml index 17659ca55..961d4d403 100644 --- a/.github/workflows/tg-bot.yml +++ b/.github/workflows/tg-bot.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/checkout@v3 - uses: gradle/wrapper-validation-action@v1 - - uses: actions/setup-python@v3 + - uses: actions/setup-python@v4 with: python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified From 5b7c35bfbbdeab3e75cff24a173e39e6877482ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D5=B1=D5=BC=D6=85=D5=BC=E1=83=A7=5F=D5=BD=D5=BC=C4=B8?= =?UTF-8?q?=D5=BC=D6=85=D5=A1=D5=BC?= <87353286+TheAnonyUnknown@users.noreply.github.com> Date: Sun, 26 Jun 2022 16:02:16 +0530 Subject: [PATCH 005/202] Update README.md --- README.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index b5c6894f0..277902dcc 100644 --- a/README.md +++ b/README.md @@ -7,25 +7,25 @@ [![Twitter](https://libre-tube.github.io/assets/tw-widget.svg)](https://twitter.com/libretube) [![Reddit](https://libre-tube.github.io/assets/rd-widget.svg)](https://www.reddit.com/r/Libretube/) -[Get it on F-Droid](https://f-droid.org/en/packages/com.github.libretube/) -[Get it on IzzyOnDroid](https://apt.izzysoft.de/fdroid/index/apk/com.github.libretube) -[Get it on GitHub](https://github.com/libre-tube/LibreTube/releases/latest) -[Get it on GitHub](https://t.me/LibreTube) +[Get it on F-Droid](https://f-droid.org/en/packages/com.github.libretube/) +[Get it on IzzyOnDroid](https://apt.izzysoft.de/fdroid/index/apk/com.github.libretube) +[Get it on GitHub](https://github.com/libre-tube/LibreTube/releases/latest) +[Get it on GitHub](https://t.me/LibreTube) -## Screenshots +## 📱 Screenshots -[](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_1.png) -[](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_2.png) -[](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_3.png) -[](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_4.png) -[](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_5.png) -[](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_6.png) -[](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_7.png) -[](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_8.png) -[](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_9.png) +[Home](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_1.png) +[Search](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_2.png) +[Player](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_3.png) +[Channel](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_4.png) +[Settings](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_5.png) +[Subscriptions](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_6.png) +[Subscriptions List](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_7.png) +[Library](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_8.png) +[Playlist](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_9.png) -## Features +## ⭐ Features | Feature || | - | - | @@ -39,21 +39,21 @@ | Comments | ✅ | -## Contributing +## 😇 Contributing Whether you have ideas, translations, design changes, code cleaning, or real heavy code changes, help is always welcome.The more is done the better it gets! If creating a pull request, please make sure to format your code (preferred ktlint) before. If opening an issue without following the issue template, we will ignore the issue and force close it. -WARNING: THIS IS A BETA VERSION, THEREFORE YOU MAY ENCOUNTER BUGS. IF YOU DO, OPEN AN ISSUE VIA OUR GITHUB REPOSITORY. +>**⚠️ WARNING: This is a beta version, therefore you may encounter bugs. If you do, open an issue via our github repository.** -### Translation +### 📝 Translation Translation status -### Donate +### 💰 Donate [![Support us on Patreon](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fshieldsio-patreon.vercel.app%2Fapi%3Fusername%3Dlibretubeteam%26type%3Dpatrons&style=for-the-badge)](https://patreon.com/libretubeteam) **BTC:** `bc1q0hk2smc74ej8fxupfrp05wk867e54e2zztnxfc` From c36519294b0592ea155238f3ec0b8fe6a340d610 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D5=B1=D5=BC=D6=85=D5=BC=E1=83=A7=5F=D5=BD=D5=BC=C4=B8?= =?UTF-8?q?=D5=BC=D6=85=D5=A1=D5=BC?= <87353286+TheAnonyUnknown@users.noreply.github.com> Date: Mon, 27 Jun 2022 18:42:51 +0530 Subject: [PATCH 006/202] Fixed layout for mobile screen --- README.md | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 277902dcc..348273de3 100644 --- a/README.md +++ b/README.md @@ -7,23 +7,27 @@ [![Twitter](https://libre-tube.github.io/assets/tw-widget.svg)](https://twitter.com/libretube) [![Reddit](https://libre-tube.github.io/assets/rd-widget.svg)](https://www.reddit.com/r/Libretube/) -[Get it on F-Droid](https://f-droid.org/en/packages/com.github.libretube/) -[Get it on IzzyOnDroid](https://apt.izzysoft.de/fdroid/index/apk/com.github.libretube) -[Get it on GitHub](https://github.com/libre-tube/LibreTube/releases/latest) -[Get it on GitHub](https://t.me/LibreTube) +[Get it on F-Droid](https://f-droid.org/en/packages/com.github.libretube/) +[Get it on IzzyOnDroid](https://apt.izzysoft.de/fdroid/index/apk/com.github.libretube) +[Get it on GitHub](https://github.com/libre-tube/LibreTube/releases/latest) +[Get it on GitHub](https://t.me/LibreTube) ## 📱 Screenshots -[Home](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_1.png) -[Search](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_2.png) -[Player](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_3.png) -[Channel](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_4.png) -[Settings](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_5.png) -[Subscriptions](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_6.png) -[Subscriptions List](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_7.png) -[Library](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_8.png) -[Playlist](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_9.png) +
+ +[Home](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_1.png) +[Search](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_2.png) +[Player](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_3.png) +[Channel](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_4.png) +[Settings](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_5.png) +[Subscriptions](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_6.png) +[Subscriptions List](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_7.png) +[Library](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_8.png) +[Playlist](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_9.png) + +
## ⭐ Features From f9984f9ec324b29118e568896dde5e7754944b11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D5=B1=D5=BC=D6=85=D5=BC=E1=83=A7=5F=D5=BD=D5=BC=C4=B8?= =?UTF-8?q?=D5=BC=D6=85=D5=A1=D5=BC?= <87353286+TheAnonyUnknown@users.noreply.github.com> Date: Mon, 27 Jun 2022 18:54:13 +0530 Subject: [PATCH 007/202] Try to fix pc layout --- README.md | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 348273de3..f0195ad4d 100644 --- a/README.md +++ b/README.md @@ -7,25 +7,15 @@ [![Twitter](https://libre-tube.github.io/assets/tw-widget.svg)](https://twitter.com/libretube) [![Reddit](https://libre-tube.github.io/assets/rd-widget.svg)](https://www.reddit.com/r/Libretube/) -[Get it on F-Droid](https://f-droid.org/en/packages/com.github.libretube/) -[Get it on IzzyOnDroid](https://apt.izzysoft.de/fdroid/index/apk/com.github.libretube) -[Get it on GitHub](https://github.com/libre-tube/LibreTube/releases/latest) -[Get it on GitHub](https://t.me/LibreTube) +[Get it on F-Droid](https://f-droid.org/en/packages/com.github.libretube/) [Get it on IzzyOnDroid](https://apt.izzysoft.de/fdroid/index/apk/com.github.libretube) [Get it on GitHub](https://github.com/libre-tube/LibreTube/releases/latest) [Get it on GitHub](https://t.me/LibreTube) + ## 📱 Screenshots
-[Home](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_1.png) -[Search](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_2.png) -[Player](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_3.png) -[Channel](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_4.png) -[Settings](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_5.png) -[Subscriptions](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_6.png) -[Subscriptions List](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_7.png) -[Library](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_8.png) -[Playlist](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_9.png) +[Home](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_1.png) [Search](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_2.png) [Player](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_3.png) [Channel](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_4.png) [Settings](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_5.png) [Subscriptions](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_6.png) [Subscriptions List](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_7.png) [Library](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_8.png) [Playlist](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_9.png)
From fe13ec8048e55e58709edcdf3e39d9974a314bf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D5=B1=D5=BC=D6=85=D5=BC=E1=83=A7=5F=D5=BD=D5=BC=C4=B8?= =?UTF-8?q?=D5=BC=D6=85=D5=A1=D5=BC?= <87353286+TheAnonyUnknown@users.noreply.github.com> Date: Wed, 29 Jun 2022 16:40:59 +0530 Subject: [PATCH 008/202] Reworked layout and line wrapping --- README.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f0195ad4d..825f66780 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,10 @@ [![Twitter](https://libre-tube.github.io/assets/tw-widget.svg)](https://twitter.com/libretube) [![Reddit](https://libre-tube.github.io/assets/rd-widget.svg)](https://www.reddit.com/r/Libretube/) -[Get it on F-Droid](https://f-droid.org/en/packages/com.github.libretube/) [Get it on IzzyOnDroid](https://apt.izzysoft.de/fdroid/index/apk/com.github.libretube) [Get it on GitHub](https://github.com/libre-tube/LibreTube/releases/latest) [Get it on GitHub](https://t.me/LibreTube) +[Get it on F-Droid](https://f-droid.org/en/packages/com.github.libretube/) +[Get it on IzzyOnDroid](https://apt.izzysoft.de/fdroid/index/apk/com.github.libretube) +[Get it on GitHub](https://github.com/libre-tube/LibreTube/releases/latest) +[Get it on GitHub](https://t.me/LibreTube) @@ -15,7 +18,15 @@
-[Home](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_1.png) [Search](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_2.png) [Player](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_3.png) [Channel](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_4.png) [Settings](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_5.png) [Subscriptions](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_6.png) [Subscriptions List](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_7.png) [Library](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_8.png) [Playlist](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_9.png) +[Home](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_1.png) +[Search](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_2.png) +[Player](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_3.png) +[Channel](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_4.png) +[Settings](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_5.png) +[Subscriptions](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_6.png) +[Subscriptions List](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_7.png) +[Library](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_8.png) +[Playlist](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_9.png)
@@ -54,6 +65,6 @@ If opening an issue without following the issue template, we will ignore the iss **XMR:** `44txdmy4E5bDzMYQJh1ZSoHbrp1sWfpGa2FYg26L2ya8EaRejPsh42yVrYhepW9P4YWvrqmTZvms35z5FDgqy1xcVewk18d` -## Mirrors (read-only) +## 🪞 Mirrors (read-only) GitLab

NotABug

From 47c6bdcb23d12c51a7290dcfe7d944b0dea95895 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D5=B1=D5=BC=D6=85=D5=BC=E1=83=A7=5F=D5=BD=D5=BC=C4=B8?= =?UTF-8?q?=D5=BC=D6=85=D5=A1=D5=BC?= <87353286+TheAnonyUnknown@users.noreply.github.com> Date: Wed, 29 Jun 2022 17:00:55 +0530 Subject: [PATCH 009/202] Refactored sizing --- README.md | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 825f66780..b2ccd8980 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,10 @@ [![Twitter](https://libre-tube.github.io/assets/tw-widget.svg)](https://twitter.com/libretube) [![Reddit](https://libre-tube.github.io/assets/rd-widget.svg)](https://www.reddit.com/r/Libretube/) -[Get it on F-Droid](https://f-droid.org/en/packages/com.github.libretube/) -[Get it on IzzyOnDroid](https://apt.izzysoft.de/fdroid/index/apk/com.github.libretube) -[Get it on GitHub](https://github.com/libre-tube/LibreTube/releases/latest) -[Get it on GitHub](https://t.me/LibreTube) +[Get it on F-Droid](https://f-droid.org/en/packages/com.github.libretube/) +[Get it on IzzyOnDroid](https://apt.izzysoft.de/fdroid/index/apk/com.github.libretube) +[Get it on GitHub](https://github.com/libre-tube/LibreTube/releases/latest) +[Get it on GitHub](https://t.me/LibreTube) @@ -18,15 +18,15 @@
-[Home](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_1.png) -[Search](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_2.png) -[Player](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_3.png) -[Channel](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_4.png) -[Settings](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_5.png) -[Subscriptions](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_6.png) -[Subscriptions List](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_7.png) -[Library](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_8.png) -[Playlist](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_9.png) +[Home](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_1.png) +[Search](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_2.png) +[Player](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_3.png) +[Channel](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_4.png) +[Settings](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_5.png) +[Subscriptions](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_6.png) +[Subscriptions List](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_7.png) +[Library](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_8.png) +[Playlist](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_9.png)
@@ -45,6 +45,7 @@ ## 😇 Contributing + Whether you have ideas, translations, design changes, code cleaning, or real heavy code changes, help is always welcome.The more is done the better it gets! If creating a pull request, please make sure to format your code (preferred ktlint) before. @@ -54,11 +55,13 @@ If opening an issue without following the issue template, we will ignore the iss >**⚠️ WARNING: This is a beta version, therefore you may encounter bugs. If you do, open an issue via our github repository.** ### 📝 Translation + Translation status ### 💰 Donate + [![Support us on Patreon](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fshieldsio-patreon.vercel.app%2Fapi%3Fusername%3Dlibretubeteam%26type%3Dpatrons&style=for-the-badge)](https://patreon.com/libretubeteam) **BTC:** `bc1q0hk2smc74ej8fxupfrp05wk867e54e2zztnxfc` From c098b3265eabd4696014b16adb6a3b748729f319 Mon Sep 17 00:00:00 2001 From: "restyled-io[bot]" <32688539+restyled-io[bot]@users.noreply.github.com> Date: Wed, 29 Jun 2022 17:03:07 +0530 Subject: [PATCH 010/202] Code Enhancements --- README.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index b2ccd8980..1480a5b52 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![Telegram](https://libre-tube.github.io/assets/tg-widget.svg)](https://t.me/libretube) [![Twitter](https://libre-tube.github.io/assets/tw-widget.svg)](https://twitter.com/libretube) [![Reddit](https://libre-tube.github.io/assets/rd-widget.svg)](https://www.reddit.com/r/Libretube/) - + [Get it on F-Droid](https://f-droid.org/en/packages/com.github.libretube/) [Get it on IzzyOnDroid](https://apt.izzysoft.de/fdroid/index/apk/com.github.libretube) [Get it on GitHub](https://github.com/libre-tube/LibreTube/releases/latest) @@ -32,17 +32,16 @@ ## ⭐ Features -| Feature || -| - | - | -| User Accounts | ✅ | -| Subscriptions | ✅ | -| User Playlists | ✅ | -| Channel Playlists | ✅ | -| Search Filters | ✅ | -| SponsorBlock | ✅ | -| Subtitles | ✅ | -| Comments | ✅ | - +| Feature | | +| ----------------- | --- | +| User Accounts | ✅ | +| Subscriptions | ✅ | +| User Playlists | ✅ | +| Channel Playlists | ✅ | +| Search Filters | ✅ | +| SponsorBlock | ✅ | +| Subtitles | ✅ | +| Comments | ✅ | ## 😇 Contributing @@ -52,7 +51,7 @@ If creating a pull request, please make sure to format your code (preferred ktli If opening an issue without following the issue template, we will ignore the issue and force close it. ->**⚠️ WARNING: This is a beta version, therefore you may encounter bugs. If you do, open an issue via our github repository.** +> **⚠️ WARNING: This is a beta version, therefore you may encounter bugs. If you do, open an issue via our github repository.** ### 📝 Translation @@ -69,5 +68,6 @@ If opening an issue without following the issue template, we will ignore the iss **XMR:** `44txdmy4E5bDzMYQJh1ZSoHbrp1sWfpGa2FYg26L2ya8EaRejPsh42yVrYhepW9P4YWvrqmTZvms35z5FDgqy1xcVewk18d` ## 🪞 Mirrors (read-only) + GitLab

NotABug

From 9259778e0302986209698fe882bce8f3ed990005 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D5=B1=D5=BC=D6=85=D5=BC=E1=83=A7=5F=D5=BD=D5=BC=C4=B8?= =?UTF-8?q?=D5=BC=D6=85=D5=A1=D5=BC?= <87353286+TheAnonyUnknown@users.noreply.github.com> Date: Wed, 29 Jun 2022 17:32:34 +0530 Subject: [PATCH 011/202] Try to fix pc layout again --- README.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 1480a5b52..de10ad348 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,32 @@
LibreTube -[![GPL-v3](https://libre-tube.github.io/assets/license-widget.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html) -[![Matrix](https://libre-tube.github.io/assets/mat-widget.svg)](https://matrix.to/#/#LibreTube:matrix.org) -[![Telegram](https://libre-tube.github.io/assets/tg-widget.svg)](https://t.me/libretube) -[![Twitter](https://libre-tube.github.io/assets/tw-widget.svg)](https://twitter.com/libretube) -[![Reddit](https://libre-tube.github.io/assets/rd-widget.svg)](https://www.reddit.com/r/Libretube/) + [![GPL-v3](https://libre-tube.github.io/assets/license-widget.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html) + [![Matrix](https://libre-tube.github.io/assets/mat-widget.svg)](https://matrix.to/#/#LibreTube:matrix.org) + [![Telegram](https://libre-tube.github.io/assets/tg-widget.svg)](https://t.me/libretube) + [![Twitter](https://libre-tube.github.io/assets/tw-widget.svg)](https://twitter.com/libretube) + [![Reddit](https://libre-tube.github.io/assets/rd-widget.svg)](https://www.reddit.com/r/Libretube/) -[Get it on F-Droid](https://f-droid.org/en/packages/com.github.libretube/) -[Get it on IzzyOnDroid](https://apt.izzysoft.de/fdroid/index/apk/com.github.libretube) -[Get it on GitHub](https://github.com/libre-tube/LibreTube/releases/latest) -[Get it on GitHub](https://t.me/LibreTube) + [Get it on F-Droid](https://f-droid.org/en/packages/com.github.libretube/) + [Get it on IzzyOnDroid](https://apt.izzysoft.de/fdroid/index/apk/com.github.libretube) + [Get it on GitHub](https://github.com/libre-tube/LibreTube/releases/latest) + [Get it on GitHub](https://t.me/LibreTube)
## 📱 Screenshots -
+
-[Home](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_1.png) -[Search](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_2.png) -[Player](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_3.png) -[Channel](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_4.png) -[Settings](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_5.png) -[Subscriptions](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_6.png) -[Subscriptions List](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_7.png) -[Library](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_8.png) -[Playlist](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_9.png) +[Home](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_1.png) +[Search](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_2.png) +[Player](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_3.png) +[Channel](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_4.png) +[Settings](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_5.png) +[Subscriptions](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_6.png) +[Subscriptions List](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_7.png) +[Library](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_8.png) +[Playlist](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_9.png)
From b521bcd3bb3de22c8db0e802bcc786371a64f126 Mon Sep 17 00:00:00 2001 From: "restyled-io[bot]" <32688539+restyled-io[bot]@users.noreply.github.com> Date: Wed, 29 Jun 2022 17:34:30 +0530 Subject: [PATCH 012/202] Removed extra spaces --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index de10ad348..d15adf310 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,16 @@
LibreTube - [![GPL-v3](https://libre-tube.github.io/assets/license-widget.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html) - [![Matrix](https://libre-tube.github.io/assets/mat-widget.svg)](https://matrix.to/#/#LibreTube:matrix.org) - [![Telegram](https://libre-tube.github.io/assets/tg-widget.svg)](https://t.me/libretube) - [![Twitter](https://libre-tube.github.io/assets/tw-widget.svg)](https://twitter.com/libretube) - [![Reddit](https://libre-tube.github.io/assets/rd-widget.svg)](https://www.reddit.com/r/Libretube/) +[![GPL-v3](https://libre-tube.github.io/assets/license-widget.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html) +[![Matrix](https://libre-tube.github.io/assets/mat-widget.svg)](https://matrix.to/#/#LibreTube:matrix.org) +[![Telegram](https://libre-tube.github.io/assets/tg-widget.svg)](https://t.me/libretube) +[![Twitter](https://libre-tube.github.io/assets/tw-widget.svg)](https://twitter.com/libretube) +[![Reddit](https://libre-tube.github.io/assets/rd-widget.svg)](https://www.reddit.com/r/Libretube/) - [Get it on F-Droid](https://f-droid.org/en/packages/com.github.libretube/) - [Get it on IzzyOnDroid](https://apt.izzysoft.de/fdroid/index/apk/com.github.libretube) - [Get it on GitHub](https://github.com/libre-tube/LibreTube/releases/latest) - [Get it on GitHub](https://t.me/LibreTube) +[Get it on F-Droid](https://f-droid.org/en/packages/com.github.libretube/) +[Get it on IzzyOnDroid](https://apt.izzysoft.de/fdroid/index/apk/com.github.libretube) +[Get it on GitHub](https://github.com/libre-tube/LibreTube/releases/latest) +[Get it on GitHub](https://t.me/LibreTube)
From 94fd3087143d772cd0f77c01acecf3411906d576 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D5=B1=D5=BC=D6=85=D5=BC=E1=83=A7=5F=D5=BD=D5=BC=C4=B8?= =?UTF-8?q?=D5=BC=D6=85=D5=A1=D5=BC?= <87353286+TheAnonyUnknown@users.noreply.github.com> Date: Thu, 30 Jun 2022 09:07:49 +0530 Subject: [PATCH 013/202] Update README.md --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d15adf310..87aa1ecfe 100644 --- a/README.md +++ b/README.md @@ -7,16 +7,18 @@ [![Twitter](https://libre-tube.github.io/assets/tw-widget.svg)](https://twitter.com/libretube) [![Reddit](https://libre-tube.github.io/assets/rd-widget.svg)](https://www.reddit.com/r/Libretube/) -[Get it on F-Droid](https://f-droid.org/en/packages/com.github.libretube/) -[Get it on IzzyOnDroid](https://apt.izzysoft.de/fdroid/index/apk/com.github.libretube) -[Get it on GitHub](https://github.com/libre-tube/LibreTube/releases/latest) -[Get it on GitHub](https://t.me/LibreTube) +
+ +[Get it on F-Droid](https://f-droid.org/en/packages/com.github.libretube/) +[Get it on IzzyOnDroid](https://apt.izzysoft.de/fdroid/index/apk/com.github.libretube) +[Get it on GitHub](https://github.com/libre-tube/LibreTube/releases/latest) +[Get it on GitHub](https://t.me/LibreTube)
## 📱 Screenshots -
+
[Home](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_1.png) [Search](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_2.png) From 946ff5108aff304641197d97e428a5857d41a73f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D5=B1=D5=BC=D6=85=D5=BC=E1=83=A7=5F=D5=BD=D5=BC=C4=B8?= =?UTF-8?q?=D5=BC=D6=85=D5=A1=D5=BC?= <87353286+TheAnonyUnknown@users.noreply.github.com> Date: Thu, 30 Jun 2022 09:29:09 +0530 Subject: [PATCH 014/202] =?UTF-8?q?3=C3=973=20layout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 87aa1ecfe..9cb63c092 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,10 @@
-[Get it on F-Droid](https://f-droid.org/en/packages/com.github.libretube/) -[Get it on IzzyOnDroid](https://apt.izzysoft.de/fdroid/index/apk/com.github.libretube) -[Get it on GitHub](https://github.com/libre-tube/LibreTube/releases/latest) -[Get it on GitHub](https://t.me/LibreTube) +[Get it on F-Droid](https://f-droid.org/en/packages/com.github.libretube/) +[Get it on IzzyOnDroid](https://apt.izzysoft.de/fdroid/index/apk/com.github.libretube)
+[Get it on GitHub](https://github.com/libre-tube/LibreTube/releases/latest) +[Get it on GitHub](https://t.me/LibreTube)
@@ -20,15 +20,15 @@
-[Home](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_1.png) -[Search](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_2.png) -[Player](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_3.png) -[Channel](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_4.png) -[Settings](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_5.png) -[Subscriptions](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_6.png) -[Subscriptions List](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_7.png) -[Library](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_8.png) -[Playlist](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_9.png) +[Home](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_1.png) +[Search](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_2.png) +[Player](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_3.png) +[Channel](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_4.png) +[Settings](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_5.png) +[Subscriptions](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_6.png) +[Subscriptions List](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_7.png) +[Library](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_8.png) +[Playlist](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_9.png)
From c81f1e064285d86c2aa1182cdf43532aca85c0b9 Mon Sep 17 00:00:00 2001 From: Bnyro <82752168+Bnyro@users.noreply.github.com> Date: Thu, 30 Jun 2022 07:57:48 +0200 Subject: [PATCH 015/202] Update tg-bot.yml --- .github/workflows/tg-bot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tg-bot.yml b/.github/workflows/tg-bot.yml index 961d4d403..17659ca55 100644 --- a/.github/workflows/tg-bot.yml +++ b/.github/workflows/tg-bot.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/checkout@v3 - uses: gradle/wrapper-validation-action@v1 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v3 with: python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified From 2801f5d1659bfb0c4f6148fdc2bbe3c51d398783 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Thu, 30 Jun 2022 13:38:21 +0200 Subject: [PATCH 016/202] reduce preload buffer --- .../main/java/com/github/libretube/fragments/PlayerFragment.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt b/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt index 05d306338..779203258 100644 --- a/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt +++ b/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt @@ -969,7 +969,7 @@ class PlayerFragment : Fragment() { // cache the last three minutes .setBackBuffer(1000 * 60 * 3, true) .setBufferDurationsMs( - DefaultLoadControl.DEFAULT_MIN_BUFFER_MS, + 1000 * 10, // exo default is 50s bufferingGoal, DefaultLoadControl.DEFAULT_BUFFER_FOR_PLAYBACK_MS, DefaultLoadControl.DEFAULT_BUFFER_FOR_PLAYBACK_AFTER_REBUFFER_MS From 6d50edb6a539e579dd793a236a3fae8fb9932509 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Thu, 30 Jun 2022 14:19:54 +0200 Subject: [PATCH 017/202] chapters animation --- .../util/CustomOnScaleGestureListener.kt | 34 +++++++++++++++++++ app/src/main/res/layout/chapter_column.xml | 3 +- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 app/src/main/java/com/github/libretube/util/CustomOnScaleGestureListener.kt diff --git a/app/src/main/java/com/github/libretube/util/CustomOnScaleGestureListener.kt b/app/src/main/java/com/github/libretube/util/CustomOnScaleGestureListener.kt new file mode 100644 index 000000000..7d166c68d --- /dev/null +++ b/app/src/main/java/com/github/libretube/util/CustomOnScaleGestureListener.kt @@ -0,0 +1,34 @@ +package com.github.libretube.util + +import android.util.Log +import android.view.ScaleGestureDetector +import com.google.android.exoplayer2.ui.AspectRatioFrameLayout +import com.google.android.exoplayer2.ui.StyledPlayerView + +class CustomOnScaleGestureListener( + private val player: StyledPlayerView +) : ScaleGestureDetector.SimpleOnScaleGestureListener() { + private var scaleFactor = 0f + + override fun onScale( + detector: ScaleGestureDetector + ): Boolean { + scaleFactor = detector.scaleFactor + return true + } + + override fun onScaleBegin( + detector: ScaleGestureDetector + ): Boolean { + return true + } + + override fun onScaleEnd(detector: ScaleGestureDetector) { + Log.e("scale", "scale") + if (scaleFactor > 1) { + player.resizeMode = AspectRatioFrameLayout.RESIZE_MODE_ZOOM + } else { + player.resizeMode = AspectRatioFrameLayout.RESIZE_MODE_FIT + } + } +} diff --git a/app/src/main/res/layout/chapter_column.xml b/app/src/main/res/layout/chapter_column.xml index f323807ab..b44de7e06 100644 --- a/app/src/main/res/layout/chapter_column.xml +++ b/app/src/main/res/layout/chapter_column.xml @@ -3,7 +3,8 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="100dp" android:layout_height="wrap_content" - android:layout_marginHorizontal="5dp" + android:paddingHorizontal="5dp" + android:background="?attr/selectableItemBackground" android:orientation="vertical"> Date: Thu, 30 Jun 2022 14:20:22 +0200 Subject: [PATCH 018/202] . --- .../util/CustomOnScaleGestureListener.kt | 34 ------------------- 1 file changed, 34 deletions(-) delete mode 100644 app/src/main/java/com/github/libretube/util/CustomOnScaleGestureListener.kt diff --git a/app/src/main/java/com/github/libretube/util/CustomOnScaleGestureListener.kt b/app/src/main/java/com/github/libretube/util/CustomOnScaleGestureListener.kt deleted file mode 100644 index 7d166c68d..000000000 --- a/app/src/main/java/com/github/libretube/util/CustomOnScaleGestureListener.kt +++ /dev/null @@ -1,34 +0,0 @@ -package com.github.libretube.util - -import android.util.Log -import android.view.ScaleGestureDetector -import com.google.android.exoplayer2.ui.AspectRatioFrameLayout -import com.google.android.exoplayer2.ui.StyledPlayerView - -class CustomOnScaleGestureListener( - private val player: StyledPlayerView -) : ScaleGestureDetector.SimpleOnScaleGestureListener() { - private var scaleFactor = 0f - - override fun onScale( - detector: ScaleGestureDetector - ): Boolean { - scaleFactor = detector.scaleFactor - return true - } - - override fun onScaleBegin( - detector: ScaleGestureDetector - ): Boolean { - return true - } - - override fun onScaleEnd(detector: ScaleGestureDetector) { - Log.e("scale", "scale") - if (scaleFactor > 1) { - player.resizeMode = AspectRatioFrameLayout.RESIZE_MODE_ZOOM - } else { - player.resizeMode = AspectRatioFrameLayout.RESIZE_MODE_FIT - } - } -} From 87f7fcb3232273e0a79c69146d5e500772ea414d Mon Sep 17 00:00:00 2001 From: Bnyro Date: Thu, 30 Jun 2022 14:30:23 +0200 Subject: [PATCH 019/202] add support for android 13 monochrome icons --- .../res/drawable/ic_launcher_monochrome.xml | 17 +++++++++++++++++ .../main/res/mipmap-anydpi-v26/ic_launcher.xml | 1 + .../res/mipmap-anydpi-v26/ic_launcher_round.xml | 1 + 3 files changed, 19 insertions(+) create mode 100644 app/src/main/res/drawable/ic_launcher_monochrome.xml diff --git a/app/src/main/res/drawable/ic_launcher_monochrome.xml b/app/src/main/res/drawable/ic_launcher_monochrome.xml new file mode 100644 index 000000000..7ea164ea6 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_monochrome.xml @@ -0,0 +1,17 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml index c9ad5f98f..6c7bd4e4a 100644 --- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -2,4 +2,5 @@ + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml index c9ad5f98f..6c7bd4e4a 100644 --- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -2,4 +2,5 @@ + \ No newline at end of file From 37bba6ea953f7844a20ad3553068b3a394c62d32 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Thu, 30 Jun 2022 14:39:37 +0200 Subject: [PATCH 020/202] fix icon size --- .../res/drawable/ic_launcher_monochrome.xml | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/app/src/main/res/drawable/ic_launcher_monochrome.xml b/app/src/main/res/drawable/ic_launcher_monochrome.xml index 7ea164ea6..6cc55ad92 100644 --- a/app/src/main/res/drawable/ic_launcher_monochrome.xml +++ b/app/src/main/res/drawable/ic_launcher_monochrome.xml @@ -4,14 +4,14 @@ android:height="1280dp" android:viewportWidth="1280" android:viewportHeight="1280"> - - - \ No newline at end of file + + + From 8f758566f128009fd82d4d881742ad1626b80116 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Thu, 30 Jun 2022 16:02:55 +0200 Subject: [PATCH 021/202] autoplay in background mode --- .../com/github/libretube/BackgroundMode.kt | 53 +++++++++++++++++-- .../libretube/dialogs/VideoOptionsDialog.kt | 2 +- .../libretube/fragments/PlayerFragment.kt | 2 +- .../libretube/util/DescriptionAdapter.kt | 4 +- 4 files changed, 53 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/github/libretube/BackgroundMode.kt b/app/src/main/java/com/github/libretube/BackgroundMode.kt index 79ff8a319..a95a8801d 100644 --- a/app/src/main/java/com/github/libretube/BackgroundMode.kt +++ b/app/src/main/java/com/github/libretube/BackgroundMode.kt @@ -1,13 +1,16 @@ package com.github.libretube +import android.app.NotificationManager import android.content.Context import android.support.v4.media.session.MediaSessionCompat import com.github.libretube.obj.Streams import com.github.libretube.util.DescriptionAdapter +import com.github.libretube.util.PreferenceHelper import com.github.libretube.util.RetrofitInstance import com.google.android.exoplayer2.C import com.google.android.exoplayer2.ExoPlayer import com.google.android.exoplayer2.MediaItem +import com.google.android.exoplayer2.Player import com.google.android.exoplayer2.audio.AudioAttributes import com.google.android.exoplayer2.ext.mediasession.MediaSessionConnector import com.google.android.exoplayer2.ui.PlayerNotificationManager @@ -42,7 +45,7 @@ class BackgroundMode { /** * The [PlayerNotificationManager] to load the [mediaSession] content on it. */ - private lateinit var playerNotification: PlayerNotificationManager + private var playerNotification: PlayerNotificationManager? = null /** * The [AudioAttributes] handle the audio focus of the [player] @@ -63,9 +66,45 @@ class BackgroundMode { .setAudioAttributes(audioAttributes, true) .build() } + + /** + * Listens for changed playbackStates (e.g. pause, end) + * Plays the next video when the current one ended + */ + player!!.addListener(object : Player.Listener { + override fun onPlaybackStateChanged(@Player.State state: Int) { + val autoplay = PreferenceHelper.getBoolean(c, "autoplay", false) + if (state == Player.STATE_ENDED) { + if (autoplay) playNextVideo(c) + } + } + }) setMediaItem(c) } + /** + * Plays the first related video to the current (used when the playback of the current video ended) + */ + private fun playNextVideo(c: Context) { + if (response!!.relatedStreams!!.isNotEmpty()) { + val videoId = response!! + .relatedStreams!![0].url!! + .replace("/watch?v=", "") + + // destroy old player and its notification + playerNotification = null + player = null + + // kill old notification + val notificationManager = c.getSystemService(Context.NOTIFICATION_SERVICE) + as NotificationManager + notificationManager.cancel(1) + + // play new video on background + playOnBackgroundMode(c, videoId) + } + } + /** * Initializes the [playerNotification] attached to the [player] and shows it. */ @@ -82,10 +121,12 @@ class BackgroundMode { ) ) .build() - playerNotification.apply { + playerNotification?.apply { setPlayer(player) - setUsePreviousAction(false) setUseNextAction(false) + setUsePreviousAction(false) + setUseStopAction(true) + setColorized(true) setMediaSessionToken(mediaSession.sessionToken) } } @@ -110,7 +151,11 @@ class BackgroundMode { /** * Gets the video data and prepares the [player]. */ - fun playOnBackgroundMode(c: Context, videoId: String, seekToPosition: Long) { + fun playOnBackgroundMode( + c: Context, + videoId: String, + seekToPosition: Long = 0 + ) { runBlocking { val job = launch { response = RetrofitInstance.api.getStreams(videoId) diff --git a/app/src/main/java/com/github/libretube/dialogs/VideoOptionsDialog.kt b/app/src/main/java/com/github/libretube/dialogs/VideoOptionsDialog.kt index 9271af500..da87f5551 100644 --- a/app/src/main/java/com/github/libretube/dialogs/VideoOptionsDialog.kt +++ b/app/src/main/java/com/github/libretube/dialogs/VideoOptionsDialog.kt @@ -47,7 +47,7 @@ class VideoOptionsDialog(private val videoId: String, context: Context) : Dialog // This for example will be the "Background mode" option 0 -> { BackgroundMode.getInstance() - .playOnBackgroundMode(requireContext(), videoId, 0) + .playOnBackgroundMode(requireContext(), videoId) } // Add Video to Playlist Dialog 1 -> { diff --git a/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt b/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt index 779203258..55b6cbd3b 100644 --- a/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt +++ b/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt @@ -1006,8 +1006,8 @@ class PlayerFragment : Fragment() { playerNotification.apply { setPlayer(exoPlayer) - setUseNextAction(false) setUsePreviousAction(false) + setUseStopAction(true) setMediaSessionToken(mediaSession.sessionToken) } } diff --git a/app/src/main/java/com/github/libretube/util/DescriptionAdapter.kt b/app/src/main/java/com/github/libretube/util/DescriptionAdapter.kt index 8f81b6fad..a7c9c1ec9 100644 --- a/app/src/main/java/com/github/libretube/util/DescriptionAdapter.kt +++ b/app/src/main/java/com/github/libretube/util/DescriptionAdapter.kt @@ -83,8 +83,8 @@ class DescriptionAdapter( return try { val resizedBitmap = Bitmap.createScaledBitmap( bitmap, - 1080, - 1080, + bitmap.width, + bitmap.width, false ) resizedBitmap From 6806f4fe6ec5b3d9c29c870e9e92ea4677213239 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Thu, 30 Jun 2022 21:05:31 +0200 Subject: [PATCH 022/202] introduce viewbinding --- app/build.gradle | 4 ++ .../java/com/github/libretube/MainActivity.kt | 22 +++---- .../libretube/fragments/PlayerFragment.kt | 57 +++++++++---------- 3 files changed, 44 insertions(+), 39 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 90f219fa8..043de6114 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -17,6 +17,10 @@ android { resValue "string", "app_name", "LibreTube" } + buildFeatures { + viewBinding true + } + buildTypes { release { minifyEnabled true diff --git a/app/src/main/java/com/github/libretube/MainActivity.kt b/app/src/main/java/com/github/libretube/MainActivity.kt index 5c694a275..459bb8d4a 100644 --- a/app/src/main/java/com/github/libretube/MainActivity.kt +++ b/app/src/main/java/com/github/libretube/MainActivity.kt @@ -32,6 +32,7 @@ import androidx.fragment.app.Fragment import androidx.navigation.NavController import androidx.navigation.findNavController import androidx.navigation.ui.setupWithNavController +import com.github.libretube.databinding.ActivityMainBinding import com.github.libretube.fragments.PlayerFragment import com.github.libretube.fragments.isFullScreen import com.github.libretube.services.ClosingService @@ -46,7 +47,9 @@ import com.google.android.material.color.DynamicColors class MainActivity : AppCompatActivity() { val TAG = "MainActivity" - lateinit var bottomNavigationView: BottomNavigationView + lateinit var binding: ActivityMainBinding + + private lateinit var bottomNavigationView: BottomNavigationView private lateinit var toolbar: Toolbar lateinit var navController: NavController @@ -76,12 +79,12 @@ class MainActivity : AppCompatActivity() { startActivity(intent) } } else { - setContentView(R.layout.activity_main) + binding = ActivityMainBinding.inflate(layoutInflater) + setContentView(binding.root) requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT - bottomNavigationView = findViewById(R.id.bottomNav) navController = findNavController(R.id.fragment) - bottomNavigationView.setupWithNavController(navController) + binding.bottomNav.setupWithNavController(navController) // hide the trending page if enabled val hideTrendingPage = PreferenceHelper.getBoolean(this, "hide_trending_page", false) @@ -94,7 +97,7 @@ class MainActivity : AppCompatActivity() { "library" -> navController.navigate(R.id.library) } - bottomNavigationView.setOnItemSelectedListener { + binding.bottomNav.setOnItemSelectedListener { when (it.itemId) { R.id.home2 -> { navController.backQueue.clear() @@ -112,7 +115,6 @@ class MainActivity : AppCompatActivity() { false } - toolbar = findViewById(R.id.toolbar) val typedValue = TypedValue() this.theme.resolveAttribute(R.attr.colorPrimary, typedValue, true) val hexColor = String.format("#%06X", (0xFFFFFF and typedValue.data)) @@ -120,15 +122,15 @@ class MainActivity : AppCompatActivity() { "LibreTube", HtmlCompat.FROM_HTML_MODE_COMPACT ) - toolbar.title = appName + binding.toolbar.title = appName - toolbar.setNavigationOnClickListener { + binding.toolbar.setNavigationOnClickListener { // settings activity stuff val intent = Intent(this, SettingsActivity::class.java) startActivity(intent) } - toolbar.setOnMenuItemClickListener { + binding.toolbar.setOnMenuItemClickListener { when (it.itemId) { R.id.action_search -> { navController.navigate(R.id.searchFragment) @@ -267,7 +269,7 @@ class MainActivity : AppCompatActivity() { override fun onBackPressed() { try { - val mainMotionLayout = findViewById(R.id.mainMotionLayout) + val mainMotionLayout = binding.mainMotionLayout if (mainMotionLayout.progress == 0.toFloat()) { mainMotionLayout.transitionToEnd() findViewById(R.id.main_container).isClickable = false diff --git a/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt b/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt index 55b6cbd3b..a6762f05d 100644 --- a/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt +++ b/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt @@ -43,6 +43,7 @@ import com.github.libretube.R import com.github.libretube.adapters.ChaptersAdapter import com.github.libretube.adapters.CommentsAdapter import com.github.libretube.adapters.TrendingAdapter +import com.github.libretube.databinding.FragmentPlayerBinding import com.github.libretube.dialogs.AddtoPlaylistDialog import com.github.libretube.dialogs.DownloadDialog import com.github.libretube.dialogs.ShareDialog @@ -102,6 +103,8 @@ var isMiniPlayerVisible = false class PlayerFragment : Fragment() { private val TAG = "PlayerFragment" + private lateinit var binding: FragmentPlayerBinding + private var videoId: String? = null private var playlistId: String? = null private var sId: Int = 0 @@ -157,8 +160,9 @@ class PlayerFragment : Fragment() { container: ViewGroup?, savedInstanceState: Bundle? ): View? { + binding = FragmentPlayerBinding.inflate(layoutInflater, container, false) // Inflate the layout for this fragment - return inflater.inflate(R.layout.fragment_player, container, false) + return binding.root } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { @@ -172,17 +176,16 @@ class PlayerFragment : Fragment() { } private fun initializeTransitionLayout(view: View) { - val playerDescription = view.findViewById(R.id.player_description) videoId = videoId!!.replace("/watch?v=", "") - relDownloadVideo = view.findViewById(R.id.relPlayer_download) + val mainActivity = activity as MainActivity - mainActivity.findViewById(R.id.container).visibility = View.VISIBLE - val playerMotionLayout = view.findViewById(R.id.playerMotionLayout) - motionLayout = playerMotionLayout - exoPlayerView = view.findViewById(R.id.player) + mainActivity.binding.container.visibility = View.VISIBLE + + motionLayout = binding.playerMotionLayout + exoPlayerView = binding.player view.findViewById(R.id.player_description).text = videoId - playerMotionLayout.addTransitionListener(object : MotionLayout.TransitionListener { + motionLayout.addTransitionListener(object : MotionLayout.TransitionListener { override fun onTransitionStarted( motionLayout: MotionLayout?, startId: Int, @@ -198,7 +201,7 @@ class PlayerFragment : Fragment() { ) { val mainActivity = activity as MainActivity val mainMotionLayout = - mainActivity.findViewById(R.id.mainMotionLayout) + mainActivity.binding.mainMotionLayout mainMotionLayout.progress = abs(progress) exoPlayerView.hideController() eId = endId @@ -209,7 +212,7 @@ class PlayerFragment : Fragment() { println(currentId) val mainActivity = activity as MainActivity val mainMotionLayout = - mainActivity.findViewById(R.id.mainMotionLayout) + mainActivity.binding.mainMotionLayout if (currentId == eId) { isMiniPlayerVisible = true exoPlayerView.useController = false @@ -230,10 +233,10 @@ class PlayerFragment : Fragment() { } }) - playerMotionLayout.progress = 1.toFloat() - playerMotionLayout.transitionToStart() + motionLayout.progress = 1.toFloat() + motionLayout.transitionToStart() - view.findViewById(R.id.close_imageView).setOnClickListener { + binding.closeImageView.setOnClickListener { isMiniPlayerVisible = false motionLayout.transitionToEnd() val mainActivity = activity as MainActivity @@ -251,25 +254,23 @@ class PlayerFragment : Fragment() { .remove(this) .commit() } - val playImageView = view.findViewById(R.id.play_imageView) - playImageView.setOnClickListener { + binding.playImageView.setOnClickListener { paused = if (paused) { - playImageView.setImageResource(R.drawable.ic_pause) + binding.playImageView.setImageResource(R.drawable.ic_pause) exoPlayer.play() false } else { - playImageView.setImageResource(R.drawable.ic_play) + binding.playImageView.setImageResource(R.drawable.ic_play) exoPlayer.pause() true } } // video description and chapters toggle - val descLinLayout = view.findViewById(R.id.desc_linLayout) - view.findViewById(R.id.player_title_layout).setOnClickListener { - val arrowImageView = view.findViewById(R.id.player_description_arrow) - arrowImageView.animate().rotationBy(180F).setDuration(250).start() - descLinLayout.visibility = if (descLinLayout.isVisible) View.GONE else View.VISIBLE + binding.playerTitleLayout.setOnClickListener { + binding.playerDescriptionArrow.animate().rotationBy(180F).setDuration(250).start() + binding.descLinLayout.visibility = + if (binding.descLinLayout.isVisible) View.GONE else View.VISIBLE } view.findViewById(R.id.comments_toggle) @@ -279,8 +280,6 @@ class PlayerFragment : Fragment() { val fullScreenButton = view.findViewById(R.id.fullscreen) val exoTitle = view.findViewById(R.id.exo_title) - val mainContainer = view.findViewById(R.id.main_container) - val linLayout = view.findViewById(R.id.linLayout) // FullScreen button trigger fullScreenButton.setOnClickListener { @@ -291,8 +290,8 @@ class PlayerFragment : Fragment() { enableTransition(R.id.yt_transition, false) } - mainContainer.isClickable = true - linLayout.visibility = View.GONE + binding.mainContainer.isClickable = true + binding.linLayout.visibility = View.GONE fullScreenButton.setImageResource(R.drawable.ic_fullscreen_exit) exoTitle.visibility = View.VISIBLE @@ -304,8 +303,8 @@ class PlayerFragment : Fragment() { enableTransition(R.id.yt_transition, true) } - mainContainer.isClickable = false - linLayout.visibility = View.VISIBLE + binding.mainContainer.isClickable = false + binding.linLayout.visibility = View.VISIBLE fullScreenButton.setImageResource(R.drawable.ic_fullscreen) exoTitle.visibility = View.INVISIBLE @@ -714,7 +713,7 @@ class PlayerFragment : Fragment() { // check if livestream if (response.duration!! > 0) { // download clicked - relDownloadVideo.setOnClickListener { + binding.relPlayerDownload.setOnClickListener { if (!IS_DOWNLOAD_RUNNING) { val newFragment = DownloadDialog() val bundle = Bundle() From 0498e52f5d8376e40eba0332c85353335bfdf0c4 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Thu, 30 Jun 2022 21:25:40 +0200 Subject: [PATCH 023/202] viewbind playerfragment --- .../libretube/fragments/PlayerFragment.kt | 128 +++++++----------- .../layout/exo_styled_player_control_view.xml | 2 +- app/src/main/res/layout/fragment_player.xml | 2 +- 3 files changed, 54 insertions(+), 78 deletions(-) diff --git a/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt b/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt index a6762f05d..a928122dc 100644 --- a/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt +++ b/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt @@ -22,14 +22,10 @@ import android.view.ViewGroup import android.widget.Button import android.widget.FrameLayout import android.widget.ImageButton -import android.widget.ImageView import android.widget.LinearLayout -import android.widget.RelativeLayout -import android.widget.ScrollView import android.widget.TextView import android.widget.Toast import androidx.constraintlayout.motion.widget.MotionLayout -import androidx.constraintlayout.widget.ConstraintLayout import androidx.core.net.toUri import androidx.core.os.bundleOf import androidx.core.view.isVisible @@ -37,7 +33,6 @@ import androidx.fragment.app.Fragment import androidx.lifecycle.lifecycleScope import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.LinearLayoutManager -import androidx.recyclerview.widget.RecyclerView import com.github.libretube.MainActivity import com.github.libretube.R import com.github.libretube.adapters.ChaptersAdapter @@ -117,14 +112,11 @@ class PlayerFragment : Fragment() { private var isSubscribed: Boolean = false - private lateinit var relatedRecView: RecyclerView - private lateinit var commentsRecView: RecyclerView private var commentsAdapter: CommentsAdapter? = null private var commentsLoaded: Boolean? = false private var nextPage: String? = null private var isLoading = true private lateinit var exoPlayerView: StyledPlayerView - private lateinit var motionLayout: MotionLayout private lateinit var exoPlayer: ExoPlayer private lateinit var segmentData: Segments private var relatedStreamsEnabled = true @@ -136,8 +128,6 @@ class PlayerFragment : Fragment() { private var isPlayerLocked: Boolean = false - private lateinit var relDownloadVideo: LinearLayout - private lateinit var mediaSession: MediaSessionCompat private lateinit var mediaSessionConnector: MediaSessionConnector private lateinit var playerNotification: PlayerNotificationManager @@ -159,7 +149,7 @@ class PlayerFragment : Fragment() { inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? - ): View? { + ): View { binding = FragmentPlayerBinding.inflate(layoutInflater, container, false) // Inflate the layout for this fragment return binding.root @@ -181,11 +171,9 @@ class PlayerFragment : Fragment() { val mainActivity = activity as MainActivity mainActivity.binding.container.visibility = View.VISIBLE - motionLayout = binding.playerMotionLayout exoPlayerView = binding.player - - view.findViewById(R.id.player_description).text = videoId - motionLayout.addTransitionListener(object : MotionLayout.TransitionListener { + + binding.playerMotionLayout.addTransitionListener(object : MotionLayout.TransitionListener { override fun onTransitionStarted( motionLayout: MotionLayout?, startId: Int, @@ -225,7 +213,7 @@ class PlayerFragment : Fragment() { } override fun onTransitionTrigger( - motionLayout: MotionLayout?, + MotionLayout: MotionLayout?, triggerId: Int, positive: Boolean, progress: Float @@ -233,12 +221,12 @@ class PlayerFragment : Fragment() { } }) - motionLayout.progress = 1.toFloat() - motionLayout.transitionToStart() + binding.playerMotionLayout.progress = 1.toFloat() + binding.playerMotionLayout.transitionToStart() binding.closeImageView.setOnClickListener { isMiniPlayerVisible = false - motionLayout.transitionToEnd() + binding.playerMotionLayout.transitionToEnd() val mainActivity = activity as MainActivity mainActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT mainActivity.supportFragmentManager.beginTransaction() @@ -247,7 +235,7 @@ class PlayerFragment : Fragment() { } view.findViewById(R.id.close_imageButton).setOnClickListener { isMiniPlayerVisible = false - motionLayout.transitionToEnd() + binding.playerMotionLayout.transitionToEnd() val mainActivity = activity as MainActivity mainActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT mainActivity.supportFragmentManager.beginTransaction() @@ -285,7 +273,7 @@ class PlayerFragment : Fragment() { fullScreenButton.setOnClickListener { exoPlayerView.hideController() if (!isFullScreen) { - with(motionLayout) { + with(binding.playerMotionLayout) { getConstraintSet(R.id.start).constrainHeight(R.id.player, -1) enableTransition(R.id.yt_transition, false) } @@ -298,7 +286,7 @@ class PlayerFragment : Fragment() { val mainActivity = activity as MainActivity mainActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE } else { - with(motionLayout) { + with(binding.playerMotionLayout) { getConstraintSet(R.id.start).constrainHeight(R.id.player, 0) enableTransition(R.id.yt_transition, true) } @@ -342,32 +330,28 @@ class PlayerFragment : Fragment() { isPlayerLocked = !isPlayerLocked } - val scrollView = view.findViewById(R.id.player_scrollView) - scrollView.viewTreeObserver + binding.playerScrollView.viewTreeObserver .addOnScrollChangedListener { - if (scrollView.getChildAt(0).bottom - == (scrollView.height + scrollView.scrollY) && + if (binding.playerScrollView.getChildAt(0).bottom + == (binding.playerScrollView.height + binding.playerScrollView.scrollY) && nextPage != null ) { fetchNextComments() } } - commentsRecView = view.findViewById(R.id.comments_recView) - commentsRecView.layoutManager = LinearLayoutManager(view.context) + binding.commentsRecView.layoutManager = LinearLayoutManager(view.context) + binding.commentsRecView.setItemViewCacheSize(20) - commentsRecView.setItemViewCacheSize(20) - - relatedRecView = view.findViewById(R.id.player_recView) - relatedRecView.layoutManager = + binding.relatedRecView.layoutManager = GridLayoutManager(view.context, resources.getInteger(R.integer.grid_items)) } private fun toggleComments() { - commentsRecView.visibility = - if (commentsRecView.isVisible) View.GONE else View.VISIBLE - relatedRecView.visibility = - if (relatedRecView.isVisible) View.GONE else View.VISIBLE + binding.commentsRecView.visibility = + if (binding.commentsRecView.isVisible) View.GONE else View.VISIBLE + binding.relatedRecView.visibility = + if (binding.relatedRecView.isVisible) View.GONE else View.VISIBLE if (!commentsLoaded!!) fetchComments() } @@ -637,18 +621,17 @@ class PlayerFragment : Fragment() { } private fun initializePlayerView(view: View, response: Streams) { - view.findViewById(R.id.player_views_info).text = + binding.playerViewsInfo.text = context?.getString(R.string.views, response.views.formatShort()) + " • " + response.uploadDate - view.findViewById(R.id.textLike).text = response.likes.formatShort() - view.findViewById(R.id.textDislike).text = response.dislikes.formatShort() - val channelImage = view.findViewById(R.id.player_channelImage) - Picasso.get().load(response.uploaderAvatar).into(channelImage) - view.findViewById(R.id.player_channelName).text = response.uploader + binding.textLike.text = response.likes.formatShort() + binding.textDislike.text = response.dislikes.formatShort() + Picasso.get().load(response.uploaderAvatar).into(binding.playerChannelImage) + binding.playerChannelName.text = response.uploader - view.findViewById(R.id.title_textView).text = response.title - view.findViewById(R.id.player_title).text = response.title - view.findViewById(R.id.player_description).text = response.description + binding.titleTextView.text = response.title + binding.playerTitle.text = response.title + binding.playerDescription.text = response.description view.findViewById(R.id.exo_title).text = response.title @@ -689,24 +672,21 @@ class PlayerFragment : Fragment() { if (playWhenReady && playbackState == Player.STATE_READY) { // media actually playing transitioning = false - view.findViewById(R.id.play_imageView) - .setImageResource(R.drawable.ic_pause) + binding.playImageView.setImageResource(R.drawable.ic_pause) } else if (playWhenReady) { // might be idle (plays after prepare()), // buffering (plays when data available) // or ended (plays when seek away from end) - view.findViewById(R.id.play_imageView) - .setImageResource(R.drawable.ic_play) + binding.playImageView.setImageResource(R.drawable.ic_play) } else { // player paused in any state - view.findViewById(R.id.play_imageView) - .setImageResource(R.drawable.ic_play) + binding.playImageView.setImageResource(R.drawable.ic_play) } } }) // share button - view.findViewById(R.id.relPlayer_share).setOnClickListener { + binding.relPlayerShare.setOnClickListener { val shareDialog = ShareDialog(videoId!!, false) shareDialog.show(childFragmentManager, "ShareDialog") } @@ -731,7 +711,7 @@ class PlayerFragment : Fragment() { } if (response.hls != null) { - view.findViewById(R.id.relPlayer_vlc).setOnClickListener { + binding.relPlayerVlc.setOnClickListener { // start an intent with video as mimetype using the hls stream val uri: Uri = Uri.parse(response.hls) val intent = Intent() @@ -748,14 +728,14 @@ class PlayerFragment : Fragment() { } if (relatedStreamsEnabled) { // only show related streams if enabled - relatedRecView.adapter = TrendingAdapter( + binding.relatedRecView.adapter = TrendingAdapter( response.relatedStreams!!, childFragmentManager ) } // set video description val description = response.description!! - view.findViewById(R.id.player_description).text = + binding.playerDescription.text = // detect whether the description is html formatted if (description.contains("<") && description.contains(">")) { if (SDK_INT >= Build.VERSION_CODES.N) { @@ -768,19 +748,18 @@ class PlayerFragment : Fragment() { description } - view.findViewById(R.id.player_channel).setOnClickListener { + binding.playerChannel.setOnClickListener { val activity = view.context as MainActivity val bundle = bundleOf("channel_id" to response.uploaderUrl) activity.navController.navigate(R.id.channel, bundle) - activity.findViewById(R.id.mainMotionLayout).transitionToEnd() - view.findViewById(R.id.playerMotionLayout).transitionToEnd() + activity.binding.mainMotionLayout.transitionToEnd() + binding.playerMotionLayout.transitionToEnd() } val token = PreferenceHelper.getToken(requireContext()) if (token != "") { val channelId = response.uploaderUrl?.replace("/channel/", "") - val subButton = view.findViewById(R.id.player_subscribe) - isSubscribed(subButton, channelId!!) - view.findViewById(R.id.save).setOnClickListener { + isSubscribed(binding.playerSubscribe, channelId!!) + binding.save.setOnClickListener { val newFragment = AddtoPlaylistDialog() val bundle = Bundle() bundle.putString("videoId", videoId) @@ -791,13 +770,11 @@ class PlayerFragment : Fragment() { } private fun initializeChapters(chapters: List) { - val chaptersRecView = view?.findViewById(R.id.chapters_recView) - if (chapters.isNotEmpty()) { - chaptersRecView?.layoutManager = + binding.chaptersRecView.layoutManager = LinearLayoutManager(this.context, LinearLayoutManager.HORIZONTAL, false) - chaptersRecView?.adapter = ChaptersAdapter(chapters, exoPlayer) - chaptersRecView?.visibility = View.VISIBLE + binding.chaptersRecView.adapter = ChaptersAdapter(chapters, exoPlayer) + binding.chaptersRecView.visibility = View.VISIBLE } } @@ -1142,7 +1119,7 @@ class PlayerFragment : Fragment() { return@launchWhenCreated } commentsAdapter = CommentsAdapter(videoId!!, commentsResponse.comments) - commentsRecView.adapter = commentsAdapter + binding.commentsRecView.adapter = commentsAdapter nextPage = commentsResponse.nextpage commentsLoaded = true isLoading = false @@ -1175,35 +1152,34 @@ class PlayerFragment : Fragment() { if (isInPictureInPictureMode) { exoPlayerView.hideController() exoPlayerView.useController = false - with(motionLayout) { + with(binding.playerMotionLayout) { getConstraintSet(R.id.start).constrainHeight(R.id.player, -1) enableTransition(R.id.yt_transition, false) } - view?.findViewById(R.id.main_container)?.isClickable = true - view?.findViewById(R.id.top_bar)?.visibility = View.GONE + binding.mainContainer.isClickable = true + view?.findViewById(R.id.exo_top_bar)?.visibility = View.GONE val mainActivity = activity as MainActivity mainActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT isFullScreen = false } else { - with(motionLayout) { + with(binding.playerMotionLayout) { getConstraintSet(R.id.start).constrainHeight(R.id.player, 0) enableTransition(R.id.yt_transition, true) } exoPlayerView.showController() exoPlayerView.useController = true - view?.findViewById(R.id.main_container)?.isClickable = false - view?.findViewById(R.id.top_bar)?.visibility = View.VISIBLE + binding.mainContainer.isClickable = false + view?.findViewById(R.id.exo_top_bar)?.visibility = View.VISIBLE } } fun onUserLeaveHint() { val bounds = Rect() - val scrollView = view?.findViewById(R.id.player_scrollView) - scrollView?.getHitRect(bounds) + binding.playerScrollView.getHitRect(bounds) if (SDK_INT >= Build.VERSION_CODES.O && exoPlayer.isPlaying && ( - scrollView?.getLocalVisibleRect(bounds) == true || + binding.playerScrollView.getLocalVisibleRect(bounds) == true || isFullScreen ) ) { diff --git a/app/src/main/res/layout/exo_styled_player_control_view.xml b/app/src/main/res/layout/exo_styled_player_control_view.xml index 02d9d5655..d0f2f93f2 100644 --- a/app/src/main/res/layout/exo_styled_player_control_view.xml +++ b/app/src/main/res/layout/exo_styled_player_control_view.xml @@ -28,7 +28,7 @@ android:background="@color/exo_black_opacity_60" /> Date: Thu, 30 Jun 2022 21:26:16 +0200 Subject: [PATCH 024/202] ktlint --- .../main/java/com/github/libretube/fragments/PlayerFragment.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt b/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt index a928122dc..263352f56 100644 --- a/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt +++ b/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt @@ -172,7 +172,7 @@ class PlayerFragment : Fragment() { mainActivity.binding.container.visibility = View.VISIBLE exoPlayerView = binding.player - + binding.playerMotionLayout.addTransitionListener(object : MotionLayout.TransitionListener { override fun onTransitionStarted( motionLayout: MotionLayout?, From 9ebd3d5f7e517fc4939f2d1274dd53fc5065ae9d Mon Sep 17 00:00:00 2001 From: Bnyro Date: Fri, 1 Jul 2022 10:19:00 +0200 Subject: [PATCH 025/202] convert all dialogs to viewbinding --- .../libretube/dialogs/AddtoPlaylistDialog.kt | 34 +++++----- .../libretube/dialogs/CreatePlaylistDialog.kt | 24 +++---- .../libretube/dialogs/CustomInstanceDialog.kt | 30 +++------ .../libretube/dialogs/DeleteAccountDialog.kt | 24 +++---- .../libretube/dialogs/DownloadDialog.kt | 30 ++++----- .../github/libretube/dialogs/LoginDialog.kt | 66 ++++++++----------- .../github/libretube/dialogs/LogoutDialog.kt | 46 +++++++++++++ .../libretube/preferences/InstanceSettings.kt | 13 +++- app/src/main/res/layout/dialog_logout.xml | 1 + 9 files changed, 140 insertions(+), 128 deletions(-) create mode 100644 app/src/main/java/com/github/libretube/dialogs/LogoutDialog.kt diff --git a/app/src/main/java/com/github/libretube/dialogs/AddtoPlaylistDialog.kt b/app/src/main/java/com/github/libretube/dialogs/AddtoPlaylistDialog.kt index cabc0826b..0cc9119ad 100644 --- a/app/src/main/java/com/github/libretube/dialogs/AddtoPlaylistDialog.kt +++ b/app/src/main/java/com/github/libretube/dialogs/AddtoPlaylistDialog.kt @@ -4,17 +4,14 @@ import android.app.Dialog import android.os.Bundle import android.util.Log import android.util.TypedValue -import android.view.View import android.widget.ArrayAdapter -import android.widget.Button -import android.widget.Spinner -import android.widget.TextView import android.widget.Toast import androidx.core.text.HtmlCompat import androidx.fragment.app.DialogFragment import androidx.fragment.app.Fragment import androidx.lifecycle.lifecycleScope import com.github.libretube.R +import com.github.libretube.databinding.DialogAddtoplaylistBinding import com.github.libretube.obj.PlaylistId import com.github.libretube.util.PreferenceHelper import com.github.libretube.util.RetrofitInstance @@ -24,23 +21,22 @@ import java.io.IOException class AddtoPlaylistDialog : DialogFragment() { private val TAG = "AddToPlaylistDialog" + private lateinit var binding: DialogAddtoplaylistBinding + private lateinit var videoId: String private lateinit var token: String - private lateinit var spinner: Spinner - private lateinit var button: Button + override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { return activity?.let { videoId = arguments?.getString("videoId")!! val builder = MaterialAlertDialogBuilder(it) // Get the layout inflater - val inflater = requireActivity().layoutInflater + binding = DialogAddtoplaylistBinding.inflate(layoutInflater) + token = PreferenceHelper.getToken(requireContext()) - var view: View = inflater.inflate(R.layout.dialog_addtoplaylist, null) - spinner = view.findViewById(R.id.playlists_spinner) - button = view.findViewById(R.id.addToPlaylist) - if (token != "") { - fetchPlaylists() - } + + if (token != "") fetchPlaylists() + val typedValue = TypedValue() this.requireActivity().theme.resolveAttribute(R.attr.colorPrimaryDark, typedValue, true) val hexColor = String.format("#%06X", (0xFFFFFF and typedValue.data)) @@ -48,9 +44,9 @@ class AddtoPlaylistDialog : DialogFragment() { "LibreTube", HtmlCompat.FROM_HTML_MODE_COMPACT ) - view.findViewById(R.id.title).text = appName + binding.title.text = appName - builder.setView(view) + builder.setView(binding.root) builder.create() } ?: throw IllegalStateException("Activity cannot be null") } @@ -80,10 +76,12 @@ class AddtoPlaylistDialog : DialogFragment() { arrayAdapter.setDropDownViewResource( android.R.layout.simple_spinner_dropdown_item ) - spinner.adapter = arrayAdapter + binding.playlistsSpinner.adapter = arrayAdapter runOnUiThread { - button.setOnClickListener { - addToPlaylist(response[spinner.selectedItemPosition].id!!) + binding.addToPlaylist.setOnClickListener { + addToPlaylist( + response[binding.playlistsSpinner.selectedItemPosition].id!! + ) } } } else { diff --git a/app/src/main/java/com/github/libretube/dialogs/CreatePlaylistDialog.kt b/app/src/main/java/com/github/libretube/dialogs/CreatePlaylistDialog.kt index d08256704..c08a9096a 100644 --- a/app/src/main/java/com/github/libretube/dialogs/CreatePlaylistDialog.kt +++ b/app/src/main/java/com/github/libretube/dialogs/CreatePlaylistDialog.kt @@ -4,32 +4,29 @@ import android.app.Dialog import android.os.Bundle import android.util.Log import android.util.TypedValue -import android.view.View -import android.widget.Button -import android.widget.TextView import android.widget.Toast import androidx.core.text.HtmlCompat import androidx.fragment.app.DialogFragment import androidx.lifecycle.lifecycleScope import com.github.libretube.R +import com.github.libretube.databinding.DialogCreatePlaylistBinding import com.github.libretube.fragments.Library import com.github.libretube.obj.Playlists import com.github.libretube.util.PreferenceHelper import com.github.libretube.util.RetrofitInstance import com.google.android.material.dialog.MaterialAlertDialogBuilder -import com.google.android.material.textfield.TextInputEditText import retrofit2.HttpException import java.io.IOException class CreatePlaylistDialog : DialogFragment() { val TAG = "CreatePlaylistDialog" private var token: String = "" + private lateinit var binding: DialogCreatePlaylistBinding override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { return activity?.let { val builder = MaterialAlertDialogBuilder(it) - val inflater = requireActivity().layoutInflater - val view: View = inflater.inflate(R.layout.dialog_create_playlist, null) + binding = DialogCreatePlaylistBinding.inflate(layoutInflater) val typedValue = TypedValue() this.requireActivity().theme.resolveAttribute(R.attr.colorPrimaryDark, typedValue, true) @@ -38,21 +35,18 @@ class CreatePlaylistDialog : DialogFragment() { "LibreTube", HtmlCompat.FROM_HTML_MODE_COMPACT ) - view.findViewById(R.id.title).text = appName + binding.title.text = appName - val cancelBtn = view.findViewById