Added new units

This commit is contained in:
Sad Ellie 2022-04-14 21:11:50 +03:00
parent d76d4825df
commit 56d49e75c9
5 changed files with 27 additions and 2 deletions

View File

@ -1,5 +1,10 @@
package com.sadellie.unitto.data.units package com.sadellie.unitto.data.units
/**
* All UnitIDs. Long file.
*
* NEVER CHANGE IDS THAT ARE ALREADY HERE, THESE IDS ARE USED IN DATABASE
*/
object MyUnitIDS { object MyUnitIDS {
// LENGTH // LENGTH
@ -70,6 +75,7 @@ object MyUnitIDS {
const val kibibit = "kibibit" const val kibibit = "kibibit"
const val kilobit = "kilobit" const val kilobit = "kilobit"
const val megabit = "megabit" const val megabit = "megabit"
const val mebibit = "mebibit"
const val gigabit = "gigabit" const val gigabit = "gigabit"
const val terabit = "terabit" const val terabit = "terabit"
const val petabit = "petabit" const val petabit = "petabit"
@ -78,6 +84,7 @@ object MyUnitIDS {
const val kibibyte = "kibibyte" const val kibibyte = "kibibyte"
const val kilobyte = "kilobyte" const val kilobyte = "kilobyte"
const val megabyte = "megabyte" const val megabyte = "megabyte"
const val mebibyte = "mebibyte"
const val gigabyte = "gigabyte" const val gigabyte = "gigabyte"
const val terabyte = "terabyte" const val terabyte = "terabyte"
const val petabyte = "petabyte" const val petabyte = "petabyte"
@ -111,6 +118,7 @@ object MyUnitIDS {
const val nanosecond = "nanosecond" const val nanosecond = "nanosecond"
const val microsecond = "microsecond" const val microsecond = "microsecond"
const val millisecond = "millisecond" const val millisecond = "millisecond"
const val jiffy = "jiffy"
const val second = "second" const val second = "second"
const val minute = "minute" const val minute = "minute"
const val hour = "hour" const val hour = "hour"
@ -167,6 +175,7 @@ object MyUnitIDS {
const val kibibit_per_second = "kibibit_per_second" const val kibibit_per_second = "kibibit_per_second"
const val kilobit_per_second = "kilobit_per_second" const val kilobit_per_second = "kilobit_per_second"
const val megabit_per_second = "megabit_per_second" const val megabit_per_second = "megabit_per_second"
const val mebibit_per_second = "mebibit_per_second"
const val gigabit_per_second = "gigabit_per_second" const val gigabit_per_second = "gigabit_per_second"
const val terabit_per_second = "terabit_per_second" const val terabit_per_second = "terabit_per_second"
const val petabit_per_second = "petabit_per_second" const val petabit_per_second = "petabit_per_second"
@ -175,6 +184,7 @@ object MyUnitIDS {
const val kibibyte_per_second = "kibibyte_per_second" const val kibibyte_per_second = "kibibyte_per_second"
const val kilobyte_per_second = "kilobyte_per_second" const val kilobyte_per_second = "kilobyte_per_second"
const val megabyte_per_second = "megabyte_per_second" const val megabyte_per_second = "megabyte_per_second"
const val mebibyte_per_second = "mebibyte_per_second"
const val gigabyte_per_second = "gigabyte_per_second" const val gigabyte_per_second = "gigabyte_per_second"
const val terabyte_per_second = "terabyte_per_second" const val terabyte_per_second = "terabyte_per_second"
const val petabyte_per_second = "petabyte_per_second" const val petabyte_per_second = "petabyte_per_second"

View File

@ -13,6 +13,7 @@ val DATA_TRANSFER_COLLECTION: List<AbstractUnit> by lazy {
MyUnit(MyUnitIDS.kibibit_per_second, BigDecimal.valueOf(1_024), UnitGroup.DATA_TRANSFER, R.string.kibibit_per_second, R.string.kibibit_per_second_short), MyUnit(MyUnitIDS.kibibit_per_second, BigDecimal.valueOf(1_024), UnitGroup.DATA_TRANSFER, R.string.kibibit_per_second, R.string.kibibit_per_second_short),
MyUnit(MyUnitIDS.kilobit_per_second, BigDecimal.valueOf(1_000), UnitGroup.DATA_TRANSFER, R.string.kilobit_per_second, R.string.kilobit_per_second_short), MyUnit(MyUnitIDS.kilobit_per_second, BigDecimal.valueOf(1_000), UnitGroup.DATA_TRANSFER, R.string.kilobit_per_second, R.string.kilobit_per_second_short),
MyUnit(MyUnitIDS.megabit_per_second, BigDecimal.valueOf(1_000_000), UnitGroup.DATA_TRANSFER, R.string.megabit_per_second, R.string.megabit_per_second_short), MyUnit(MyUnitIDS.megabit_per_second, BigDecimal.valueOf(1_000_000), UnitGroup.DATA_TRANSFER, R.string.megabit_per_second, R.string.megabit_per_second_short),
MyUnit(MyUnitIDS.mebibit_per_second, BigDecimal.valueOf(1_048_576), UnitGroup.DATA_TRANSFER, R.string.mebibit_per_second, R.string.mebibit_per_second_short),
MyUnit(MyUnitIDS.gigabit_per_second, BigDecimal.valueOf(1_000_000_000), UnitGroup.DATA_TRANSFER, R.string.gigabit_per_second, R.string.gigabit_per_second_short), MyUnit(MyUnitIDS.gigabit_per_second, BigDecimal.valueOf(1_000_000_000), UnitGroup.DATA_TRANSFER, R.string.gigabit_per_second, R.string.gigabit_per_second_short),
MyUnit(MyUnitIDS.terabit_per_second, BigDecimal.valueOf(1_000_000_000_000), UnitGroup.DATA_TRANSFER, R.string.terabit_per_second, R.string.terabit_per_second_short), MyUnit(MyUnitIDS.terabit_per_second, BigDecimal.valueOf(1_000_000_000_000), UnitGroup.DATA_TRANSFER, R.string.terabit_per_second, R.string.terabit_per_second_short),
MyUnit(MyUnitIDS.petabit_per_second, BigDecimal.valueOf(1_000_000_000_000_000), UnitGroup.DATA_TRANSFER, R.string.petabit_per_second, R.string.petabit_per_second_short), MyUnit(MyUnitIDS.petabit_per_second, BigDecimal.valueOf(1_000_000_000_000_000), UnitGroup.DATA_TRANSFER, R.string.petabit_per_second, R.string.petabit_per_second_short),
@ -21,6 +22,7 @@ val DATA_TRANSFER_COLLECTION: List<AbstractUnit> by lazy {
MyUnit(MyUnitIDS.kibibyte_per_second, BigDecimal.valueOf(8_192), UnitGroup.DATA_TRANSFER, R.string.kibibyte_per_second, R.string.kibibyte_per_second_short), MyUnit(MyUnitIDS.kibibyte_per_second, BigDecimal.valueOf(8_192), UnitGroup.DATA_TRANSFER, R.string.kibibyte_per_second, R.string.kibibyte_per_second_short),
MyUnit(MyUnitIDS.kilobyte_per_second, BigDecimal.valueOf(8_000), UnitGroup.DATA_TRANSFER, R.string.kilobyte_per_second, R.string.kilobyte_per_second_short), MyUnit(MyUnitIDS.kilobyte_per_second, BigDecimal.valueOf(8_000), UnitGroup.DATA_TRANSFER, R.string.kilobyte_per_second, R.string.kilobyte_per_second_short),
MyUnit(MyUnitIDS.megabyte_per_second, BigDecimal.valueOf(8_000_000), UnitGroup.DATA_TRANSFER, R.string.megabyte_per_second, R.string.megabyte_per_second_short), MyUnit(MyUnitIDS.megabyte_per_second, BigDecimal.valueOf(8_000_000), UnitGroup.DATA_TRANSFER, R.string.megabyte_per_second, R.string.megabyte_per_second_short),
MyUnit(MyUnitIDS.mebibyte_per_second, BigDecimal.valueOf(8_388_608), UnitGroup.DATA_TRANSFER, R.string.mebibyte_per_second, R.string.mebibyte_per_second_short),
MyUnit(MyUnitIDS.gigabyte_per_second, BigDecimal.valueOf(8_000_000_000), UnitGroup.DATA_TRANSFER, R.string.gigabyte_per_second, R.string.gigabyte_per_second_short), MyUnit(MyUnitIDS.gigabyte_per_second, BigDecimal.valueOf(8_000_000_000), UnitGroup.DATA_TRANSFER, R.string.gigabyte_per_second, R.string.gigabyte_per_second_short),
MyUnit(MyUnitIDS.terabyte_per_second, BigDecimal.valueOf(8_000_000_000_000), UnitGroup.DATA_TRANSFER, R.string.terabyte_per_second, R.string.terabyte_per_second_short), MyUnit(MyUnitIDS.terabyte_per_second, BigDecimal.valueOf(8_000_000_000_000), UnitGroup.DATA_TRANSFER, R.string.terabyte_per_second, R.string.terabyte_per_second_short),
MyUnit(MyUnitIDS.petabyte_per_second, BigDecimal.valueOf(8_000_000_000_000_000), UnitGroup.DATA_TRANSFER, R.string.petabyte_per_second, R.string.petabyte_per_second_short), MyUnit(MyUnitIDS.petabyte_per_second, BigDecimal.valueOf(8_000_000_000_000_000), UnitGroup.DATA_TRANSFER, R.string.petabyte_per_second, R.string.petabyte_per_second_short),

View File

@ -13,6 +13,7 @@ val DATA_COLLECTION: List<AbstractUnit> by lazy {
MyUnit(MyUnitIDS.kibibit, BigDecimal.valueOf(1_024), UnitGroup.DATA, R.string.kibibit, R.string.kibibit_short), MyUnit(MyUnitIDS.kibibit, BigDecimal.valueOf(1_024), UnitGroup.DATA, R.string.kibibit, R.string.kibibit_short),
MyUnit(MyUnitIDS.kilobit, BigDecimal.valueOf(1_000), UnitGroup.DATA, R.string.kilobit, R.string.kilobit_short), MyUnit(MyUnitIDS.kilobit, BigDecimal.valueOf(1_000), UnitGroup.DATA, R.string.kilobit, R.string.kilobit_short),
MyUnit(MyUnitIDS.megabit, BigDecimal.valueOf(1_000_000), UnitGroup.DATA, R.string.megabit, R.string.megabit_short), MyUnit(MyUnitIDS.megabit, BigDecimal.valueOf(1_000_000), UnitGroup.DATA, R.string.megabit, R.string.megabit_short),
MyUnit(MyUnitIDS.mebibit, BigDecimal.valueOf(1_048_576), UnitGroup.DATA, R.string.mebibit, R.string.mebibit_short),
MyUnit(MyUnitIDS.gigabit, BigDecimal.valueOf(1_000_000_000), UnitGroup.DATA, R.string.gigabit, R.string.gigabit_short), MyUnit(MyUnitIDS.gigabit, BigDecimal.valueOf(1_000_000_000), UnitGroup.DATA, R.string.gigabit, R.string.gigabit_short),
MyUnit(MyUnitIDS.terabit, BigDecimal.valueOf(1_000_000_000_000), UnitGroup.DATA, R.string.terabit, R.string.terabit_short), MyUnit(MyUnitIDS.terabit, BigDecimal.valueOf(1_000_000_000_000), UnitGroup.DATA, R.string.terabit, R.string.terabit_short),
MyUnit(MyUnitIDS.petabit, BigDecimal.valueOf(1_000_000_000_000_000), UnitGroup.DATA, R.string.petabit, R.string.petabit_short), MyUnit(MyUnitIDS.petabit, BigDecimal.valueOf(1_000_000_000_000_000), UnitGroup.DATA, R.string.petabit, R.string.petabit_short),
@ -21,6 +22,7 @@ val DATA_COLLECTION: List<AbstractUnit> by lazy {
MyUnit(MyUnitIDS.kibibyte, BigDecimal.valueOf(8_192), UnitGroup.DATA, R.string.kibibyte, R.string.kibibyte_short), MyUnit(MyUnitIDS.kibibyte, BigDecimal.valueOf(8_192), UnitGroup.DATA, R.string.kibibyte, R.string.kibibyte_short),
MyUnit(MyUnitIDS.kilobyte, BigDecimal.valueOf(8_000), UnitGroup.DATA, R.string.kilobyte, R.string.kilobyte_short), MyUnit(MyUnitIDS.kilobyte, BigDecimal.valueOf(8_000), UnitGroup.DATA, R.string.kilobyte, R.string.kilobyte_short),
MyUnit(MyUnitIDS.megabyte, BigDecimal.valueOf(8_000_000), UnitGroup.DATA, R.string.megabyte, R.string.megabyte_short), MyUnit(MyUnitIDS.megabyte, BigDecimal.valueOf(8_000_000), UnitGroup.DATA, R.string.megabyte, R.string.megabyte_short),
MyUnit(MyUnitIDS.mebibyte, BigDecimal.valueOf(8_388_608), UnitGroup.DATA, R.string.mebibyte, R.string.mebibyte_short),
MyUnit(MyUnitIDS.gigabyte, BigDecimal.valueOf(8_000_000_000), UnitGroup.DATA, R.string.gigabyte, R.string.gigabyte_short), MyUnit(MyUnitIDS.gigabyte, BigDecimal.valueOf(8_000_000_000), UnitGroup.DATA, R.string.gigabyte, R.string.gigabyte_short),
MyUnit(MyUnitIDS.terabyte, BigDecimal.valueOf(8_000_000_000_000), UnitGroup.DATA, R.string.terabyte, R.string.terabyte_short), MyUnit(MyUnitIDS.terabyte, BigDecimal.valueOf(8_000_000_000_000), UnitGroup.DATA, R.string.terabyte, R.string.terabyte_short),
MyUnit(MyUnitIDS.petabyte, BigDecimal.valueOf(8_000_000_000_000_000), UnitGroup.DATA, R.string.petabyte, R.string.petabyte_short), MyUnit(MyUnitIDS.petabyte, BigDecimal.valueOf(8_000_000_000_000_000), UnitGroup.DATA, R.string.petabyte, R.string.petabyte_short),

View File

@ -13,6 +13,7 @@ val TIME_COLLECTION: List<AbstractUnit> by lazy {
MyUnit(MyUnitIDS.nanosecond, BigDecimal.valueOf(1_000_000_000), UnitGroup.TIME, R.string.nanosecond, R.string.nanosecond_short), MyUnit(MyUnitIDS.nanosecond, BigDecimal.valueOf(1_000_000_000), UnitGroup.TIME, R.string.nanosecond, R.string.nanosecond_short),
MyUnit(MyUnitIDS.microsecond, BigDecimal.valueOf(1_000_000_000_000), UnitGroup.TIME, R.string.microsecond, R.string.microsecond_short), MyUnit(MyUnitIDS.microsecond, BigDecimal.valueOf(1_000_000_000_000), UnitGroup.TIME, R.string.microsecond, R.string.microsecond_short),
MyUnit(MyUnitIDS.millisecond, BigDecimal.valueOf(1_000_000_000_000_000), UnitGroup.TIME, R.string.millisecond, R.string.millisecond_short), MyUnit(MyUnitIDS.millisecond, BigDecimal.valueOf(1_000_000_000_000_000), UnitGroup.TIME, R.string.millisecond, R.string.millisecond_short),
MyUnit(MyUnitIDS.jiffy, BigDecimal.valueOf(10_000_000_000_000_000), UnitGroup.TIME, R.string.jiffy, R.string.jiffy_short),
MyUnit(MyUnitIDS.second, BigDecimal.valueOf(1_000_000_000_000_000_000), UnitGroup.TIME, R.string.second, R.string.second_short), MyUnit(MyUnitIDS.second, BigDecimal.valueOf(1_000_000_000_000_000_000), UnitGroup.TIME, R.string.second, R.string.second_short),
MyUnit(MyUnitIDS.minute, BigDecimal.valueOf(60_000_000_000_000_000_000.0), UnitGroup.TIME, R.string.minute, R.string.minute_short), MyUnit(MyUnitIDS.minute, BigDecimal.valueOf(60_000_000_000_000_000_000.0), UnitGroup.TIME, R.string.minute, R.string.minute_short),
MyUnit(MyUnitIDS.hour, BigDecimal.valueOf(3_600_000_000_000_000_000_000.0), UnitGroup.TIME, R.string.hour, R.string.hour_short), MyUnit(MyUnitIDS.hour, BigDecimal.valueOf(3_600_000_000_000_000_000_000.0), UnitGroup.TIME, R.string.hour, R.string.hour_short),

View File

@ -128,6 +128,8 @@
<string name="kilobit_short">Kb</string> <string name="kilobit_short">Kb</string>
<string name="megabit">Megabit</string> <string name="megabit">Megabit</string>
<string name="megabit_short">Mb</string> <string name="megabit_short">Mb</string>
<string name="mebibit">Mebibit</string>
<string name="mebibit_short">Mib</string>
<string name="gigabit">Gigabit</string> <string name="gigabit">Gigabit</string>
<string name="gigabit_short">Gb</string> <string name="gigabit_short">Gb</string>
<string name="terabit">Terabit</string> <string name="terabit">Terabit</string>
@ -144,6 +146,8 @@
<string name="kilobyte_short">KB</string> <string name="kilobyte_short">KB</string>
<string name="megabyte">Megabyte</string> <string name="megabyte">Megabyte</string>
<string name="megabyte_short">MB</string> <string name="megabyte_short">MB</string>
<string name="mebibyte">Mebibyte</string>
<string name="mebibyte_short">MiB</string>
<string name="gigabyte">Gigabyte</string> <string name="gigabyte">Gigabyte</string>
<string name="gigabyte_short">GB</string> <string name="gigabyte_short">GB</string>
<string name="terabyte">Terabyte</string> <string name="terabyte">Terabyte</string>
@ -162,6 +166,8 @@
<string name="kilobit_per_second_short">Kb/s</string> <string name="kilobit_per_second_short">Kb/s</string>
<string name="megabit_per_second">Megabit per second</string> <string name="megabit_per_second">Megabit per second</string>
<string name="megabit_per_second_short">Mb/s</string> <string name="megabit_per_second_short">Mb/s</string>
<string name="mebibit_per_second">Mebibit per second</string>
<string name="mebibit_per_second_short">Mib/s</string>
<string name="gigabit_per_second">Gigabit per second</string> <string name="gigabit_per_second">Gigabit per second</string>
<string name="gigabit_per_second_short">Gb/s</string> <string name="gigabit_per_second_short">Gb/s</string>
<string name="terabit_per_second">Terabit per second</string> <string name="terabit_per_second">Terabit per second</string>
@ -178,6 +184,8 @@
<string name="kilobyte_per_second_short">KB/s</string> <string name="kilobyte_per_second_short">KB/s</string>
<string name="megabyte_per_second">Megabyte per second</string> <string name="megabyte_per_second">Megabyte per second</string>
<string name="megabyte_per_second_short">MB/s</string> <string name="megabyte_per_second_short">MB/s</string>
<string name="mebibyte_per_second">Mebibyte per second</string>
<string name="mebibyte_per_second_short">MiB/s</string>
<string name="gigabyte_per_second">Gigabyte per second</string> <string name="gigabyte_per_second">Gigabyte per second</string>
<string name="gigabyte_per_second_short">GB/s</string> <string name="gigabyte_per_second_short">GB/s</string>
<string name="terabyte_per_second">Terabyte per second</string> <string name="terabyte_per_second">Terabyte per second</string>
@ -240,6 +248,8 @@
<string name="microsecond_short">µs</string> <string name="microsecond_short">µs</string>
<string name="millisecond">Millisecond</string> <string name="millisecond">Millisecond</string>
<string name="millisecond_short">ms</string> <string name="millisecond_short">ms</string>
<string name="jiffy">Jiffy</string>
<string name="jiffy_short">j</string>
<string name="second">Second</string> <string name="second">Second</string>
<string name="second_short">s</string> <string name="second_short">s</string>
<string name="minute">Minute</string> <string name="minute">Minute</string>