mirror of
https://github.com/Michatec/Radio.git
synced 2026-11-30 23:21:52 +01:00
feat(collection): add search and favorite filtering
Implemented a search bar and favorites filter for the station list. Added a search button to the station collection card, updated the adapter to handle filtered datasets, and integrated the search UI into both mobile and Android TV layouts. Includes localized strings for multiple languages.
This commit is contained in:
1 parent
cb1ca8ef80
commit
ba404c04d3
17 files changed
+318
-27
No files matched your search
@@ -10,10 +10,13 @@ import android.content.pm.PackageManager
|
||||
import android.media.AudioManager
|
||||
import android.net.Uri
|
||||
import android.os.*
|
||||
import android.text.Editable
|
||||
import android.text.TextWatcher
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import android.widget.Toast
|
||||
import androidx.activity.OnBackPressedCallback
|
||||
import androidx.activity.result.ActivityResultLauncher
|
||||
@@ -97,6 +100,7 @@ class PlayerFragment : Fragment(),
|
||||
private var tempStationUuid: String = String()
|
||||
private var itemTouchHelper: ItemTouchHelper? = null
|
||||
private var shaderEffectView: ShaderEffectView? = null
|
||||
private var isSearchActive: Boolean = false
|
||||
|
||||
// Check if the device running the app is an Android TV instance
|
||||
private val isAndroidTV: Boolean by lazy {
|
||||
@@ -181,6 +185,7 @@ class PlayerFragment : Fragment(),
|
||||
// find views and set them up
|
||||
val rootView: View = inflater.inflate(R.layout.fragment_player, container, false)
|
||||
layout = LayoutHolder(rootView)
|
||||
isSearchActive = false
|
||||
|
||||
shaderEffectView = rootView.findViewById(R.id.player_shader_effect)
|
||||
initializeViews()
|
||||
@@ -381,6 +386,20 @@ class PlayerFragment : Fragment(),
|
||||
pickImage()
|
||||
}
|
||||
|
||||
/* Overrides onSearchButtonTapped from CollectionAdapterListener */
|
||||
override fun onSearchButtonTapped() {
|
||||
isSearchActive = !isSearchActive
|
||||
layout.toggleSearchLayout(isSearchActive)
|
||||
if (!isSearchActive) {
|
||||
collectionAdapter.filter("", false)
|
||||
} else if (isAndroidTV) {
|
||||
// TV: focus search field and show keyboard
|
||||
layout.searchInputEditText?.requestFocus()
|
||||
val imm = context?.getSystemService(Context.INPUT_METHOD_SERVICE) as? InputMethodManager
|
||||
imm?.showSoftInput(layout.searchInputEditText, 0)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Overrides onYesNoDialog from YesNoDialogListener */
|
||||
override fun onYesNoDialog(
|
||||
@@ -518,7 +537,7 @@ class PlayerFragment : Fragment(),
|
||||
Snackbar.LENGTH_SHORT
|
||||
)
|
||||
if (!isAndroidTV) {
|
||||
snackbar.setAnchorView(layout.bottomSheet)
|
||||
snackbar.anchorView = layout.bottomSheet
|
||||
}
|
||||
snackbar.show()
|
||||
}
|
||||
@@ -532,6 +551,20 @@ class PlayerFragment : Fragment(),
|
||||
togglePeriodicSleepTimerUpdateRequest()
|
||||
}
|
||||
|
||||
// set up search input
|
||||
layout.searchInputEditText?.addTextChangedListener(object : TextWatcher {
|
||||
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {}
|
||||
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {}
|
||||
override fun afterTextChanged(s: Editable?) {
|
||||
performSearch()
|
||||
}
|
||||
})
|
||||
|
||||
// set up favorites filter
|
||||
layout.searchFilterFavoritesSwitch?.setOnCheckedChangeListener { _, _ ->
|
||||
performSearch()
|
||||
}
|
||||
|
||||
// set up TV station navigation
|
||||
layout.playerPrevButtonView?.setOnClickListener {
|
||||
val currentPosition = CollectionHelper.getStationPosition(collection, playerState.stationUuid)
|
||||
@@ -607,6 +640,14 @@ class PlayerFragment : Fragment(),
|
||||
pickSingleMediaLauncher.launch(PickVisualMediaRequest(ActivityResultContracts.PickVisualMedia.ImageOnly))
|
||||
}
|
||||
|
||||
/* Performs search and updates list */
|
||||
private fun performSearch() {
|
||||
val query = layout.searchInputEditText?.text?.toString() ?: ""
|
||||
val onlyFavorites = layout.searchFilterFavoritesSwitch?.isChecked ?: false
|
||||
collectionAdapter.filter(query, onlyFavorites)
|
||||
layout.toggleSearchNoResults(collectionAdapter.itemCount == 1 && (query.isNotEmpty() || onlyFavorites))
|
||||
}
|
||||
|
||||
/* Handles this activity's start intent */
|
||||
private fun handleStartIntent() {
|
||||
val intent = (activity as Activity).intent
|
||||
@@ -724,9 +765,9 @@ class PlayerFragment : Fragment(),
|
||||
// handle navigation arguments
|
||||
handleNavigationArguments()
|
||||
}
|
||||
collectionViewModel.collectionSizeLiveData.observe(this) {
|
||||
collectionViewModel.collectionSizeLiveData.observe(this) { size ->
|
||||
// size of collection changed
|
||||
layout.toggleOnboarding(activity as Context, collection.stations.size)
|
||||
layout.toggleOnboarding(activity as Context, size)
|
||||
updatePlayerViews()
|
||||
CollectionHelper.exportCollectionM3u(activity as Context, collection)
|
||||
CollectionHelper.exportCollectionPls(activity as Context, collection)
|
||||
|
||||
@@ -50,12 +50,15 @@ class CollectionAdapter(
|
||||
/* Main class variables */
|
||||
private lateinit var collectionViewModel: CollectionViewModel
|
||||
private var collection: Collection = Collection()
|
||||
private var filteredStations: MutableList<Station> = mutableListOf()
|
||||
private var editStationsEnabled: Boolean = PreferencesHelper.loadEditStationsEnabled(context)
|
||||
private var editStationStreamsEnabled: Boolean = PreferencesHelper.loadEditStreamUrisEnabled(context)
|
||||
private var expandedStationUuid: String = PreferencesHelper.loadStationListStreamUuid()
|
||||
private var expandedStationPosition: Int = -1
|
||||
var isExpandedForEdit: Boolean = false
|
||||
private var reorderStationUuid: String = ""
|
||||
private var currentSearchQuery: String = ""
|
||||
private var currentOnlyFavorites: Boolean = false
|
||||
|
||||
|
||||
/* Listener Interface */
|
||||
@@ -63,6 +66,7 @@ class CollectionAdapter(
|
||||
fun onPlayButtonTapped(stationUuid: String)
|
||||
fun onAddNewButtonTapped()
|
||||
fun onChangeImageButtonTapped(stationUuid: String)
|
||||
fun onSearchButtonTapped()
|
||||
}
|
||||
|
||||
|
||||
@@ -108,8 +112,7 @@ class CollectionAdapter(
|
||||
|
||||
/* Implement the method to handle item move */
|
||||
fun onItemMove(fromPosition: Int, toPosition: Int) {
|
||||
// Do nothing if in "edit" mode
|
||||
if (isExpandedForEdit) {
|
||||
if (isExpandedForEdit || filteredStations.size != collection.stations.size) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -141,8 +144,12 @@ class CollectionAdapter(
|
||||
|
||||
/* Implement the method to handle item dismissal */
|
||||
fun onItemDismiss(position: Int) {
|
||||
// Remove the item at the given position from your data collection
|
||||
collection.stations.removeAt(position)
|
||||
val station = filteredStations[position]
|
||||
val originalPosition = collection.stations.indexOfFirst { it.uuid == station.uuid }
|
||||
if (originalPosition != -1) {
|
||||
collection.stations.removeAt(originalPosition)
|
||||
}
|
||||
filteredStations.removeAt(position)
|
||||
notifyItemRemoved(position)
|
||||
}
|
||||
|
||||
@@ -154,6 +161,27 @@ class CollectionAdapter(
|
||||
}
|
||||
|
||||
|
||||
/* Filters the station list based on query and favorite status */
|
||||
fun filter(query: String, onlyFavorites: Boolean) {
|
||||
currentSearchQuery = query
|
||||
currentOnlyFavorites = onlyFavorites
|
||||
applyFilter()
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
private fun applyFilter() {
|
||||
filteredStations = if (currentSearchQuery.isEmpty() && !currentOnlyFavorites) {
|
||||
collection.stations.toMutableList()
|
||||
} else {
|
||||
collection.stations.filter { station ->
|
||||
val matchesQuery = station.name.contains(currentSearchQuery, ignoreCase = true)
|
||||
val matchesFavorite = !currentOnlyFavorites || station.starred
|
||||
matchesQuery && matchesFavorite
|
||||
}.toMutableList()
|
||||
}
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
/* Overrides onBindViewHolder */
|
||||
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
|
||||
when (holder) {
|
||||
@@ -171,11 +199,15 @@ class CollectionAdapter(
|
||||
addNewViewHolder.visualizerButtonView.setOnClickListener {
|
||||
it.findNavController().navigate(R.id.visualizer_destination)
|
||||
}
|
||||
addNewViewHolder.playerSearchButtonView.setOnClickListener {
|
||||
collectionAdapterListener.onSearchButtonTapped()
|
||||
}
|
||||
addNewViewHolder.playerSearchButtonView.isVisible = collection.stations.isNotEmpty()
|
||||
}
|
||||
// CASE STATION CARD
|
||||
is StationViewHolder -> {
|
||||
// get station from position
|
||||
val station: Station = collection.stations[position]
|
||||
val station: Station = filteredStations[position]
|
||||
|
||||
// get reference to StationViewHolder
|
||||
val stationViewHolder: StationViewHolder = holder
|
||||
@@ -583,7 +615,7 @@ class CollectionAdapter(
|
||||
|
||||
} else if (holder is StationViewHolder) {
|
||||
// get station from position
|
||||
val station: Station = collection.stations[holder.bindingAdapterPosition]
|
||||
val station: Station = filteredStations[holder.bindingAdapterPosition]
|
||||
|
||||
for (data in payloads) {
|
||||
when (data as Int) {
|
||||
@@ -621,19 +653,24 @@ class CollectionAdapter(
|
||||
/* Overrides getItemCount */
|
||||
override fun getItemCount(): Int {
|
||||
// +1 ==> the add station card
|
||||
return collection.stations.size + 1
|
||||
return filteredStations.size + 1
|
||||
}
|
||||
|
||||
|
||||
/* Removes a station from collection */
|
||||
fun removeStation(context: Context, position: Int) {
|
||||
val station = filteredStations[position]
|
||||
val originalPosition = collection.stations.indexOfFirst { it.uuid == station.uuid }
|
||||
if (originalPosition == -1) return
|
||||
|
||||
val newCollection = collection.deepCopy()
|
||||
// delete images assets
|
||||
CollectionHelper.deleteStationImages(context, newCollection.stations[position])
|
||||
CollectionHelper.deleteStationImages(context, newCollection.stations[originalPosition])
|
||||
// remove station from collection
|
||||
newCollection.stations.removeAt(position)
|
||||
newCollection.stations.removeAt(originalPosition)
|
||||
collection = newCollection
|
||||
// update list
|
||||
filteredStations.removeAt(position)
|
||||
notifyItemRemoved(position)
|
||||
// save collection and broadcast changes
|
||||
CollectionHelper.saveCollection(context, newCollection)
|
||||
@@ -642,15 +679,16 @@ class CollectionAdapter(
|
||||
|
||||
/* Toggles starred status of a station */
|
||||
fun toggleStarredStation(context: Context, position: Int) {
|
||||
val station = filteredStations[position]
|
||||
val originalPosition = collection.stations.indexOfFirst { it.uuid == station.uuid }
|
||||
if (originalPosition == -1) return
|
||||
|
||||
// update view (reset "swipe" state of station card)
|
||||
notifyItemChanged(position)
|
||||
// mark starred
|
||||
val stationUuid: String = collection.stations[position].uuid
|
||||
collection.stations[position].apply { starred = !starred }
|
||||
collection.stations[originalPosition].apply { starred = !starred }
|
||||
// sort collection
|
||||
collection = CollectionHelper.sortCollection(collection)
|
||||
// update list
|
||||
notifyItemMoved(position, CollectionHelper.getStationPosition(collection, stationUuid))
|
||||
// save collection and broadcast changes
|
||||
CollectionHelper.saveCollection(context, collection)
|
||||
}
|
||||
@@ -690,7 +728,7 @@ class CollectionAdapter(
|
||||
|
||||
/* Determines if position is last */
|
||||
private fun isPositionFooter(position: Int): Boolean {
|
||||
return position == collection.stations.size
|
||||
return position == filteredStations.size
|
||||
}
|
||||
|
||||
|
||||
@@ -698,6 +736,7 @@ class CollectionAdapter(
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
private fun updateRecyclerView(oldCollection: Collection, newCollection: Collection) {
|
||||
collection = newCollection
|
||||
applyFilter()
|
||||
if (oldCollection.stations.isEmpty() && newCollection.stations.isNotEmpty()) {
|
||||
// data set has been initialized - redraw the whole list
|
||||
notifyDataSetChanged()
|
||||
@@ -757,6 +796,8 @@ class CollectionAdapter(
|
||||
listItemAddNewLayout.findViewById(R.id.card_settings)
|
||||
val visualizerButtonView: ExtendedFloatingActionButton =
|
||||
listItemAddNewLayout.findViewById(R.id.card_visualizer)
|
||||
val playerSearchButtonView: ExtendedFloatingActionButton =
|
||||
listItemAddNewLayout.findViewById(R.id.player_search_button)
|
||||
}
|
||||
/*
|
||||
* End of inner class
|
||||
|
||||
@@ -6,7 +6,10 @@ import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.graphics.drawable.AnimatedVectorDrawable
|
||||
import android.transition.ChangeBounds
|
||||
import android.transition.TransitionManager
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.animation.Animation
|
||||
import android.view.animation.AnimationUtils
|
||||
import android.widget.ImageButton
|
||||
@@ -23,7 +26,9 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.google.android.gms.cast.framework.CastButtonFactory
|
||||
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
||||
import com.google.android.material.materialswitch.MaterialSwitch
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
import com.google.android.material.textfield.TextInputEditText
|
||||
import com.michatec.radio.Keys
|
||||
import com.michatec.radio.R
|
||||
import com.michatec.radio.core.Station
|
||||
@@ -56,6 +61,10 @@ data class LayoutHolder(var rootView: View) {
|
||||
var playerPrevButtonView: ImageButton? = rootView.findViewById(R.id.player_prev_button)
|
||||
var playerNextButtonView: ImageButton? = rootView.findViewById(R.id.player_next_button)
|
||||
private var bufferingIndicator: ProgressBar = rootView.findViewById(R.id.player_buffering_indicator)
|
||||
private var searchLayout: View? = rootView.findViewById(R.id.search_layout)
|
||||
var searchInputEditText: TextInputEditText? = rootView.findViewById(R.id.search_input_edit_text)
|
||||
var searchFilterFavoritesSwitch: MaterialSwitch? = rootView.findViewById(R.id.search_filter_favorites_switch)
|
||||
private var searchNoResultsView: View? = rootView.findViewById(R.id.search_no_results_view)
|
||||
private var sheetStreamingLinkHeadline: TextView? = rootView.findViewById(R.id.sheet_streaming_link_headline)
|
||||
private var sheetStreamingLinkView: TextView? = rootView.findViewById(R.id.sheet_streaming_link)
|
||||
private var sheetMetadataHistoryHeadline: TextView? = rootView.findViewById(R.id.sheet_metadata_headline)
|
||||
@@ -362,6 +371,27 @@ data class LayoutHolder(var rootView: View) {
|
||||
}
|
||||
}
|
||||
|
||||
/* Toggles visibility of the search layout */
|
||||
fun toggleSearchLayout(visible: Boolean) {
|
||||
val parent = searchLayout?.parent as? ViewGroup
|
||||
if (parent != null) {
|
||||
val transition = ChangeBounds()
|
||||
transition.duration = 300
|
||||
TransitionManager.beginDelayedTransition(parent, transition)
|
||||
}
|
||||
searchLayout?.isVisible = visible
|
||||
if (!visible) {
|
||||
searchInputEditText?.text?.clear()
|
||||
searchFilterFavoritesSwitch?.isChecked = false
|
||||
searchNoResultsView?.isGone = true
|
||||
}
|
||||
}
|
||||
|
||||
/* Shows/hides no results message */
|
||||
fun toggleSearchNoResults(show: Boolean) {
|
||||
searchNoResultsView?.isVisible = show
|
||||
}
|
||||
|
||||
|
||||
/* Toggles visibility of the onboarding screen */
|
||||
fun toggleOnboarding(context: Context, collectionSize: Int): Boolean {
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@color/icon_default"
|
||||
android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z"/>
|
||||
</vector>
|
||||
@@ -12,6 +12,54 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<!-- SEARCH BAR -->
|
||||
<LinearLayout
|
||||
android:id="@+id/search_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="8dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="visible">
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/search_input_layout"
|
||||
style="@style/Widget.Material3.TextInputLayout.OutlinedBox"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:endIconMode="clear_text"
|
||||
app:startIconDrawable="@drawable/ic_search_24dp">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/search_input_edit_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/search_hint"
|
||||
android:inputType="text"
|
||||
android:maxLines="1" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.materialswitch.MaterialSwitch
|
||||
android:id="@+id/search_filter_favorites_switch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="@string/search_filter_favorites" />
|
||||
|
||||
<!-- NO RESULTS MESSAGE -->
|
||||
<TextView
|
||||
android:id="@+id/search_no_results_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="@string/search_no_results"
|
||||
android:textAppearance="@style/TextAppearance.Material3.BodyLarge"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/station_list"
|
||||
android:layout_width="match_parent"
|
||||
@@ -19,7 +67,7 @@
|
||||
android:clipToPadding="false"
|
||||
android:padding="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/search_layout" />
|
||||
|
||||
<include
|
||||
layout="@layout/element_onboarding"
|
||||
|
||||
@@ -22,6 +22,24 @@
|
||||
app:strokeColor="@color/list_card_stroke_background"
|
||||
app:strokeWidth="3dp" />
|
||||
|
||||
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
|
||||
android:id="@+id/player_search_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="130dp"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:focusable="true"
|
||||
android:clickable="true"
|
||||
android:stateListAnimator="@null"
|
||||
app:backgroundTint="@color/list_card_background"
|
||||
app:icon="@drawable/ic_search_24dp"
|
||||
app:iconTint="@color/icon_default"
|
||||
app:rippleColor="@color/list_card_stroke_background"
|
||||
app:strokeColor="@color/list_card_stroke_background"
|
||||
app:strokeWidth="3dp" />
|
||||
|
||||
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
|
||||
android:id="@+id/card_visualizer"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
@@ -19,18 +20,79 @@
|
||||
android:orientation="vertical"
|
||||
tools:context="com.michatec.radio.PlayerFragment">
|
||||
|
||||
<!-- STATION LIST -->
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/station_list"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="2dp"
|
||||
android:visibility="visible" />
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- ONBOARDING -->
|
||||
<include
|
||||
layout="@layout/element_onboarding"
|
||||
android:visibility="gone" />
|
||||
<!-- SEARCH BAR -->
|
||||
<LinearLayout
|
||||
android:id="@+id/search_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="8dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/search_input_layout"
|
||||
style="@style/Widget.Material3.TextInputLayout.OutlinedBox"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:endIconMode="clear_text"
|
||||
app:startIconDrawable="@drawable/ic_search_24dp">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/search_input_edit_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/search_hint"
|
||||
android:inputType="text"
|
||||
android:maxLines="1" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.materialswitch.MaterialSwitch
|
||||
android:id="@+id/search_filter_favorites_switch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="@string/search_filter_favorites" />
|
||||
|
||||
<!-- NO RESULTS MESSAGE -->
|
||||
<TextView
|
||||
android:id="@+id/search_no_results_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="@string/search_no_results"
|
||||
android:textAppearance="@style/TextAppearance.Material3.BodyLarge"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<!-- STATION LIST -->
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/station_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="2dp"
|
||||
android:visibility="visible" />
|
||||
|
||||
<!-- ONBOARDING -->
|
||||
<include
|
||||
layout="@layout/element_onboarding"
|
||||
android:visibility="gone" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- PLAYER SHEET -->
|
||||
<include layout="@layout/bottom_sheet_playback_controls" />
|
||||
|
||||
@@ -191,4 +191,8 @@
|
||||
<string name="pref_remote_control_summary">Betjen radioen fra din webbrowser</string>
|
||||
<string name="pref_remote_control_url">Betjen radioen fra http://%1$s:8080</string>
|
||||
<string name="error_webserver">Web fjernbetjeningsserver crashet/stoppede.</string>
|
||||
<string name="search_hint">Søg stationer…</string>
|
||||
<string name="search_filter_favorites">Kun favoritter</string>
|
||||
<string name="search_no_results">Ingen stationer fundet.</string>
|
||||
<string name="descr_player_search_button">Søg stationer</string>
|
||||
</resources>
|
||||
@@ -15,6 +15,7 @@
|
||||
<string name="descr_expanded_player_sleep_timer_start_button">Schlaf-Timer starten</string>
|
||||
<string name="descr_player_playback_button">Start/Pause</string>
|
||||
<string name="descr_player_station_image">Senderbild</string>
|
||||
<string name="descr_player_search_button">Sender suchen</string>
|
||||
<!-- Dialogs -->
|
||||
<string name="dialog_add_station_title">Station hinzufügen</string>
|
||||
<string name="dialog_edit_station_name">Sendername</string>
|
||||
@@ -193,4 +194,7 @@
|
||||
<string name="pref_remote_control_summary">Steuere das Radio über deinen Webbrowser</string>
|
||||
<string name="pref_remote_control_url">Steuere das Radio über http://%1$s:8080</string>
|
||||
<string name="error_webserver">Web-Fernbedienungsserver abgestürzt/gestoppt.</string>
|
||||
<string name="search_hint">Sender suchen…</string>
|
||||
<string name="search_filter_favorites">Nur Favoriten</string>
|
||||
<string name="search_no_results">Keine Sender gefunden.</string>
|
||||
</resources>
|
||||
@@ -193,4 +193,9 @@
|
||||
<string name="pref_remote_control_summary">Ελέγξτε το ραδιόφωνο από το πρόγραμμα περιήγησής σας</string>
|
||||
<string name="pref_remote_control_url">Ελέγξτε το ραδιόφωνο από το http://%1$s:8080</string>
|
||||
<string name="error_webserver">Ο διακομιστής τηλεχειριστηρίου ιστού κατέρρευσε/σταμάτησε.</string>
|
||||
|
||||
<string name="descr_player_search_button">Αναζήτηση σταθμών</string>
|
||||
<string name="search_hint">Αναζήτηση σταθμών…</string>
|
||||
<string name="search_filter_favorites">Μόνο αγαπημένα</string>
|
||||
<string name="search_no_results">Δεν βρέθηκαν σταθμοί.</string>
|
||||
</resources>
|
||||
@@ -191,4 +191,9 @@
|
||||
<string name="pref_remote_control_summary">Contrôlez la radio depuis votre navigateur web</string>
|
||||
<string name="pref_remote_control_url">Contrôlez la radio depuis http://%1$s:8080</string>
|
||||
<string name="error_webserver">Serveur de télécommande Web planté/arrêté.</string>
|
||||
|
||||
<string name="descr_player_search_button">Rechercher des stations</string>
|
||||
<string name="search_hint">Rechercher des stations…</string>
|
||||
<string name="search_filter_favorites">Favoris uniquement</string>
|
||||
<string name="search_no_results">Aucune station trouvée.</string>
|
||||
</resources>
|
||||
@@ -192,4 +192,8 @@
|
||||
<string name="pref_remote_control_summary">ウェブブラウザからラジオを操作</string>
|
||||
<string name="pref_remote_control_url">http://%1$s:8080 からラジオを操作</string>
|
||||
<string name="error_webserver">Webリモートサーバーがクラッシュ/停止しました。</string>
|
||||
<string name="search_hint">局を検索…</string>
|
||||
<string name="search_filter_favorites">お気に入りのみ</string>
|
||||
<string name="search_no_results">局が見つかりません。</string>
|
||||
<string name="descr_player_search_button">局を検索</string>
|
||||
</resources>
|
||||
@@ -193,4 +193,8 @@
|
||||
<string name="pref_remote_control_summary">Bedien de radio vanuit je webbrowser</string>
|
||||
<string name="pref_remote_control_url">Bedien de radio via http://%1$s:8080</string>
|
||||
<string name="error_webserver">De webserver voor de afstandsbediening is gecrasht of gestopt.</string>
|
||||
<string name="search_hint">Zenders zoeken…</string>
|
||||
<string name="search_filter_favorites">Alleen favorieten</string>
|
||||
<string name="search_no_results">Geen zenders gevonden.</string>
|
||||
<string name="descr_player_search_button">Zenders zoeken</string>
|
||||
</resources>
|
||||
@@ -192,4 +192,8 @@
|
||||
<string name="pref_remote_control_summary">Steruj radiem z przeglądarki internetowej</string>
|
||||
<string name="pref_remote_control_url">Steruj radiem przez http://%1$s:8080</string>
|
||||
<string name="error_webserver">Serwer zdalnego sterowania uległ awarii/zatrzymaniu.</string>
|
||||
<string name="search_hint">Szukaj stacji…</string>
|
||||
<string name="search_filter_favorites">Tylko ulubione</string>
|
||||
<string name="search_no_results">Nie znaleziono stacji.</string>
|
||||
<string name="descr_player_search_button">Szukaj stacji</string>
|
||||
</resources>
|
||||
@@ -193,4 +193,8 @@
|
||||
<string name="pref_remote_control_summary">Управляйте радио из вашего веб-браузера</string>
|
||||
<string name="pref_remote_control_url">Управляйте радио через http://%1$s:8080</string>
|
||||
<string name="error_webserver">Веб-сервер удалённого управления упал/остановлен.</string>
|
||||
<string name="search_hint">Поиск станций…</string>
|
||||
<string name="search_filter_favorites">Только избранное</string>
|
||||
<string name="search_no_results">Станции не найдены.</string>
|
||||
<string name="descr_player_search_button">Поиск станций</string>
|
||||
</resources>
|
||||
@@ -193,4 +193,8 @@
|
||||
<string name="pref_remote_control_summary">Керуйте радіо з вашого веб-браузера</string>
|
||||
<string name="pref_remote_control_url">Керуйте радіо через http://%1$s:8080</string>
|
||||
<string name="error_webserver">Веб-сервер дистанційного керування аварійно зупинився/зупинено.</string>
|
||||
<string name="search_hint">Пошук станцій…</string>
|
||||
<string name="search_filter_favorites">Тільки улюблені</string>
|
||||
<string name="search_no_results">Станцій не знайдено.</string>
|
||||
<string name="descr_player_search_button">Пошук станцій</string>
|
||||
</resources>
|
||||
@@ -18,6 +18,7 @@
|
||||
<string name="descr_expanded_player_sleep_timer_start_button">Start sleep timer</string>
|
||||
<string name="descr_player_playback_button">Play/pause</string>
|
||||
<string name="descr_player_station_image">Station image</string>
|
||||
<string name="descr_player_search_button">Search stations</string>
|
||||
|
||||
<!-- Dialogs -->
|
||||
<string name="dialog_add_station_title">Add Station</string>
|
||||
@@ -228,4 +229,7 @@
|
||||
<string name="pref_remote_control_summary">Control radio from your web browser</string>
|
||||
<string name="pref_remote_control_url">Control radio from http://%1$s:8080</string>
|
||||
<string name="error_webserver">Web Remote server crashed / stopped.</string>
|
||||
<string name="search_hint">Search stations…</string>
|
||||
<string name="search_filter_favorites">Only favorites</string>
|
||||
<string name="search_no_results">No stations found.</string>
|
||||
</resources>
|
||||
Reference in new issue
Block a user