├── .gitignore
├── .idea
├── .name
├── compiler.xml
├── copyright
│ └── profiles_settings.xml
├── encodings.xml
├── gradle.xml
├── libraries
│ ├── animated_vector_drawable_23_2_0.xml
│ ├── appcompat_v7_23_2_0.xml
│ ├── audio.xml
│ ├── cardboard.xml
│ ├── cardview_v7_21_0_3.xml
│ ├── design_23_2_0.xml
│ ├── play_services_appindexing_8_1_0.xml
│ ├── play_services_basement_8_1_0.xml
│ ├── rajawali_1_0_325.xml
│ ├── recyclerview_v7_23_2_0.xml
│ ├── support_annotations_23_2_0.xml
│ ├── support_v4_23_2_0.xml
│ └── support_vector_drawable_23_2_0.xml
├── misc.xml
├── modules.xml
├── runConfigurations.xml
├── vcs.xml
└── workspace.xml
├── README.md
├── app
├── .gitignore
├── build.gradle
├── libs
│ ├── audio.jar
│ └── cardboard.jar
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── neointernet
│ │ └── neo360
│ │ └── ApplicationTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ ├── com
│ │ │ └── neointernet
│ │ │ │ └── neo360
│ │ │ │ ├── activity
│ │ │ │ ├── ListActivity.java
│ │ │ │ ├── MainActivity.java
│ │ │ │ └── VideoActivity.java
│ │ │ │ ├── adapter
│ │ │ │ └── VideoFileAdapter.java
│ │ │ │ ├── listener
│ │ │ │ ├── CardboardEventListener.java
│ │ │ │ └── VideoTimeListener.java
│ │ │ │ ├── renderer
│ │ │ │ └── VideoRenderer.java
│ │ │ │ ├── util
│ │ │ │ └── SharedPreferenceUtil.java
│ │ │ │ └── view
│ │ │ │ └── MyCardboardView.java
│ │ └── org
│ │ │ └── rajawali3d
│ │ │ └── cardboard
│ │ │ ├── RajawaliCardboardRenderer.java
│ │ │ └── RajawaliCardboardView.java
│ └── res
│ │ ├── drawable-v21
│ │ ├── ic_menu_camera.xml
│ │ ├── ic_menu_gallery.xml
│ │ ├── ic_menu_manage.xml
│ │ ├── ic_menu_send.xml
│ │ ├── ic_menu_share.xml
│ │ └── ic_menu_slideshow.xml
│ │ ├── drawable
│ │ ├── play.png
│ │ ├── side_nav_bar.xml
│ │ ├── stop.png
│ │ └── vr.png
│ │ ├── layout
│ │ ├── activity_list.xml
│ │ ├── activity_main.xml
│ │ ├── app_bar_main.xml
│ │ ├── content_main.xml
│ │ ├── nav_header_main.xml
│ │ ├── video_controller.xml
│ │ ├── video_row.xml
│ │ └── vr.xml
│ │ ├── menu
│ │ ├── activity_main_drawer.xml
│ │ ├── main.xml
│ │ ├── menu_list.xml
│ │ └── menu_main.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxxhdpi
│ │ └── ic_launcher.png
│ │ ├── raw
│ │ └── coc.mp4
│ │ ├── values-v21
│ │ └── styles.xml
│ │ ├── values-w820dp
│ │ └── dimens.xml
│ │ └── values
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── drawables.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── neointernet
│ └── neo360
│ └── ExampleUnitTest.java
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by https://www.gitignore.io/api/gradle,android,windows
2 |
3 | ### Gradle ###
4 | .gradle
5 | build/
6 |
7 | # Ignore Gradle GUI config
8 | gradle-app.setting
9 |
10 | # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
11 | !gradle-wrapper.jar
12 |
13 | # Cache of project
14 | .gradletasknamecache
15 |
16 | # # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
17 | # gradle/wrapper/gradle-wrapper.properties
18 |
19 |
20 | ### Android ###
21 | # Built application files
22 | *.apk
23 | *.ap_
24 |
25 | # Files for the Dalvik VM
26 | *.dex
27 |
28 | # Java class files
29 | *.class
30 |
31 | # Generated files
32 | bin/
33 | gen/
34 | out/
35 |
36 | # Gradle files
37 | .gradle/
38 | build/
39 |
40 | # Local configuration file (sdk path, etc)
41 | local.properties
42 |
43 | # Proguard folder generated by Eclipse
44 | proguard/
45 |
46 | # Log Files
47 | *.log
48 |
49 | # Android Studio Navigation editor temp files
50 | .navigation/
51 |
52 | # Android Studio captures folder
53 | captures/
54 |
55 | # Intellij
56 | *.iml
57 |
58 | # Keystore files
59 | *.jks
60 |
61 | ### Android Patch ###
62 | gen-external-apklibs
63 |
64 |
65 | ### Windows ###
66 | # Windows image file caches
67 | Thumbs.db
68 | ehthumbs.db
69 |
70 | # Folder config file
71 | Desktop.ini
72 |
73 | # Recycle Bin used on file shares
74 | $RECYCLE.BIN/
75 |
76 | # Windows Installer files
77 | *.cab
78 | *.msi
79 | *.msm
80 | *.msp
81 |
82 | # Windows shortcuts
83 | *.lnk
84 |
--------------------------------------------------------------------------------
/.idea/.name:
--------------------------------------------------------------------------------
1 | NEO360
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
18 |
19 |
--------------------------------------------------------------------------------
/.idea/libraries/animated_vector_drawable_23_2_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/libraries/appcompat_v7_23_2_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/.idea/libraries/audio.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/libraries/cardboard.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/libraries/cardview_v7_21_0_3.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/libraries/design_23_2_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/.idea/libraries/play_services_appindexing_8_1_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.idea/libraries/play_services_basement_8_1_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.idea/libraries/rajawali_1_0_325.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/libraries/recyclerview_v7_23_2_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/.idea/libraries/support_annotations_23_2_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.idea/libraries/support_v4_23_2_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/.idea/libraries/support_vector_drawable_23_2_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # android-vr-player
2 | Android Virtual Reality Video Player
3 |
4 | ## Reference
5 | - https://github.com/pondurii/vrVideo
6 | - https://github.com/Rajawali/RajawaliVR
7 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 23
5 | buildToolsVersion "23.0.2"
6 |
7 | defaultConfig {
8 | applicationId "com.neointernet.neo360"
9 | minSdkVersion 16
10 | targetSdkVersion 23
11 | versionCode 1
12 | versionName "1.0"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | compile fileTree(dir: 'libs', include: ['*.jar'])
24 | testCompile 'junit:junit:4.12'
25 | compile 'com.android.support:appcompat-v7:23.2.0'
26 | compile 'com.android.support:design:23.2.0'
27 | compile 'com.google.android.gms:play-services-appindexing:8.1.0'
28 | compile 'org.rajawali3d:rajawali:1.0.325'
29 | compile 'com.android.support:cardview-v7:21.0.+'
30 | compile 'com.android.support:recyclerview-v7:21.0.+'
31 | }
32 |
--------------------------------------------------------------------------------
/app/libs/audio.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Wef2/android-vr-player/7f0fc0d3d24e7ca5db0ea3bf3e14357125bc1acd/app/libs/audio.jar
--------------------------------------------------------------------------------
/app/libs/cardboard.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Wef2/android-vr-player/7f0fc0d3d24e7ca5db0ea3bf3e14357125bc1acd/app/libs/cardboard.jar
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in C:\Users\neo-202\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/neointernet/neo360/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.neointernet.neo360;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
12 |
15 |
18 |
19 |
25 |
29 |
30 |
31 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
46 |
50 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/app/src/main/java/com/neointernet/neo360/activity/ListActivity.java:
--------------------------------------------------------------------------------
1 | package com.neointernet.neo360.activity;
2 |
3 | /**
4 | * Created by neo-202 on 2016-03-22.
5 | */
6 |
7 | import android.content.Intent;
8 | import android.os.Bundle;
9 | import android.os.Environment;
10 | import android.os.FileObserver;
11 | import android.support.v7.app.AppCompatActivity;
12 | import android.support.v7.widget.LinearLayoutManager;
13 | import android.support.v7.widget.RecyclerView;
14 | import android.util.Log;
15 | import android.view.View;
16 |
17 | import com.neointernet.neo360.R;
18 | import com.neointernet.neo360.adapter.VideoFileAdapter;
19 |
20 | import java.io.File;
21 | import java.util.ArrayList;
22 |
23 | public class ListActivity extends AppCompatActivity implements View.OnClickListener {
24 |
25 | private String folderPath = Environment.getExternalStorageDirectory() + File.separator + "360Videos";
26 | private File folder;
27 | private File[] files;
28 | private ArrayList fileArrayList;
29 | private FileObserver fileObserver;
30 |
31 | private RecyclerView recyclerView;
32 | private RecyclerView.Adapter adapter;
33 | private RecyclerView.LayoutManager layoutManager;
34 |
35 | @Override
36 | public void onCreate(Bundle savedInstanceState) {
37 | super.onCreate(savedInstanceState);
38 | setContentView(R.layout.activity_list);
39 |
40 | folder = new File(folderPath);
41 | Log.i("Folder", folder.toString());
42 | Log.i("Folder", folder.getAbsolutePath().toString());
43 | Log.i("Folder", folder.listFiles().toString());
44 |
45 | fileArrayList = new ArrayList<>();
46 | setFileArray();
47 | adapter = new VideoFileAdapter(this, fileArrayList);
48 | recyclerView = (RecyclerView) findViewById(R.id.video_recyler_view);
49 | recyclerView.setHasFixedSize(true);
50 | layoutManager = new LinearLayoutManager(this);
51 | recyclerView.setLayoutManager(layoutManager);
52 | recyclerView.setAdapter(adapter);
53 |
54 | fileObserver = new FileObserver(folderPath) {
55 | @Override
56 | public void onEvent(int event, String path) {
57 | Log.i("EVENT", Integer.toString(event));
58 | switch (event) {
59 | case FileObserver.CREATE:
60 | Log.i("FILE OBSERVER", "CREATE");
61 | break;
62 | case FileObserver.DELETE:
63 | Log.i("FILE OBSERVER", "DELETE");
64 | break;
65 | }
66 |
67 | }
68 | };
69 | }
70 |
71 | public void setFileArray() {
72 | files = folder.listFiles();
73 | fileArrayList.clear();
74 | for (File file : files) {
75 | fileArrayList.add(file);
76 | }
77 | }
78 |
79 | @Override
80 | public void onClick(View v) {
81 | File newFile = (File)v.getTag();
82 | Intent intent = new Intent(ListActivity.this, VideoActivity.class);
83 | intent.putExtra("videopath", newFile.getPath());
84 | startActivity(intent);
85 | }
86 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/neointernet/neo360/activity/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.neointernet.neo360.activity;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.support.design.widget.NavigationView;
6 | import android.support.v4.view.GravityCompat;
7 | import android.support.v4.widget.DrawerLayout;
8 | import android.support.v7.app.ActionBarDrawerToggle;
9 | import android.support.v7.app.AppCompatActivity;
10 | import android.support.v7.widget.Toolbar;
11 | import android.view.Menu;
12 | import android.view.MenuItem;
13 |
14 | import com.neointernet.neo360.R;
15 |
16 | public class MainActivity extends AppCompatActivity
17 | implements NavigationView.OnNavigationItemSelectedListener {
18 |
19 | @Override
20 | protected void onCreate(Bundle savedInstanceState) {
21 | super.onCreate(savedInstanceState);
22 | setContentView(R.layout.activity_main);
23 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
24 | setSupportActionBar(toolbar);
25 |
26 | DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
27 | ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
28 | this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
29 | drawer.setDrawerListener(toggle);
30 | toggle.syncState();
31 |
32 | NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
33 | navigationView.setNavigationItemSelectedListener(this);
34 | }
35 |
36 | @Override
37 | public void onBackPressed() {
38 | DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
39 | if (drawer.isDrawerOpen(GravityCompat.START)) {
40 | drawer.closeDrawer(GravityCompat.START);
41 | } else {
42 | super.onBackPressed();
43 | }
44 | }
45 |
46 | @Override
47 | public boolean onCreateOptionsMenu(Menu menu) {
48 | // Inflate the menu; this adds items to the action bar if it is present.
49 | getMenuInflater().inflate(R.menu.main, menu);
50 | return true;
51 | }
52 |
53 | @Override
54 | public boolean onOptionsItemSelected(MenuItem item) {
55 | // Handle action bar item clicks here. The action bar will
56 | // automatically handle clicks on the Home/Up button, so long
57 | // as you specify a parent activity in AndroidManifest.xml.
58 | int id = item.getItemId();
59 |
60 | //noinspection SimplifiableIfStatement
61 | if (id == R.id.action_settings) {
62 | return true;
63 | }
64 |
65 | return super.onOptionsItemSelected(item);
66 | }
67 |
68 | @SuppressWarnings("StatementWithEmptyBody")
69 | @Override
70 | public boolean onNavigationItemSelected(MenuItem item) {
71 | // Handle navigation view item clicks here.
72 | int id = item.getItemId();
73 |
74 | if (id == R.id.nav_camera) {
75 |
76 | } else if (id == R.id.nav_gallery) {
77 | Intent intent = new Intent(MainActivity.this, ListActivity.class);
78 | startActivity(intent);
79 | }
80 |
81 | DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
82 | drawer.closeDrawer(GravityCompat.START);
83 | return true;
84 | }
85 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/neointernet/neo360/activity/VideoActivity.java:
--------------------------------------------------------------------------------
1 | package com.neointernet.neo360.activity;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.util.Log;
6 | import android.view.LayoutInflater;
7 | import android.view.MotionEvent;
8 | import android.view.View;
9 | import android.widget.Button;
10 | import android.widget.ImageButton;
11 | import android.widget.LinearLayout;
12 | import android.widget.SeekBar;
13 |
14 | import com.google.vrtoolkit.cardboard.CardboardActivity;
15 | import com.neointernet.neo360.R;
16 | import com.neointernet.neo360.listener.CardboardEventListener;
17 | import com.neointernet.neo360.listener.VideoTimeListener;
18 | import com.neointernet.neo360.renderer.VideoRenderer;
19 | import com.neointernet.neo360.view.MyCardboardView;
20 |
21 | /**
22 | * Created by neo-202 on 2016-03-22.
23 | */
24 | public class VideoActivity extends CardboardActivity implements VideoTimeListener, CardboardEventListener {
25 |
26 | private MyCardboardView view;
27 | private VideoRenderer renderer;
28 | private View barLayout;
29 | private ImageButton vrButton, playButton;
30 | private SeekBar videoSeekBar;
31 |
32 | @Override
33 | protected void onCreate(Bundle savedInstanceState) {
34 | super.onCreate(savedInstanceState);
35 |
36 | view = new MyCardboardView(VideoActivity.this);
37 | view.setSettingsButtonEnabled(false);
38 | view.setVRModeEnabled(true);
39 | view.setDistortionCorrectionEnabled(false);
40 | view.setAlignmentMarkerEnabled(false);
41 | setContentView(view);
42 | setCardboardView(view);
43 |
44 | Intent intent = getIntent();
45 | renderer = new VideoRenderer(VideoActivity.this, intent.getStringExtra("videopath"));
46 | view.setRenderer(renderer);
47 | view.setSurfaceRenderer(renderer);
48 | renderer.setVideoTimeListener(this);
49 |
50 | view.addCardboardEventListener(renderer);
51 | view.addCardboardEventListener(this);
52 |
53 | LayoutInflater layoutInflater = getLayoutInflater();
54 | barLayout = (View) layoutInflater.inflate(R.layout.video_controller, null);
55 | addContentView(barLayout, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));
56 |
57 | vrButton = (ImageButton) findViewById(R.id.vrButton);
58 | playButton = (ImageButton) findViewById(R.id.playButton);
59 | videoSeekBar = (SeekBar) findViewById(R.id.videoSeekBar);
60 |
61 | vrButton.setOnClickListener(new View.OnClickListener() {
62 | @Override
63 | public void onClick(View v) {
64 | view.changeVRMode();
65 | }
66 | });
67 |
68 | playButton.setOnClickListener(new View.OnClickListener() {
69 | @Override
70 | public void onClick(View v) {
71 | if (renderer.isPlaying()) {
72 | playButton.setImageResource(R.drawable.stop);
73 | renderer.onPause();
74 | } else {
75 | playButton.setImageResource(R.drawable.play);
76 | renderer.onResume();
77 | }
78 | }
79 | });
80 |
81 | videoSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
82 | @Override
83 | public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
84 | if (fromUser) {
85 | renderer.setMediaPlayerSeekTo(progress);
86 | seekBar.setProgress(progress);
87 | }
88 | }
89 |
90 | @Override
91 | public void onStartTrackingTouch(SeekBar seekBar) {
92 | }
93 |
94 | @Override
95 | public void onStopTrackingTouch(SeekBar seekBar) {
96 |
97 | }
98 | });
99 | }
100 |
101 | @Override
102 | public void onVideoInit(int length) {
103 | videoSeekBar.setMax(length);
104 | }
105 |
106 | @Override
107 | public void listenTime(int time) {
108 | videoSeekBar.setProgress(time);
109 | }
110 |
111 | @Override
112 | public void onCardboardTouch(MotionEvent e) {
113 | if (e.getAction() == MotionEvent.ACTION_DOWN) {
114 | int visibility = barLayout.getVisibility();
115 | if (visibility == View.INVISIBLE) {
116 | barLayout.setVisibility(View.VISIBLE);
117 | } else if (visibility == View.VISIBLE) {
118 | barLayout.setVisibility(View.INVISIBLE);
119 | }
120 | }
121 | }
122 |
123 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/neointernet/neo360/adapter/VideoFileAdapter.java:
--------------------------------------------------------------------------------
1 | package com.neointernet.neo360.adapter;
2 |
3 | import android.media.ThumbnailUtils;
4 | import android.provider.MediaStore;
5 | import android.support.v7.widget.CardView;
6 | import android.support.v7.widget.RecyclerView;
7 | import android.view.LayoutInflater;
8 | import android.view.View;
9 | import android.view.ViewGroup;
10 | import android.widget.ImageView;
11 | import android.widget.TextView;
12 |
13 | import com.neointernet.neo360.R;
14 |
15 | import java.io.File;
16 | import java.util.ArrayList;
17 | import java.util.Collection;
18 |
19 | public class VideoFileAdapter extends RecyclerView.Adapter {
20 | private ArrayList videos;
21 | private View.OnClickListener listener;
22 |
23 | public VideoFileAdapter(View.OnClickListener listener, Collection videoModels) {
24 | this.listener = listener;
25 | videos = new ArrayList<>();
26 | videos.addAll(videoModels);
27 | }
28 |
29 | @Override
30 | public VideoFileAdapter.ViewHolder onCreateViewHolder(ViewGroup parent,
31 | int viewType) {
32 | View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.video_row, parent, false);
33 | ViewHolder vh = new ViewHolder(v);
34 | return vh;
35 | }
36 |
37 | @Override
38 | public void onBindViewHolder(ViewHolder holder, int position) {
39 | holder.cardView.setTag(getFile(position));
40 | holder.imageView.setImageBitmap(ThumbnailUtils.createVideoThumbnail(getFile(position).getPath(), MediaStore.Video.Thumbnails.FULL_SCREEN_KIND));
41 | holder.nameText.setText(getFile(position).getName());
42 | holder.lengthText.setText(Long.toString(getFile(position).length()));
43 | holder.cardView.setOnClickListener(listener);
44 | }
45 |
46 | @Override
47 | public int getItemCount() {
48 | return videos.size();
49 | }
50 |
51 | public File getFile(int position) {
52 | return videos.get(position);
53 | }
54 |
55 | public String getFilePath(int position) {
56 | return videos.get(position).getPath();
57 | }
58 |
59 | public static class ViewHolder extends RecyclerView.ViewHolder {
60 |
61 | public CardView cardView;
62 | public TextView nameText, lengthText;
63 | public ImageView imageView;
64 |
65 | public ViewHolder(View v) {
66 | super(v);
67 | cardView = (CardView) v.findViewById(R.id.card_view);
68 | imageView = (ImageView) v.findViewById(R.id.video_image);
69 | nameText = (TextView) v.findViewById(R.id.video_name_text);
70 | lengthText = (TextView) v.findViewById(R.id.video_length_text);
71 | }
72 | }
73 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/neointernet/neo360/listener/CardboardEventListener.java:
--------------------------------------------------------------------------------
1 | package com.neointernet.neo360.listener;
2 |
3 | import android.view.MotionEvent;
4 |
5 | /**
6 | * Created by neo-202 on 2016-03-22.
7 | */
8 | public interface CardboardEventListener {
9 | void onCardboardTouch(MotionEvent e);
10 | }
11 |
--------------------------------------------------------------------------------
/app/src/main/java/com/neointernet/neo360/listener/VideoTimeListener.java:
--------------------------------------------------------------------------------
1 | package com.neointernet.neo360.listener;
2 |
3 | /**
4 | * Created by neo-202 on 2016-03-23.
5 | */
6 | public interface VideoTimeListener {
7 | void onVideoInit(int length);
8 | void listenTime(int time);
9 | }
10 |
--------------------------------------------------------------------------------
/app/src/main/java/com/neointernet/neo360/renderer/VideoRenderer.java:
--------------------------------------------------------------------------------
1 | package com.neointernet.neo360.renderer;
2 |
3 | import android.app.Activity;
4 | import android.content.res.Resources;
5 | import android.graphics.SurfaceTexture;
6 | import android.media.MediaPlayer;
7 | import android.net.Uri;
8 | import android.util.Log;
9 | import android.view.MotionEvent;
10 |
11 | import com.google.vrtoolkit.cardboard.Eye;
12 | import com.neointernet.neo360.activity.VideoActivity;
13 | import com.neointernet.neo360.listener.CardboardEventListener;
14 | import com.neointernet.neo360.listener.VideoTimeListener;
15 |
16 | import org.rajawali3d.cardboard.RajawaliCardboardRenderer;
17 | import org.rajawali3d.materials.Material;
18 | import org.rajawali3d.materials.textures.ATexture;
19 | import org.rajawali3d.materials.textures.StreamingTexture;
20 | import org.rajawali3d.math.Matrix4;
21 | import org.rajawali3d.math.Quaternion;
22 | import org.rajawali3d.math.vector.Vector3;
23 | import org.rajawali3d.primitives.Sphere;
24 |
25 | import java.io.File;
26 |
27 | public class VideoRenderer extends RajawaliCardboardRenderer implements CardboardEventListener {
28 |
29 |
30 | private static final int NONE = 0;
31 | private static final int DRAG = 1;
32 | private static final int ZOOM = 2;
33 | private VideoActivity videoActivity;
34 | private String videoPath;
35 | private int mode = NONE;
36 | private float posX1, posX2, posY1, posY2;
37 | private float distance1, distance2;
38 | private VideoTimeListener listener;
39 | private MediaPlayer mediaPlayer;
40 | private StreamingTexture streamingTexture;
41 | private boolean vrMode;
42 |
43 | private long elapsedRealtime;
44 | private double deltaTime;
45 | private Matrix4 eyeMatrix = new Matrix4();
46 | private Quaternion eyeQuaternion = new Quaternion();
47 | private Quaternion rotateQuaternion = new Quaternion();
48 |
49 | private float angleX = 0;
50 | private float angleY = 0;
51 | private float angleZ = 0;
52 |
53 | public VideoRenderer(Activity activity) {
54 | super(activity.getApplicationContext());
55 | videoActivity = (VideoActivity) activity;
56 | }
57 |
58 | public VideoRenderer(Activity activity, String videoPath) {
59 | super(activity.getApplicationContext());
60 | this.videoPath = videoPath;
61 | videoActivity = (VideoActivity) activity;
62 | }
63 |
64 | @Override
65 | protected void initScene() {
66 | File file = new File(videoPath);
67 | Uri uri = Uri.fromFile(file);
68 | Log.i("URI", uri.toString());
69 | mediaPlayer = MediaPlayer.create(getContext(), uri);
70 | mediaPlayer.setLooping(true);
71 |
72 | streamingTexture = new StreamingTexture("texture", mediaPlayer);
73 | Material material = new Material();
74 | material.setColorInfluence(0);
75 | try {
76 | material.addTexture(streamingTexture);
77 | } catch (ATexture.TextureException e) {
78 | e.printStackTrace();
79 | }
80 |
81 | Sphere sphere = new Sphere(100, 128, 64);
82 | sphere.setScaleX(-1);
83 | sphere.setMaterial(material);
84 |
85 | getCurrentScene().addChild(sphere);
86 | getCurrentCamera().setPosition(Vector3.ZERO);
87 | getCurrentCamera().setFieldOfView(75);
88 |
89 | mediaPlayer.start();
90 |
91 | mediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
92 | @Override
93 | public void onCompletion(MediaPlayer mp) {
94 | Log.i("Media Player Status", "Completed");
95 | mp.stop();
96 | mp.release();
97 | videoActivity.finish();
98 | }
99 | });
100 |
101 | notifyVideoInit(mediaPlayer.getDuration());
102 | }
103 |
104 | public void setVideoTimeListener(VideoTimeListener listener) {
105 | this.listener = listener;
106 | }
107 |
108 | public void notifyVideoInit(int length) {
109 | listener.onVideoInit(length);
110 | }
111 |
112 | public void notifyTime(int time) {
113 | listener.listenTime(time);
114 | }
115 |
116 | public void setMediaPlayerSeekTo(int progress) {
117 | mediaPlayer.seekTo(progress);
118 | }
119 |
120 | @Override
121 | protected void onRender(long elapsedRealTime, double deltaTime) {
122 | this.elapsedRealtime = elapsedRealTime;
123 | this.deltaTime = deltaTime;
124 | streamingTexture.update();
125 | notifyTime(mediaPlayer.getCurrentPosition());
126 | }
127 |
128 | @Override
129 | public void onPause() {
130 | super.onPause();
131 | if (mediaPlayer != null) {
132 | mediaPlayer.pause();
133 | }
134 | }
135 |
136 | @Override
137 | public void onResume() {
138 | super.onResume();
139 | if (mediaPlayer != null) {
140 | mediaPlayer.start();
141 | }
142 | }
143 |
144 | @Override
145 | public void onRenderSurfaceDestroyed(SurfaceTexture surfaceTexture) {
146 | super.onRenderSurfaceDestroyed(surfaceTexture);
147 | mediaPlayer.release();
148 | }
149 |
150 | @Override
151 | public void onCardboardTouch(MotionEvent e) {
152 | int action = e.getAction();
153 | double fieldOfView = getCurrentCamera().getFieldOfView();
154 |
155 | switch (action & MotionEvent.ACTION_MASK) {
156 | case MotionEvent.ACTION_DOWN:
157 | posX1 = e.getX();
158 | posY1 = e.getY();
159 | mode = DRAG;
160 | break;
161 | case MotionEvent.ACTION_MOVE:
162 | if (mode == DRAG) {
163 | posX2 = e.getX();
164 | posY2 = e.getY();
165 |
166 | if (posX2 - posX1 > 0) {
167 | angleX = angleX + (posX2 - posX1) / 10;
168 | } else if (posX1 - posX2 > 0) {
169 | angleX = angleX - (posX1 - posX2) / 10;
170 | }
171 | if (posY2 - posY1 > 0) {
172 | angleY = angleY + (posY2 - posY1) / 10;
173 | } else if (posY1 - posY2 > 0) {
174 | angleY = angleY - (posY1 - posY2) / 10;
175 | }
176 |
177 | if (Math.abs(posX2 - posX1) > 15 || Math.abs(posY2 - posY1) > 15) {
178 | posX1 = posX2;
179 | posY1 = posY2;
180 | }
181 | } else if (mode == ZOOM) {
182 | distance1 = calculateDistance(e);
183 | if (distance1 - distance2 > 0) {
184 | if (fieldOfView < 130) {
185 | fieldOfView = fieldOfView + (distance1 - distance2) / 10;
186 | getCurrentCamera().setFieldOfView(fieldOfView);
187 | }
188 | distance2 = distance1;
189 | } else if (distance2 - distance1 > 0) {
190 | if (fieldOfView > 20) {
191 | fieldOfView = fieldOfView - (distance2 - distance1) / 10;
192 | getCurrentCamera().setFieldOfView(fieldOfView);
193 | }
194 | distance2 = distance1;
195 | }
196 | }
197 | break;
198 | case MotionEvent.ACTION_UP:
199 | break;
200 | case MotionEvent.ACTION_POINTER_UP:
201 | mode = NONE;
202 | break;
203 | case MotionEvent.ACTION_POINTER_DOWN:
204 | mode = ZOOM;
205 | distance1 = calculateDistance(e);
206 | distance2 = calculateDistance(e);
207 | break;
208 | case MotionEvent.ACTION_CANCEL:
209 | default:
210 | break;
211 | }
212 | }
213 |
214 | private float calculateDistance(MotionEvent e) {
215 | float x = e.getX(0) - e.getX(1);
216 | float y = e.getY(0) - e.getY(1);
217 | return (float) Math.sqrt(x * x + y * y);
218 | }
219 |
220 |
221 | @Override
222 | public void onDrawEye(Eye eye) {
223 | eyeMatrix.setAll(eye.getEyeView());
224 | eyeQuaternion.fromMatrix(eyeMatrix);
225 | rotateQuaternion.fromEuler(angleX, angleY, angleZ);
226 | getCurrentCamera().setOrientation(eyeQuaternion);
227 | getCurrentCamera().rotate(rotateQuaternion);
228 | render(elapsedRealtime, deltaTime);
229 | }
230 |
231 | public boolean isPlaying() {
232 | return mediaPlayer.isPlaying();
233 | }
234 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/neointernet/neo360/util/SharedPreferenceUtil.java:
--------------------------------------------------------------------------------
1 | package com.neointernet.neo360.util;
2 |
3 | import android.content.Context;
4 | import android.content.SharedPreferences;
5 | import android.preference.PreferenceManager;
6 |
7 | /**
8 | * Created by neo-202 on 2016-03-29.
9 | */
10 | public class SharedPreferenceUtil {
11 |
12 | public static void putSharedPreference(Context context, String key, String value) {
13 | SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
14 | SharedPreferences.Editor editor = prefs.edit();
15 | editor.putString(key, value);
16 | editor.commit();
17 | }
18 |
19 | public static String getSharedPreference(Context context, String key) {
20 | SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
21 | return prefs.getString(key, null);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/app/src/main/java/com/neointernet/neo360/view/MyCardboardView.java:
--------------------------------------------------------------------------------
1 | package com.neointernet.neo360.view;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.view.MotionEvent;
6 |
7 | import com.neointernet.neo360.listener.CardboardEventListener;
8 |
9 | import org.rajawali3d.cardboard.RajawaliCardboardView;
10 |
11 | import java.util.ArrayList;
12 | import java.util.List;
13 |
14 | /**
15 | * Created by neo-202 on 2016-03-22.
16 | */
17 | public class MyCardboardView extends RajawaliCardboardView {
18 |
19 | private List listeners = new ArrayList<>();
20 |
21 | public MyCardboardView(Context context) {
22 | super(context);
23 | }
24 |
25 | public MyCardboardView(Context context, AttributeSet attrs) {
26 | super(context, attrs);
27 | }
28 |
29 | public boolean onTouchEvent(MotionEvent e) {
30 | notifyTouchEvent(e);
31 | return super.onTouchEvent(e);
32 | }
33 |
34 | public void changeVRMode(){
35 | if(getVRMode()){
36 | setVRModeEnabled(false);
37 | }
38 | else{
39 | setVRModeEnabled(true);
40 | }
41 | }
42 |
43 | public void addCardboardEventListener(CardboardEventListener listener){
44 | listeners.add(listener);
45 | }
46 |
47 | public void notifyTouchEvent(MotionEvent e){
48 | for(CardboardEventListener listener : listeners){
49 | listener.onCardboardTouch(e);
50 | }
51 | }
52 |
53 | }
--------------------------------------------------------------------------------
/app/src/main/java/org/rajawali3d/cardboard/RajawaliCardboardRenderer.java:
--------------------------------------------------------------------------------
1 | package org.rajawali3d.cardboard;
2 |
3 | import android.content.Context;
4 | import android.view.MotionEvent;
5 |
6 | import com.google.vrtoolkit.cardboard.CardboardView;
7 | import com.google.vrtoolkit.cardboard.Eye;
8 | import com.google.vrtoolkit.cardboard.HeadTransform;
9 | import com.google.vrtoolkit.cardboard.Viewport;
10 |
11 | import org.rajawali3d.math.Matrix4;
12 | import org.rajawali3d.math.Quaternion;
13 | import org.rajawali3d.renderer.RajawaliRenderer;
14 |
15 | import java.nio.Buffer;
16 | import java.nio.FloatBuffer;
17 | import java.nio.IntBuffer;
18 |
19 | import javax.microedition.khronos.egl.EGLConfig;
20 | import javax.microedition.khronos.opengles.GL10;
21 |
22 | public abstract class RajawaliCardboardRenderer extends RajawaliRenderer implements CardboardView.StereoRenderer {
23 |
24 | private static GL10 gl10;
25 | private long ellapsedRealtime;
26 | private double deltaTime;
27 | private Matrix4 eyeMatrix = new Matrix4();
28 | private Quaternion eyeQuaternion = new Quaternion();
29 |
30 | public RajawaliCardboardRenderer(Context context) {
31 | super(context);
32 | }
33 |
34 | public RajawaliCardboardRenderer(Context context, boolean registerForResources) {
35 | super(context, registerForResources);
36 | }
37 |
38 | @Override
39 | public void onNewFrame(HeadTransform headTransform) {
40 | super.onRenderFrame(null);
41 | }
42 |
43 | @Override
44 | protected void onRender(long ellapsedRealtime, double deltaTime) {
45 | this.ellapsedRealtime = ellapsedRealtime;
46 | this.deltaTime = deltaTime;
47 | }
48 |
49 | @Override
50 | public void onDrawEye(Eye eye) {
51 |
52 | // Apply the eye transformation to the camera
53 | eyeMatrix.setAll(eye.getEyeView());
54 | eyeQuaternion.fromMatrix(eyeMatrix);
55 | getCurrentCamera().setOrientation(eyeQuaternion);
56 |
57 | render(ellapsedRealtime, deltaTime);
58 | }
59 |
60 | @Override
61 | public void onFinishFrame(Viewport viewport) {
62 | }
63 |
64 | @Override
65 | public void onSurfaceChanged(int width, int height) {
66 | super.onRenderSurfaceSizeChanged(null, width, height);
67 | }
68 |
69 | @Override
70 | public void onSurfaceCreated(EGLConfig config) {
71 | super.onRenderSurfaceCreated(config, gl10, -1, -1);
72 | }
73 |
74 | @Override
75 | public void onRendererShutdown() {
76 | }
77 |
78 | @Override
79 | public void onOffsetsChanged(float xOffset, float yOffset, float xOffsetStep, float yOffsetStep, int xPixelOffset, int yPixelOffset) {
80 | }
81 |
82 | @Override
83 | public void onTouchEvent(MotionEvent event) {
84 | }
85 |
86 | }
87 |
--------------------------------------------------------------------------------
/app/src/main/java/org/rajawali3d/cardboard/RajawaliCardboardView.java:
--------------------------------------------------------------------------------
1 | package org.rajawali3d.cardboard;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.util.Log;
6 | import android.view.MotionEvent;
7 | import android.view.View;
8 |
9 | import com.google.vrtoolkit.cardboard.CardboardView;
10 |
11 | import org.rajawali3d.surface.IRajawaliSurface;
12 | import org.rajawali3d.surface.IRajawaliSurfaceRenderer;
13 |
14 | public class RajawaliCardboardView extends CardboardView implements IRajawaliSurface {
15 |
16 | private IRajawaliSurfaceRenderer renderer;
17 |
18 | public RajawaliCardboardView(Context context) {
19 | super(context);
20 | }
21 |
22 | public RajawaliCardboardView(Context context, AttributeSet attrs) {
23 | super(context, attrs);
24 | }
25 |
26 | @Override
27 | public void onPause() {
28 | super.onPause();
29 | renderer.onPause();
30 | }
31 |
32 | @Override
33 | public void onResume() {
34 | super.onResume();
35 | renderer.onResume();
36 | }
37 |
38 | @Override
39 | protected void onVisibilityChanged(View changedView, int visibility) {
40 | if (visibility == View.GONE || visibility == View.INVISIBLE) {
41 | onPause();
42 | } else {
43 | onResume();
44 | }
45 | super.onVisibilityChanged(changedView, visibility);
46 | }
47 |
48 | @Override
49 | protected void onAttachedToWindow() {
50 | super.onAttachedToWindow();
51 | onResume();
52 | }
53 |
54 | @Override
55 | public void onDetachedFromWindow() {
56 | super.onDetachedFromWindow();
57 | renderer.onRenderSurfaceDestroyed(null);
58 | }
59 |
60 | @Override
61 | public void setFrameRate(double rate) {
62 | throw new IllegalStateException("not implemented");
63 | }
64 |
65 | @Override
66 | public void setAntiAliasingMode(ANTI_ALIASING_CONFIG config) {
67 | throw new IllegalStateException("not implemented");
68 | }
69 |
70 | @Override
71 | public void setSampleCount(int count) {
72 | throw new IllegalStateException("not implemented");
73 | }
74 |
75 | @Override
76 | public void setSurfaceRenderer(IRajawaliSurfaceRenderer renderer) throws IllegalStateException {
77 |
78 | if (this.renderer != null)
79 | throw new IllegalStateException("A renderer has already been set for this view.");
80 |
81 | renderer.setRenderSurface(this);
82 |
83 | this.renderer = renderer;
84 |
85 | onPause(); // We want to halt the surface view until we are ready
86 | }
87 |
88 | @Override
89 | public void requestRenderUpdate() {
90 | requestRender();
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v21/ic_menu_camera.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v21/ic_menu_gallery.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v21/ic_menu_manage.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v21/ic_menu_send.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v21/ic_menu_share.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v21/ic_menu_slideshow.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/play.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Wef2/android-vr-player/7f0fc0d3d24e7ca5db0ea3bf3e14357125bc1acd/app/src/main/res/drawable/play.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/side_nav_bar.xml:
--------------------------------------------------------------------------------
1 |
3 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/stop.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Wef2/android-vr-player/7f0fc0d3d24e7ca5db0ea3bf3e14357125bc1acd/app/src/main/res/drawable/stop.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/vr.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Wef2/android-vr-player/7f0fc0d3d24e7ca5db0ea3bf3e14357125bc1acd/app/src/main/res/drawable/vr.png
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_list.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
15 |
16 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/app_bar_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/content_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/nav_header_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
20 |
21 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/video_controller.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
21 |
22 |
28 |
29 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/video_row.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
14 |
15 |
19 |
20 |
25 |
26 |
31 |
32 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/vr.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/activity_main_drawer.xml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/main.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_list.xml:
--------------------------------------------------------------------------------
1 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Wef2/android-vr-player/7f0fc0d3d24e7ca5db0ea3bf3e14357125bc1acd/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Wef2/android-vr-player/7f0fc0d3d24e7ca5db0ea3bf3e14357125bc1acd/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Wef2/android-vr-player/7f0fc0d3d24e7ca5db0ea3bf3e14357125bc1acd/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Wef2/android-vr-player/7f0fc0d3d24e7ca5db0ea3bf3e14357125bc1acd/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Wef2/android-vr-player/7f0fc0d3d24e7ca5db0ea3bf3e14357125bc1acd/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/raw/coc.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Wef2/android-vr-player/7f0fc0d3d24e7ca5db0ea3bf3e14357125bc1acd/app/src/main/res/raw/coc.mp4
--------------------------------------------------------------------------------
/app/src/main/res/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 | >
2 |
3 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 | 16dp
6 |
7 | 16dp
8 | 100dp
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/values/drawables.xml:
--------------------------------------------------------------------------------
1 |
2 | - @android:drawable/ic_menu_camera
3 | - @android:drawable/ic_menu_gallery
4 | - @android:drawable/ic_menu_slideshow
5 | - @android:drawable/ic_menu_manage
6 | - @android:drawable/ic_menu_share
7 | - @android:drawable/ic_menu_send
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | NEO360
3 | Settings
4 | MainActivity
5 |
6 | Open navigation drawer
7 | Close navigation drawer
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/test/java/com/neointernet/neo360/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.neointernet.neo360;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * To work on unit tests, switch the Test Artifact in the Build Variants view.
9 | */
10 | public class ExampleUnitTest {
11 | @Test
12 | public void addition_isCorrect() throws Exception {
13 | assertEquals(4, 2 + 2);
14 | }
15 | }
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:1.5.0'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | }
19 | }
20 |
21 | task clean(type: Delete) {
22 | delete rootProject.buildDir
23 | }
24 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Wef2/android-vr-player/7f0fc0d3d24e7ca5db0ea3bf3e14357125bc1acd/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Oct 21 11:34:03 PDT 2015
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------