@ajuarezso/capacitor-liquid-glass 0.3.5 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -114,19 +114,20 @@ final class LiquidGlassTabBarOverlay: UIViewController {
|
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
hostVC.addChild(self)
|
|
117
|
-
self.view.translatesAutoresizingMaskIntoConstraints = false
|
|
118
117
|
hostVC.view.addSubview(self.view)
|
|
118
|
+
self.view.translatesAutoresizingMaskIntoConstraints = false
|
|
119
|
+
// CRÍTICO: `didMove(toParent:)` ANTES de activar constraints. iOS 26
|
|
120
|
+
// ejecuta el primer layout pass al didMove; tener el parenting
|
|
121
|
+
// completo antes de que el sistema mida el UITabBar es lo que el
|
|
122
|
+
// heurístico de Liquid Glass auto-adopt espera (patrón stay-liquid).
|
|
123
|
+
self.didMove(toParent: hostVC)
|
|
119
124
|
// SIN top constraint — la altura del view se deriva del intrinsic
|
|
120
125
|
// content size del UITabBar dentro (~50pt + safe-area-bottom).
|
|
121
|
-
// Replica del patrón stay-liquid (validado en producción) que
|
|
122
|
-
// permite a iOS 26 detectar este UITabBar como "floating tab bar"
|
|
123
|
-
// y aplicarle Liquid Glass automáticamente.
|
|
124
126
|
NSLayoutConstraint.activate([
|
|
125
127
|
self.view.leadingAnchor.constraint(equalTo: hostVC.view.leadingAnchor),
|
|
126
128
|
self.view.trailingAnchor.constraint(equalTo: hostVC.view.trailingAnchor),
|
|
127
129
|
self.view.bottomAnchor.constraint(equalTo: hostVC.view.bottomAnchor),
|
|
128
130
|
])
|
|
129
|
-
self.didMove(toParent: hostVC)
|
|
130
131
|
self.hostVC = hostVC
|
|
131
132
|
emitLayout()
|
|
132
133
|
}
|
|
@@ -190,7 +191,12 @@ final class LiquidGlassTabBarOverlay: UIViewController {
|
|
|
190
191
|
return tab
|
|
191
192
|
}
|
|
192
193
|
|
|
193
|
-
tabBar.
|
|
194
|
+
// CRÍTICO: setter directo `tabBar.items = ...` en lugar de
|
|
195
|
+
// `tabBar.setItems(_, animated: false)`. En iOS 26 el método
|
|
196
|
+
// `setItems(animated:)` toma un path interno distinto que puede
|
|
197
|
+
// invalidar el adopt automático de Liquid Glass. El setter directo
|
|
198
|
+
// es el que stay-liquid usa (línea 98 de su TabsBarOverlay).
|
|
199
|
+
tabBar.items = uiItems
|
|
194
200
|
|
|
195
201
|
if selectedIndex < 0 {
|
|
196
202
|
tabBar.selectedItem = nil
|
|
@@ -214,41 +220,23 @@ final class LiquidGlassTabBarOverlay: UIViewController {
|
|
|
214
220
|
tabBarItems[idx].badgeValue = value
|
|
215
221
|
}
|
|
216
222
|
|
|
223
|
+
/// CRÍTICO: NO tocar `tabBar.alpha`, `tabBar.transform` ni `tabBar.isHidden`.
|
|
224
|
+
/// iOS 26 inspecciona el UITabBar en el primer layout pass para decidir si
|
|
225
|
+
/// adopta Liquid Glass. Si en ese momento el bar está con `alpha=0` o un
|
|
226
|
+
/// `transform` distinto de `.identity`, el sistema descarta el adopt y NO
|
|
227
|
+
/// re-evalúa aunque después vuelva a valores normales.
|
|
228
|
+
///
|
|
229
|
+
/// Para animar la aparición/desaparición sin perder el adopt, se manipula
|
|
230
|
+
/// `self.view.isHidden` (el contenedor del VC), no el UITabBar mismo.
|
|
231
|
+
/// Patrón validado en stay-liquid (su `update()` simplemente hace
|
|
232
|
+
/// `view.isHidden = !visible`).
|
|
217
233
|
func show() {
|
|
218
|
-
|
|
219
|
-
tabBar.isHidden = false
|
|
220
|
-
tabBar.alpha = 0
|
|
221
|
-
tabBar.transform = CGAffineTransform(translationX: 0, y: 20)
|
|
222
|
-
UIView.animate(
|
|
223
|
-
withDuration: 0.28,
|
|
224
|
-
delay: 0,
|
|
225
|
-
usingSpringWithDamping: 0.85,
|
|
226
|
-
initialSpringVelocity: 0,
|
|
227
|
-
options: [.curveEaseOut, .allowUserInteraction],
|
|
228
|
-
animations: {
|
|
229
|
-
self.tabBar.alpha = 1
|
|
230
|
-
self.tabBar.transform = .identity
|
|
231
|
-
},
|
|
232
|
-
completion: nil
|
|
233
|
-
)
|
|
234
|
+
view.isHidden = false
|
|
234
235
|
emitLayout()
|
|
235
236
|
}
|
|
236
237
|
|
|
237
238
|
func hide() {
|
|
238
|
-
|
|
239
|
-
UIView.animate(
|
|
240
|
-
withDuration: 0.18,
|
|
241
|
-
delay: 0,
|
|
242
|
-
options: [.curveEaseIn, .allowUserInteraction],
|
|
243
|
-
animations: {
|
|
244
|
-
self.tabBar.alpha = 0
|
|
245
|
-
self.tabBar.transform = CGAffineTransform(translationX: 0, y: 20)
|
|
246
|
-
},
|
|
247
|
-
completion: { _ in
|
|
248
|
-
self.tabBar.isHidden = true
|
|
249
|
-
self.tabBar.transform = .identity
|
|
250
|
-
}
|
|
251
|
-
)
|
|
239
|
+
view.isHidden = true
|
|
252
240
|
}
|
|
253
241
|
|
|
254
242
|
func setSelectedIndex(_ index: Int) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ajuarezso/capacitor-liquid-glass",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.6",
|
|
4
4
|
"description": "iOS 26 Liquid Glass native chrome (TabBar, NavigationBar, Alerts, Sheets) for Capacitor apps. Falls back gracefully on iOS < 26 and Android.",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|