Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package org.schabi.newpipe.settings.preferencesearch

import androidx.annotation.XmlRes

/**
* Represents a preference-item inside the search.
*
* @param key Key of the setting/preference. E.g. used inside [android.content.SharedPreferences].
* @param title Title of the setting, e.g. 'Default resolution' or 'Show higher resolutions'.
* @param summary Summary of the setting, e.g. '480p' or 'Only some devices can play 2k/4k'.
* @param entries Possible entries of the setting, e.g. 480p,720p,...
* @param breadcrumbs Breadcrumbs - a hint where the setting is located e.g. 'Video and Audio > Player'
* @param searchIndexItemResId The xml-resource where this item was found/built from.
*/

data class PreferenceSearchItem(
val key: String,
val title: String,
val summary: String,
val entries: String,
val breadcrumbs: String,
@XmlRes val searchIndexItemResId: Int
) {
fun hasData(): Boolean {
return !key.isEmpty() && !title.isEmpty()
}

fun getAllRelevantSearchFields(): MutableList<String?> {
return mutableListOf(title, summary, entries, breadcrumbs)
}

override fun toString(): String {
return "PreferenceItem: $title $summary $key"
}
}