-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
451f37c
commit 98190bb
Showing
13 changed files
with
312 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
app/src/main/java/net/youapps/calcyou/data/converters/AngleConverter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package net.youapps.calcyou.data.converters | ||
|
||
import net.youapps.calcyou.R | ||
|
||
class AngleConverter : UnitConverter { | ||
override val units: List<ConverterUnit> = listOf( | ||
FactorUnit(R.string.degree, Math.PI / 180), | ||
FactorUnit(R.string.radian, 1.0), | ||
FactorUnit(R.string.gradian, Math.PI / 200), | ||
FactorUnit(R.string.turn, 2 * Math.PI) | ||
) | ||
} | ||
|
12 changes: 12 additions & 0 deletions
12
app/src/main/java/net/youapps/calcyou/data/converters/DensityConverter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package net.youapps.calcyou.data.converters | ||
|
||
import net.youapps.calcyou.R | ||
|
||
class DensityConverter : UnitConverter { | ||
override val units: List<ConverterUnit> = listOf( | ||
FactorUnit(R.string.kilogram_per_cubic_meter, 1.0), | ||
FactorUnit(R.string.gram_per_cubic_centimeter, 1E3), | ||
FactorUnit(R.string.pound_per_cubic_foot, 16.018463), | ||
FactorUnit(R.string.pound_per_gallon, 0.11982642) | ||
) | ||
} |
13 changes: 13 additions & 0 deletions
13
app/src/main/java/net/youapps/calcyou/data/converters/EnergyConverter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package net.youapps.calcyou.data.converters | ||
|
||
import net.youapps.calcyou.R | ||
|
||
class EnergyConverter : UnitConverter { | ||
override val units: List<ConverterUnit> = listOf( | ||
FactorUnit(R.string.joule, 1.0), | ||
FactorUnit(R.string.kilojoule, 1E3), | ||
FactorUnit(R.string.megajoule, 1E6), | ||
FactorUnit(R.string.calorie, 4.184), | ||
FactorUnit(R.string.kilocalorie, 4.184E3) | ||
) | ||
} |
13 changes: 13 additions & 0 deletions
13
app/src/main/java/net/youapps/calcyou/data/converters/ForceConverter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package net.youapps.calcyou.data.converters | ||
|
||
import net.youapps.calcyou.R | ||
|
||
class ForceConverter : UnitConverter { | ||
override val units: List<ConverterUnit> = listOf( | ||
FactorUnit(R.string.newton, 1.0), | ||
FactorUnit(R.string.kilonewton, 1E3), | ||
FactorUnit(R.string.dyne, 1E-5), | ||
FactorUnit(R.string.pound_force, 4.448222), | ||
FactorUnit(R.string.ounce_force, 0.2780139) | ||
) | ||
} |
12 changes: 12 additions & 0 deletions
12
app/src/main/java/net/youapps/calcyou/data/converters/FuelConverter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package net.youapps.calcyou.data.converters | ||
|
||
import net.youapps.calcyou.R | ||
|
||
class FuelConverter : UnitConverter { | ||
override val units: List<ConverterUnit> = listOf( | ||
FactorUnit(R.string.liter, 1.0), | ||
FactorUnit(R.string.gallon_us, 3.78541), | ||
FactorUnit(R.string.gallon_uk, 4.54609), | ||
FactorUnit(R.string.barrel, 158.98729) | ||
) | ||
} |
12 changes: 12 additions & 0 deletions
12
app/src/main/java/net/youapps/calcyou/data/converters/LightConverter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package net.youapps.calcyou.data.converters | ||
|
||
import net.youapps.calcyou.R | ||
|
||
class LightConverter : UnitConverter { | ||
override val units: List<ConverterUnit> = listOf( | ||
FactorUnit(R.string.lumen, 1.0), | ||
FactorUnit(R.string.candela, 1.0), | ||
FactorUnit(R.string.lux, 1.0 / 3.14159), // Lumen per square meter | ||
FactorUnit(R.string.footcandle, 10.7639104167097) | ||
) | ||
} |
13 changes: 13 additions & 0 deletions
13
app/src/main/java/net/youapps/calcyou/data/converters/PowerConverter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package net.youapps.calcyou.data.converters | ||
|
||
import net.youapps.calcyou.R | ||
|
||
class PowerConverter : UnitConverter { | ||
override val units: List<ConverterUnit> = listOf( | ||
FactorUnit(R.string.watt, 1.0), | ||
FactorUnit(R.string.kilowatt, 1E3), | ||
FactorUnit(R.string.megawatt, 1E6), | ||
FactorUnit(R.string.horsepower, 745.7), | ||
FactorUnit(R.string.btu_per_hour, 252.0) | ||
) | ||
} |
16 changes: 16 additions & 0 deletions
16
app/src/main/java/net/youapps/calcyou/data/converters/PressureConverter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package net.youapps.calcyou.data.converters | ||
|
||
import net.youapps.calcyou.R | ||
|
||
class PressureConverter : UnitConverter { | ||
override val units: List<ConverterUnit> = listOf( | ||
FactorUnit(R.string.pascal, 1.0), | ||
FactorUnit(R.string.kilopascal, 1E3), | ||
FactorUnit(R.string.megapascal, 1E6), | ||
FactorUnit(R.string.gigapascal, 1E9), | ||
FactorUnit(R.string.bar, 1E5), | ||
FactorUnit(R.string.millibar, 1E2), | ||
FactorUnit(R.string.atmosphere, 101325.0), | ||
FactorUnit(R.string.psi, 6894.757293168) // Pounds per Square Inch | ||
) | ||
} |
13 changes: 13 additions & 0 deletions
13
app/src/main/java/net/youapps/calcyou/data/converters/TimeConverter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package net.youapps.calcyou.data.converters | ||
|
||
import net.youapps.calcyou.R | ||
|
||
class TimeConverter : UnitConverter { | ||
override val units: List<ConverterUnit> = listOf( | ||
FactorUnit(R.string.second, 1.0), | ||
FactorUnit(R.string.minute, 60.0), | ||
FactorUnit(R.string.hour, 3.6E3), | ||
FactorUnit(R.string.day, 8.64E4), | ||
FactorUnit(R.string.week, 6.048E5) | ||
) | ||
} |
12 changes: 12 additions & 0 deletions
12
app/src/main/java/net/youapps/calcyou/data/converters/TorqueConverter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package net.youapps.calcyou.data.converters | ||
|
||
import net.youapps.calcyou.R | ||
|
||
class TorqueConverter : UnitConverter { | ||
override val units: List<ConverterUnit> = listOf( | ||
FactorUnit(R.string.newton_meter, 1.0), | ||
FactorUnit(R.string.kilonewton_meter, 1E3), | ||
FactorUnit(R.string.pound_foot, 1.3558179), | ||
FactorUnit(R.string.ounce_inch, 0.08333333) | ||
) | ||
} |
12 changes: 12 additions & 0 deletions
12
app/src/main/java/net/youapps/calcyou/data/converters/ViscosityConverter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package net.youapps.calcyou.data.converters | ||
|
||
import net.youapps.calcyou.R | ||
|
||
class ViscosityConverter : UnitConverter { | ||
override val units: List<ConverterUnit> = listOf( | ||
FactorUnit(R.string.pascal_second, 1.0), | ||
FactorUnit(R.string.centipoise, 0.01), | ||
FactorUnit(R.string.stoke, 1E4), | ||
FactorUnit(R.string.poiseuille, 1E9) | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters