LiquidProgress - Liquid progress within any image.

LiquidProgress
Liquid progress within any image.

GIF_20250406_043939_618

Progress is shifted sideways by a motion sensor based on the device's orientation, and shaking it creates a very short sine wave.


GIF_20250429_013236_446

The images on the left side have their normal color, those on the right side have the color applied with the LiquidColor function.


LoadImage

Load image from assets and prepare grayscale version.

The image is converted to grayscale and then colored back to its original color by calling LiquidProgress.


LiquidProgress

Set the progress (0.0 to 1.0).

The default value is 0.0 to 1.0, but you can multiply by 100 if you want to use a value between 0 and 100.

I've included the example in the aia project.


LiquidColor

A tint color (ARGB) to the liquid fill.

Add transparency if the image has multiple colors so that they can be seen inked.

  • If no transparency is added, the image will be covered with a solid color.

LiquidEffectEnabled

Enable or disable the liquid effect for a specific ID.

If it is false it will disable the motion sensor and the waves of the established id, but there will still be a slight movement, but it will not be tilt or wave.


AllLiquidEffectEnabled

Enable or disable the liquid effect for all IDs.

If false, it will disable the motion sensor and waves.


ReleaseResources

Free all resources and unregister sensor to avoid memory leaks.


ProgressCompleted

Triggered when the liquid progress reaches 100% (1.0).


v1.1 April 29, 2025.

LiquidProgress.aia (32.2 KB)

joejsanz.joedevliquidprogress.aix (13.8 KB)


JDK: 11
Minimum API Level: 21
Updated On: 2025-04-29T07:00:00Z

Built using: FAST-CLI v3.1.0


Thanks.

10 Likes

Very funny extension !

1 Like

Is this extension loading images only from assets?

You can also use URLs, but for some reason if you use more than one, the progress looks weird, but using just one URL is fine.

https://png.pngtree.com/png-clipart/20221019/original/pngtree-whatsapp-icon-png-image_8704827.png

1 Like

Existe la posibilidad de que no utilice los acelerómetros? es decir... no necesito el movimiento de balanceo. Gracias y estupenda extensión

1 Like

Muchas gracias Miguel

Si, en la próxima actualización haré que sea opcional.

2 Likes

Muchísimas gracias, es más que nada porque tengo la sensación de que con la animación se hace muy pesada la extensión y al crear varios depósitos hace que no vaya fluida y de vez en cuando se me congela mi app. Seguiré con atención la actualización :wink:

Probablemente si pasa por eso, por que consume mucho recurso por el sensor de movimiento.
En un rato mas subire la actualizacion, espero te funcione bien, si no, me avisas.

Update v1.1 April 29, 2025.

2 Likes


Joel me gusta mucho la idea pero los bloques AllLiquidEffectEnabled, LiquidEffectEnabled y ReleaseResources hace que no me lea bien los porcentajes

Sólo añadí Call Deca 12 .AllLiquidEffectEnabled como False y no consigo que me llene el depósito como quiero, si lo pongo True si que lo llena cuando pongo 9000 Kilos que es como lo tengo configurado, pero entonces activa los efectos que es lo que quiero quitar. Muchas Gracias y fantástico trabajo

1 Like

Solo en el 12 te falla así como tienes los bloques en la imagen?

Pon la función 'AllLiquidEffectEnabled' hasta arriba de todos los LoadImage, arriba del Dec_12 para ver si cambia algo.

Si no, en la noche ya que regrese a la computadora replicare las 12 que tienes para ver qué puede estar ocasionando el problema.