remove some redundant viewpager variables

This commit is contained in:
tibbi 2017-03-25 10:47:40 +01:00
parent dda66bf127
commit 96e661dbb9

View file

@ -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) {