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() {
|
private fun measureScreen() {
|
||||||
val metrics = DisplayMetrics()
|
val metrics = DisplayMetrics()
|
||||||
windowManager.defaultDisplay.getRealMetrics(metrics)
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
|
||||||
screenWidth = metrics.widthPixels
|
windowManager.defaultDisplay.getRealMetrics(metrics)
|
||||||
screenHeight = metrics.heightPixels
|
screenWidth = metrics.widthPixels
|
||||||
|
screenHeight = metrics.heightPixels
|
||||||
|
} else {
|
||||||
|
windowManager.defaultDisplay.getMetrics(metrics)
|
||||||
|
screenWidth = metrics.widthPixels
|
||||||
|
screenHeight = metrics.heightPixels
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun reloadViewPager() {
|
private fun reloadViewPager() {
|
||||||
|
|
Loading…
Reference in New Issue