Merge branch 'libre-tube:master' into master

This commit is contained in:
XelXen 2022-06-18 19:39:01 +05:30 committed by GitHub
commit f18af3d094
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 98 additions and 70 deletions

View File

@ -12,7 +12,7 @@ jobs:
- name: ktlint
uses: ScaCap/action-ktlint@1.4
with:
github_token: ${{ secrets.ACCESS_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-check
android: true
fail_on_error: true

View File

@ -253,8 +253,8 @@ class PlayerFragment : Fragment() {
}
view.findViewById<RelativeLayout>(R.id.player_title_layout).setOnClickListener {
val image = view.findViewById<ImageView>(R.id.player_description_arrow)
image.animate().rotationBy(180F).setDuration(100).start()
val arrowImageView = view.findViewById<ImageView>(R.id.player_description_arrow)
arrowImageView.animate().rotationBy(180F).setDuration(100).start()
if (playerDescription.isVisible) {
playerDescription.visibility = View.GONE
} else {

View File

@ -6,9 +6,6 @@ import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.animation.Animation
import android.view.animation.LinearInterpolator
import android.view.animation.RotateAnimation
import android.widget.ImageView
import android.widget.ProgressBar
import android.widget.RelativeLayout
@ -79,9 +76,13 @@ class Subscriptions : Fragment() {
}
var toggleSubs = view.findViewById<RelativeLayout>(R.id.toggle_subs)
val arrowImageView = view.findViewById<ImageView>(R.id.toggle)
toggleSubs.visibility = View.VISIBLE
var loadedSubbedChannels = false
toggleSubs.setOnClickListener {
arrowImageView.animate().rotationBy(180F).setDuration(100).start()
if (!channelRecView.isVisible) {
if (!loadedSubbedChannels) {
channelRecView?.layoutManager = LinearLayoutManager(context)
@ -90,21 +91,6 @@ class Subscriptions : Fragment() {
}
channelRecView.visibility = View.VISIBLE
feedRecView.visibility = View.GONE
// toggle button
val rotate = RotateAnimation(
0F,
180F,
Animation.RELATIVE_TO_SELF,
0.5f,
Animation.RELATIVE_TO_SELF,
0.5f
)
rotate.duration = 100
rotate.interpolator = LinearInterpolator()
rotate.fillAfter = true
val image = view.findViewById<ImageView>(R.id.toggle)
image.startAnimation(rotate)
} else {
channelRecView.visibility = View.GONE
feedRecView.visibility = View.VISIBLE

View File

@ -56,6 +56,13 @@ class MainSettings : PreferenceFragmentCompat() {
true
}
val player = findPreference<Preference>("player")
player?.setOnPreferenceClickListener {
val newFragment = PlayerSettings()
navigateSettings(newFragment)
true
}
val advanced = findPreference<Preference>("advanced")
advanced?.setOnPreferenceClickListener {
val newFragment = AdvancedSettings()

View File

@ -0,0 +1,17 @@
package com.github.libretube.preferences
import android.os.Bundle
import android.widget.TextView
import androidx.preference.PreferenceFragmentCompat
import com.github.libretube.R
class PlayerSettings : PreferenceFragmentCompat() {
val TAG = "PlayerSettings"
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
setPreferencesFromResource(R.xml.player_settings, rootKey)
val topBarTextView = activity?.findViewById<TextView>(R.id.topBar_textView)
topBarTextView?.text = getString(R.string.player)
}
}

View File

@ -143,9 +143,9 @@
<string name="no_update_available">You are running the latest version.</string>
<string name="playback_speed">Default playback speed</string>
<string name="advanced">Advanced</string>
<string name="player">Player</string>
<string name="player">Audio and video</string>
<string name="appearance_summary">Adjust the app to your liking.</string>
<string name="advanced_summary">Player, downloads, history</string>
<string name="advanced_summary">Downloads, history</string>
<string name="live">Live</string>
<string name="no_replies">This comment has no replies.</string>
<string name="authors">Authors</string>
@ -192,4 +192,7 @@
<string name="player_autoplay">Autoplay</string>
<string name="hideTrendingPage">Hide trending page</string>
<string name="instance_frontend_url">URL to instance frontend</string>
<string name="quality">Quality</string>
<string name="behavior">Behavior</string>
<string name="player_summary">Quality and player behavior</string>
</resources>

View File

@ -2,53 +2,6 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<PreferenceCategory app:title="@string/player">
<ListPreference
android:icon="@drawable/ic_hd"
app:defaultValue=""
app:entries="@array/defres"
app:entryValues="@array/defresValue"
app:key="default_res"
app:title="@string/defres"
app:useSimpleSummaryProvider="true" />
<ListPreference
android:icon="@drawable/ic_video"
app:defaultValue="WEBM"
app:entries="@array/playerVideoFormats"
app:entryValues="@array/playerVideoFormats"
app:key="player_video_format"
app:title="@string/playerVideoFormat"
app:useSimpleSummaryProvider="true" />
<ListPreference
android:icon="@drawable/ic_speed"
app:defaultValue="1F"
app:entries="@array/playbackSpeed"
app:entryValues="@array/playbackSpeedValues"
app:key="playback_speed"
app:title="@string/playback_speed"
app:useSimpleSummaryProvider="true" />
<ListPreference
android:icon="@drawable/ic_time"
app:defaultValue="50"
app:entries="@array/bufferingGoal"
app:entryValues="@array/bufferingGoal"
app:key="buffering_goal"
app:summary="@string/buffering_goal_summary"
app:title="@string/buffering_goal" />
<SwitchPreferenceCompat
android:icon="@drawable/ic_play"
app:key="autoplay"
app:title="@string/player_autoplay"
android:summaryOff="@string/disabled"
android:summaryOn="@string/enabled" />
</PreferenceCategory>
<PreferenceCategory app:title="@string/downloads">
<ListPreference

View File

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<PreferenceCategory app:title="@string/quality">
<ListPreference
android:icon="@drawable/ic_hd"
app:defaultValue=""
app:entries="@array/defres"
app:entryValues="@array/defresValue"
app:key="default_res"
app:title="@string/defres"
app:useSimpleSummaryProvider="true" />
<ListPreference
android:icon="@drawable/ic_video"
app:defaultValue="WEBM"
app:entries="@array/playerVideoFormats"
app:entryValues="@array/playerVideoFormats"
app:key="player_video_format"
app:title="@string/playerVideoFormat"
app:useSimpleSummaryProvider="true" />
</PreferenceCategory>
<PreferenceCategory app:title="@string/behavior">
<ListPreference
android:icon="@drawable/ic_speed"
app:defaultValue="1F"
app:entries="@array/playbackSpeed"
app:entryValues="@array/playbackSpeedValues"
app:key="playback_speed"
app:title="@string/playback_speed"
app:useSimpleSummaryProvider="true" />
<ListPreference
android:icon="@drawable/ic_time"
app:defaultValue="50"
app:entries="@array/bufferingGoal"
app:entryValues="@array/bufferingGoal"
app:key="buffering_goal"
app:summary="@string/buffering_goal_summary"
app:title="@string/buffering_goal" />
<SwitchPreferenceCompat
android:icon="@drawable/ic_play"
app:key="autoplay"
app:title="@string/player_autoplay"
android:summaryOff="@string/disabled"
android:summaryOn="@string/enabled" />
</PreferenceCategory>
</PreferenceScreen>

View File

@ -44,6 +44,12 @@
app:summary="@string/sponsorblock_summary"
app:title="@string/sponsorblock" />
<Preference
android:icon="@drawable/ic_video"
app:key="player"
app:summary="@string/player_summary"
app:title="@string/player" />
<Preference
android:icon="@drawable/ic_list"
app:key="advanced"