adding some player related UI at the player fragment

This commit is contained in:
tibbi 2020-04-01 12:19:05 +02:00
parent 2d6fce812e
commit 921c21fcf9
2 changed files with 114 additions and 2 deletions

View File

@ -57,7 +57,7 @@ android {
}
dependencies {
implementation 'com.simplemobiletools:commons:5.24.6'
implementation 'com.simplemobiletools:commons:5.24.7'
implementation 'org.greenrobot:eventbus:3.2.0'
implementation 'com.github.Armen101:AudioRecordView:1.0.2'
}

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<com.simplemobiletools.voicerecorder.fragments.PlayerFragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/player_holder"
android:layout_width="match_parent"
android:layout_height="match_parent">
@ -9,7 +10,7 @@
android:id="@+id/recordings_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/breadcrumbs"
android:layout_above="@+id/player_controls_wrapper"
android:clipToPadding="false"
android:scrollbars="none"
app:layoutManager="com.simplemobiletools.commons.views.MyLinearLayoutManager" />
@ -18,10 +19,121 @@
android:id="@+id/recordings_fastscroller"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignTop="@+id/recordings_list"
android:layout_alignBottom="@+id/recordings_list"
android:layout_alignParentEnd="true"
android:paddingStart="@dimen/normal_margin">
<include layout="@layout/fastscroller_handle_vertical" />
</com.simplemobiletools.commons.views.FastScroller>
<RelativeLayout
android:id="@+id/player_controls_wrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:paddingBottom="@dimen/activity_margin">
<View
android:id="@+id/player_divider"
android:layout_width="match_parent"
android:layout_height="1px"
android:background="@color/divider_grey"
android:importantForAccessibility="no" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/player_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:ellipsize="end"
android:gravity="center_horizontal"
android:maxLines="1"
android:padding="@dimen/activity_margin"
android:textSize="@dimen/big_text_size"
tools:text="Recording title" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/player_progress_current"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/player_controls"
android:layout_alignTop="@+id/player_progressbar"
android:layout_alignBottom="@+id/player_progressbar"
android:background="?attr/selectableItemBackgroundBorderless"
android:gravity="center_vertical"
android:maxLines="1"
android:paddingStart="@dimen/normal_margin"
android:paddingEnd="@dimen/medium_margin"
tools:text="00:00" />
<com.simplemobiletools.commons.views.MySeekBar
android:id="@+id/player_progressbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/player_title"
android:layout_toStartOf="@+id/player_progress_max"
android:layout_toEndOf="@+id/player_progress_current"
android:clickable="true"
android:focusable="true"
android:paddingTop="@dimen/normal_margin"
android:paddingBottom="@dimen/normal_margin" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/player_progress_max"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/player_progressbar"
android:layout_alignBottom="@+id/player_progressbar"
android:layout_alignParentEnd="true"
android:background="?attr/selectableItemBackgroundBorderless"
android:gravity="center_vertical"
android:maxLines="1"
android:paddingStart="@dimen/medium_margin"
android:paddingEnd="@dimen/normal_margin"
tools:text="00:00" />
<LinearLayout
android:id="@+id/player_controls"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/player_progressbar"
android:orientation="horizontal">
<ImageView
android:id="@+id/previous_btn"
android:layout_width="@dimen/normal_icon_size"
android:layout_height="@dimen/normal_icon_size"
android:layout_weight="1"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/previous"
android:paddingTop="@dimen/small_margin"
android:paddingBottom="@dimen/small_margin"
android:src="@drawable/ic_previous_vector" />
<ImageView
android:id="@+id/play_pause_btn"
android:layout_width="@dimen/normal_icon_size"
android:layout_height="@dimen/normal_icon_size"
android:layout_weight="1"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/playpause"
android:paddingTop="@dimen/small_margin"
android:paddingBottom="@dimen/small_margin"
android:src="@drawable/ic_play_vector" />
<ImageView
android:id="@+id/next_btn"
android:layout_width="@dimen/normal_icon_size"
android:layout_height="@dimen/normal_icon_size"
android:layout_weight="1"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/next"
android:paddingTop="@dimen/small_margin"
android:paddingBottom="@dimen/small_margin"
android:src="@drawable/ic_next_vector" />
</LinearLayout>
</RelativeLayout>
</com.simplemobiletools.voicerecorder.fragments.PlayerFragment>