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 e28b6267c..97c9a77a1 100644 --- a/app/src/main/java/com/github/libretube/adapters/PlaylistAdapter.kt +++ b/app/src/main/java/com/github/libretube/adapters/PlaylistAdapter.kt @@ -16,6 +16,7 @@ import com.github.libretube.preferences.PreferenceHelper import com.github.libretube.util.ConnectionHelper import com.github.libretube.util.NavigationHelper import com.github.libretube.util.RetrofitInstance +import com.github.libretube.util.setWatchProgressLength import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -51,13 +52,13 @@ class PlaylistAdapter( holder.binding.apply { playlistTitle.text = streamItem.title playlistDescription.text = streamItem.uploaderName - playlistDuration.text = DateUtils.formatElapsedTime(streamItem.duration!!) + thumbnailDuration.text = DateUtils.formatElapsedTime(streamItem.duration!!) ConnectionHelper.loadImage(streamItem.thumbnail, playlistThumbnail) root.setOnClickListener { NavigationHelper.navigateVideo(root.context, streamItem.url, playlistId) } + val videoId = streamItem.url!!.replace("/watch?v=", "") root.setOnLongClickListener { - val videoId = streamItem.url!!.replace("/watch?v=", "") VideoOptionsDialog(videoId, root.context) .show(childFragmentManager, "VideoOptionsDialog") true @@ -70,6 +71,7 @@ class PlaylistAdapter( removeFromPlaylist(token, position) } } + watchProgress.setWatchProgressLength(videoId, streamItem.duration!!) } } diff --git a/app/src/main/java/com/github/libretube/adapters/TrendingAdapter.kt b/app/src/main/java/com/github/libretube/adapters/TrendingAdapter.kt index 4c4b4f30e..2451acd75 100644 --- a/app/src/main/java/com/github/libretube/adapters/TrendingAdapter.kt +++ b/app/src/main/java/com/github/libretube/adapters/TrendingAdapter.kt @@ -16,12 +16,24 @@ import com.github.libretube.util.setWatchProgressLength class TrendingAdapter( private val streamItems: List, - private val childFragmentManager: FragmentManager + private val childFragmentManager: FragmentManager, + private val showAllAtOne: Boolean = true ) : RecyclerView.Adapter() { - private val TAG = "SubscriptionAdapter" + private val TAG = "TrendingAdapter" + + var index = 10 override fun getItemCount(): Int { - return streamItems.size + return if (showAllAtOne) streamItems.size + else index + } + + fun updateItems() { + index += 10 + if (index > streamItems.size) { + index = streamItems.size + } + notifyDataSetChanged() } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): SubscriptionViewHolder { diff --git a/app/src/main/java/com/github/libretube/adapters/WatchHistoryAdapter.kt b/app/src/main/java/com/github/libretube/adapters/WatchHistoryAdapter.kt index 4bd70b516..8da51363e 100644 --- a/app/src/main/java/com/github/libretube/adapters/WatchHistoryAdapter.kt +++ b/app/src/main/java/com/github/libretube/adapters/WatchHistoryAdapter.kt @@ -5,9 +5,10 @@ import android.view.LayoutInflater import android.view.ViewGroup import androidx.fragment.app.FragmentManager import androidx.recyclerview.widget.RecyclerView -import com.github.libretube.databinding.VideoRowBinding +import com.github.libretube.databinding.WatchHistoryRowBinding import com.github.libretube.dialogs.VideoOptionsDialog import com.github.libretube.obj.WatchHistoryItem +import com.github.libretube.preferences.PreferenceHelper import com.github.libretube.util.ConnectionHelper import com.github.libretube.util.NavigationHelper import com.github.libretube.util.setWatchProgressLength @@ -19,15 +20,9 @@ class WatchHistoryAdapter( RecyclerView.Adapter() { private val TAG = "WatchHistoryAdapter" - fun clear() { - val size = watchHistory.size - watchHistory.clear() - notifyItemRangeRemoved(0, size) - } - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): WatchHistoryViewHolder { val layoutInflater = LayoutInflater.from(parent.context) - val binding = VideoRowBinding.inflate(layoutInflater, parent, false) + val binding = WatchHistoryRowBinding.inflate(layoutInflater, parent, false) return WatchHistoryViewHolder(binding) } @@ -45,6 +40,12 @@ class WatchHistoryAdapter( NavigationHelper.navigateChannel(root.context, video.uploaderUrl) } + deleteBTN.setOnClickListener { + PreferenceHelper.removeFromWatchHistory(video.videoId!!) + watchHistory.removeAt(position) + notifyItemRemoved(position) + } + root.setOnClickListener { NavigationHelper.navigateVideo(root.context, video.videoId) } @@ -63,5 +64,5 @@ class WatchHistoryAdapter( } } -class WatchHistoryViewHolder(val binding: VideoRowBinding) : +class WatchHistoryViewHolder(val binding: WatchHistoryRowBinding) : RecyclerView.ViewHolder(binding.root) diff --git a/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt b/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt index f9499d3c8..02a3a7e18 100644 --- a/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt +++ b/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt @@ -600,7 +600,6 @@ class PlayerFragment : Fragment() { } mainActivity.requestedOrientation = orientation } - binding.player.setDoubleTapOverlayLayoutParams(90) Globals.IS_FULL_SCREEN = true } 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 1c3e1c2f1..0e6049259 100644 --- a/app/src/main/java/com/github/libretube/fragments/SearchFragment.kt +++ b/app/src/main/java/com/github/libretube/fragments/SearchFragment.kt @@ -66,6 +66,7 @@ class SearchFragment : Fragment() { binding.clearSearchImageView.setOnClickListener { binding.autoCompleteTextView.text.clear() + binding.historyRecycler.adapter = null showHistory() } @@ -128,7 +129,7 @@ class SearchFragment : Fragment() { } override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) { - if (s!! != "") { + if (s.toString() != "") { binding.searchRecycler.adapter = null binding.searchRecycler.viewTreeObserver @@ -143,14 +144,15 @@ class SearchFragment : Fragment() { override fun afterTextChanged(s: Editable?) { if (s!!.isEmpty()) { + binding.historyRecycler.adapter = null showHistory() } } }) binding.autoCompleteTextView.setOnEditorActionListener( - OnEditorActionListener { _, actionId, _ -> - if (actionId == EditorInfo.IME_ACTION_SEARCH) { - view?.let { context?.hideKeyboard(it) } + OnEditorActionListener { textView, actionId, _ -> + if (actionId == EditorInfo.IME_ACTION_SEARCH && textView.text.toString() != "") { + view.let { context?.hideKeyboard(it) } binding.searchRecycler.visibility = VISIBLE binding.historyRecycler.visibility = GONE fetchSearch(binding.autoCompleteTextView.text.toString()) diff --git a/app/src/main/java/com/github/libretube/fragments/SubscriptionsFragment.kt b/app/src/main/java/com/github/libretube/fragments/SubscriptionsFragment.kt index 3d1327132..467703d1c 100644 --- a/app/src/main/java/com/github/libretube/fragments/SubscriptionsFragment.kt +++ b/app/src/main/java/com/github/libretube/fragments/SubscriptionsFragment.kt @@ -85,6 +85,20 @@ class SubscriptionsFragment : Fragment() { binding.subFeedContainer.visibility = View.VISIBLE } } + + binding.scrollviewSub.viewTreeObserver + .addOnScrollChangedListener { + if (binding.scrollviewSub.getChildAt(0).bottom + == (binding.scrollviewSub.height + binding.scrollviewSub.scrollY) + ) { + // scroll view is at bottom + if (isLoaded) { + binding.subRefresh.isRefreshing = true + subscriptionAdapter?.updateItems() + binding.subRefresh.isRefreshing = false + } + } + } } else { binding.subRefresh.isEnabled = false } @@ -106,7 +120,7 @@ class SubscriptionsFragment : Fragment() { binding.subRefresh.isRefreshing = false } if (response.isNotEmpty()) { - subscriptionAdapter = TrendingAdapter(response, childFragmentManager) + subscriptionAdapter = TrendingAdapter(response, childFragmentManager, false) feedRecView.adapter = subscriptionAdapter } else { runOnUiThread { diff --git a/app/src/main/java/com/github/libretube/fragments/WatchHistoryFragment.kt b/app/src/main/java/com/github/libretube/fragments/WatchHistoryFragment.kt index 03f00c576..43c5e3a4d 100644 --- a/app/src/main/java/com/github/libretube/fragments/WatchHistoryFragment.kt +++ b/app/src/main/java/com/github/libretube/fragments/WatchHistoryFragment.kt @@ -27,12 +27,12 @@ class WatchHistoryFragment : Fragment() { super.onViewCreated(view, savedInstanceState) val watchHistory = PreferenceHelper.getWatchHistory() - val watchHistoryAdapter = WatchHistoryAdapter(watchHistory, childFragmentManager) - binding.watchHistoryRecView.adapter = watchHistoryAdapter - binding.clearHistory.setOnClickListener { - PreferenceHelper.removePreference("watch_history") - watchHistoryAdapter.clear() + if (watchHistory.isNotEmpty()) { + val watchHistoryAdapter = WatchHistoryAdapter(watchHistory, childFragmentManager) + binding.watchHistoryRecView.adapter = watchHistoryAdapter + binding.historyEmpty.visibility = View.GONE + binding.watchHistoryRecView.visibility = View.VISIBLE } // reverse order diff --git a/app/src/main/java/com/github/libretube/preferences/AdvancedSettings.kt b/app/src/main/java/com/github/libretube/preferences/AdvancedSettings.kt index 35cc1e7ed..557a6cd32 100644 --- a/app/src/main/java/com/github/libretube/preferences/AdvancedSettings.kt +++ b/app/src/main/java/com/github/libretube/preferences/AdvancedSettings.kt @@ -3,10 +3,8 @@ package com.github.libretube.preferences import android.os.Bundle import androidx.preference.Preference import androidx.preference.PreferenceFragmentCompat -import androidx.preference.SwitchPreferenceCompat import com.github.libretube.R import com.github.libretube.activities.SettingsActivity -import com.github.libretube.dialogs.RequireRestartDialog import com.google.android.material.dialog.MaterialAlertDialogBuilder class AdvancedSettings : PreferenceFragmentCompat() { @@ -18,13 +16,6 @@ class AdvancedSettings : PreferenceFragmentCompat() { val settingsActivity = activity as SettingsActivity settingsActivity.changeTopBarText(getString(R.string.advanced)) - val dataSaverMode = findPreference(PreferenceKeys.DATA_SAVER_MODE) - dataSaverMode?.setOnPreferenceChangeListener { _, _ -> - val restartDialog = RequireRestartDialog() - restartDialog.show(childFragmentManager, "RequireRestartDialog") - true - } - val resetSettings = findPreference(PreferenceKeys.RESET_SETTINGS) resetSettings?.setOnPreferenceClickListener { showResetDialog() @@ -34,6 +25,9 @@ class AdvancedSettings : PreferenceFragmentCompat() { private fun showResetDialog() { MaterialAlertDialogBuilder(requireContext()) + .setTitle(R.string.reset) + .setMessage(R.string.reset_message) + .setNegativeButton(getString(R.string.cancel)) { _, _ -> } .setPositiveButton(R.string.reset) { _, _ -> // clear default preferences PreferenceHelper.clearPreferences() @@ -41,12 +35,8 @@ class AdvancedSettings : PreferenceFragmentCompat() { // clear login token PreferenceHelper.setToken("") - val restartDialog = RequireRestartDialog() - restartDialog.show(childFragmentManager, "RequireRestartDialog") + activity?.recreate() } - .setNegativeButton(getString(R.string.cancel)) { _, _ -> } - .setTitle(R.string.reset) - .setMessage(R.string.reset_message) .show() } } diff --git a/app/src/main/java/com/github/libretube/preferences/AppearanceSettings.kt b/app/src/main/java/com/github/libretube/preferences/AppearanceSettings.kt index 81aece34c..c61c5b682 100644 --- a/app/src/main/java/com/github/libretube/preferences/AppearanceSettings.kt +++ b/app/src/main/java/com/github/libretube/preferences/AppearanceSettings.kt @@ -51,13 +51,6 @@ class AppearanceSettings : PreferenceFragmentCompat() { true } - val gridColumns = findPreference(PreferenceKeys.GRID_COLUMNS) - gridColumns?.setOnPreferenceChangeListener { _, _ -> - val restartDialog = RequireRestartDialog() - restartDialog.show(childFragmentManager, "RequireRestartDialog") - true - } - val labelVisibilityMode = findPreference(PreferenceKeys.LABEL_VISIBILITY) labelVisibilityMode?.setOnPreferenceChangeListener { _, _ -> val restartDialog = RequireRestartDialog() diff --git a/app/src/main/java/com/github/libretube/preferences/GeneralSettings.kt b/app/src/main/java/com/github/libretube/preferences/GeneralSettings.kt index bbbba3f83..c40ed8427 100644 --- a/app/src/main/java/com/github/libretube/preferences/GeneralSettings.kt +++ b/app/src/main/java/com/github/libretube/preferences/GeneralSettings.kt @@ -2,7 +2,6 @@ package com.github.libretube.preferences import android.os.Bundle import androidx.preference.ListPreference -import androidx.preference.Preference import androidx.preference.PreferenceFragmentCompat import androidx.preference.SwitchPreferenceCompat import com.github.libretube.R @@ -18,13 +17,6 @@ class GeneralSettings : PreferenceFragmentCompat() { val settingsActivity = activity as SettingsActivity settingsActivity.changeTopBarText(getString(R.string.general)) - val region = findPreference("region") - region?.setOnPreferenceChangeListener { _, _ -> - val restartDialog = RequireRestartDialog() - restartDialog.show(childFragmentManager, "RequireRestartDialog") - true - } - val language = findPreference("language") language?.setOnPreferenceChangeListener { _, _ -> val restartDialog = RequireRestartDialog() diff --git a/app/src/main/java/com/github/libretube/preferences/HistorySettings.kt b/app/src/main/java/com/github/libretube/preferences/HistorySettings.kt index 96160e3ac..885989ca7 100644 --- a/app/src/main/java/com/github/libretube/preferences/HistorySettings.kt +++ b/app/src/main/java/com/github/libretube/preferences/HistorySettings.kt @@ -5,6 +5,7 @@ import androidx.preference.Preference import androidx.preference.PreferenceFragmentCompat import com.github.libretube.R import com.github.libretube.activities.SettingsActivity +import com.google.android.material.dialog.MaterialAlertDialogBuilder class HistorySettings : PreferenceFragmentCompat() { @@ -17,22 +18,34 @@ class HistorySettings : PreferenceFragmentCompat() { // clear search history val clearHistory = findPreference(PreferenceKeys.CLEAR_SEARCH_HISTORY) clearHistory?.setOnPreferenceClickListener { - PreferenceHelper.removePreference("search_history") + showClearDialog(R.string.clear_history, "search_history") true } // clear watch history and positions val clearWatchHistory = findPreference(PreferenceKeys.CLEAR_WATCH_HISTORY) clearWatchHistory?.setOnPreferenceClickListener { - PreferenceHelper.removePreference("watch_history") + showClearDialog(R.string.clear_history, "watch_history") true } // clear watch positions val clearWatchPositions = findPreference(PreferenceKeys.CLEAR_WATCH_POSITIONS) clearWatchPositions?.setOnPreferenceClickListener { - PreferenceHelper.removePreference("watch_positions") + showClearDialog(R.string.reset_watch_positions, "watch_positions") true } } + + private fun showClearDialog(title: Int, preferenceKey: String) { + MaterialAlertDialogBuilder(requireContext()) + .setTitle(title) + .setMessage(R.string.irreversible) + .setNegativeButton(getString(R.string.cancel)) { _, _ -> } + .setPositiveButton(R.string.okay) { _, _ -> + // clear the selected preference preferences + PreferenceHelper.removePreference(preferenceKey) + } + .show() + } } diff --git a/app/src/main/java/com/github/libretube/preferences/InstanceSettings.kt b/app/src/main/java/com/github/libretube/preferences/InstanceSettings.kt index efa881c08..d2d82c013 100644 --- a/app/src/main/java/com/github/libretube/preferences/InstanceSettings.kt +++ b/app/src/main/java/com/github/libretube/preferences/InstanceSettings.kt @@ -21,7 +21,6 @@ import com.github.libretube.dialogs.CustomInstanceDialog import com.github.libretube.dialogs.DeleteAccountDialog import com.github.libretube.dialogs.LoginDialog import com.github.libretube.dialogs.LogoutDialog -import com.github.libretube.dialogs.RequireRestartDialog import com.github.libretube.util.PermissionHelper import com.github.libretube.util.RetrofitInstance import org.json.JSONObject @@ -120,14 +119,13 @@ class InstanceSettings : PreferenceFragmentCompat() { // fetchInstance() initCustomInstances(instance!!) instance.setOnPreferenceChangeListener { _, newValue -> - val restartDialog = RequireRestartDialog() - restartDialog.show(childFragmentManager, "RequireRestartDialog") RetrofitInstance.url = newValue.toString() if (!PreferenceHelper.getBoolean(PreferenceKeys.AUTH_INSTANCE_TOGGLE, false)) { RetrofitInstance.authUrl = newValue.toString() logout() } RetrofitInstance.lazyMgr.reset() + activity?.recreate() true } @@ -142,8 +140,7 @@ class InstanceSettings : PreferenceFragmentCompat() { RetrofitInstance.authUrl = newValue.toString() RetrofitInstance.lazyMgr.reset() logout() - val restartDialog = RequireRestartDialog() - restartDialog.show(childFragmentManager, "RequireRestartDialog") + activity?.recreate() true } @@ -155,8 +152,8 @@ class InstanceSettings : PreferenceFragmentCompat() { // either use new auth url or the normal api url if auth instance disabled RetrofitInstance.authUrl = if (newValue == false) RetrofitInstance.url else authInstance.value - val restartDialog = RequireRestartDialog() - restartDialog.show(childFragmentManager, "RequireRestartDialog") + RetrofitInstance.lazyMgr.reset() + activity?.recreate() true } diff --git a/app/src/main/java/com/github/libretube/preferences/PreferenceHelper.kt b/app/src/main/java/com/github/libretube/preferences/PreferenceHelper.kt index 50bfcaefe..ecd3025e1 100644 --- a/app/src/main/java/com/github/libretube/preferences/PreferenceHelper.kt +++ b/app/src/main/java/com/github/libretube/preferences/PreferenceHelper.kt @@ -26,38 +26,10 @@ object PreferenceHelper { editor = settings.edit() } - fun setString(key: String?, value: String?) { - editor.putString(key, value) - editor.apply() - } - - fun setInt(key: String?, value: Int) { - editor.putInt(key, value) - editor.apply() - } - - fun setLong(key: String?, value: Long) { - editor.putLong(key, value) - editor.apply() - } - - fun setBoolean(key: String?, value: Boolean) { - editor.putBoolean(key, value) - editor.apply() - } - fun getString(key: String?, defValue: String?): String { return settings.getString(key, defValue)!! } - fun getInt(key: String?, defValue: Int): Int { - return settings.getInt(key, defValue) - } - - fun getLong(key: String?, defValue: Long): Long { - return settings.getLong(key, defValue) - } - fun getBoolean(key: String?, defValue: Boolean): Boolean { return settings.getBoolean(key, defValue) } @@ -150,6 +122,8 @@ object PreferenceHelper { } fun addToWatchHistory(videoId: String, streams: Streams) { + removeFromWatchHistory(videoId) + val watchHistoryItem = WatchHistoryItem( videoId, streams.title, @@ -161,21 +135,30 @@ object PreferenceHelper { streams.duration ) + val mapper = ObjectMapper() val watchHistory = getWatchHistory() - // delete entries that have the same videoId - var indexToRemove: Int? = null - watchHistory.forEachIndexed { index, item -> - if (item.videoId == videoId) indexToRemove = index - } - if (indexToRemove != null) watchHistory.removeAt(indexToRemove!!) - watchHistory += watchHistoryItem val json = mapper.writeValueAsString(watchHistory) editor.putString("watch_history", json).apply() } + fun removeFromWatchHistory(videoId: String) { + val mapper = ObjectMapper() + val watchHistory = getWatchHistory() + + var indexToRemove: Int? = null + watchHistory.forEachIndexed { index, item -> + if (item.videoId == videoId) indexToRemove = index + } + if (indexToRemove != null) { + watchHistory.removeAt(indexToRemove!!) + val json = mapper.writeValueAsString(watchHistory) + editor.putString("watch_history", json).commit() + } + } + fun getWatchHistory(): ArrayList { val json: String = settings.getString("watch_history", "")!! val type = mapper.typeFactory.constructCollectionType( diff --git a/app/src/main/java/com/github/libretube/views/CustomExoPlayerView.kt b/app/src/main/java/com/github/libretube/views/CustomExoPlayerView.kt index 3557cc3a7..193609b63 100644 --- a/app/src/main/java/com/github/libretube/views/CustomExoPlayerView.kt +++ b/app/src/main/java/com/github/libretube/views/CustomExoPlayerView.kt @@ -5,7 +5,6 @@ import android.content.Context import android.util.AttributeSet import android.view.MotionEvent import android.view.View -import com.github.libretube.R import com.github.libretube.databinding.ExoStyledPlayerControlViewBinding import com.github.libretube.util.DoubleTapListener import com.github.libretube.util.OnDoubleTapEventListener @@ -54,26 +53,6 @@ internal class CustomExoPlayerView( setOnClickListener(doubleTouchListener) } - override fun hideController() { - super.hideController() - setDoubleTapOverlayLayoutParams(0) - } - - override fun showController() { - setDoubleTapOverlayLayoutParams(90) - super.showController() - } - - // set the top and bottom margin of the double tap overlay - fun setDoubleTapOverlayLayoutParams(margin: Int) { - val dpMargin = resources?.displayMetrics?.density!!.toInt() * margin - val doubleTapOverlay = binding.root.findViewById(R.id.doubleTapOverlay) - val params = doubleTapOverlay.layoutParams as MarginLayoutParams - params.topMargin = dpMargin - params.bottomMargin = dpMargin - doubleTapOverlay.layoutParams = params - } - override fun onTouchEvent(event: MotionEvent): Boolean { // save the x position of the touch event xPos = event.x diff --git a/app/src/main/res/drawable/ic_delete.xml b/app/src/main/res/drawable/ic_delete.xml index 05fc2abd8..8e7c70a7b 100644 --- a/app/src/main/res/drawable/ic_delete.xml +++ b/app/src/main/res/drawable/ic_delete.xml @@ -1,11 +1,10 @@ - + android:tint="?android:attr/colorControlNormal" + android:viewportWidth="48" + android:viewportHeight="48"> + android:pathData="M13.05,42q-1.2,0 -2.1,-0.9 -0.9,-0.9 -0.9,-2.1L10.05,10.5L8,10.5v-3h9.4L17.4,6h13.2v1.5L40,7.5v3h-2.05L37.95,39q0,1.2 -0.9,2.1 -0.9,0.9 -2.1,0.9ZM18.35,34.7h3L21.35,14.75h-3ZM26.65,34.7h3L29.65,14.75h-3Z" /> diff --git a/app/src/main/res/layout/channel_subscription_row.xml b/app/src/main/res/layout/channel_subscription_row.xml index d8b8b7430..d2ec9e123 100644 --- a/app/src/main/res/layout/channel_subscription_row.xml +++ b/app/src/main/res/layout/channel_subscription_row.xml @@ -1,6 +1,7 @@ + android:textSize="16sp" + tools:text="Channel Name" /> + app:elevation="20dp" + tools:text="@string/unsubscribe" /> \ No newline at end of file diff --git a/app/src/main/res/layout/chapter_column.xml b/app/src/main/res/layout/chapter_column.xml index d8dc611a4..17f2c3487 100644 --- a/app/src/main/res/layout/chapter_column.xml +++ b/app/src/main/res/layout/chapter_column.xml @@ -3,6 +3,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="wrap_content" android:layout_height="match_parent" + xmlns:tools="http://schemas.android.com/tools" android:background="?attr/selectableItemBackground" android:backgroundTint="@android:color/transparent" app:strokeWidth="0dp"> @@ -23,12 +24,12 @@ diff --git a/app/src/main/res/layout/comments_row.xml b/app/src/main/res/layout/comments_row.xml index 5256e49d6..2a4602244 100644 --- a/app/src/main/res/layout/comments_row.xml +++ b/app/src/main/res/layout/comments_row.xml @@ -1,6 +1,7 @@ @@ -45,9 +46,9 @@ android:layout_height="wrap_content" android:ellipsize="end" android:maxLines="2" - android:text="Author and Time" android:textSize="15sp" - android:textStyle="bold" /> + android:textStyle="bold" + tools:text="Author and Time" /> + tools:text="Comment Text" /> + tools:text="LikeCount" /> @@ -57,9 +57,9 @@ android:drawablePadding="3dip" android:ellipsize="end" android:maxLines="1" - android:text="Channel Name" android:textSize="16sp" - android:textStyle="bold" /> + android:textStyle="bold" + tools:text="Channel Name" /> @@ -78,14 +78,15 @@ style="@style/Widget.Material3.Button.ElevatedButton" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:drawableLeft="@drawable/ic_bell_small" + android:drawableStart="@drawable/ic_bell_small" android:drawableTint="?android:attr/textColorPrimary" android:stateListAnimator="@null" android:text="@string/subscribe" android:textColor="?android:attr/textColorPrimary" android:textSize="12sp" app:cornerRadius="20dp" - app:elevation="20dp" /> + app:elevation="20dp" + tools:targetApi="m" /> @@ -96,8 +97,7 @@ android:layout_marginStart="10dp" android:layout_marginEnd="10dp" android:layout_marginBottom="15dp" - android:autoLink="web" - android:text="" /> + android:autoLink="web" /> + android:textSize="18sp" + tools:text="Video Title" /> + tools:text="10M views 2 days ago " /> + tools:text="4.2K" /> + tools:text="1.3K" /> @@ -264,7 +264,6 @@ android:layout_toEndOf="@+id/player_channelImage" android:ellipsize="end" android:maxLines="1" - android:text="" android:textSize="15sp" /> @@ -275,7 +274,7 @@ android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_centerVertical="true" - android:drawableLeft="@drawable/ic_bell" + android:drawableStart="@drawable/ic_bell" android:drawableTint="?android:attr/textColorPrimary" android:text="@string/subscribe" android:textColor="?android:attr/textColorPrimary" @@ -377,7 +376,9 @@ + android:layout_gravity="center" + android:gravity="center" + android:layout_height="wrap_content" /> diff --git a/app/src/main/res/layout/fragment_playlist.xml b/app/src/main/res/layout/fragment_playlist.xml index 5b30b3347..e4b2c1201 100644 --- a/app/src/main/res/layout/fragment_playlist.xml +++ b/app/src/main/res/layout/fragment_playlist.xml @@ -34,7 +34,6 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" - android:text="" android:textSize="24sp" android:textStyle="bold" /> @@ -43,7 +42,7 @@ android:layout_width="20dp" android:layout_height="20dp" android:layout_gravity="center" - android:layout_marginRight="10dp" + android:layout_marginEnd="10dp" android:src="@drawable/ic_three_dots" /> diff --git a/app/src/main/res/layout/fragment_search.xml b/app/src/main/res/layout/fragment_search.xml index 1cd0329b1..b39ba3a3a 100644 --- a/app/src/main/res/layout/fragment_search.xml +++ b/app/src/main/res/layout/fragment_search.xml @@ -37,8 +37,8 @@ style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginLeft="20dp" - android:layout_marginRight="30dp" + android:layout_marginStart="20dp" + android:layout_marginEnd="30dp" android:background="@android:color/transparent" app:hintEnabled="false"> @@ -59,9 +59,9 @@ android:id="@+id/clearSearch_imageView" android:layout_width="20dp" android:layout_height="20dp" - android:layout_alignParentRight="true" + android:layout_alignParentEnd="true" android:layout_centerVertical="true" - android:layout_marginRight="16dp" + android:layout_marginEnd="16dp" android:src="@drawable/ic_close" /> @@ -71,260 +71,12 @@ android:id="@+id/filterMenu_imageView" android:layout_width="30dp" android:layout_height="30dp" - android:layout_alignParentRight="true" android:layout_marginTop="25dp" - android:layout_marginRight="20dp" + android:layout_marginEnd="20dp" android:layout_weight="0" android:src="@drawable/ic_filter" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - + android:layout_marginHorizontal="10dp" + android:gravity="center" + android:text="@string/history_empty" + android:textSize="20sp" + android:textStyle="bold" /> - \ No newline at end of file + + + \ No newline at end of file diff --git a/app/src/main/res/layout/playlist_row.xml b/app/src/main/res/layout/playlist_row.xml index cca5c2238..a0193c730 100644 --- a/app/src/main/res/layout/playlist_row.xml +++ b/app/src/main/res/layout/playlist_row.xml @@ -36,27 +36,43 @@ android:layout_height="match_parent" tools:srcCompat="@tools:sample/backgrounds/scenic" /> - + android:layout_gravity="bottom" + android:orientation="vertical"> - + android:layout_gravity="end" + android:layout_marginEnd="5dp" + android:layout_marginBottom="5dp" + app:cardBackgroundColor="@color/duration_background_color" + app:cardCornerRadius="8dp" + app:cardElevation="0dp"> + + + + + + + + - + app:layout_constraintTop_toTopOf="parent" + tools:text="Playlist Name" /> + app:layout_constraintTop_toBottomOf="@+id/playlist_title" + tools:text="Description" /> @@ -52,8 +51,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginStart="8dp" - android:text="" - app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintEnd_toStartOf="@id/delete_playlist" app:layout_constraintStart_toEndOf="@+id/card_playlist_thumbnail" app:layout_constraintTop_toBottomOf="@+id/playlist_title" /> diff --git a/app/src/main/res/layout/replies_row.xml b/app/src/main/res/layout/replies_row.xml index 6c46ed634..f8d76b0af 100644 --- a/app/src/main/res/layout/replies_row.xml +++ b/app/src/main/res/layout/replies_row.xml @@ -1,6 +1,7 @@ @@ -34,9 +35,9 @@ android:layout_height="wrap_content" android:ellipsize="end" android:maxLines="2" - android:text="Author and Time" android:textSize="15sp" - android:textStyle="bold" /> + android:textStyle="bold" + tools:text="Author and Time" /> + tools:text="Comment Text" /> + tools:text="LikeCount" /> @@ -74,22 +73,22 @@ android:layout_marginEnd="8dp" android:ellipsize="end" android:maxLines="2" - android:text="Title" android:textSize="15sp" android:textStyle="bold" app:layout_constraintEnd_toEndOf="@+id/thumbnailcard" app:layout_constraintStart_toEndOf="@+id/channel_image" - app:layout_constraintTop_toBottomOf="@+id/thumbnailcard" /> + app:layout_constraintTop_toBottomOf="@+id/thumbnailcard" + tools:text="Title" /> + app:layout_constraintTop_toBottomOf="@+id/textView_title" + tools:text="Channel Name" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index cc8a791ed..16783b4b8 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -271,4 +271,6 @@ Checking frequency %1$s new streams are available New streams by %1$s … + Are you sure? This can\'t be undone! + History is empty. \ No newline at end of file diff --git a/app/src/main/res/xml/history_settings.xml b/app/src/main/res/xml/history_settings.xml index 71f1b9df8..ec13f6005 100644 --- a/app/src/main/res/xml/history_settings.xml +++ b/app/src/main/res/xml/history_settings.xml @@ -45,7 +45,7 @@ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/shot_1.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/shot_1.png index 7c900a531..979cd6ecd 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/shot_1.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/shot_1.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/shot_2.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/shot_2.png index 5a2f0773c..cbf444d62 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/shot_2.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/shot_2.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/shot_3.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/shot_3.png index 802ec8686..7fe38795e 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/shot_3.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/shot_3.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/shot_4.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/shot_4.png index 96d29660a..287f86d56 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/shot_4.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/shot_4.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/shot_5.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/shot_5.png index c6ddc7814..cb781e591 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/shot_5.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/shot_5.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/shot_6.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/shot_6.png index 9a0014718..2e5c248d2 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/shot_6.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/shot_6.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/shot_7.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/shot_7.png index 66fddce95..7a3e9f04b 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/shot_7.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/shot_7.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/shot_8.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/shot_8.png index 0c5471c71..3c1d53a45 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/shot_8.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/shot_8.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/shot_9.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/shot_9.png index 71d066f41..1775b4360 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/shot_9.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/shot_9.png differ