Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,15 @@ fun Player.seekForward(positionMs: Long, shouldFastSeek: Boolean = false) {
this.seekTo(positionMs)
}

/**
* Jumps to the specified timestamp.
*
* @param timestampMs The timestamp to jump to, in milliseconds.
*/
fun Player.jumpToTimestamp(timestampMs: Long) {
this.seekTo(timestampMs)
}

@get:UnstableApi
val Player.audioSessionId: Int
get() = when (this) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@android:color/white" />
<corners android:radius="16dp" />
<padding android:left="16dp" android:top="16dp" android:right="16dp" android:bottom="16dp" />
</shape>
9 changes: 9 additions & 0 deletions feature/player/src/main/res/drawable/ic_export.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="?attr/colorOnSurface"
android:pathData="M5,20h14v-2H5v2zm7-18l-5,5h3v4h4v-4h3l-5-5z"/>
</vector>
9 changes: 9 additions & 0 deletions feature/player/src/main/res/drawable/ic_sections.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FFFFFF"
android:pathData="M3,3h18c1.1,0 2,0.9 2,2v14c0,1.1 -0.9,2 -2,2H3c-1.1,0 -2,-0.9 -2,-2V5c0,-1.1 0.9,-2 2,-2zm0,2v14h18V5H3zm2,3h14v2H5V8zm0,4h14v2H5v-2zm0,4h14v2H5v-2z"/>
</vector>
47 changes: 47 additions & 0 deletions feature/player/src/main/res/layout/bottom_sheet_sections.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp"
android:background="?attr/colorSurface"
xmlns:android="http://schemas.android.com/apk/res/android">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:paddingBottom="8dp"
android:background="?attr/colorSurface"
android:elevation="2dp"
android:padding="8dp">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/sections"
android:textColor="?attr/colorOnSurface"
android:textAppearance="?attr/textAppearanceHeadline6"
android:paddingBottom="8dp" />

<ImageButton
android:id="@+id/btn_export_bookmarks"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/transparent_circle_background"
android:contentDescription="@string/export_bookmarks"
android:padding="12dp"
android:src="@drawable/ic_export" />
</LinearLayout>

<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">

<LinearLayout
android:id="@+id/sections_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
</ScrollView>
</LinearLayout>
86 changes: 56 additions & 30 deletions feature/player/src/main/res/layout/exo_player_control_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
app:layout_constraintStart_toStartOf="parent">

<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
Expand Down Expand Up @@ -208,19 +209,65 @@
app:tint="@android:color/white" />

<ImageButton
android:id="@+id/btn_background"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dimen_controls_horizontal"
android:background="@drawable/transparent_circle_background"
android:contentDescription="@string/screen_rotation"
android:padding="12dp"
android:src="@drawable/ic_headset"
app:tint="@android:color/white" />
android:id="@+id/btn_show_sections"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dimen_controls_horizontal"
android:background="@drawable/transparent_circle_background"
android:contentDescription="Show Sections"
android:padding="12dp"
android:src="@drawable/ic_sections"
app:tint="@android:color/white" />

<ImageButton
android:id="@+id/btn_background"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dimen_controls_horizontal"
android:background="@drawable/transparent_circle_background"
android:contentDescription="@string/screen_rotation"
android:padding="12dp"
android:src="@drawable/ic_headset"
app:tint="@android:color/white" />

</LinearLayout>
<LinearLayout
android:id="@+id/sections_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone"
android:padding="16dp">



</LinearLayout>

</androidx.constraintlayout.widget.ConstraintLayout>

<FrameLayout
android:id="@+id/player_lock_controls"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:visibility="invisible"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="-1dp"
tools:visibility="visible">

<ImageButton
android:id="@+id/btn_unlock_controls"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dimen_controls_horizontal"
android:background="@drawable/rounded_corner"
android:contentDescription="@string/controls_unlock"
android:padding="12dp"
android:src="@drawable/ic_lock"
app:tint="@android:color/white" />

</FrameLayout>

</androidx.constraintlayout.widget.ConstraintLayout>

<LinearLayout
Expand Down Expand Up @@ -269,25 +316,4 @@

</FrameLayout>

<FrameLayout
android:id="@+id/player_lock_controls"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:visibility="invisible"
tools:visibility="visible">

<ImageButton
android:id="@+id/btn_unlock_controls"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dimen_controls_horizontal"
android:background="@drawable/rounded_corner"
android:contentDescription="@string/controls_unlock"
android:padding="12dp"
android:src="@drawable/ic_lock"
app:tint="@android:color/white" />

</FrameLayout>

</FrameLayout>
5 changes: 5 additions & 0 deletions feature/player/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="export_bookmarks">Export Sections</string>
<string name="sections">Chapters</string>
</resources>