From 012e091349994ab76c073c60df75b8581eedd6f2 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 23 Oct 2017 19:39:43 +0200 Subject: [PATCH] minor code cleanup at videofragment --- .../gallery/activities/ViewPagerActivity.kt | 1 - .../simplemobiletools/gallery/fragments/VideoFragment.kt | 8 +------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index 64c315ba4..df2a14722 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -273,7 +273,6 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1 || !isDestroyed) { view_pager.apply { adapter = pagerAdapter - adapter!!.notifyDataSetChanged() currentItem = mPos addOnPageChangeListener(this@ViewPagerActivity) } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt index 9d2e395f1..86db872a9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -9,7 +9,6 @@ import android.os.Bundle import android.os.Handler import android.provider.Settings import android.util.DisplayMetrics -import android.util.Log import android.view.* import android.view.animation.AnimationUtils import android.widget.SeekBar @@ -26,6 +25,7 @@ import java.io.IOException class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSeekBarChangeListener { private val CLICK_MAX_DURATION = 150 private val SLIDE_INFO_FADE_DELAY = 1000L + private val PROGRESS = "progress" private var mMediaPlayer: MediaPlayer? = null private var mSurfaceView: SurfaceView? = null @@ -59,11 +59,6 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee lateinit var medium: Medium lateinit var mTimeHolder: View - companion object { - private val TAG = VideoFragment::class.java.simpleName - private val PROGRESS = "progress" - } - override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { mView = inflater.inflate(R.layout.pager_video_item, container, false) mTimeHolder = mView.video_time_holder @@ -397,7 +392,6 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee prepareAsync() } } catch (e: IOException) { - Log.e(TAG, "init media player failed $e") releaseMediaPlayer() } }