wip
This commit is contained in:
parent
38ffad5f60
commit
588154b050
|
@ -155,7 +155,7 @@ final class EmojiPickerViewController: UICollectionViewController {
|
||||||
|
|
||||||
guard let item = dataSource.itemIdentifier(for: indexPath) else { return }
|
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)
|
viewModel.updateUse(emoji: item)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,9 +12,11 @@ final class AutocompleteItemCollectionViewCell: SeparatorConfiguredCollectionVie
|
||||||
|
|
||||||
contentConfiguration = AutocompleteItemContentConfiguration(item: item, identityContext: identityContext)
|
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
|
self.backgroundConfiguration = backgroundConfiguration
|
||||||
|
|
||||||
|
|
|
@ -11,9 +11,12 @@ final class EmojiCollectionViewCell: UICollectionViewCell {
|
||||||
|
|
||||||
contentConfiguration = EmojiContentConfiguration(emoji: emoji)
|
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
|
backgroundConfiguration.cornerRadius = .defaultCornerRadius
|
||||||
|
|
||||||
self.backgroundConfiguration = backgroundConfiguration
|
self.backgroundConfiguration = backgroundConfiguration
|
||||||
|
|
|
@ -62,6 +62,8 @@ private extension CompositionInputAccessoryView {
|
||||||
autocompleteCollectionView.backgroundColor = .clear
|
autocompleteCollectionView.backgroundColor = .clear
|
||||||
autocompleteCollectionView.layer.cornerRadius = .defaultCornerRadius
|
autocompleteCollectionView.layer.cornerRadius = .defaultCornerRadius
|
||||||
autocompleteCollectionView.layer.maskedCorners = [.layerMaxXMinYCorner, .layerMinXMinYCorner]
|
autocompleteCollectionView.layer.maskedCorners = [.layerMaxXMinYCorner, .layerMinXMinYCorner]
|
||||||
|
autocompleteCollectionView.dataSource = autocompleteDataSource
|
||||||
|
autocompleteCollectionView.delegate = self
|
||||||
|
|
||||||
let autocompleteBackgroundView = UIVisualEffectView(effect: UIBlurEffect(style: .systemChromeMaterial))
|
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 {
|
private extension CompositionInputAccessoryView {
|
||||||
static func autocompleteLayout() -> UICollectionViewLayout {
|
static func autocompleteLayout() -> UICollectionViewLayout {
|
||||||
var listConfig = UICollectionLayoutListConfiguration(appearance: .plain)
|
var listConfig = UICollectionLayoutListConfiguration(appearance: .plain)
|
||||||
|
|
Loading…
Reference in New Issue