diff --git a/README.md b/README.md index b5c6894f0..9cb63c092 100644 --- a/README.md +++ b/README.md @@ -6,60 +6,70 @@ [![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 +## 📱 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) +
-## Features +[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) -| Feature || -| - | - | -| User Accounts | ✅ | -| Subscriptions | ✅ | -| User Playlists | ✅ | -| Channel Playlists | ✅ | -| Search Filters | ✅ | -| SponsorBlock | ✅ | -| Subtitles | ✅ | -| Comments | ✅ | +
+## ⭐ Features + +| Feature | | +| ----------------- | --- | +| User Accounts | ✅ | +| Subscriptions | ✅ | +| User Playlists | ✅ | +| Channel Playlists | ✅ | +| Search Filters | ✅ | +| SponsorBlock | ✅ | +| Subtitles | ✅ | +| 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` **XMR:** `44txdmy4E5bDzMYQJh1ZSoHbrp1sWfpGa2FYg26L2ya8EaRejPsh42yVrYhepW9P4YWvrqmTZvms35z5FDgqy1xcVewk18d` -## Mirrors (read-only) +## 🪞 Mirrors (read-only) + GitLab

NotABug

diff --git a/app/build.gradle b/app/build.gradle index 90f219fa8..d0ed08e1b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,13 +10,17 @@ android { applicationId 'com.github.libretube' minSdk 21 targetSdk 31 - versionCode 12 - versionName '0.3.2' + versionCode 13 + versionName '0.3.3' multiDexEnabled true testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' resValue "string", "app_name", "LibreTube" } + buildFeatures { + viewBinding true + } + buildTypes { release { minifyEnabled true diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index b5efba744..dbc40491c 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -22,15 +22,17 @@ android:supportsRtl="true" android:theme="@style/Theme.Purple"> + android:exported="false" /> + + android:targetActivity=".activities.MainActivity"> @@ -70,7 +72,7 @@ android:label="@string/app_name" android:roundIcon="@mipmap/ic_fire_round" android:supportsPictureInPicture="true" - android:targetActivity=".MainActivity"> + android:targetActivity=".activities.MainActivity"> @@ -87,7 +89,7 @@ android:label="@string/app_name" android:roundIcon="@mipmap/ic_flame_round" android:supportsPictureInPicture="true" - android:targetActivity=".MainActivity"> + android:targetActivity=".activities.MainActivity"> @@ -104,7 +106,7 @@ android:label="@string/app_name" android:roundIcon="@mipmap/ic_shaped_round" android:supportsPictureInPicture="true" - android:targetActivity=".MainActivity"> + android:targetActivity=".activities.MainActivity"> @@ -121,7 +123,7 @@ android:label="@string/app_name" android:roundIcon="@mipmap/ic_torch_round" android:supportsPictureInPicture="true" - android:targetActivity=".MainActivity"> + android:targetActivity=".activities.MainActivity"> @@ -138,7 +140,7 @@ android:label="@string/app_name" android:roundIcon="@mipmap/ic_legacy_round" android:supportsPictureInPicture="true" - android:targetActivity=".MainActivity"> + android:targetActivity=".activities.MainActivity"> @@ -155,7 +157,7 @@ android:label="@string/app_name" android:roundIcon="@mipmap/ic_bird_round" android:supportsPictureInPicture="true" - android:targetActivity=".MainActivity"> + android:targetActivity=".activities.MainActivity"> @@ -163,7 +165,7 @@ diff --git a/app/src/main/java/com/github/libretube/Constants.kt b/app/src/main/java/com/github/libretube/Constants.kt index 52a5d0ef3..26d940916 100644 --- a/app/src/main/java/com/github/libretube/Constants.kt +++ b/app/src/main/java/com/github/libretube/Constants.kt @@ -1,8 +1,23 @@ package com.github.libretube +/** + * API link for the update checker + */ const val GITHUB_API_URL = "https://api.github.com/repos/libre-tube/LibreTube/releases/latest" + +/** + * Links for the about fragment + */ const val WEBSITE_URL = "https://libre-tube.github.io/" -const val AUTHORS_URL = "https://github.com/libre-tube/LibreTube/graphs/contributors" -const val DONATE_URL = "https://libre-tube.github.io/#donate" -const val CONTRIBUTING_URL = "https://github.com/libre-tube/LibreTube#donate" +const val DONATE_URL = "https://github.com/libre-tube/LibreTube#donate" +const val GITHUB_URL = "https://github.com/libre-tube/LibreTube" const val PIPED_GITHUB_URL = "https://github.com/TeamPiped/Piped" + +/** + * Social media links for the community fragment + */ +const val TELEGRAM_URL = "https://t.me/libretube" +const val MATRIX_URL = "https://matrix.to/#/#LibreTube:matrix.org" +const val DISCORD_URL = "https://discord.com/invite/Qc34xCj2GV" +const val REDDIT_URL = "https://www.reddit.com/r/Libretube/" +const val TWITTER_URL = "https://twitter.com/libretube" diff --git a/app/src/main/java/com/github/libretube/MainActivity.kt b/app/src/main/java/com/github/libretube/activities/MainActivity.kt similarity index 67% rename from app/src/main/java/com/github/libretube/MainActivity.kt rename to app/src/main/java/com/github/libretube/activities/MainActivity.kt index 5c694a275..d5618ef91 100644 --- a/app/src/main/java/com/github/libretube/MainActivity.kt +++ b/app/src/main/java/com/github/libretube/activities/MainActivity.kt @@ -1,57 +1,70 @@ -package com.github.libretube +package com.github.libretube.activities import android.app.Activity import android.content.Context import android.content.Intent import android.content.pm.ActivityInfo import android.content.res.Configuration -import android.net.ConnectivityManager -import android.net.NetworkCapabilities import android.net.Uri import android.os.Build import android.os.Bundle import android.os.Handler import android.os.Looper import android.util.Log -import android.util.TypedValue import android.view.View import android.view.WindowInsets import android.view.WindowInsetsController import android.view.WindowManager import android.view.inputmethod.InputMethodManager -import android.widget.Button -import android.widget.ImageView import android.widget.LinearLayout import androidx.appcompat.app.AppCompatActivity -import androidx.appcompat.widget.Toolbar import androidx.constraintlayout.motion.widget.MotionLayout import androidx.constraintlayout.widget.ConstraintLayout import androidx.core.os.bundleOf -import androidx.core.text.HtmlCompat import androidx.fragment.app.Fragment import androidx.navigation.NavController import androidx.navigation.findNavController import androidx.navigation.ui.setupWithNavController +import com.github.libretube.R +import com.github.libretube.databinding.ActivityMainBinding import com.github.libretube.fragments.PlayerFragment import com.github.libretube.fragments.isFullScreen +import com.github.libretube.preferences.PreferenceHelper import com.github.libretube.services.ClosingService +import com.github.libretube.util.ConnectionHelper import com.github.libretube.util.CronetHelper import com.github.libretube.util.LocaleHelper -import com.github.libretube.util.PreferenceHelper import com.github.libretube.util.RetrofitInstance import com.github.libretube.util.ThemeHelper -import com.google.android.material.bottomnavigation.BottomNavigationView import com.google.android.material.color.DynamicColors +import com.google.android.material.elevation.SurfaceColors class MainActivity : AppCompatActivity() { val TAG = "MainActivity" - lateinit var bottomNavigationView: BottomNavigationView - private lateinit var toolbar: Toolbar + lateinit var binding: ActivityMainBinding + lateinit var navController: NavController + private var startFragmentId = R.id.homeFragment override fun onCreate(savedInstanceState: Bundle?) { - DynamicColors.applyToActivityIfAvailable(this) + /** + * apply dynamic colors if enabled + */ + val materialColorsEnabled = PreferenceHelper + .getString(this, "accent_color", "purple") == "my" + if (materialColorsEnabled) { + // apply dynamic colors to the current activity + DynamicColors.applyToActivityIfAvailable(this) + // apply dynamic colors to the all other activities + DynamicColors.applyToActivitiesIfAvailable(application) + } + + // set the theme + ThemeHelper.updateTheme(this) + // set the language + LocaleHelper.updateLanguage(this) + super.onCreate(savedInstanceState) // start service that gets called on closure @@ -61,74 +74,89 @@ class MainActivity : AppCompatActivity() { RetrofitInstance.url = PreferenceHelper.getString(this, "selectInstance", "https://pipedapi.kavin.rocks/")!! - - ThemeHelper.updateTheme(this) - LocaleHelper.updateLanguage(this) + // set auth instance + RetrofitInstance.authUrl = + if (PreferenceHelper.getBoolean(this, "auth_instance_toggle", false)) { + PreferenceHelper.getString( + this, + "selectAuthInstance", + "https://pipedapi.kavin.rocks/" + )!! + } else { + RetrofitInstance.url + } // show noInternet Activity if no internet available on app startup - if (!isNetworkAvailable(this)) { - setContentView(R.layout.activity_nointernet) - findViewById