Add more quick action icons
This commit is contained in:
parent
f39a9811f2
commit
d5b58df6af
@ -12,48 +12,35 @@ interface SearchAction : Searchable {
|
|||||||
fun start(context: Context)
|
fun start(context: Context)
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class SearchActionIcon {
|
enum class SearchActionIcon(private val value: Int) {
|
||||||
Search,
|
Search(0),
|
||||||
Custom,
|
Custom(1),
|
||||||
Website,
|
Website(2),
|
||||||
Alarm,
|
Alarm(3),
|
||||||
Timer,
|
Timer(4),
|
||||||
Contact,
|
Contact(5),
|
||||||
Phone,
|
Phone(6),
|
||||||
Email,
|
Email(7),
|
||||||
Message,
|
Message(8),
|
||||||
Calendar,
|
Calendar(9),
|
||||||
Translate;
|
Translate(10),
|
||||||
|
WebSearch(11),
|
||||||
|
PersonSearch(12),
|
||||||
|
StatsSearch(13),
|
||||||
|
SearchPage(14),
|
||||||
|
SearchList(15),
|
||||||
|
ImageSearch(16),
|
||||||
|
Location(17),
|
||||||
|
Movie(18),
|
||||||
|
Music(19),
|
||||||
|
Game(20),
|
||||||
|
Note(21);
|
||||||
fun toInt(): Int {
|
fun toInt(): Int {
|
||||||
return when (this) {
|
return value
|
||||||
Search -> 0
|
|
||||||
Custom -> 1
|
|
||||||
Website -> 2
|
|
||||||
Alarm -> 3
|
|
||||||
Timer -> 4
|
|
||||||
Contact -> 5
|
|
||||||
Phone -> 6
|
|
||||||
Email -> 7
|
|
||||||
Message -> 8
|
|
||||||
Calendar -> 9
|
|
||||||
Translate -> 10
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
companion object {
|
companion object {
|
||||||
fun fromInt(value: Int?): SearchActionIcon {
|
fun fromInt(value: Int?): SearchActionIcon {
|
||||||
return when (value) {
|
return values().firstOrNull { it.value == value } ?: Search
|
||||||
1 -> Custom
|
|
||||||
2 -> Website
|
|
||||||
3 -> Alarm
|
|
||||||
4 -> Timer
|
|
||||||
5 -> Contact
|
|
||||||
6 -> Phone
|
|
||||||
7 -> Email
|
|
||||||
8 -> Message
|
|
||||||
9 -> Calendar
|
|
||||||
10 -> Translate
|
|
||||||
else -> Search
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -7,14 +7,29 @@ import androidx.compose.material.icons.Icons
|
|||||||
import androidx.compose.material.icons.rounded.Alarm
|
import androidx.compose.material.icons.rounded.Alarm
|
||||||
import androidx.compose.material.icons.rounded.Call
|
import androidx.compose.material.icons.rounded.Call
|
||||||
import androidx.compose.material.icons.rounded.Email
|
import androidx.compose.material.icons.rounded.Email
|
||||||
|
import androidx.compose.material.icons.rounded.Error
|
||||||
import androidx.compose.material.icons.rounded.Event
|
import androidx.compose.material.icons.rounded.Event
|
||||||
|
import androidx.compose.material.icons.rounded.FindInPage
|
||||||
|
import androidx.compose.material.icons.rounded.Games
|
||||||
|
import androidx.compose.material.icons.rounded.ImageSearch
|
||||||
import androidx.compose.material.icons.rounded.Language
|
import androidx.compose.material.icons.rounded.Language
|
||||||
|
import androidx.compose.material.icons.rounded.LocationOn
|
||||||
|
import androidx.compose.material.icons.rounded.ManageSearch
|
||||||
|
import androidx.compose.material.icons.rounded.Movie
|
||||||
|
import androidx.compose.material.icons.rounded.MusicNote
|
||||||
import androidx.compose.material.icons.rounded.Person
|
import androidx.compose.material.icons.rounded.Person
|
||||||
import androidx.compose.material.icons.rounded.PersonAdd
|
import androidx.compose.material.icons.rounded.PersonAdd
|
||||||
|
import androidx.compose.material.icons.rounded.PersonSearch
|
||||||
|
import androidx.compose.material.icons.rounded.Place
|
||||||
|
import androidx.compose.material.icons.rounded.QueryStats
|
||||||
import androidx.compose.material.icons.rounded.Search
|
import androidx.compose.material.icons.rounded.Search
|
||||||
import androidx.compose.material.icons.rounded.Sms
|
import androidx.compose.material.icons.rounded.Sms
|
||||||
|
import androidx.compose.material.icons.rounded.SportsEsports
|
||||||
|
import androidx.compose.material.icons.rounded.StickyNote2
|
||||||
import androidx.compose.material.icons.rounded.Timer
|
import androidx.compose.material.icons.rounded.Timer
|
||||||
import androidx.compose.material.icons.rounded.Translate
|
import androidx.compose.material.icons.rounded.Translate
|
||||||
|
import androidx.compose.material.icons.rounded.TravelExplore
|
||||||
|
import androidx.compose.material.icons.rounded.Warning
|
||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
@ -119,6 +134,18 @@ fun getSearchActionIconVector(icon: SearchActionIcon): ImageVector {
|
|||||||
SearchActionIcon.Message -> Icons.Rounded.Sms
|
SearchActionIcon.Message -> Icons.Rounded.Sms
|
||||||
SearchActionIcon.Calendar -> Icons.Rounded.Event
|
SearchActionIcon.Calendar -> Icons.Rounded.Event
|
||||||
SearchActionIcon.Translate -> Icons.Rounded.Translate
|
SearchActionIcon.Translate -> Icons.Rounded.Translate
|
||||||
else -> Icons.Rounded.Search
|
SearchActionIcon.Search -> Icons.Rounded.Search
|
||||||
|
SearchActionIcon.Custom -> Icons.Rounded.Warning
|
||||||
|
SearchActionIcon.WebSearch -> Icons.Rounded.TravelExplore
|
||||||
|
SearchActionIcon.PersonSearch -> Icons.Rounded.PersonSearch
|
||||||
|
SearchActionIcon.StatsSearch -> Icons.Rounded.QueryStats
|
||||||
|
SearchActionIcon.SearchPage -> Icons.Rounded.FindInPage
|
||||||
|
SearchActionIcon.SearchList -> Icons.Rounded.ManageSearch
|
||||||
|
SearchActionIcon.ImageSearch -> Icons.Rounded.ImageSearch
|
||||||
|
SearchActionIcon.Location -> Icons.Rounded.Place
|
||||||
|
SearchActionIcon.Movie -> Icons.Rounded.Movie
|
||||||
|
SearchActionIcon.Music -> Icons.Rounded.MusicNote
|
||||||
|
SearchActionIcon.Game -> Icons.Rounded.SportsEsports
|
||||||
|
SearchActionIcon.Note -> Icons.Rounded.StickyNote2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user