浏览代码

move magic numbers to value objects

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Andy Scherzinger 4 年之前
父节点
当前提交
d923a41696
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      app/src/main/java/com/nextcloud/talk/activities/FullScreenImageActivity.kt

+ 5 - 2
app/src/main/java/com/nextcloud/talk/activities/FullScreenImageActivity.kt

@@ -45,6 +45,9 @@ class FullScreenImageActivity : AppCompatActivity() {
 
 
     private var showFullscreen = false
     private var showFullscreen = false
 
 
+    private val maxScale = 6.0f
+    private val mediumScale = 2.45f
+
     override fun onCreateOptionsMenu(menu: Menu?): Boolean {
     override fun onCreateOptionsMenu(menu: Menu?): Boolean {
         menuInflater.inflate(R.menu.menu_preview, menu)
         menuInflater.inflate(R.menu.menu_preview, menu)
         return true
         return true
@@ -93,8 +96,8 @@ class FullScreenImageActivity : AppCompatActivity() {
 
 
         // Enable enlarging the image more than default 3x maximumScale.
         // Enable enlarging the image more than default 3x maximumScale.
         // Medium scale adapted to make double-tap behaviour more consistent.
         // Medium scale adapted to make double-tap behaviour more consistent.
-        binding.photoView.maximumScale = 6.0f
-        binding.photoView.mediumScale = 2.45f
+        binding.photoView.maximumScale = maxScale
+        binding.photoView.mediumScale = mediumScale
 
 
         val fileName = intent.getStringExtra("FILE_NAME")
         val fileName = intent.getStringExtra("FILE_NAME")
         val isGif = intent.getBooleanExtra("IS_GIF", false)
         val isGif = intent.getBooleanExtra("IS_GIF", false)