diff --git a/app/src/main/java/com/github/libretube/adapters/ChannelAdapter.kt b/app/src/main/java/com/github/libretube/adapters/ChannelAdapter.kt index d6ea63c02..d508172c6 100644 --- a/app/src/main/java/com/github/libretube/adapters/ChannelAdapter.kt +++ b/app/src/main/java/com/github/libretube/adapters/ChannelAdapter.kt @@ -5,13 +5,10 @@ import android.text.format.DateUtils import android.view.LayoutInflater import android.view.View import android.view.ViewGroup -import android.widget.ImageView -import android.widget.TextView import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.FragmentManager import androidx.recyclerview.widget.RecyclerView import com.github.libretube.R -import com.github.libretube.databinding.ChannelSubscriptionRowBinding import com.github.libretube.databinding.VideoChannelRowBinding import com.github.libretube.dialogs.VideoOptionsDialog import com.github.libretube.fragments.PlayerFragment @@ -47,7 +44,7 @@ class ChannelAdapter( channelDescription.text = trending.title channelViews.text = trending.views.formatShort() + " • " + - DateUtils.getRelativeTimeSpanString(trending.uploaded!!) + DateUtils.getRelativeTimeSpanString(trending.uploaded!!) channelDuration.text = DateUtils.formatElapsedTime(trending.duration!!) Picasso.get().load(trending.thumbnail).into(channelThumbnail) diff --git a/app/src/main/java/com/github/libretube/adapters/CommentsAdapter.kt b/app/src/main/java/com/github/libretube/adapters/CommentsAdapter.kt index 0f7088278..200aae14c 100644 --- a/app/src/main/java/com/github/libretube/adapters/CommentsAdapter.kt +++ b/app/src/main/java/com/github/libretube/adapters/CommentsAdapter.kt @@ -1,12 +1,9 @@ package com.github.libretube.adapters -import android.annotation.SuppressLint import android.util.Log import android.view.LayoutInflater import android.view.View import android.view.ViewGroup -import android.widget.ImageView -import android.widget.TextView import android.widget.Toast import androidx.constraintlayout.motion.widget.MotionLayout import androidx.core.os.bundleOf @@ -54,7 +51,7 @@ class CommentsAdapter( binding.apply { commentInfos.text = comment.author.toString() + - " • " + comment.commentedTime.toString() + " • " + comment.commentedTime.toString() commentText.text = comment.commentText.toString() Picasso.get().load(comment.thumbnail).fit().centerCrop().into(commentorImage) @@ -74,10 +71,12 @@ class CommentsAdapter( val bundle = bundleOf("channel_id" to comment.commentorUrl) activity.navController.navigate(R.id.channel, bundle) try { - val mainMotionLayout = activity.findViewById(R.id.mainMotionLayout) + val mainMotionLayout = + activity.findViewById(R.id.mainMotionLayout) if (mainMotionLayout.progress == 0.toFloat()) { mainMotionLayout.transitionToEnd() - activity.findViewById(R.id.playerMotionLayout).transitionToEnd() + activity.findViewById(R.id.playerMotionLayout) + .transitionToEnd() } } catch (e: Exception) { } @@ -91,7 +90,8 @@ class CommentsAdapter( nextpage = comment.repliesPage fetchReplies(nextpage, repliesAdapter) } else { - Toast.makeText(holder.v.context, R.string.no_replies, Toast.LENGTH_SHORT).show() + Toast.makeText(holder.v.context, R.string.no_replies, Toast.LENGTH_SHORT) + .show() } } else { repliesAdapter.clear() diff --git a/app/src/main/java/com/github/libretube/adapters/PlaylistAdapter.kt b/app/src/main/java/com/github/libretube/adapters/PlaylistAdapter.kt index 5c432d786..e08c65489 100644 --- a/app/src/main/java/com/github/libretube/adapters/PlaylistAdapter.kt +++ b/app/src/main/java/com/github/libretube/adapters/PlaylistAdapter.kt @@ -7,14 +7,11 @@ import android.util.Log import android.view.LayoutInflater import android.view.View import android.view.ViewGroup -import android.widget.ImageView -import android.widget.TextView import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.FragmentManager import androidx.recyclerview.widget.RecyclerView import com.github.libretube.R import com.github.libretube.databinding.PlaylistRowBinding -import com.github.libretube.databinding.PlaylistsRowBinding import com.github.libretube.dialogs.VideoOptionsDialog import com.github.libretube.fragments.PlayerFragment import com.github.libretube.obj.PlaylistId diff --git a/app/src/main/java/com/github/libretube/adapters/PlaylistsAdapter.kt b/app/src/main/java/com/github/libretube/adapters/PlaylistsAdapter.kt index bb38fafcb..49a2fa274 100644 --- a/app/src/main/java/com/github/libretube/adapters/PlaylistsAdapter.kt +++ b/app/src/main/java/com/github/libretube/adapters/PlaylistsAdapter.kt @@ -5,8 +5,6 @@ import android.util.Log import android.view.LayoutInflater import android.view.View import android.view.ViewGroup -import android.widget.ImageView -import android.widget.TextView import androidx.core.os.bundleOf import androidx.recyclerview.widget.RecyclerView import com.github.libretube.MainActivity diff --git a/app/src/main/java/com/github/libretube/adapters/RepliesAdapter.kt b/app/src/main/java/com/github/libretube/adapters/RepliesAdapter.kt index 43819b104..edbdca36a 100644 --- a/app/src/main/java/com/github/libretube/adapters/RepliesAdapter.kt +++ b/app/src/main/java/com/github/libretube/adapters/RepliesAdapter.kt @@ -3,8 +3,6 @@ package com.github.libretube.adapters import android.view.LayoutInflater import android.view.View import android.view.ViewGroup -import android.widget.ImageView -import android.widget.TextView import androidx.constraintlayout.motion.widget.MotionLayout import androidx.core.os.bundleOf import androidx.recyclerview.widget.RecyclerView @@ -45,7 +43,7 @@ class RepliesAdapter( val reply = replies[position] commentInfos.text = reply.author.toString() + - " • " + reply.commentedTime.toString() + " • " + reply.commentedTime.toString() commentText.text = reply.commentText.toString() Picasso.get().load(reply.thumbnail).fit().centerCrop().into(commentorImage) @@ -65,10 +63,12 @@ class RepliesAdapter( val bundle = bundleOf("channel_id" to reply.commentorUrl) activity.navController.navigate(R.id.channel, bundle) try { - val mainMotionLayout = activity.findViewById(R.id.mainMotionLayout) + val mainMotionLayout = + activity.findViewById(R.id.mainMotionLayout) if (mainMotionLayout.progress == 0.toFloat()) { mainMotionLayout.transitionToEnd() - activity.findViewById(R.id.playerMotionLayout).transitionToEnd() + activity.findViewById(R.id.playerMotionLayout) + .transitionToEnd() } } catch (e: Exception) { } diff --git a/app/src/main/java/com/github/libretube/adapters/SearchHistoryAdapter.kt b/app/src/main/java/com/github/libretube/adapters/SearchHistoryAdapter.kt index c649c37c7..5b0412c9c 100644 --- a/app/src/main/java/com/github/libretube/adapters/SearchHistoryAdapter.kt +++ b/app/src/main/java/com/github/libretube/adapters/SearchHistoryAdapter.kt @@ -5,12 +5,8 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.widget.EditText -import android.widget.ImageView -import android.widget.TextView import androidx.recyclerview.widget.RecyclerView -import com.github.libretube.R import com.github.libretube.databinding.SearchhistoryRowBinding -import com.github.libretube.databinding.SearchsuggestionRowBinding import com.github.libretube.fragments.SearchFragment import com.github.libretube.util.PreferenceHelper diff --git a/app/src/main/java/com/github/libretube/adapters/SubscriptionAdapter.kt b/app/src/main/java/com/github/libretube/adapters/SubscriptionAdapter.kt index b5fefafa4..7462b580f 100644 --- a/app/src/main/java/com/github/libretube/adapters/SubscriptionAdapter.kt +++ b/app/src/main/java/com/github/libretube/adapters/SubscriptionAdapter.kt @@ -64,10 +64,12 @@ class SubscriptionAdapter( val bundle = bundleOf("channel_id" to trending.uploaderUrl) activity.navController.navigate(R.id.channel, bundle) try { - val mainMotionLayout = activity.findViewById(R.id.mainMotionLayout) + val mainMotionLayout = + activity.findViewById(R.id.mainMotionLayout) if (mainMotionLayout.progress == 0.toFloat()) { mainMotionLayout.transitionToEnd() - activity.findViewById(R.id.playerMotionLayout).transitionToEnd() + activity.findViewById(R.id.playerMotionLayout) + .transitionToEnd() } } catch (e: Exception) { } diff --git a/app/src/main/java/com/github/libretube/adapters/SubscriptionChannelAdapter.kt b/app/src/main/java/com/github/libretube/adapters/SubscriptionChannelAdapter.kt index 02d176df1..6a4586ff6 100644 --- a/app/src/main/java/com/github/libretube/adapters/SubscriptionChannelAdapter.kt +++ b/app/src/main/java/com/github/libretube/adapters/SubscriptionChannelAdapter.kt @@ -5,8 +5,6 @@ import android.util.Log import android.view.LayoutInflater import android.view.View import android.view.ViewGroup -import android.widget.ImageView -import android.widget.TextView import androidx.core.os.bundleOf import androidx.recyclerview.widget.RecyclerView import com.github.libretube.MainActivity @@ -61,7 +59,8 @@ class SubscriptionChannelAdapter(private val subscriptions: MutableList() { private val TAG = "TrendingAdapter" - private lateinit var binding: TrendingRowBinding + private lateinit var binding: TrendingRowBinding override fun getItemCount(): Int { return videoFeed.size @@ -45,8 +42,8 @@ class TrendingAdapter( textViewTitle.text = trending.title textViewChannel.text = trending.uploaderName + " • " + - trending.views.formatShort() + " • " + - DateUtils.getRelativeTimeSpanString(trending.uploaded!!) + trending.views.formatShort() + " • " + + DateUtils.getRelativeTimeSpanString(trending.uploaded!!) if (trending.duration != -1L) { thumbnailDuration.text = DateUtils.formatElapsedTime(trending.duration!!) } else { @@ -58,10 +55,12 @@ class TrendingAdapter( val bundle = bundleOf("channel_id" to trending.uploaderUrl) activity.navController.navigate(R.id.channel, bundle) try { - val mainMotionLayout = activity.findViewById(R.id.mainMotionLayout) + val mainMotionLayout = + activity.findViewById(R.id.mainMotionLayout) if (mainMotionLayout.progress == 0.toFloat()) { mainMotionLayout.transitionToEnd() - activity.findViewById(R.id.playerMotionLayout).transitionToEnd() + activity.findViewById(R.id.playerMotionLayout) + .transitionToEnd() } } catch (e: Exception) { } diff --git a/app/src/main/java/com/github/libretube/fragments/SearchFragment.kt b/app/src/main/java/com/github/libretube/fragments/SearchFragment.kt index 855aaa3b9..e6a9fd737 100644 --- a/app/src/main/java/com/github/libretube/fragments/SearchFragment.kt +++ b/app/src/main/java/com/github/libretube/fragments/SearchFragment.kt @@ -259,7 +259,12 @@ class SearchFragment : Fragment() { val historyList = PreferenceHelper.getHistory(requireContext()) if (historyList.isNotEmpty()) { binding.historyRecycler.adapter = - SearchHistoryAdapter(requireContext(), historyList, binding.autoCompleteTextView, this) + SearchHistoryAdapter( + requireContext(), + historyList, + binding.autoCompleteTextView, + this + ) binding.historyRecycler.visibility = VISIBLE } }