mirror of
https://github.com/ultrasonic/ultrasonic
synced 2025-02-16 11:41:16 +01:00
Unify play next and play last icons,
style fixes
This commit is contained in:
parent
eeb2d13d96
commit
2086a6cac5
@ -167,7 +167,9 @@ class SearchFragment : MultiListFragment<Identifiable>(), KoinComponent {
|
||||
inflater.inflate(R.menu.search, menu)
|
||||
val searchItem = menu.findItem(R.id.search_item)
|
||||
val searchView = searchItem.actionView as SearchView
|
||||
searchView.setSearchableInfo(searchManager.getSearchableInfo(requireActivity().componentName))
|
||||
val searchableInfo = searchManager.getSearchableInfo(requireActivity().componentName)
|
||||
searchView.setSearchableInfo(searchableInfo)
|
||||
|
||||
val arguments = arguments
|
||||
val autoPlay =
|
||||
arguments != null && arguments.getBoolean(Constants.INTENT_EXTRA_NAME_AUTOPLAY, false)
|
||||
@ -186,8 +188,10 @@ class SearchFragment : MultiListFragment<Identifiable>(), KoinComponent {
|
||||
Timber.d("onSuggestionClick: %d", position)
|
||||
val cursor = searchView.suggestionsAdapter.cursor
|
||||
cursor.moveToPosition(position)
|
||||
val suggestion =
|
||||
cursor.getString(2) // TODO: Try to do something with this magic const -- 2 is the index of col containing suggestion name.
|
||||
|
||||
// TODO: Try to do something with this magic const:
|
||||
// 2 is the index of col containing suggestion name.
|
||||
val suggestion = cursor.getString(2)
|
||||
searchView.setQuery(suggestion, true)
|
||||
return true
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ class BaseAdapter<T : Identifiable> : MultiTypeAdapter() {
|
||||
override var items: List<Any>
|
||||
get() = getCurrentList()
|
||||
set(value) {
|
||||
throw IllegalAccessException("You must use submitList() to add data to the MultiTypeDiffAdapter")
|
||||
throw IllegalAccessException("You must use submitList() to add data to the Adapter")
|
||||
}
|
||||
|
||||
var mDiffer: AsyncListDiffer<T> = AsyncListDiffer(
|
||||
|
@ -22,9 +22,9 @@ import org.moire.ultrasonic.service.RxBus
|
||||
* When clicked it will drop down a list of all available Folders and allow you to
|
||||
* select one. The intended usage is to supply a filter to lists of artists, albums, etc
|
||||
*/
|
||||
class FolderSelectorBinder(
|
||||
context: Context
|
||||
) : ItemViewBinder<FolderSelectorBinder.FolderHeader, FolderSelectorBinder.ViewHolder>(), KoinComponent {
|
||||
class FolderSelectorBinder(context: Context) :
|
||||
ItemViewBinder<FolderSelectorBinder.FolderHeader, FolderSelectorBinder.ViewHolder>(),
|
||||
KoinComponent {
|
||||
|
||||
private val weakContext: WeakReference<Context> = WeakReference(context)
|
||||
|
||||
|
@ -8,10 +8,10 @@ import org.moire.ultrasonic.data.ActiveServerProvider
|
||||
|
||||
object Helper {
|
||||
@JvmStatic
|
||||
fun createPopupMenu(view: View, contextMenuLayout: Int = R.menu.artist_context_menu): PopupMenu {
|
||||
fun createPopupMenu(view: View, layout: Int = R.menu.artist_context_menu): PopupMenu {
|
||||
val popup = PopupMenu(view.context, view)
|
||||
val inflater: MenuInflater = popup.menuInflater
|
||||
inflater.inflate(contextMenuLayout, popup.menu)
|
||||
inflater.inflate(layout, popup.menu)
|
||||
|
||||
val downloadMenuItem = popup.menu.findItem(R.id.menu_download)
|
||||
downloadMenuItem?.isVisible = !ActiveServerProvider.isOffline()
|
||||
|
@ -69,7 +69,8 @@ class ArtistListFragment : EntryListFragment<ArtistOrIndex>() {
|
||||
bundle.putString(Constants.INTENT_EXTRA_NAME_NAME, item.name)
|
||||
bundle.putString(Constants.INTENT_EXTRA_NAME_PARENT_ID, item.id)
|
||||
bundle.putBoolean(Constants.INTENT_EXTRA_NAME_ARTIST, (item is Artist))
|
||||
bundle.putString(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_TYPE, Constants.ALPHABETICAL_BY_NAME)
|
||||
bundle.putString(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_TYPE,
|
||||
Constants.ALPHABETICAL_BY_NAME)
|
||||
bundle.putString(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_TITLE, item.name)
|
||||
bundle.putInt(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_SIZE, 1000)
|
||||
bundle.putInt(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_OFFSET, 0)
|
||||
|
@ -47,12 +47,4 @@ class SearchListModel(application: Application) : GenericListModel(application)
|
||||
songs = result.songs.take(SearchFragment.DEFAULT_SONGS)
|
||||
)
|
||||
}
|
||||
|
||||
// fun mergeList(result: SearchResult): List<Identifiable> {
|
||||
// val list = mutableListOf<Identifiable>()
|
||||
// list.add(result.artists)
|
||||
// list.add(result.albums)
|
||||
// list.add(result.songs)
|
||||
// return list
|
||||
// }
|
||||
}
|
||||
|
@ -18,9 +18,7 @@ class DragSortCallback : ItemTouchHelper.SimpleCallback(UP or DOWN, 0) {
|
||||
val from = viewHolder.bindingAdapterPosition
|
||||
val to = target.bindingAdapterPosition
|
||||
|
||||
Timber.w("MOVED %s %s", to, from)
|
||||
|
||||
// Move it in the data set
|
||||
// FIXME: Move it in the data set
|
||||
(recyclerView.adapter as BaseAdapter<*>).moveItem(from, to)
|
||||
|
||||
return true
|
||||
|
10
ultrasonic/src/main/res/drawable/ic_baseline_info_24.xml
Normal file
10
ultrasonic/src/main/res/drawable/ic_baseline_info_24.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM13,17h-2v-6h2v6zM13,9h-2L11,7h2v2z"/>
|
||||
</vector>
|
@ -1,9 +0,0 @@
|
||||
<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="#FFF"
|
||||
android:pathData="M4,6L2,6v14c0,1.1 0.9,2 2,2h14v-2L4,20L4,6zM20,2L8,2c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2zM19,11h-4v4h-2v-4L9,11L9,9h4L13,5h2v4h4v2z"/>
|
||||
</vector>
|
@ -1,9 +0,0 @@
|
||||
<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="#000"
|
||||
android:pathData="M4,6L2,6v14c0,1.1 0.9,2 2,2h14v-2L4,20L4,6zM20,2L8,2c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2zM19,11h-4v4h-2v-4L9,11L9,9h4L13,5h2v4h4v2z"/>
|
||||
</vector>
|
10
ultrasonic/src/main/res/drawable/ic_play_last.xml
Normal file
10
ultrasonic/src/main/res/drawable/ic_play_last.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="64"
|
||||
android:viewportHeight="64"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="#000000"
|
||||
android:pathData="m58.59,46.88h-32a1,-1 0,0 0,-1 1v5.34a1,-1 0,0 0,1 1h32a1,-1 0,0 0,1 -1v-5.34a1,-1 0,0 0,-1 -1zM58.59,28.22h-32a1,-1 0,0 0,-1 1v5.33a1,-1 0,0 0,1 1h32a1,-1 0,0 0,1 -1v-5.33a1,-1 0,0 0,-1 -1zM58.59,9.78h-48a1,-1 0,0 0,-1 1v5.34a1,-1 0,0 0,1 1h48a1,-1 0,0 0,1 -1v-5.34a1,-1 0,0 0,-1 -1zM5.41,29.63a1,-1 0,0 0,-1 1v21.18a1,-1 0,0 0,1.5 0.86L24.26,42.08a1,-1 0,0 0,0 -1.73L5.91,29.76a1,-1 0,0 0,-0.5 -0.13z" />
|
||||
</vector>
|
10
ultrasonic/src/main/res/drawable/ic_play_next.xml
Normal file
10
ultrasonic/src/main/res/drawable/ic_play_next.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="64"
|
||||
android:viewportHeight="64"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:pathData="M58.59,17.12h-32a1,1 0,0 1,-1 -1L25.59,10.78a1,1 0,0 1,1 -1h32a1,1 0,0 1,1 1v5.34A1,1 0,0 1,58.59 17.12ZM58.59,35.78h-32a1,1 0,0 1,-1 -1L25.59,29.45a1,1 0,0 1,1 -1h32a1,1 0,0 1,1 1v5.33A1,1 0,0 1,58.59 35.78ZM58.59,54.22h-48a1,1 0,0 1,-1 -1L9.59,47.88a1,1 0,0 1,1 -1h48a1,1 0,0 1,1 1v5.34A1,1 0,0 1,58.59 54.22ZM5.41,34.37a1,1 0,0 1,-1 -1L4.41,12.19a1,1 0,0 1,1.5 -0.86L24.26,21.92a1,1 0,0 1,0 1.73L5.91,34.24A1,1 0,0 1,5.41 34.37Z"
|
||||
android:fillColor="#000000"/>
|
||||
</vector>
|
@ -1,9 +0,0 @@
|
||||
<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="#FFF"
|
||||
android:pathData="M4,10h12v2L4,12zM4,6h12v2L4,8zM4,14h8v2L4,16zM14,14v6l5,-3z"/>
|
||||
</vector>
|
@ -1,9 +0,0 @@
|
||||
<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="#000"
|
||||
android:pathData="M4,10h12v2L4,12zM4,6h12v2L4,8zM4,14h8v2L4,16zM14,14v6l5,-3z"/>
|
||||
</vector>
|
@ -32,7 +32,7 @@
|
||||
android:layout_height="32dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:layout_weight="1"
|
||||
android:src="?attr/media_play_next"
|
||||
android:src="@drawable/ic_play_next"
|
||||
android:visibility="gone"
|
||||
android:contentDescription="@string/common.play_next" />
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
android:layout_height="32dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:layout_weight="1"
|
||||
android:src="?attr/add_to_queue"
|
||||
android:src="@drawable/ic_play_last"
|
||||
android:visibility="gone"
|
||||
android:contentDescription="@string/common.play_last" />
|
||||
|
||||
|
@ -39,7 +39,6 @@
|
||||
<attr name="star_full" format="reference"/>
|
||||
<attr name="about" format="reference"/>
|
||||
<attr name="select_all" format="reference"/>
|
||||
<attr name="add_to_queue" format="reference"/>
|
||||
<attr name="browse" format="reference"/>
|
||||
<attr name="exit" format="reference"/>
|
||||
<attr name="forward" format="reference"/>
|
||||
@ -73,7 +72,6 @@
|
||||
<attr name="media_play" format="reference"/>
|
||||
<attr name="podcasts" format="reference"/>
|
||||
<attr name="refresh" format="reference"/>
|
||||
<attr name="media_play_next" format="reference"/>
|
||||
<attr name="media_play_small" format="reference"/>
|
||||
<attr name="media_stop" format="reference"/>
|
||||
<attr name="media_toggle" format="reference"/>
|
||||
|
@ -12,7 +12,6 @@
|
||||
<item name="star_full">@drawable/ic_star_full_dark</item>
|
||||
<item name="about">@drawable/ic_menu_about_dark</item>
|
||||
<item name="select_all">@drawable/ic_menu_select_all_dark</item>
|
||||
<item name="add_to_queue">@drawable/ic_menu_add_to_queue_dark</item>
|
||||
<item name="browse">@drawable/ic_menu_browse_dark</item>
|
||||
<item name="exit">@drawable/ic_menu_exit_dark</item>
|
||||
<item name="backward">@drawable/ic_menu_backward_dark</item>
|
||||
@ -46,7 +45,6 @@
|
||||
<item name="media_play">@drawable/media_start_normal_dark</item>
|
||||
<item name="podcasts">@drawable/ic_menu_podcasts_dark</item>
|
||||
<item name="refresh">@drawable/ic_menu_refresh_dark</item>
|
||||
<item name="media_play_next">@drawable/media_play_next_dark</item>
|
||||
<item name="media_play_small">@drawable/ic_stat_play_dark</item>
|
||||
<item name="media_stop">@drawable/media_stop_normal_dark</item>
|
||||
<item name="media_toggle">@drawable/media_toggle_list_normal_dark</item>
|
||||
@ -63,6 +61,7 @@
|
||||
<item name="more_vert">@drawable/ic_more_vert_dark</item>
|
||||
<item name="list_selector_holo">@drawable/list_selector_holo_dark</item>
|
||||
<item name="list_selector_holo_selected">@drawable/list_selector_holo_dark_selected</item>
|
||||
<item name="colorControlNormal">@color/selected_menu_background_light</item>
|
||||
</style>
|
||||
|
||||
<style name="UltrasonicTheme.Dark" parent="Theme.MaterialComponents">
|
||||
@ -78,7 +77,6 @@
|
||||
<item name="star_full">@drawable/ic_star_full_dark</item>
|
||||
<item name="about">@drawable/ic_menu_about_dark</item>
|
||||
<item name="select_all">@drawable/ic_menu_select_all_dark</item>
|
||||
<item name="add_to_queue">@drawable/ic_menu_add_to_queue_dark</item>
|
||||
<item name="browse">@drawable/ic_menu_browse_dark</item>
|
||||
<item name="exit">@drawable/ic_menu_exit_dark</item>
|
||||
<item name="backward">@drawable/ic_menu_backward_dark</item>
|
||||
@ -112,7 +110,6 @@
|
||||
<item name="media_play">@drawable/media_start_normal_dark</item>
|
||||
<item name="podcasts">@drawable/ic_menu_podcasts_dark</item>
|
||||
<item name="refresh">@drawable/ic_menu_refresh_dark</item>
|
||||
<item name="media_play_next">@drawable/media_play_next_dark</item>
|
||||
<item name="media_play_small">@drawable/ic_stat_play_dark</item>
|
||||
<item name="media_stop">@drawable/media_stop_normal_dark</item>
|
||||
<item name="media_toggle">@drawable/media_toggle_list_normal_dark</item>
|
||||
@ -129,6 +126,7 @@
|
||||
<item name="more_vert">@drawable/ic_more_vert_dark</item>
|
||||
<item name="list_selector_holo">@drawable/list_selector_holo_dark</item>
|
||||
<item name="list_selector_holo_selected">@drawable/list_selector_holo_dark_selected</item>
|
||||
<item name="colorControlNormal">@color/selected_menu_background_light</item>
|
||||
</style>
|
||||
|
||||
<style name="UltrasonicTheme.Light" parent="Theme.MaterialComponents.Light">
|
||||
@ -143,7 +141,6 @@
|
||||
<item name="star_full">@drawable/ic_star_full_light</item>
|
||||
<item name="about">@drawable/ic_menu_about_light</item>
|
||||
<item name="select_all">@drawable/ic_menu_select_all_light</item>
|
||||
<item name="add_to_queue">@drawable/ic_menu_add_to_queue_light</item>
|
||||
<item name="browse">@drawable/ic_menu_browse_light</item>
|
||||
<item name="exit">@drawable/ic_menu_exit_light</item>
|
||||
<item name="backward">@drawable/ic_menu_backward_light</item>
|
||||
@ -177,7 +174,6 @@
|
||||
<item name="media_play">@drawable/media_start_normal_light</item>
|
||||
<item name="podcasts">@drawable/ic_menu_podcasts_light</item>
|
||||
<item name="refresh">@drawable/ic_menu_refresh_light</item>
|
||||
<item name="media_play_next">@drawable/media_play_next_light</item>
|
||||
<item name="media_play_small">@drawable/ic_stat_play_light</item>
|
||||
<item name="media_stop">@drawable/media_stop_normal_light</item>
|
||||
<item name="media_toggle">@drawable/media_toggle_list_normal_light</item>
|
||||
@ -194,5 +190,6 @@
|
||||
<item name="more_vert">@drawable/ic_more_vert_light</item>
|
||||
<item name="list_selector_holo">@drawable/list_selector_holo_light</item>
|
||||
<item name="list_selector_holo_selected">@drawable/list_selector_holo_light_selected</item>
|
||||
<item name="colorControlNormal">@color/selected_menu_background_dark</item>
|
||||
</style>
|
||||
</resources>
|
Loading…
x
Reference in New Issue
Block a user