mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-01-06 17:40:30 +05:30
ktlint
This commit is contained in:
parent
31cf6f608e
commit
7f130dedb7
@ -1,6 +1,5 @@
|
|||||||
package com.github.libretube.adapters
|
package com.github.libretube.adapters
|
||||||
|
|
||||||
import android.R.attr.data
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.text.format.DateUtils
|
import android.text.format.DateUtils
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
@ -19,7 +18,6 @@ import com.github.libretube.fragments.PlayerFragment
|
|||||||
import com.github.libretube.obj.WatchHistoryItem
|
import com.github.libretube.obj.WatchHistoryItem
|
||||||
import com.squareup.picasso.Picasso
|
import com.squareup.picasso.Picasso
|
||||||
|
|
||||||
|
|
||||||
class WatchHistoryAdapter(
|
class WatchHistoryAdapter(
|
||||||
private val watchHistory: MutableList<WatchHistoryItem>,
|
private val watchHistory: MutableList<WatchHistoryItem>,
|
||||||
private val childFragmentManager: FragmentManager
|
private val childFragmentManager: FragmentManager
|
||||||
|
@ -457,8 +457,9 @@ class PlayerFragment : Fragment() {
|
|||||||
initAutoPlay()
|
initAutoPlay()
|
||||||
val watchHistoryEnabled =
|
val watchHistoryEnabled =
|
||||||
PreferenceHelper.getBoolean(requireContext(), "Watch_history_toggle", true)
|
PreferenceHelper.getBoolean(requireContext(), "Watch_history_toggle", true)
|
||||||
if (watchHistoryEnabled)
|
if (watchHistoryEnabled) {
|
||||||
PreferenceHelper.addToWatchHistory(requireContext(), videoId!!, response)
|
PreferenceHelper.addToWatchHistory(requireContext(), videoId!!, response)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,6 @@ class WatchHistoryFragment : Fragment() {
|
|||||||
val watchHistoryAdapter = WatchHistoryAdapter(watchHistory, childFragmentManager)
|
val watchHistoryAdapter = WatchHistoryAdapter(watchHistory, childFragmentManager)
|
||||||
binding.watchHistoryRecView.adapter = watchHistoryAdapter
|
binding.watchHistoryRecView.adapter = watchHistoryAdapter
|
||||||
|
|
||||||
|
|
||||||
binding.clearHistory.setOnClickListener {
|
binding.clearHistory.setOnClickListener {
|
||||||
PreferenceHelper.removePreference(requireContext(), "watch_history")
|
PreferenceHelper.removePreference(requireContext(), "watch_history")
|
||||||
watchHistoryAdapter.clear()
|
watchHistoryAdapter.clear()
|
||||||
|
@ -2,7 +2,6 @@ package com.github.libretube.util
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.SharedPreferences
|
import android.content.SharedPreferences
|
||||||
import android.util.Log
|
|
||||||
import androidx.preference.PreferenceManager
|
import androidx.preference.PreferenceManager
|
||||||
import com.github.libretube.obj.CustomInstance
|
import com.github.libretube.obj.CustomInstance
|
||||||
import com.github.libretube.obj.Streams
|
import com.github.libretube.obj.Streams
|
||||||
@ -151,7 +150,6 @@ object PreferenceHelper {
|
|||||||
}
|
}
|
||||||
if (indexToRemove != Int.MAX_VALUE) watchHistory.removeAt(indexToRemove)
|
if (indexToRemove != Int.MAX_VALUE) watchHistory.removeAt(indexToRemove)
|
||||||
|
|
||||||
|
|
||||||
watchHistory += watchHistoryItem
|
watchHistory += watchHistoryItem
|
||||||
|
|
||||||
val json = gson.toJson(watchHistory)
|
val json = gson.toJson(watchHistory)
|
||||||
|
Loading…
Reference in New Issue
Block a user