mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 22:30:30 +05:30
commit
6a2364d5bc
@ -25,8 +25,9 @@ class ChannelAdapter(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun updateItems(newItems: List<StreamItem>) {
|
fun updateItems(newItems: List<StreamItem>) {
|
||||||
|
val feedSize = videoFeed.size
|
||||||
videoFeed.addAll(newItems)
|
videoFeed.addAll(newItems)
|
||||||
notifyDataSetChanged()
|
notifyItemRangeInserted(feedSize, newItems.size)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ChannelViewHolder {
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ChannelViewHolder {
|
||||||
|
@ -81,9 +81,8 @@ class LoginDialog : DialogFragment() {
|
|||||||
Toast.makeText(context, R.string.loggedIn, Toast.LENGTH_SHORT).show()
|
Toast.makeText(context, R.string.loggedIn, Toast.LENGTH_SHORT).show()
|
||||||
PreferenceHelper.setToken(response.token!!)
|
PreferenceHelper.setToken(response.token!!)
|
||||||
PreferenceHelper.setUsername(login.username!!)
|
PreferenceHelper.setUsername(login.username!!)
|
||||||
val restartDialog = RequireRestartDialog()
|
|
||||||
restartDialog.show(parentFragmentManager, "RequireRestartDialog")
|
|
||||||
dialog?.dismiss()
|
dialog?.dismiss()
|
||||||
|
activity?.recreate()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,8 @@ fun View?.setWatchProgressLength(videoId: String, duration: Long) {
|
|||||||
positions.forEach {
|
positions.forEach {
|
||||||
if (it.videoId == videoId) {
|
if (it.videoId == videoId) {
|
||||||
val fullWidth = (parent as LinearLayout).width
|
val fullWidth = (parent as LinearLayout).width
|
||||||
if (duration != 0L) newWidth = (fullWidth * (it.position / (duration))) / 1000
|
if (duration != 0L) newWidth =
|
||||||
|
(fullWidth * (it.position / (duration))) / 1000
|
||||||
return@forEach
|
return@forEach
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ class ChannelFragment : Fragment() {
|
|||||||
if (nextPage != null && !isLoading) {
|
if (nextPage != null && !isLoading) {
|
||||||
isLoading = true
|
isLoading = true
|
||||||
binding.channelRefresh.isRefreshing = true
|
binding.channelRefresh.isRefreshing = true
|
||||||
fetchNextPage()
|
fetchChannelNextPage()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -217,7 +217,7 @@ class ChannelFragment : Fragment() {
|
|||||||
run()
|
run()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun fetchNextPage() {
|
private fun fetchChannelNextPage() {
|
||||||
fun run() {
|
fun run() {
|
||||||
lifecycleScope.launchWhenCreated {
|
lifecycleScope.launchWhenCreated {
|
||||||
val response = try {
|
val response = try {
|
||||||
|
@ -563,7 +563,11 @@ class PlayerFragment : Fragment() {
|
|||||||
exoPlayer.pause()
|
exoPlayer.pause()
|
||||||
|
|
||||||
// start the background mode
|
// start the background mode
|
||||||
BackgroundHelper.playOnBackground(requireContext(), videoId!!)
|
BackgroundHelper.playOnBackground(
|
||||||
|
requireContext(),
|
||||||
|
videoId!!,
|
||||||
|
exoPlayer.currentPosition
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.playerScrollView.viewTreeObserver
|
binding.playerScrollView.viewTreeObserver
|
||||||
@ -1080,7 +1084,7 @@ class PlayerFragment : Fragment() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// check if livestream
|
// check if livestream
|
||||||
if (response.duration!! > 0) {
|
if (response.duration > 0) {
|
||||||
// download clicked
|
// download clicked
|
||||||
binding.relPlayerDownload.setOnClickListener {
|
binding.relPlayerDownload.setOnClickListener {
|
||||||
if (!Globals.IS_DOWNLOAD_RUNNING) {
|
if (!Globals.IS_DOWNLOAD_RUNNING) {
|
||||||
@ -1148,7 +1152,6 @@ class PlayerFragment : Fragment() {
|
|||||||
binding.playerMotionLayout.transitionToEnd()
|
binding.playerMotionLayout.transitionToEnd()
|
||||||
}
|
}
|
||||||
if (token != "") {
|
if (token != "") {
|
||||||
val channelId = response.uploaderUrl?.toID()
|
|
||||||
isSubscribed()
|
isSubscribed()
|
||||||
binding.relPlayerSave.setOnClickListener {
|
binding.relPlayerSave.setOnClickListener {
|
||||||
val newFragment = AddtoPlaylistDialog()
|
val newFragment = AddtoPlaylistDialog()
|
||||||
@ -1241,11 +1244,6 @@ class PlayerFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun toggleController() {
|
|
||||||
if (exoPlayerView.isControllerFullyVisible) exoPlayerView.hideController()
|
|
||||||
else exoPlayerView.showController()
|
|
||||||
}
|
|
||||||
|
|
||||||
// enable seek bar preview
|
// enable seek bar preview
|
||||||
private fun enableSeekbarPreview() {
|
private fun enableSeekbarPreview() {
|
||||||
playerBinding.exoProgress.addListener(object : TimeBar.OnScrubListener {
|
playerBinding.exoProgress.addListener(object : TimeBar.OnScrubListener {
|
||||||
|
@ -15,7 +15,6 @@ import com.github.libretube.adapters.SearchHistoryAdapter
|
|||||||
import com.github.libretube.adapters.SearchSuggestionsAdapter
|
import com.github.libretube.adapters.SearchSuggestionsAdapter
|
||||||
import com.github.libretube.databinding.FragmentSearchBinding
|
import com.github.libretube.databinding.FragmentSearchBinding
|
||||||
import com.github.libretube.preferences.PreferenceHelper
|
import com.github.libretube.preferences.PreferenceHelper
|
||||||
import com.github.libretube.preferences.PreferenceKeys
|
|
||||||
import com.github.libretube.util.RetrofitInstance
|
import com.github.libretube.util.RetrofitInstance
|
||||||
import retrofit2.HttpException
|
import retrofit2.HttpException
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
@ -43,23 +42,12 @@ class SearchFragment() : Fragment() {
|
|||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
|
|
||||||
// add the query to the history
|
|
||||||
if (query != null) addToHistory(query!!)
|
|
||||||
|
|
||||||
binding.suggestionsRecycler.layoutManager = LinearLayoutManager(requireContext())
|
binding.suggestionsRecycler.layoutManager = LinearLayoutManager(requireContext())
|
||||||
// fetch the search or history
|
// fetch the search or history
|
||||||
if (query == null || query == "") showHistory()
|
if (query == null || query == "") showHistory()
|
||||||
else fetchSuggestions(query!!)
|
else fetchSuggestions(query!!)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun addToHistory(query: String) {
|
|
||||||
val searchHistoryEnabled =
|
|
||||||
PreferenceHelper.getBoolean(PreferenceKeys.SEARCH_HISTORY_TOGGLE, true)
|
|
||||||
if (searchHistoryEnabled && query != "") {
|
|
||||||
PreferenceHelper.saveToSearchHistory(query)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun fetchSuggestions(query: String) {
|
private fun fetchSuggestions(query: String) {
|
||||||
fun run() {
|
fun run() {
|
||||||
lifecycleScope.launchWhenCreated {
|
lifecycleScope.launchWhenCreated {
|
||||||
@ -95,6 +83,9 @@ class SearchFragment() : Fragment() {
|
|||||||
historyList,
|
historyList,
|
||||||
(activity as MainActivity).searchView
|
(activity as MainActivity).searchView
|
||||||
)
|
)
|
||||||
|
} else {
|
||||||
|
binding.suggestionsRecycler.visibility = View.GONE
|
||||||
|
binding.historyEmpty.visibility = View.VISIBLE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,6 +11,8 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
|||||||
import com.github.libretube.R
|
import com.github.libretube.R
|
||||||
import com.github.libretube.adapters.SearchAdapter
|
import com.github.libretube.adapters.SearchAdapter
|
||||||
import com.github.libretube.databinding.FragmentSearchResultBinding
|
import com.github.libretube.databinding.FragmentSearchResultBinding
|
||||||
|
import com.github.libretube.preferences.PreferenceHelper
|
||||||
|
import com.github.libretube.preferences.PreferenceKeys
|
||||||
import com.github.libretube.util.RetrofitInstance
|
import com.github.libretube.util.RetrofitInstance
|
||||||
import com.github.libretube.util.hideKeyboard
|
import com.github.libretube.util.hideKeyboard
|
||||||
import retrofit2.HttpException
|
import retrofit2.HttpException
|
||||||
@ -43,6 +45,9 @@ class SearchResultFragment : Fragment() {
|
|||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
|
|
||||||
|
// add the query to the history
|
||||||
|
addToHistory(query)
|
||||||
|
|
||||||
// filter options
|
// filter options
|
||||||
binding.filterChipGroup.setOnCheckedStateChangeListener { _, _ ->
|
binding.filterChipGroup.setOnCheckedStateChangeListener { _, _ ->
|
||||||
apiSearchFilter = when (
|
apiSearchFilter = when (
|
||||||
@ -89,6 +94,9 @@ class SearchResultFragment : Fragment() {
|
|||||||
binding.searchRecycler.layoutManager = LinearLayoutManager(requireContext())
|
binding.searchRecycler.layoutManager = LinearLayoutManager(requireContext())
|
||||||
searchAdapter = SearchAdapter(response.items, childFragmentManager)
|
searchAdapter = SearchAdapter(response.items, childFragmentManager)
|
||||||
binding.searchRecycler.adapter = searchAdapter
|
binding.searchRecycler.adapter = searchAdapter
|
||||||
|
} else {
|
||||||
|
binding.searchContainer.visibility = View.GONE
|
||||||
|
binding.noSearchResult.visibility = View.VISIBLE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nextPage = response.nextpage!!
|
nextPage = response.nextpage!!
|
||||||
@ -120,6 +128,14 @@ class SearchResultFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun addToHistory(query: String) {
|
||||||
|
val searchHistoryEnabled =
|
||||||
|
PreferenceHelper.getBoolean(PreferenceKeys.SEARCH_HISTORY_TOGGLE, true)
|
||||||
|
if (searchHistoryEnabled && query != "") {
|
||||||
|
PreferenceHelper.saveToSearchHistory(query)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun Fragment?.runOnUiThread(action: () -> Unit) {
|
private fun Fragment?.runOnUiThread(action: () -> Unit) {
|
||||||
this ?: return
|
this ?: return
|
||||||
if (!isAdded) return // Fragment not attached to an Activity
|
if (!isAdded) return // Fragment not attached to an Activity
|
||||||
|
@ -197,7 +197,8 @@ class SubscriptionsFragment : Fragment() {
|
|||||||
binding.subRefresh.isRefreshing = false
|
binding.subRefresh.isRefreshing = false
|
||||||
}
|
}
|
||||||
if (response.isNotEmpty()) {
|
if (response.isNotEmpty()) {
|
||||||
binding.subChannels.adapter = SubscriptionChannelAdapter(response.toMutableList())
|
binding.subChannels.adapter =
|
||||||
|
SubscriptionChannelAdapter(response.toMutableList())
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(context, R.string.subscribeIsEmpty, Toast.LENGTH_SHORT).show()
|
Toast.makeText(context, R.string.subscribeIsEmpty, Toast.LENGTH_SHORT).show()
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,8 @@ class NotificationSettings : PreferenceFragmentCompat() {
|
|||||||
val settingsActivity = activity as SettingsActivity
|
val settingsActivity = activity as SettingsActivity
|
||||||
settingsActivity.changeTopBarText(getString(R.string.notifications))
|
settingsActivity.changeTopBarText(getString(R.string.notifications))
|
||||||
|
|
||||||
val notificationsEnabled = findPreference<SwitchPreferenceCompat>(PreferenceKeys.NOTIFICATION_ENABLED)
|
val notificationsEnabled =
|
||||||
|
findPreference<SwitchPreferenceCompat>(PreferenceKeys.NOTIFICATION_ENABLED)
|
||||||
notificationsEnabled?.setOnPreferenceChangeListener { _, _ ->
|
notificationsEnabled?.setOnPreferenceChangeListener { _, _ ->
|
||||||
updateNotificationPrefs()
|
updateNotificationPrefs()
|
||||||
true
|
true
|
||||||
|
@ -66,10 +66,10 @@ class BackgroundMode : Service() {
|
|||||||
override fun onCreate() {
|
override fun onCreate() {
|
||||||
super.onCreate()
|
super.onCreate()
|
||||||
if (Build.VERSION.SDK_INT >= 26) {
|
if (Build.VERSION.SDK_INT >= 26) {
|
||||||
val channelId = "background service"
|
val channelId = BACKGROUND_CHANNEL_ID
|
||||||
val channel = NotificationChannel(
|
val channel = NotificationChannel(
|
||||||
channelId,
|
channelId,
|
||||||
"BackgroundPlay Service",
|
"Background Service",
|
||||||
NotificationManager.IMPORTANCE_DEFAULT
|
NotificationManager.IMPORTANCE_DEFAULT
|
||||||
)
|
)
|
||||||
val notificationManager = getSystemService(NOTIFICATION_SERVICE) as NotificationManager
|
val notificationManager = getSystemService(NOTIFICATION_SERVICE) as NotificationManager
|
||||||
@ -77,7 +77,7 @@ class BackgroundMode : Service() {
|
|||||||
val notification: Notification = Notification.Builder(this, channelId)
|
val notification: Notification = Notification.Builder(this, channelId)
|
||||||
.setContentTitle(getString(R.string.app_name))
|
.setContentTitle(getString(R.string.app_name))
|
||||||
.setContentText(getString(R.string.playingOnBackground)).build()
|
.setContentText(getString(R.string.playingOnBackground)).build()
|
||||||
startForeground(1, notification)
|
startForeground(PLAYER_NOTIFICATION_ID, notification)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ object BackgroundHelper {
|
|||||||
fun playOnBackground(
|
fun playOnBackground(
|
||||||
context: Context,
|
context: Context,
|
||||||
videoId: String,
|
videoId: String,
|
||||||
position: Int? = null
|
position: Long? = null
|
||||||
) {
|
) {
|
||||||
val intent = Intent(context, BackgroundMode::class.java)
|
val intent = Intent(context, BackgroundMode::class.java)
|
||||||
intent.putExtra("videoId", videoId)
|
intent.putExtra("videoId", videoId)
|
||||||
|
@ -7,7 +7,8 @@ import androidx.work.WorkerParameters
|
|||||||
/**
|
/**
|
||||||
* The notification worker which checks for new streams in a certain frequency
|
* The notification worker which checks for new streams in a certain frequency
|
||||||
*/
|
*/
|
||||||
class NotificationWorker(appContext: Context, parameters: WorkerParameters) : Worker(appContext, parameters) {
|
class NotificationWorker(appContext: Context, parameters: WorkerParameters) :
|
||||||
|
Worker(appContext, parameters) {
|
||||||
private val TAG = "NotificationWorker"
|
private val TAG = "NotificationWorker"
|
||||||
|
|
||||||
override fun doWork(): Result {
|
override fun doWork(): Result {
|
||||||
|
@ -36,9 +36,9 @@
|
|||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:stateListAnimator="@null"
|
android:stateListAnimator="@null"
|
||||||
|
android:text="@string/unsubscribe"
|
||||||
android:textColor="?android:attr/textColorPrimary"
|
android:textColor="?android:attr/textColorPrimary"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
app:cornerRadius="20dp"
|
app:cornerRadius="20dp"
|
||||||
app:elevation="20dp"
|
app:elevation="20dp" />
|
||||||
android:text="@string/unsubscribe" />
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
@ -1,9 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
|
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:background="?attr/selectableItemBackground"
|
android:background="?attr/selectableItemBackground"
|
||||||
android:backgroundTint="@android:color/transparent"
|
android:backgroundTint="@android:color/transparent"
|
||||||
app:strokeWidth="0dp">
|
app:strokeWidth="0dp">
|
||||||
@ -24,13 +24,13 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/chapter_title"
|
android:id="@+id/chapter_title"
|
||||||
tools:text="Title"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="3dp"
|
android:layout_marginTop="3dp"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:maxLines="3"
|
android:maxLines="3"
|
||||||
android:textSize="13sp" />
|
android:textSize="13sp"
|
||||||
|
tools:text="Title" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<merge xmlns:tools="http://schemas.android.com/tools"
|
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@id/exo_controls_background"
|
android:id="@id/exo_controls_background"
|
||||||
@ -172,15 +172,15 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:layout_marginStart="5dp">
|
android:layout_marginStart="10dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@id/exo_position"
|
android:id="@id/exo_position"
|
||||||
style="@style/TimeString" />
|
style="@style/TimeString" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:text=" • "
|
|
||||||
style="@style/TimeString"
|
style="@style/TimeString"
|
||||||
|
android:text=" • "
|
||||||
tools:ignore="HardcodedText" />
|
tools:ignore="HardcodedText" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@ -194,7 +194,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:layout_marginStart="5dp"
|
android:layout_marginStart="10dp"
|
||||||
android:visibility="gone">
|
android:visibility="gone">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@ -210,8 +210,8 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/liveIndicator"
|
android:id="@+id/liveIndicator"
|
||||||
android:text="@string/live"
|
style="@style/TimeString"
|
||||||
style="@style/TimeString" />
|
android:text="@string/live" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -376,9 +376,9 @@
|
|||||||
<com.github.libretube.views.DoubleTapOverlay
|
<com.github.libretube.views.DoubleTapOverlay
|
||||||
android:id="@+id/doubleTapOverlay"
|
android:id="@+id/doubleTapOverlay"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:gravity="center"
|
android:gravity="center" />
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
</com.github.libretube.views.CustomExoPlayerView>
|
</com.github.libretube.views.CustomExoPlayerView>
|
||||||
|
|
||||||
@ -411,12 +411,12 @@
|
|||||||
android:id="@+id/title_textView"
|
android:id="@+id/title_textView"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingVertical="15dp"
|
|
||||||
android:paddingStart="8dp"
|
|
||||||
android:paddingEnd="12dp"
|
|
||||||
android:alpha="0"
|
android:alpha="0"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
|
android:paddingVertical="15dp"
|
||||||
|
android:paddingStart="8dp"
|
||||||
|
android:paddingEnd="12dp"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/play_imageView"
|
app:layout_constraintBottom_toBottomOf="@+id/play_imageView"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/play_imageView"
|
app:layout_constraintEnd_toStartOf="@+id/play_imageView"
|
||||||
|
@ -11,4 +11,29 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginVertical="10dp" />
|
android:layout_marginVertical="10dp" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/history_empty"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="100dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginVertical="10dp"
|
||||||
|
android:src="@drawable/ic_history" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/history_empty"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -7,6 +7,12 @@
|
|||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
tools:context=".fragments.SearchFragment">
|
tools:context=".fragments.SearchFragment">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/search_container"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
<HorizontalScrollView
|
<HorizontalScrollView
|
||||||
android:id="@+id/filter_bar"
|
android:id="@+id/filter_bar"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@ -23,6 +29,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingStart="8dp"
|
android:paddingStart="8dp"
|
||||||
android:paddingEnd="8dp"
|
android:paddingEnd="8dp"
|
||||||
|
app:checkedChip="@id/chip_all"
|
||||||
app:selectionRequired="true"
|
app:selectionRequired="true"
|
||||||
app:singleLine="true"
|
app:singleLine="true"
|
||||||
app:singleSelection="true">
|
app:singleSelection="true">
|
||||||
@ -75,4 +82,31 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="10dp" />
|
android:layout_margin="10dp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/no_search_result"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="100dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginVertical="10dp"
|
||||||
|
android:src="@drawable/ic_search" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/no_search_result"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</FrameLayout>
|
@ -120,9 +120,9 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="end"
|
android:layout_gravity="end"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
android:drawablePadding="5dp"
|
android:drawablePadding="5dp"
|
||||||
android:paddingHorizontal="10dp"
|
android:paddingHorizontal="10dp"
|
||||||
android:layout_marginBottom="5dp"
|
|
||||||
android:text="@string/most_recent"
|
android:text="@string/most_recent"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
app:drawableEndCompat="@drawable/ic_arrow_downward" />
|
app:drawableEndCompat="@drawable/ic_arrow_downward" />
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_search"
|
android:id="@+id/action_search"
|
||||||
|
android:focusableInTouchMode="true"
|
||||||
android:icon="@drawable/ic_search"
|
android:icon="@drawable/ic_search"
|
||||||
android:title="@string/search_hint"
|
android:title="@string/search_hint"
|
||||||
app:showAsAction="ifRoom"
|
|
||||||
app:actionViewClass="androidx.appcompat.widget.SearchView"
|
app:actionViewClass="androidx.appcompat.widget.SearchView"
|
||||||
android:focusableInTouchMode="true" />
|
app:showAsAction="ifRoom" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_settings"
|
android:id="@+id/action_settings"
|
||||||
|
@ -286,4 +286,5 @@
|
|||||||
<string name="network_wifi">WiFi only</string>
|
<string name="network_wifi">WiFi only</string>
|
||||||
<string name="translate">Translate</string>
|
<string name="translate">Translate</string>
|
||||||
<string name="translate_summary">Help by translating the app to the language you speak</string>
|
<string name="translate_summary">Help by translating the app to the language you speak</string>
|
||||||
|
<string name="no_search_result">No results found.</string>
|
||||||
</resources>
|
</resources>
|
@ -6,10 +6,10 @@
|
|||||||
|
|
||||||
<SwitchPreferenceCompat
|
<SwitchPreferenceCompat
|
||||||
android:icon="@drawable/ic_notification"
|
android:icon="@drawable/ic_notification"
|
||||||
|
android:summary="@string/notify_new_streams_summary"
|
||||||
app:defaultValue="true"
|
app:defaultValue="true"
|
||||||
app:key="notification_toggle"
|
app:key="notification_toggle"
|
||||||
app:title="@string/notify_new_streams"
|
app:title="@string/notify_new_streams" />
|
||||||
android:summary="@string/notify_new_streams_summary"/>
|
|
||||||
|
|
||||||
<ListPreference
|
<ListPreference
|
||||||
android:icon="@drawable/ic_time"
|
android:icon="@drawable/ic_time"
|
||||||
|
Loading…
Reference in New Issue
Block a user