diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1275a7534..d58858e8f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,7 +12,7 @@ jobs: - name: ktlint uses: ScaCap/action-ktlint@1.3 with: - github_token: ${{ secrets.github_token }} + github_token: ${{ secrets.ACCESS_TOKEN }} reporter: github-pr-review android: true fail_on_error: true diff --git a/README.md b/README.md index d1930ab99..e8d85086c 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ [![Matrix](https://img.shields.io/matrix/LibreTube:matrix.org)](https://matrix.to/#/#LibreTube:matrix.org) [![Telegram](https://img.shields.io/endpoint?color=neon&style=flat-square&url=https://tg.sumanjay.workers.dev/libretube)](https://t.me/libretube) [![Twitter](https://img.shields.io/twitter/follow/libretube?style=social)](https://twitter.com/libretube) - +[![Reddit](https://img.shields.io/reddit/subreddit-subscribers/libretube?style=social)](https://www.reddit.com/r/Libretube/) [Get it on F-Droid](https://f-droid.org/en/packages/com.github.libretube/) [Get it on GitHub](https://github.com/libre-tube/LibreTube/releases/latest) diff --git a/app/src/main/java/com/github/libretube/AddtoPlaylistDialog.kt b/app/src/main/java/com/github/libretube/AddtoPlaylistDialog.kt index 0ee8cb59c..ad8fd294a 100644 --- a/app/src/main/java/com/github/libretube/AddtoPlaylistDialog.kt +++ b/app/src/main/java/com/github/libretube/AddtoPlaylistDialog.kt @@ -4,13 +4,17 @@ import android.app.Dialog import android.content.Context import android.os.Bundle import android.util.Log +import android.util.TypedValue import android.view.View import android.widget.* import androidx.appcompat.app.AlertDialog +import androidx.core.text.HtmlCompat import androidx.fragment.app.DialogFragment import androidx.fragment.app.Fragment import androidx.lifecycle.lifecycleScope import com.github.libretube.obj.PlaylistId +import com.google.android.material.dialog.MaterialAlertDialogBuilder +import retrofit2.HttpException import java.io.IOException import retrofit2.HttpException @@ -23,7 +27,7 @@ class AddtoPlaylistDialog : DialogFragment() { override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { return activity?.let { videoId = arguments?.getString("videoId")!! - val builder = AlertDialog.Builder(it) + val builder = MaterialAlertDialogBuilder(it) // Get the layout inflater val inflater = requireActivity().layoutInflater val sharedPref = context?.getSharedPreferences("token", Context.MODE_PRIVATE) @@ -34,6 +38,15 @@ class AddtoPlaylistDialog : DialogFragment() { if (token != "") { fetchPlaylists() } + val typedValue = TypedValue() + this.requireActivity().theme.resolveAttribute(R.attr.colorPrimaryDark, typedValue, true) + val hexColor = String.format("#%06X", (0xFFFFFF and typedValue.data)) + val appName = HtmlCompat.fromHtml( + "LibreTube", + HtmlCompat.FROM_HTML_MODE_COMPACT + ) + view.findViewById(R.id.title).text = appName + builder.setView(view) builder.create() } ?: throw IllegalStateException("Activity cannot be null") diff --git a/app/src/main/java/com/github/libretube/CreatePlaylistDialog.kt b/app/src/main/java/com/github/libretube/CreatePlaylistDialog.kt index 9f287c045..05c629852 100644 --- a/app/src/main/java/com/github/libretube/CreatePlaylistDialog.kt +++ b/app/src/main/java/com/github/libretube/CreatePlaylistDialog.kt @@ -1,12 +1,15 @@ package com.github.libretube import android.os.Bundle +import android.util.TypedValue import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.widget.Button +import android.widget.TextView import android.widget.Toast import androidx.core.os.bundleOf +import androidx.core.text.HtmlCompat import androidx.fragment.app.DialogFragment import androidx.fragment.app.setFragmentResult @@ -18,6 +21,15 @@ class CreatePlaylistDialog : DialogFragment() { ): View? { var rootView: View = inflater.inflate(R.layout.dialog_create_playlist, container, false) + val typedValue = TypedValue() + this.requireActivity().theme.resolveAttribute(R.attr.colorPrimaryDark, typedValue, true) + val hexColor = String.format("#%06X", (0xFFFFFF and typedValue.data)) + val appName = HtmlCompat.fromHtml( + "LibreTube", + HtmlCompat.FROM_HTML_MODE_COMPACT + ) + rootView.findViewById(R.id.title).text = appName + val cancelBtn = rootView.findViewById