Skip to content

Commit 41ec942

Browse files
committed
Fixed expression view not hiding
1 parent 8ee248e commit 41ec942

File tree

4 files changed

+11
-13
lines changed

4 files changed

+11
-13
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
- Added a setting for choosing the numpad layout: like a phone (top row 123) or a calculator (top row 789).
77
- Added a min value setting separate from max value. As a consequence, `setSignCanBeChanged` setting was removed, use a minimum or maximum of 0 instead. If the minimum or the maximum is 0, special error messages like "Result must be positive" will still be shown.
88
- Added `calcHeaderElevation`, `calcHeaderStyle`, `calcExpressionStyle` and `calcExpressionScrollViewStyle` style attributes.
9-
- Added getters to `CalcSettings` for Kotlin property syntax.
9+
- Added getters to `CalcSettings` for better Kotlin interoperability.
1010
- Added a `calcHeaderElevationDrawable` attribute, needed to customize the header before API 21.
1111
- Changed `setValue(BigDecimal)` to `setInitialValue(BigDecimal)`.
1212
- Changed `setClearOnOperation(Boolean)` to `setShouldEvaluateOnOperation(Boolean)`.

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ A fully customizable calculator dialog for Android compatible with API 16. Can b
66

77
Replace `X.Y.Z` with lastest version number: [ ![Download](https://api.bintray.com/packages/maltaisn/calc-dialog/calc-dialog/images/download.svg) ](https://bintray.com/maltaisn/calc-dialog/calc-dialog/_latestVersion)
88

9+
**WARNING:** version 2.0.0 introduces many breaking changes, like the changed package name. See the [changelog](/CHANGELOG.md) for the complete list of changes.
10+
911
If you haven't migrated to AndroidX, use version 1.3.2. Versions 1.4.0 and up use AndroidX.
1012

1113
## Tutorial
@@ -18,7 +20,7 @@ If you haven't migrated to AndroidX, use version 1.3.2. Versions 1.4.0 and up us
1820
(Screenshots date back to version 1.0.0)
1921

2022
## Changelog
21-
View [changelog](https://github.com/maltaisn/calcdialoglib/blob/master/CHANGELOG.md)
23+
View [changelog](/CHANGELOG.md)
2224

23-
## Translations
24-
The library is available in 16 languages. If you make a translation please make a pull request. There are less than 10 strings to translate, it's an easy task! Strings to translate are in `strings.xml`, do not translate those in `donottranslate.xml`. And no need to translate the demo app.
25+
## Translation
26+
The library is available in 16 languages. If you make a translation please make a pull request. Strings to translate are in `strings.xml`, do not translate those in `donottranslate.xml` and do not translate the demo app.

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
jcenter()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:3.3.1'
10+
classpath 'com.android.tools.build:gradle:3.3.2'
1111
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
1212
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
1313

calcdialog/src/main/java/com/maltaisn/calcdialog/CalcDialog.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -353,20 +353,16 @@ void sendValueResult(BigDecimal value) {
353353
}
354354

355355
void setExpressionVisible(boolean visible) {
356-
setViewVisible(expressionHsv, visible);
356+
expressionHsv.setVisibility(visible ? View.VISIBLE : View.GONE);
357357
}
358358

359359
void setAnswerBtnVisible(boolean visible) {
360-
setViewVisible(answerBtn, visible);
361-
setViewVisible(equalBtn, !visible);
360+
answerBtn.setVisibility(visible ? View.VISIBLE : View.INVISIBLE);
361+
equalBtn.setVisibility(visible ? View.INVISIBLE : View.VISIBLE);
362362
}
363363

364364
void setSignBtnVisible(boolean visible) {
365-
setViewVisible(signBtn, visible);
366-
}
367-
368-
private static void setViewVisible(View view, boolean visible) {
369-
view.setVisibility(visible ? View.VISIBLE : View.INVISIBLE);
365+
signBtn.setVisibility(visible ? View.VISIBLE : View.INVISIBLE);
370366
}
371367

372368
void setDecimalSepBtnEnabled(boolean enabled) {

0 commit comments

Comments
 (0)