Skip to content

Commit

Permalink
Remove old classes and prepare for version 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensousa committed Jun 3, 2018
1 parent 55ba696 commit bf3eeb1
Show file tree
Hide file tree
Showing 25 changed files with 313 additions and 1,089 deletions.
102 changes: 43 additions & 59 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,51 +18,45 @@ Add the following to your app's build.gradle:

```groovy
dependencies {
// Base implementation with a standard SeekBar
implementation 'com.github.rubensousa:previewseekbar:1.2'
// ExoPlayer extension that contains a TimeBar. Includes the previous dependency
implementation 'com.github.rubensousa:previewseekbar-exoplayer:2.6.0'
}
```

If you're going to use this with ExoPlayer, just add the second dependency.

## How to use



#### Add the following XML:

```xml
<com.github.rubensousa.previewseekbar.PreviewSeekBarLayout
android:id="@+id/previewSeekBarLayout"
<FrameLayout
android:id="@+id/previewFrameLayout"
android:layout_width="@dimen/video_preview_width"
android:layout_height="@dimen/video_preview_height">

<ImageView
android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<FrameLayout
android:id="@+id/previewFrameLayout"
android:layout_width="@dimen/video_preview_width"
android:layout_height="@dimen/video_preview_height">

<ImageView
android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimary" />

</FrameLayout>

<com.github.rubensousa.previewseekbar.PreviewSeekBar
android:id="@+id/previewSeekBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/previewFrameLayout"
android:layout_marginTop="25dp"
android:max="800" />

</com.github.rubensousa.previewseekbar.PreviewSeekBarLayout>
```
#### You need to add at least one PreviewSeekBar and a FrameLayout inside PreviewSeekBarLayout, else an exception will be thrown.
PreviewSeekBarLayout extends from RelativeLayout so you can add other views or layouts there.
android:layout_height="match_parent"
android:background="@color/colorPrimary" />

#### Create a PreviewLoader and pass it to PreviewSeekBarLayout:
</FrameLayout>

<com.github.rubensousa.previewseekbar.PreviewSeekBar
android:id="@+id/previewSeekBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:max="800" />
```

#### Create a PreviewLoader and pass it to PreviewSeekBarLayout:

```java
// Create a class that implements this interface and implement your own preview logic there
Expand Down Expand Up @@ -91,36 +85,26 @@ Here's the sample's exoplayer_controls: https://github.com/rubensousa/PreviewSee
The PreviewSeekBarLayout inside exoplayer_controls should be similar to this:

```xml
<com.github.rubensousa.previewseekbar.exoplayer.PreviewTimeBarLayout
android:id="@+id/previewTimeBarLayout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">

<FrameLayout
android:id="@+id/previewFrameLayout"
android:layout_width="@dimen/video_preview_width"
android:layout_height="@dimen/video_preview_height"
android:background="@drawable/video_frame"
android:padding="@dimen/video_frame_width">

<ImageView
android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>

</FrameLayout>

<com.github.rubensousa.previewseekbar.exoplayer.PreviewTimeBar
android:id="@+id/exo_progress"
style="?android:attr/progressBarStyleHorizontal"
<FrameLayout
android:id="@+id/previewFrameLayout"
android:layout_width="@dimen/video_preview_width"
android:layout_height="@dimen/video_preview_height"
android:background="@drawable/video_frame"
android:padding="@dimen/video_frame_width">

<ImageView
android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/previewFrameLayout"
android:layout_marginTop="10dp"
android:max="800" />
android:layout_height="match_parent"/>

</FrameLayout>

</com.github.rubensousa.previewseekbar.PreviewSeekBarLayout>
<com.github.rubensousa.previewseekbar.exoplayer.PreviewTimeBar
android:id="@+id/exo_progress"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:previewFrameLayout="@id/previewFrameLayout"/>
```

#### Create your own ExoPlayerLoader that seeks the video to the current position
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ org.gradle.jvmargs=-Xmx2048m
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
GROUP=com.github.rubensousa
VERSION_NAME=1.3.0
VERSION_NAME=2.0.0

POM_ARTIFACT_ID=previewseekbar
POM_NAME=PreviewSeekBar
Expand Down

This file was deleted.

Loading

0 comments on commit bf3eeb1

Please sign in to comment.