Skip to content

Commit

Permalink
zoomable
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucem-Anb committed Oct 22, 2018
1 parent dc52626 commit ba9e8d5
Show file tree
Hide file tree
Showing 26 changed files with 177 additions and 156 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
2 changes: 1 addition & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 27
compileSdkVersion 28
defaultConfig {
applicationId "hbisoft.com.surfaceviewpinchzoom"
minSdkVersion 18
targetSdkVersion 27
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand All @@ -20,8 +20,7 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
testImplementation 'junit:junit:4.12'
implementation project(path: ':lib')
implementation project(path: ':zoomable')
}
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:name="com.lucemanb.MainActivity"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
76 changes: 76 additions & 0 deletions app/src/main/java/com/lucemanb/MainActivity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
package com.lucemanb;

import android.app.Activity;
import android.graphics.SurfaceTexture;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.view.Surface;
import android.view.TextureView;

import com.lucemanb.zoomable.ZoomableTextureView;

import java.io.IOException;
import hbisoft.com.surfaceviewpinchzoom.R;


public class MainActivity extends Activity{

String path = "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4";
private MediaPlayer mediaPlayerTexture;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

final MediaPlayer.OnPreparedListener listener = new MediaPlayer.OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mp) {
mp.start();
}
};

ZoomableTextureView textureView = findViewById(R.id.textureView);

textureView.setSurfaceTextureListener(new TextureView.SurfaceTextureListener() {
@Override
public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) {
Surface s = new Surface(surface);
mediaPlayerTexture = new MediaPlayer();
mediaPlayerTexture.setSurface(s);
try {
mediaPlayerTexture.setDataSource(path);
} catch (IOException e) {
e.printStackTrace();
}
mediaPlayerTexture.prepareAsync();
mediaPlayerTexture.setOnPreparedListener(listener);
}

@Override
public void onSurfaceTextureSizeChanged(SurfaceTexture surface, int width, int height) {

}

@Override
public boolean onSurfaceTextureDestroyed(SurfaceTexture surface) {
return false;
}

@Override
public void onSurfaceTextureUpdated(SurfaceTexture surface) {

}
});
}

@Override
protected void onDestroy() {
super.onDestroy();
if (mediaPlayerTexture != null) {
mediaPlayerTexture.release();
mediaPlayerTexture = null;
}
}

}

This file was deleted.

22 changes: 22 additions & 0 deletions app/src/main/res/layout/activity_frames.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent"
tools:context=".Frames">

<SeekBar
android:layout_width="match_parent"
android:layout_margin="8dp"
android:id="@+id/control"
android:background="@color/colorPrimary"
android:layout_height="10dp" />

<hbisoft.com.surfaceviewpinchzoom.layout.PlayerView
android:layout_width="match_parent"
android:id="@+id/player"
android:layout_height="match_parent" />

</LinearLayout>
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
tools:context="com.lucemanb.MainActivity">

<com.lucem.lib.ZoomableTextureView
android:id="@+id/textureView"
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon May 21 10:37:33 SAST 2018
#Mon Oct 22 17:28:38 EAT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
Loading

0 comments on commit ba9e8d5

Please sign in to comment.