diff --git a/android/CHANGELOG.md b/android/CHANGELOG.md index ab8d968f..93858282 100644 --- a/android/CHANGELOG.md +++ b/android/CHANGELOG.md @@ -6,6 +6,14 @@ follow [https://changelog.md/](https://changelog.md/) guidelines. ## [Unreleased] +### FIXED + +## [51.2] - 2023-10-24 + +### FIXED + +- NPE when trying to recycling a QR bitmap before is was fully loaded. + ## [51.1] - 2023-10-17 ### ADDED @@ -36,7 +44,7 @@ request. - Satoshis copy in Select Bitcoin Unit screen. Now explicitly naming the option Satoshi (SAT), instead of Bitcoin (SAT). - Silence noisy DRM errors. -- Huge revamp to UI test suite. Enhancing reliability o coverage. +- Huge revamp to UI test suite. Enhancing reliability and coverage. ## [51] - 2023-07-28 diff --git a/android/apolloui/build.gradle b/android/apolloui/build.gradle index d3c6baa0..a8274261 100644 --- a/android/apolloui/build.gradle +++ b/android/apolloui/build.gradle @@ -87,8 +87,8 @@ android { applicationId "io.muun.apollo" minSdkVersion 19 targetSdkVersion 33 - versionCode 1101 - versionName "51.1" + versionCode 1102 + versionName "51.2" // Needed to make sure these classes are available in the main DEX file for API 19 // See: https://spin.atomicobject.com/2018/07/16/support-kitkat-multidex/ diff --git a/android/apolloui/src/main/java/io/muun/apollo/presentation/ui/show_qr/QrFragment.kt b/android/apolloui/src/main/java/io/muun/apollo/presentation/ui/show_qr/QrFragment.kt index 4c355841..7a7d65dd 100644 --- a/android/apolloui/src/main/java/io/muun/apollo/presentation/ui/show_qr/QrFragment.kt +++ b/android/apolloui/src/main/java/io/muun/apollo/presentation/ui/show_qr/QrFragment.kt @@ -100,7 +100,7 @@ abstract class QrFragment> : SingleFragment> : SingleFragmentmilliSatoshis of the form + * d * 10^x + 1, i.e. a single decimal digit d followed of x zeros. Those amounts are then + * perturbed by adding a single milliSatoshi. The exponent goes up to 15, which is the maximum + * amount of decimal digits representable by a double precision IEEE number + */ + @Parameters(name = "{index}: Amount {0,number,0.00000000000} btc") + public static Iterable allOrdersOfMagnitude() { + final List values = Lists.newArrayList(); + + for (int i = 1; i < DECIMAL_DIGITS; i++) { + values.add(multipleOfOneMilliSatoshi(0, i)); + } + for (int position = 1; position < DECIMAL_DIGITS_REPRESENTABLE_IN_DOUBLE; position++) { + for (int digit = 1; digit < DECIMAL_DIGITS; digit++) { + values.add(multipleOfOneMilliSatoshi(position, digit) + ONE_MILLI_SATOSHI_IN_BTC); + } + } + return values; + } + + /** + * Generates a BTC amount based on a quantity of milliSatoshis of the form + * digitValue * 10^digitPosition where digitValue + * is a number in [0, 9]. + * @param digitPosition the position of the digit + * @param digitValue the digit of the amount + * @return The BTC amount built as specified + */ + private static double multipleOfOneMilliSatoshi(int digitPosition, int digitValue) { + return ONE_MILLI_SATOSHI_IN_BTC * Math.pow(DECIMAL_DIGITS, digitPosition) * digitValue; + } +} \ No newline at end of file