mirror of
https://github.com/metabolist/metatext.git
synced 2024-11-22 08:10:59 +00:00
wip
This commit is contained in:
parent
38ffad5f60
commit
588154b050
4 changed files with 18 additions and 5 deletions
|
@ -155,7 +155,7 @@ final class EmojiPickerViewController: UICollectionViewController {
|
|||
|
||||
guard let item = dataSource.itemIdentifier(for: indexPath) else { return }
|
||||
|
||||
select(item.applyingDefaultSkinTone(identityContext: viewModel.identityContext))
|
||||
select(emoji: item.applyingDefaultSkinTone(identityContext: viewModel.identityContext))
|
||||
viewModel.updateUse(emoji: item)
|
||||
}
|
||||
|
||||
|
|
|
@ -12,9 +12,11 @@ final class AutocompleteItemCollectionViewCell: SeparatorConfiguredCollectionVie
|
|||
|
||||
contentConfiguration = AutocompleteItemContentConfiguration(item: item, identityContext: identityContext)
|
||||
|
||||
var backgroundConfiguration = UIBackgroundConfiguration.listPlainCell()
|
||||
var backgroundConfiguration = UIBackgroundConfiguration.listPlainCell().updated(for: state)
|
||||
|
||||
backgroundConfiguration.backgroundColor = state.isHighlighted || state.isSelected ? nil : .clear
|
||||
if !state.isHighlighted && !state.isSelected {
|
||||
backgroundConfiguration.backgroundColor = .clear
|
||||
}
|
||||
|
||||
self.backgroundConfiguration = backgroundConfiguration
|
||||
|
||||
|
|
|
@ -11,9 +11,12 @@ final class EmojiCollectionViewCell: UICollectionViewCell {
|
|||
|
||||
contentConfiguration = EmojiContentConfiguration(emoji: emoji)
|
||||
|
||||
var backgroundConfiguration = UIBackgroundConfiguration.listPlainCell()
|
||||
var backgroundConfiguration = UIBackgroundConfiguration.listPlainCell().updated(for: state)
|
||||
|
||||
if !state.isHighlighted && !state.isSelected {
|
||||
backgroundConfiguration.backgroundColor = .clear
|
||||
}
|
||||
|
||||
backgroundConfiguration.backgroundColor = state.isHighlighted || state.isSelected ? nil : .clear
|
||||
backgroundConfiguration.cornerRadius = .defaultCornerRadius
|
||||
|
||||
self.backgroundConfiguration = backgroundConfiguration
|
||||
|
|
|
@ -62,6 +62,8 @@ private extension CompositionInputAccessoryView {
|
|||
autocompleteCollectionView.backgroundColor = .clear
|
||||
autocompleteCollectionView.layer.cornerRadius = .defaultCornerRadius
|
||||
autocompleteCollectionView.layer.maskedCorners = [.layerMaxXMinYCorner, .layerMinXMinYCorner]
|
||||
autocompleteCollectionView.dataSource = autocompleteDataSource
|
||||
autocompleteCollectionView.delegate = self
|
||||
|
||||
let autocompleteBackgroundView = UIVisualEffectView(effect: UIBlurEffect(style: .systemChromeMaterial))
|
||||
|
||||
|
@ -236,6 +238,12 @@ private extension CompositionInputAccessoryView {
|
|||
}
|
||||
}
|
||||
|
||||
extension CompositionInputAccessoryView: UICollectionViewDelegate {
|
||||
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
|
||||
collectionView.deselectItem(at: indexPath, animated: true)
|
||||
}
|
||||
}
|
||||
|
||||
private extension CompositionInputAccessoryView {
|
||||
static func autocompleteLayout() -> UICollectionViewLayout {
|
||||
var listConfig = UICollectionLayoutListConfiguration(appearance: .plain)
|
||||
|
|
Loading…
Reference in a new issue