Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b1a092c7 authored by Niels Egberts's avatar Niels Egberts
Browse files

Add money as a new TtsSpan type.

Added ARG_QUANTITY to decimal so money and measure can 'inherit' it.

Change-Id: I0f9f464d198a9875df4a01e8a5c95a3d19ed6f7f
parent 738177ca
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -31096,6 +31096,7 @@ package android.text.style {
    field public static final java.lang.String ARG_ANIMACY = "android.arg.animacy";
    field public static final java.lang.String ARG_CASE = "android.arg.case";
    field public static final java.lang.String ARG_COUNTRY_CODE = "android.arg.country_code";
    field public static final java.lang.String ARG_CURRENCY = "android.arg.money";
    field public static final java.lang.String ARG_DAY = "android.arg.day";
    field public static final java.lang.String ARG_DENOMINATOR = "android.arg.denominator";
    field public static final java.lang.String ARG_DIGITS = "android.arg.digits";
@@ -31116,6 +31117,7 @@ package android.text.style {
    field public static final java.lang.String ARG_PATH = "android.arg.path";
    field public static final java.lang.String ARG_PORT = "android.arg.port";
    field public static final java.lang.String ARG_PROTOCOL = "android.arg.protocol";
    field public static final java.lang.String ARG_QUANTITY = "android.arg.quantity";
    field public static final java.lang.String ARG_QUERY_STRING = "android.arg.query_string";
    field public static final java.lang.String ARG_TEXT = "android.arg.text";
    field public static final java.lang.String ARG_UNIT = "android.arg.unit";
@@ -31156,6 +31158,7 @@ package android.text.style {
    field public static final java.lang.String TYPE_ELECTRONIC = "android.type.electronic";
    field public static final java.lang.String TYPE_FRACTION = "android.type.fraction";
    field public static final java.lang.String TYPE_MEASURE = "android.type.measure";
    field public static final java.lang.String TYPE_MONEY = "android.type.money";
    field public static final java.lang.String TYPE_ORDINAL = "android.type.ordinal";
    field public static final java.lang.String TYPE_TELEPHONE = "android.type.telephone";
    field public static final java.lang.String TYPE_TEXT = "android.type.text";
+45 −9
Original line number Diff line number Diff line
@@ -141,6 +141,17 @@ public class TtsSpan implements ParcelableSpan {
     */
    public static final String TYPE_ELECTRONIC = "android.type.electronic";

    /**
     * The text associated with this span is an amount of money. Set the amount
     * with the same arguments as {@link #TYPE_DECIMAL}.
     * {@link #ARG_CURRENCY} is used to set the currency. {@link #ARG_QUANTITY}
     * is optional.
     * Also accepts the arguments {@link #ARG_GENDER},
     * {@link #ARG_ANIMACY}, {@link #ARG_MULTIPLICITY} and
     * {@link #ARG_CASE}.
     */
    public static final String TYPE_MONEY = "android.type.money";

    /**
     * The text associated with this span is a series of digits that have to be
     * read sequentially. {@link #ARG_DIGITS} is required.
@@ -241,6 +252,24 @@ public class TtsSpan implements ParcelableSpan {
    public static final String ARG_FRACTIONAL_PART =
        "android.arg.fractional_part";

    /**
     * Argument used to choose the suffix (thousand, million, etc) that is used
     * to pronounce large amounts of money. For example it can be used to
     * disambiguate between "two thousand five hundred dollars" and
     * "two point five thousand dollars".
     * If implemented, engines should support at least "1000", "1000000",
     * "1000000000" and "1000000000000".
     * Example: if the {@link #ARG_INTEGER_PART} argument is "10", the
     * {@link #ARG_FRACTIONAL_PART} argument is "4", the {@link #ARG_QUANTITY}
     * argument is "1000" and the {@link #ARG_CURRENCY} argument is "usd", the
     * TTS engine may pronounce the span as "ten point four thousand dollars".
     * With the same example but with the quantity set as "1000000" the TTS
     * engine may pronounce the span as "ten point four million dollars".
     * Can be used with {@link #TYPE_MONEY}.
     */
    public static final String ARG_QUANTITY =
            "android.arg.quantity";

    /**
     * Argument used to specify the numerator of a fraction. The value can be a
     * string of digits of any size optionally prefixed with a - or +.
@@ -259,9 +288,9 @@ public class TtsSpan implements ParcelableSpan {
     * Argument used to specify the unit of a measure. The unit should always be
     * specified in English singular form. Prefixes may be used. Engines will do
     * their best to pronounce them correctly in the language used. Engines are
     * expected to at least support the most common ones like 'meter', 'second',
     * 'degree celcius' and 'degree fahrenheit' with some common prefixes like
     * 'milli' and 'kilo'.
     * expected to at least support the most common ones like "meter", "second",
     * "degree celcius" and "degree fahrenheit" with some common prefixes like
     * "milli" and "kilo".
     * Can be used with {@link #TYPE_MEASURE}.
     */
    public static final String ARG_UNIT = "android.arg.unit";
@@ -357,8 +386,8 @@ public class TtsSpan implements ParcelableSpan {
    public static final String ARG_EXTENSION = "android.arg.extension";

    /**
     * Argument used to specify the protocol of a URI. Examples are 'http' and
     * 'ftp'.
     * Argument used to specify the protocol of a URI. Examples are "http" and
     * "ftp".
     * Can be used with {@link #TYPE_ELECTRONIC}.
     */
    public static final String ARG_PROTOCOL = "android.arg.protocol";
@@ -378,8 +407,8 @@ public class TtsSpan implements ParcelableSpan {
    public static final String ARG_PASSWORD = "android.arg.password";

    /**
     * Argument used to specify the domain part of a URI. For example are
     * 'source.android.com'.
     * Argument used to specify the domain part of a URI. For example
     * "source.android.com".
     * Can be used with {@link #TYPE_ELECTRONIC}.
     */
    public static final String ARG_DOMAIN = "android.arg.domain";
@@ -393,14 +422,14 @@ public class TtsSpan implements ParcelableSpan {

    /**
     * Argument used to specify the path part of a URI. For example
     * 'source/index.html'.
     * "source/index.html".
     * Can be used with {@link #TYPE_ELECTRONIC}.
     */
    public static final String ARG_PATH = "android.arg.path";

    /**
     * Argument used to specify the query string of a URI. For example
     * 'arg=value&argtwo=value'.
     * "arg=value&argtwo=value".
     * Can be used with {@link #TYPE_ELECTRONIC}.
     */
    public static final String ARG_QUERY_STRING = "android.arg.query_string";
@@ -412,6 +441,13 @@ public class TtsSpan implements ParcelableSpan {
     */
    public static final String ARG_FRAGMENT_ID = "android.arg.fragment_id";

    /**
     * Argument used to specify the currency. Should be a ISO4217 currency code,
     * e.g. "USD".
     * Can be used with {@link #TYPE_MONEY}.
     */
    public static final String ARG_CURRENCY = "android.arg.money";

    /**
     * Argument used to specify a string of digits.
     * Can be used with {@link #TYPE_DIGITS}.