Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for "are" unit of area #115

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class Unit {
public static final int SQ_FOOT = 6;
public static final int SQ_INCH = 7;
public static final int ACRE = 8;
public static final int ARE = 9;

public static final int AUD = 1300;
public static final int BGN = 1301;
Expand Down Expand Up @@ -189,7 +190,7 @@ public class Unit {
public static final int CUBIC_FOOT = 1218;
public static final int CUBIC_YARD = 1219;

@IntDef({SQ_KILOMETRES, SQ_METRES, SQ_CENTIMETRES, HECTARE, SQ_MILE, SQ_YARD, SQ_FOOT, SQ_INCH, ACRE,
@IntDef({SQ_KILOMETRES, SQ_METRES, SQ_CENTIMETRES, HECTARE, SQ_MILE, SQ_YARD, SQ_FOOT, SQ_INCH, ACRE, ARE,
AUD, BGN, BRL, CDN, CHF, CNY, CZK, DKK, EUR, GBP, HKD, HRK, HUF, IDR, ILS, INR, JPY, KRW, MXN, MYR, NOK, NZD, PHP, PLN, RON, RUB, SEK, SGD, THB, LIRA, USD, ZAR,
BIT, BYTE, KILOBIT, KILOBYTE, MEGABIT, MEGABYTE, GIGABIT, GIGABYTE, TERABIT, TERABYTE,
JOULE, KILOJOULE, CALORIE, KILOCALORIE, BTU, FT_LBF, IN_LBF, KILOWATT_HOUR, ELECTRON_VOLT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ private void getAreaConversions() {
units.add(new Unit(SQ_FOOT, R.string.sq_foot, 0.09290304, 10.7639104167097223));
units.add(new Unit(SQ_INCH, R.string.sq_inch, 0.00064516, 1550.00310000620001));
units.add(new Unit(ACRE, R.string.acre, 4046.8564224, 0.000247105381467165342));
units.add(new Unit(ARE, R.string.are, 100.0, 0.01));
addConversion(Conversion.AREA, new Conversion(Conversion.AREA, R.string.area, units));
}

Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
<string name="sq_foot">Quadratfuß</string>
<string name="sq_inch">Quadratzoll</string>
<string name="acre">Acre</string>
<string name="are">Ar</string>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's Ar in German; Are seems to be only Swiss German according to Wikipedia.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When building and running this pull request's branch locally, I see this when the language is set to English:

screenshot_2018-07-01-15-55-57 1

and this when the language is switched to German:

screenshot_2018-07-01-15-56-12 1

Is that correct, or do I misunderstand the problem?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that's correct – looks like I got a bit confused for some reason.


<!-- Digital Storage -->
<string name="bit">Bit</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
<string name="sq_foot">Pied carré</string>
<string name="sq_inch">Pouce Carré</string>
<string name="acre">Acre</string>
<string name="are">Are</string>

<!-- Digital Storage -->
<string name="bit">Bit</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
<string name="sq_foot">Sq Foot</string>
<string name="sq_inch">Sq Inch</string>
<string name="acre">Acre</string>
<string name="are">Are</string>

<!-- Digital Storage -->
<string name="bit">Bit</string>
Expand Down