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