@@ -219,19 +219,17 @@ class KeyboardViewController: UIInputViewController {
219
219
}
220
220
221
221
222
- // Logic to create tooltip
223
- func createInformationStateDatasource( text: String , backgroundColor: UIColor ) -> ToolTipViewDatasource {
224
- let theme = ToolTipViewTheme ( backgroundColor: backgroundColor, textFont: nil , textColor: UIColor . black, textAlignment: . center, cornerRadius: 10 , masksToBounds: true )
225
- let content = getENTooltipContent ( content: text, fontSize: 10 )
222
+ // Logic to create notification tooltip.
223
+ func createInformationStateDatasource( text: NSMutableAttributedString , backgroundColor: UIColor ) -> ToolTipViewDatasource {
224
+ let theme = ToolTipViewTheme ( backgroundColor: backgroundColor, textFont: nil , textColor: keyCharColor, textAlignment: . center, cornerRadius: 10 , masksToBounds: true )
226
225
227
- return ToolTipViewDatasource ( content: content , theme: theme)
226
+ return ToolTipViewDatasource ( content: text , theme: theme)
228
227
}
229
228
230
229
func setInformationState( ) {
231
- let contentData : [ String ] = InformationToolTipData . getContent ( )
232
- let backgroundColors : [ UIColor ] = [ #colorLiteral( red: 0.6392156863 , green: 0.7764705882 , blue: 0.1921568627 , alpha: 1 ) , #colorLiteral( red: 0.6274509804 , green: 0.7333333333 , blue: 0.9098039216 , alpha: 1 ) , #colorLiteral( red: 0.9725490196 , green: 0.8666666667 , blue: 0.3960784314 , alpha: 1 ) ]
230
+ let contentData : [ NSMutableAttributedString ] = InformationToolTipData . getContent ( )
233
231
let datasources = contentData. enumerated ( ) . compactMap ( { index, text in
234
- createInformationStateDatasource ( text: text, backgroundColor: backgroundColors [ index ] )
232
+ createInformationStateDatasource ( text: text, backgroundColor: keyColor )
235
233
} )
236
234
tipView = ToolTipView ( datasources: datasources)
237
235
@@ -240,11 +238,15 @@ class KeyboardViewController: UIInputViewController {
240
238
guard let tipView = tipView else { return }
241
239
tipView. translatesAutoresizingMaskIntoConstraints = false
242
240
formKeySingle. addSubview ( tipView)
243
- tipView. leadingAnchor. constraint ( equalTo: formKeySingle. leadingAnchor, constant: 5 ) . isActive = true
244
- tipView. trailingAnchor. constraint ( equalTo: formKeySingle. trailingAnchor, constant: - 5 ) . isActive = true
245
- tipView. topAnchor. constraint ( equalTo: formKeySingle. topAnchor, constant: 5 ) . isActive = true
241
+ tipView. leadingAnchor. constraint (
242
+ equalTo: formKeySingle. leadingAnchor, constant: DeviceType . isPhone ? 15 : 40
243
+ ) . isActive = true
244
+ tipView. trailingAnchor. constraint (
245
+ equalTo: formKeySingle. trailingAnchor, constant: DeviceType . isPhone ? - 15 : - 40
246
+ ) . isActive = true
247
+ tipView. topAnchor. constraint ( equalTo: formKeySingle. topAnchor, constant: 8 ) . isActive = true
246
248
tipView. bottomAnchor. constraint ( equalTo: formKeySingle. bottomAnchor, constant: - 5 ) . isActive = true
247
-
249
+ styleBtn ( btn : formKeySingle , title : " " , radius : keyCornerRadius )
248
250
}
249
251
250
252
private func bindTooltipview( ) {
@@ -268,7 +270,8 @@ class KeyboardViewController: UIInputViewController {
268
270
weakSelf. styleShiftButtons ( )
269
271
}
270
272
}
271
-
273
+
274
+ /// Styles the shift buttons for the displayInformation states.
272
275
private func styleShiftButtons( ) {
273
276
styleBtn ( btn: shiftFormsDisplayLeft, title: " " , radius: keyCornerRadius)
274
277
styleIconBtn ( btn: shiftFormsDisplayLeft,
@@ -809,7 +812,7 @@ class KeyboardViewController: UIInputViewController {
809
812
&& deCaseVariantDeclensionState != . disabled {
810
813
switch deCaseVariantDeclensionState {
811
814
case . disabled:
812
- break // placeholder
815
+ break
813
816
case . accusativePersonalSPS, . dativePersonalSPS, . genitivePersonalSPS,
814
817
. accusativePossesiveSPS, . dativePossesiveSPS, . genitivePossesiveSPS:
815
818
formsDisplayDimensions = . view1x2
@@ -832,7 +835,7 @@ class KeyboardViewController: UIInputViewController {
832
835
&& controllerLanguage == " German "
833
836
&& [ . accusative, . dative, . genitive] . contains ( deCaseDeclensionState) {
834
837
formsDisplayDimensions = . view2x2
835
- } else if
838
+ } else if
836
839
commandState == . displayInformation {
837
840
formsDisplayDimensions = . view1x1
838
841
} else {
@@ -851,7 +854,6 @@ class KeyboardViewController: UIInputViewController {
851
854
setFormDisplay1x2View ( )
852
855
case . view1x1:
853
856
setFormDisplay1x1View ( )
854
- //break // placeholder
855
857
}
856
858
857
859
// Setup the view shift buttons.
@@ -945,7 +947,7 @@ class KeyboardViewController: UIInputViewController {
945
947
deactivateBtn ( btn: btn)
946
948
}
947
949
case . view1x1:
948
- break // placeholder
950
+ break
949
951
}
950
952
}
951
953
@@ -1134,7 +1136,7 @@ class KeyboardViewController: UIInputViewController {
1134
1136
allConjugations = [ formLeft, formRight]
1135
1137
allConjugationBtns = get1x2FormDisplayButtons ( )
1136
1138
case . view1x1:
1137
- break // placeholder
1139
+ break
1138
1140
}
1139
1141
1140
1142
// Populate conjugation view buttons.
0 commit comments