use a black background at fullscreen media if selected so

This commit is contained in:
tibbi 2017-05-14 12:01:16 +02:00
parent a780d36a6e
commit dccca19844
2 changed files with 6 additions and 1 deletions

View File

@ -7,7 +7,9 @@ import android.content.res.Configuration
import android.database.Cursor import android.database.Cursor
import android.graphics.Bitmap import android.graphics.Bitmap
import android.graphics.BitmapFactory import android.graphics.BitmapFactory
import android.graphics.Color
import android.graphics.Matrix import android.graphics.Matrix
import android.graphics.drawable.ColorDrawable
import android.hardware.SensorManager import android.hardware.SensorManager
import android.media.ExifInterface import android.media.ExifInterface
import android.net.Uri import android.net.Uri
@ -100,6 +102,9 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
reloadViewPager() reloadViewPager()
scanPath(mPath) {} scanPath(mPath) {}
setupOrientationEventListener() setupOrientationEventListener()
if (config.darkBackground)
view_pager.background = ColorDrawable(Color.BLACK)
} }
private fun setupOrientationEventListener() { private fun setupOrientationEventListener() {

View File

@ -204,7 +204,7 @@ class PhotoFragment : ViewPagerFragment() {
} }
override fun onReady() { override fun onReady() {
background = ColorDrawable(context.config.backgroundColor) background = ColorDrawable(if (context.config.darkBackground) Color.BLACK else context.config.backgroundColor)
} }
override fun onTileLoadError(e: Exception?) { override fun onTileLoadError(e: Exception?) {