use a different function for getting screen size on kitkat
This commit is contained in:
parent
ec22c274dd
commit
28a2f59514
|
@ -402,9 +402,15 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
|
||||
private fun measureScreen() {
|
||||
val metrics = DisplayMetrics()
|
||||
windowManager.defaultDisplay.getRealMetrics(metrics)
|
||||
screenWidth = metrics.widthPixels
|
||||
screenHeight = metrics.heightPixels
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
|
||||
windowManager.defaultDisplay.getRealMetrics(metrics)
|
||||
screenWidth = metrics.widthPixels
|
||||
screenHeight = metrics.heightPixels
|
||||
} else {
|
||||
windowManager.defaultDisplay.getMetrics(metrics)
|
||||
screenWidth = metrics.widthPixels
|
||||
screenHeight = metrics.heightPixels
|
||||
}
|
||||
}
|
||||
|
||||
private fun reloadViewPager() {
|
||||
|
|
Loading…
Reference in New Issue