Hi everyone,
Today I am presenting you my brand new extension: Capacity Units!
1. Introduction
This extension helps you convert 2 different types of capacity units to each other: milliliters (mL) and liters (L).
Currently this is easy, no documentation is needed.
Next version: add cubic centimeters / decimeters / meters
2. Overview of Blocks
3. Downloads
AIX file: com.appybuilder.gordonlu0749.Capacity.aix (5.4 KB)
AIA test file: capacity_test.aia (6.3 KB)
Source code (for reference only)
import android.content.Context;
import android.util.Log;
import com.google.appinventor.components.annotations.*;
import com.google.appinventor.components.runtime.*;
import com.google.appinventor.components.common.ComponentCategory;
@DesignerComponent(version = 1, description = "This extension converts milliliters and litres to each other.",
category = ComponentCategory.EXTENSION,
nonVisible = true, iconName = "https://lh3.googleusercontent.com/ogw/ADea4I42VqEybFK87QSOLCsJXghDvdf0uhA3Rya5Li0g=s32-c-mo")
@SimpleObject(external = true)
public class Capacity extends AndroidNonvisibleComponent {
private ComponentContainer container;
/**
* @param container container, component will be placed in
*/
public Capacity(ComponentContainer container) {
super(container.$form());
this.container = container;
}
@SimpleFunction(description = "Converts milliliters to liters.")
public double MillilitersToLiters (double milliliters) {
return milliliters / 1000;
}
@SimpleFunction(description = "Converts liters to milliliters.")
public double LitersToMilliliters (double liters) {
return liters * 1000;
}
}
If you don't mind, please poll below.
Is this extension good?
- Yes, this extension is very good!
- No, this extension is not good.
0 voters