mirror of
https://github.com/ichmagmaus111/ghostgram.git
synced 2026-07-20 14:30:51 +02:00
Update Ghostgram features
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
filegroup(
|
||||
name = "SGEmojiKeyboardDefaultFirst",
|
||||
srcs = glob([
|
||||
"Sources/**/*.swift",
|
||||
]),
|
||||
visibility = [
|
||||
"//visibility:public",
|
||||
],
|
||||
)
|
||||
@@ -0,0 +1,23 @@
|
||||
import Foundation
|
||||
|
||||
|
||||
func sgPatchEmojiKeyboardItems(_ items: [EmojiPagerContentComponent.ItemGroup]) -> [EmojiPagerContentComponent.ItemGroup] {
|
||||
var items = items
|
||||
let staticEmojisIndex = items.firstIndex { item in
|
||||
if let groupId = item.groupId.base as? String, groupId == "static" {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
let recentEmojisIndex = items.firstIndex { item in
|
||||
if let groupId = item.groupId.base as? String, groupId == "recent" {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
if let staticEmojisIndex = staticEmojisIndex {
|
||||
let staticEmojiItem = items.remove(at: staticEmojisIndex)
|
||||
items.insert(staticEmojiItem, at: (recentEmojisIndex ?? -1) + 1 )
|
||||
}
|
||||
return items
|
||||
}
|
||||
Reference in New Issue
Block a user