moving the bottom video time holder views in a separate layout file

This commit is contained in:
tibbi 2018-10-21 19:29:45 +02:00
parent 64180c0af1
commit 9fd3acd93f
3 changed files with 54 additions and 50 deletions

View file

@ -32,7 +32,7 @@ import com.simplemobiletools.gallery.activities.VideoActivity
import com.simplemobiletools.gallery.extensions.*
import com.simplemobiletools.gallery.helpers.*
import com.simplemobiletools.gallery.models.Medium
import kotlinx.android.synthetic.main.activity_panorama_video.*
import kotlinx.android.synthetic.main.bottom_video_time_holder.view.*
import kotlinx.android.synthetic.main.pager_video_item.view.*
import java.io.File
@ -416,7 +416,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
mIsPlaying = true
mExoPlayer?.playWhenReady = true
mView!!.video_play_outline.setImageResource(R.drawable.ic_pause)
video_play_outline.alpha = PLAY_PAUSE_VISIBLE_ALPHA
mView!!.video_play_outline.alpha = PLAY_PAUSE_VISIBLE_ALPHA
activity!!.window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
schedulePlayPauseFadeOut()
}

View file

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/video_time_holder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true">
<TextView
android:id="@+id/video_curr_time"
style="@style/MyBorderlessBackgroundStyle"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignTop="@+id/video_seekbar"
android:layout_alignBottom="@+id/video_seekbar"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:gravity="center_vertical"
android:paddingLeft="@dimen/activity_margin"
android:paddingRight="@dimen/activity_margin"
android:textColor="@android:color/white"
tools:text="00:00"/>
<com.simplemobiletools.commons.views.MySeekBar
android:id="@+id/video_seekbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toStartOf="@+id/video_duration"
android:layout_toLeftOf="@+id/video_duration"
android:layout_toEndOf="@+id/video_curr_time"
android:layout_toRightOf="@+id/video_curr_time"
android:paddingTop="@dimen/activity_margin"
android:paddingBottom="@dimen/activity_margin"/>
<TextView
android:id="@+id/video_duration"
style="@style/MyBorderlessBackgroundStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/video_seekbar"
android:layout_alignBottom="@+id/video_seekbar"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:gravity="center_vertical"
android:paddingLeft="@dimen/activity_margin"
android:paddingRight="@dimen/activity_margin"
android:textColor="@android:color/white"
tools:text="00:00"/>
</RelativeLayout>

View file

@ -91,52 +91,5 @@
android:visibility="gone"
tools:text="My video\nAnother line"/>
<RelativeLayout
android:id="@+id/video_time_holder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true">
<TextView
android:id="@+id/video_curr_time"
style="@style/MyBorderlessBackgroundStyle"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignTop="@+id/video_seekbar"
android:layout_alignBottom="@+id/video_seekbar"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:gravity="center_vertical"
android:paddingLeft="@dimen/activity_margin"
android:paddingRight="@dimen/activity_margin"
android:textColor="@android:color/white"
tools:text="00:00"/>
<com.simplemobiletools.commons.views.MySeekBar
android:id="@+id/video_seekbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toStartOf="@+id/video_duration"
android:layout_toLeftOf="@+id/video_duration"
android:layout_toEndOf="@+id/video_curr_time"
android:layout_toRightOf="@+id/video_curr_time"
android:paddingTop="@dimen/activity_margin"
android:paddingBottom="@dimen/activity_margin"/>
<TextView
android:id="@+id/video_duration"
style="@style/MyBorderlessBackgroundStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/video_seekbar"
android:layout_alignBottom="@+id/video_seekbar"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:gravity="center_vertical"
android:paddingLeft="@dimen/activity_margin"
android:paddingRight="@dimen/activity_margin"
android:textColor="@android:color/white"
tools:text="00:00"/>
</RelativeLayout>
<include layout="@layout/bottom_video_time_holder"/>
</RelativeLayout>