Skip to content

Commit be717fb

Browse files
committed
new build with zoom video.
1 parent 64e5c33 commit be717fb

File tree

6 files changed

+64
-8
lines changed

6 files changed

+64
-8
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@ KinAni is an **in progress** Android app where you can watch anime, K-drama and
99

1010
## Download
1111
App download Link
12-
<a href="https://github.com/PyPiSan/KinAni/releases/download/v4.10.1/KinAni.apk" target="_blank"><b>Download</b></a>
12+
<a href="https://github.com/PyPiSan/KinAni/releases/download/v4.10.4/KinAni.apk" target="_blank"><b>Download</b></a>
1313

1414
You can also download the latest release version.
1515

1616
## Installation
17-
Fresh Installs will not have any issue, if any send an email to kinani@pypisan.com
18-
Update the app when pop up appears if already using previous version.
1917
If app has been uninstalled previously without clearing cache, new installation might face an issue.
2018
Mail your issue at kinani@pypisan.com or create an issue here.
2119

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44

55
def versionMajor = 4
66
def versionMinor = 10
7-
def versionPatch = 3
7+
def versionPatch = 4
88

99
android {
1010
namespace 'com.pypisan.kinani'

app/src/main/java/com/pypisan/kinani/play/VideoPlayer.java

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,15 @@
99

1010
import android.annotation.SuppressLint;
1111
import android.app.Dialog;
12+
import android.content.Context;
1213
import android.content.Intent;
1314
import android.content.pm.ActivityInfo;
1415
import android.content.res.Configuration;
1516
import android.net.Uri;
1617
import android.os.Bundle;
1718
import android.util.Log;
19+
import android.view.MotionEvent;
20+
import android.view.ScaleGestureDetector;
1821
import android.view.View;
1922
import android.view.ViewGroup;
2023
import android.view.WindowManager;
@@ -27,13 +30,15 @@
2730
import android.widget.Toast;
2831

2932
import com.airbnb.lottie.LottieAnimationView;
33+
import com.google.android.exoplayer2.C;
3034
import com.google.android.exoplayer2.ExoPlayer;
3135
import com.google.android.exoplayer2.MediaItem;
3236
import com.google.android.exoplayer2.ext.cast.CastPlayer;
3337
import com.google.android.exoplayer2.ext.cast.SessionAvailabilityListener;
3438
import com.google.android.exoplayer2.extractor.ts.DefaultTsPayloadReaderFactory;
3539
import com.google.android.exoplayer2.source.hls.DefaultHlsExtractorFactory;
3640
import com.google.android.exoplayer2.source.hls.HlsMediaSource;
41+
import com.google.android.exoplayer2.ui.AspectRatioFrameLayout;
3742
import com.google.android.exoplayer2.ui.StyledPlayerView;
3843
import com.google.android.exoplayer2.upstream.DefaultHttpDataSource;
3944
import com.google.android.gms.cast.framework.CastButtonFactory;
@@ -210,9 +215,14 @@ public void onClick(View v) {
210215
player.seekTo(currFor+10000);
211216
}
212217
});
218+
219+
playerView.setResizeMode(AspectRatioFrameLayout.RESIZE_MODE_FILL);
220+
// player.setVideoScalingMode(C.VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING);
213221
}
214222

215223

224+
225+
216226
// Check Orientation
217227
// returns true if in portrait mode
218228

@@ -465,4 +475,51 @@ public void onRadioButtonClicked(View view) {
465475
break;
466476
}
467477
}
478+
479+
480+
// @Override
481+
// public boolean onTouchEvent(MotionEvent event) {
482+
// Toast.makeText(getApplicationContext(),"Touch clicked ", Toast.LENGTH_SHORT).show();
483+
// new ScaleGestureDetector(this, new MySimpleOnScaleGestureListener(playerView,getApplicationContext()))
484+
// .onTouchEvent(event);
485+
// return true;
486+
// //return super.onTouchEvent(event);
487+
// }
488+
489+
490+
private static class MySimpleOnScaleGestureListener
491+
extends ScaleGestureDetector.SimpleOnScaleGestureListener{
492+
493+
float scaleFactor = 0f;
494+
StyledPlayerView playerMode;
495+
Context v;
496+
497+
public MySimpleOnScaleGestureListener(StyledPlayerView playerMode, Context view) {
498+
super();
499+
this.playerMode = playerMode;
500+
this.v = view;
501+
}
502+
503+
@Override
504+
public boolean onScaleBegin(ScaleGestureDetector detector) {
505+
return true;
506+
}
507+
508+
@Override
509+
public boolean onScale(ScaleGestureDetector detector) {
510+
scaleFactor = detector.getScaleFactor();
511+
return true;
512+
//return super.onScale(detector);
513+
}
514+
515+
@Override
516+
public void onScaleEnd(@NonNull ScaleGestureDetector detector) {
517+
Toast.makeText(v,"scale factor is "+ scaleFactor, Toast.LENGTH_LONG).show();
518+
if (scaleFactor > 1) {
519+
playerMode.setResizeMode(AspectRatioFrameLayout.RESIZE_MODE_ZOOM);
520+
} else {
521+
playerMode.setResizeMode(AspectRatioFrameLayout.RESIZE_MODE_FIT);
522+
}
523+
}
524+
}
468525
}

app/src/main/res/layout/activity_main.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@
7474
android:layout_width="wrap_content"
7575
android:layout_height="?attr/actionBarSize"
7676
app:menu="@menu/bottom_menu"
77-
android:layout_marginEnd="5dp"
7877
app:labelVisibilityMode="labeled"
7978
android:background="@color/primaryColor"
8079
app:itemIconTint="@color/bottom_item_background"

app/src/main/res/layout/exo_player_video_layout.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
android:layout_width="match_parent"
5959
android:layout_height="@dimen/exo_styled_progress_layout_height"
6060
android:layout_gravity="bottom"
61+
android:layout_marginBottom="@dimen/exo_styled_progress_margin_bottom"
6162
/>
6263

6364
<!-- android:layout_marginBottom="@dimen/exo_styled_progress_margin_bottom"-->
@@ -145,7 +146,8 @@
145146
android:layout_height = "@dimen/exo_small_icon_height"
146147
android:layout_width ="@dimen/exo_small_icon_width"
147148
android:background="@android:color/transparent"
148-
android:src="@drawable/ic_cast" />
149+
android:src="@drawable/ic_cast"
150+
android:visibility="gone"/>
149151

150152
<ImageButton
151153
android:id="@+id/setting"
@@ -156,7 +158,7 @@
156158
android:layout_marginLeft = "@dimen/exo_small_icon_horizontal_margin"
157159
android:layout_marginRight = "@dimen/exo_small_icon_horizontal_margin"
158160
android:padding = "@dimen/exo_small_icon_padding_vertical"
159-
android:background="?android:attr/selectableItemBackground"
161+
android:background="?android:attr/selectableItemBackgroundBorderless"
160162
android:scaleType = "fitXY"/>
161163
</LinearLayout>
162164
</FrameLayout>

app/src/main/res/layout/user_page_view.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
android:layout_marginStart="10dp"
3333
android:clickable="true"
3434
android:focusable="true"
35-
android:foreground="?android:attr/selectableItemBackground"
35+
android:foreground="?android:attr/selectableItemBackgroundBorderless"
3636
android:theme="@android:style/ThemeOverlay.Material.Dark"
3737
android:contentDescription="@string/back" />
3838

0 commit comments

Comments
 (0)