Aperture: Always show sign on exposure slider value
Change-Id: Ie6da642e8e79270f40b2d9b0873ff4fcbd297bf7
diff --git a/app/src/main/java/org/lineageos/aperture/CameraActivity.kt b/app/src/main/java/org/lineageos/aperture/CameraActivity.kt
index 9ef0e36..2e828fe 100644
--- a/app/src/main/java/org/lineageos/aperture/CameraActivity.kt
+++ b/app/src/main/java/org/lineageos/aperture/CameraActivity.kt
@@ -16,6 +16,7 @@
import android.graphics.Rect
import android.graphics.drawable.AnimatedVectorDrawable
import android.graphics.drawable.ColorDrawable
+import android.icu.number.NumberFormatter
import android.location.Location
import android.location.LocationListener
import android.location.LocationManager
@@ -81,6 +82,7 @@
import org.lineageos.aperture.utils.ShortcutsUtils
import org.lineageos.aperture.utils.StorageUtils
import org.lineageos.aperture.utils.TimeUtils
+import java.util.Locale
import java.util.concurrent.ExecutorService
import java.util.concurrent.Executors
@@ -425,7 +427,8 @@
handler.sendMessageDelayed(handler.obtainMessage(MSG_HIDE_EXPOSURE_SLIDER), 2000)
}
exposureLevel.textFormatter = {
- Int.mapToRange(camera.exposureCompensationRange, it).toString()
+ EXPOSURE_LEVEL_FORMATTER.format(Int.mapToRange(camera.exposureCompensationRange, it))
+ .toString()
}
// Set primary bar button callbacks
@@ -1400,5 +1403,9 @@
private const val MSG_HIDE_ZOOM_SLIDER = 0
private const val MSG_HIDE_FOCUS_RING = 1
private const val MSG_HIDE_EXPOSURE_SLIDER = 2
+
+ private val EXPOSURE_LEVEL_FORMATTER = NumberFormatter.with()
+ .locale(Locale.US)
+ .sign(NumberFormatter.SignDisplay.EXCEPT_ZERO)
}
}