From d7488d45915fccdffcb75112142dde22c3d01b46 Mon Sep 17 00:00:00 2001 From: Halil Ozercan Date: Wed, 2 May 2018 02:49:22 +0300 Subject: [PATCH] Preparing changes for 1.2 release --- .idea/compiler.xml | 22 - .idea/copyright/profiles_settings.xml | 3 - .idea/misc.xml | 22 +- README.md | 1 + app/build.gradle | 10 +- .../halilibo/sample/BackgroundActivity.java | 14 +- .../com/halilibo/sample/MainActivity.java | 14 +- .../main/res/layout/activity_background.xml | 9 + app/src/main/res/menu/menu_dizi.xml | 8 +- app/src/main/res/raw/sub.srt | 54 +- bettervideoplayer/build.gradle | 14 +- .../BetterVideoCallback.java | 36 + .../bettervideoplayer/BetterVideoPlayer.java | 2380 ++++++++--------- .../bettervideoplayer/IUserMethods.java | 15 +- .../OnSwipeTouchListener.java | 41 +- .../bettervideoplayer/utility/Util.java | 8 +- .../src/main/res/values/attrs.xml | 6 +- build.gradle | 18 +- gradle/wrapper/gradle-wrapper.properties | 4 +- 19 files changed, 1370 insertions(+), 1309 deletions(-) delete mode 100644 .idea/compiler.xml delete mode 100644 .idea/copyright/profiles_settings.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml deleted file mode 100644 index 96cc43e..0000000 --- a/.idea/compiler.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml deleted file mode 100644 index e7bedf3..0000000 --- a/.idea/copyright/profiles_settings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 5d19981..dc34569 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,18 +1,16 @@ - - - @@ -27,17 +25,7 @@ - - - - - - - - - - - + diff --git a/README.md b/README.md index 7922add..19e6a65 100644 --- a/README.md +++ b/README.md @@ -400,6 +400,7 @@ The programmatic configuration options shown above can also be configured direct app:bvp_themeColor="@color/color_primary" app:bvp_captionSize="22sp" app:bvp_captionColor="@color/caption_color" + app:bvp_gestureType="SwipeGesture" app:bvp_loadingStyle="DoubleBounce" app:bvp_loop="false" /> ``` diff --git a/app/build.gradle b/app/build.gradle index 7146b50..a737063 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -20,9 +20,9 @@ android { } dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) - compile 'com.github.halilozercan:BetterVideoPlayer:1.1.0' - compile "com.android.support:appcompat-v7:$project.googleAPIsVersion" - compile "com.android.support:support-compat:$project.googleAPIsVersion" - compile "com.android.support:support-v4:$project.googleAPIsVersion" + implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation project(path: ":bettervideoplayer") + implementation "com.android.support:appcompat-v7:$project.googleAPIsVersion" + implementation "com.android.support:support-compat:$project.googleAPIsVersion" + implementation "com.android.support:support-v4:$project.googleAPIsVersion" } diff --git a/app/src/main/java/com/halilibo/sample/BackgroundActivity.java b/app/src/main/java/com/halilibo/sample/BackgroundActivity.java index 0e43cdd..c6fac8e 100644 --- a/app/src/main/java/com/halilibo/sample/BackgroundActivity.java +++ b/app/src/main/java/com/halilibo/sample/BackgroundActivity.java @@ -3,6 +3,8 @@ import android.net.Uri; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; +import android.view.View; +import android.widget.Toast; import com.halilibo.bettervideoplayer.BetterVideoCallback; import com.halilibo.bettervideoplayer.BetterVideoPlayer; @@ -14,7 +16,7 @@ protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_background); - BetterVideoPlayer bvp = (BetterVideoPlayer) findViewById(R.id.bvp); + BetterVideoPlayer bvp = findViewById(R.id.bvp); bvp.setSource(Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.video)); bvp.setCallback(new BetterVideoCallback() { @Override @@ -57,5 +59,15 @@ public void onToggleControls(BetterVideoPlayer player, boolean isShowing) { } }); + + findViewById(R.id.example_button).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Toast.makeText(getApplicationContext(), + "You can put a background video on your login page ;)", + Toast.LENGTH_LONG) + .show(); + } + }); } } diff --git a/app/src/main/java/com/halilibo/sample/MainActivity.java b/app/src/main/java/com/halilibo/sample/MainActivity.java index 6ddc643..de61b1f 100644 --- a/app/src/main/java/com/halilibo/sample/MainActivity.java +++ b/app/src/main/java/com/halilibo/sample/MainActivity.java @@ -36,7 +36,7 @@ public void onClick(View view) { } }); - bvp = (BetterVideoPlayer) findViewById(R.id.bvp); + bvp = findViewById(R.id.bvp); if(savedInstanceState == null) { bvp.setAutoPlay(true); @@ -52,10 +52,13 @@ public void onClick(View view) { public boolean onMenuItemClick(MenuItem item) { switch (item.getItemId()){ case R.id.action_enable_swipe: - bvp.enableSwipeGestures(); + bvp.enableSwipeGestures(getWindow()); + break; + case R.id.action_enable_double_tap: + bvp.enableDoubleTapGestures(5000); break; case R.id.action_disable_swipe: - bvp.disableSwipeGestures(); + bvp.disableGestures(); break; case R.id.action_show_bottombar: bvp.setBottomProgressBarVisibility(true); @@ -63,6 +66,11 @@ public boolean onMenuItemClick(MenuItem item) { case R.id.action_hide_bottombar: bvp.setBottomProgressBarVisibility(false); break; + case R.id.action_show_captions: + bvp.setCaptions(R.raw.sub, CaptionsView.CMime.SUBRIP); + break; + case R.id.action_hide_captions: + bvp.removeCaptions(); } return false; } diff --git a/app/src/main/res/layout/activity_background.xml b/app/src/main/res/layout/activity_background.xml index e984692..9983ee1 100644 --- a/app/src/main/res/layout/activity_background.xml +++ b/app/src/main/res/layout/activity_background.xml @@ -22,9 +22,18 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="CONTENT" + android:id="@+id/example_textview" android:textSize="30sp" android:layout_centerHorizontal="true" android:layout_centerVertical="true"/> + +