From 96e661dbb96f26cbdd5af5db00b1ba9ceab69870 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 25 Mar 2017 10:47:40 +0100 Subject: [PATCH] remove some redundant viewpager variables --- .../gallery/activities/ViewPagerActivity.kt | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index b1fda4cc2..b4b393df7 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -2,7 +2,6 @@ package com.simplemobiletools.gallery.activities import android.app.Activity import android.content.Intent -import android.content.res.Configuration import android.database.Cursor import android.graphics.Bitmap import android.graphics.BitmapFactory @@ -13,7 +12,6 @@ import android.os.Build import android.os.Bundle import android.provider.MediaStore import android.support.v4.view.ViewPager -import android.util.DisplayMetrics import android.view.Menu import android.view.MenuItem import android.view.View @@ -51,12 +49,6 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private var mShowAll = false private var mRotationDegrees = 0f - companion object { - var screenWidth = 0 - var screenHeight = 0 - var screenDensity = 0f - } - override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_medium) @@ -66,7 +58,6 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View return } - measureScreen() val uri = intent.data if (uri != null) { var cursor: Cursor? = null @@ -166,19 +157,6 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View return true } - override fun onConfigurationChanged(newConfig: Configuration?) { - super.onConfigurationChanged(newConfig) - measureScreen() - } - - private fun measureScreen() { - val metrics = DisplayMetrics() - windowManager.defaultDisplay.getMetrics(metrics) - screenWidth = metrics.widthPixels - screenHeight = metrics.heightPixels - screenDensity = metrics.density - } - private fun updatePagerItems() { val pagerAdapter = MyPagerAdapter(this, supportFragmentManager, mMedia) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 && !isDestroyed) {