Skip to content

Commit

Permalink
Merge pull request #16 from dev-labs-bg/refactor/library-module
Browse files Browse the repository at this point in the history
Refactor/library module
  • Loading branch information
slavipetrov authored Jan 29, 2018
2 parents 07de6b9 + 19b6794 commit c0c8ecc
Show file tree
Hide file tree
Showing 12 changed files with 191 additions and 206 deletions.
4 changes: 2 additions & 2 deletions dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
ext.versions = [
minSdk : 19,
compileSdk : 26,
compileSdk : 27,
buildTools : '26.0.2',
publishVersion : '0.0.1',
publishVersionCode: 1,
gradlePlugin : '3.0.1',
bintrayPlugin : '1.7.3',
mavenPlugin : '1.4.1',

supportLib : '27.0.0',
supportLib : '27.0.2',
espresso : '3.0.1',
kotlin : '1.2.0',
leakCanary : '1.5.4'
Expand Down
2 changes: 1 addition & 1 deletion library/release.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ apply from: 'keystore.gradle'
ext {
publishedGroupId = 'bg.devlabs.fullscreenvideoview'
artifactId = 'library'
libraryVersion = '0.0.5'
libraryVersion = '0.0.6'
}

version = libraryVersion
Expand Down
20 changes: 11 additions & 9 deletions library/src/main/java/bg/devlabs/fullscreenvideoview/Builder.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,37 @@
import java.io.File;

import bg.devlabs.fullscreenvideoview.orientation.LandscapeOrientation;
import bg.devlabs.fullscreenvideoview.orientation.OrientationDelegate;
import bg.devlabs.fullscreenvideoview.orientation.OrientationHelper;
import bg.devlabs.fullscreenvideoview.orientation.PortraitOrientation;

/**
* Created by Slavi Petrov on 25.10.2017
* Dev Labs
* [email protected]
*/
@SuppressWarnings("unused")
@SuppressWarnings({"unused", "ClassWithTooManyMethods", "ClassNamingConvention"})
public class Builder {
private final FullscreenVideoView fullscreenVideoView;
private final VideoControllerView controller;
private final OrientationDelegate orientationDelegate;
private final OrientationHelper orientationHelper;
private final VideoMediaPlayer videoMediaPlayer;

Builder(FullscreenVideoView fullscreenVideoView, VideoControllerView controller,
OrientationDelegate orientationDelegate, VideoMediaPlayer videoMediaPlayer) {
OrientationHelper orientationHelper, VideoMediaPlayer videoMediaPlayer) {
this.fullscreenVideoView = fullscreenVideoView;
this.controller = controller;
this.orientationDelegate = orientationDelegate;
this.orientationHelper = orientationHelper;
this.videoMediaPlayer = videoMediaPlayer;
}

void videoFile(@NonNull final File videoFile) {
Builder videoFile(@NonNull File videoFile) {
fullscreenVideoView.setupMediaPlayer(videoFile.getPath());
return this;
}

void videoUrl(@NonNull final String videoUrl) {
Builder videoUrl(@NonNull String videoUrl) {
fullscreenVideoView.setupMediaPlayer(videoUrl);
return this;
}

public Builder enableAutoStart() {
Expand Down Expand Up @@ -121,12 +123,12 @@ public Builder rewindSeconds(int rewindSeconds) {
}

public Builder landscapeOrientation(LandscapeOrientation landscapeOrientation) {
orientationDelegate.setLandscapeOrientation(landscapeOrientation);
orientationHelper.setLandscapeOrientation(landscapeOrientation);
return this;
}

public Builder portraitOrientation(PortraitOrientation portraitOrientation) {
orientationDelegate.setPortraitOrientation(portraitOrientation);
orientationHelper.setPortraitOrientation(portraitOrientation);
return this;
}

Expand Down
Loading

0 comments on commit c0c8ecc

Please sign in to comment.