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)
|
||||
}
|
||||
|
||||
enum class SearchActionIcon {
|
||||
Search,
|
||||
Custom,
|
||||
Website,
|
||||
Alarm,
|
||||
Timer,
|
||||
Contact,
|
||||
Phone,
|
||||
Email,
|
||||
Message,
|
||||
Calendar,
|
||||
Translate;
|
||||
enum class SearchActionIcon(private val value: Int) {
|
||||
Search(0),
|
||||
Custom(1),
|
||||
Website(2),
|
||||
Alarm(3),
|
||||
Timer(4),
|
||||
Contact(5),
|
||||
Phone(6),
|
||||
Email(7),
|
||||
Message(8),
|
||||
Calendar(9),
|
||||
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 {
|
||||
return when (this) {
|
||||
Search -> 0
|
||||
Custom -> 1
|
||||
Website -> 2
|
||||
Alarm -> 3
|
||||
Timer -> 4
|
||||
Contact -> 5
|
||||
Phone -> 6
|
||||
Email -> 7
|
||||
Message -> 8
|
||||
Calendar -> 9
|
||||
Translate -> 10
|
||||
}
|
||||
return value
|
||||
}
|
||||
companion object {
|
||||
fun fromInt(value: Int?): SearchActionIcon {
|
||||
return when (value) {
|
||||
1 -> Custom
|
||||
2 -> Website
|
||||
3 -> Alarm
|
||||
4 -> Timer
|
||||
5 -> Contact
|
||||
6 -> Phone
|
||||
7 -> Email
|
||||
8 -> Message
|
||||
9 -> Calendar
|
||||
10 -> Translate
|
||||
else -> Search
|
||||
}
|
||||
return values().firstOrNull { it.value == value } ?: Search
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -7,14 +7,29 @@ import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.rounded.Alarm
|
||||
import androidx.compose.material.icons.rounded.Call
|
||||
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.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.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.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.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.Translate
|
||||
import androidx.compose.material.icons.rounded.TravelExplore
|
||||
import androidx.compose.material.icons.rounded.Warning
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.runtime.Composable
|
||||
@ -119,6 +134,18 @@ fun getSearchActionIconVector(icon: SearchActionIcon): ImageVector {
|
||||
SearchActionIcon.Message -> Icons.Rounded.Sms
|
||||
SearchActionIcon.Calendar -> Icons.Rounded.Event
|
||||
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