mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47:59 +01:00
use a different function for getting screen size on kitkat
This commit is contained in:
parent
ec22c274dd
commit
28a2f59514
1 changed files with 9 additions and 3 deletions
|
@ -402,9 +402,15 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
|
||||
private fun measureScreen() {
|
||||
val metrics = DisplayMetrics()
|
||||
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 a new issue