Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

Commit

Permalink
Tidy some more things up for compliance.
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrant committed Jan 23, 2016
1 parent 4f977fd commit e79d6f2
Show file tree
Hide file tree
Showing 9 changed files with 374 additions and 399 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "com.dmitrybrant.gearvrf.planetarium"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
versionCode 2
versionName "1.1"
}
buildTypes {
release {
Expand Down
9 changes: 7 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@
* limitations under the License.
*/-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.dmitrybrant.gearvrf.planetarium">
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.dmitrybrant.gearvrf.planetarium"
android:installLocation="internalOnly">

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />

<uses-feature android:glEsVersion="0x00020000" android:required="true" />

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
Expand All @@ -42,6 +46,7 @@
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.INFO" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,28 +325,7 @@ private void setObjectPosition(GVRSceneObject obj, double ra, double dec, float

public boolean dispatchKeyEvent(KeyEvent event) {
if (event.getKeyCode() == KeyEvent.KEYCODE_VOLUME_UP) {
mContext.captureScreenLeft(new GVRScreenshotCallback() {
@Override
public void onScreenCaptured(Bitmap bitmap) {
try {
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, 100, bytes);
int imageIndex = 0;
File f;
String fileName;
do {
fileName = Integer.toString(imageIndex) + ".png";
imageIndex++;
} while ((f = new File(Environment.getExternalStorageDirectory().getPath() + "/" + fileName)).exists());
FileOutputStream fo = new FileOutputStream(f);
fo.write(bytes.toByteArray());
fo.close();
mActivity.createVrToastOnUiThread("Saved screen to " + fileName);
} catch (Exception e) {
mActivity.createVrToastOnUiThread("Screenshot error: " + e.getMessage());
}
}
});
//takeScreenshot();
}

if (event.getKeyCode() == KeyEvent.KEYCODE_BACK) {
Expand All @@ -368,7 +347,6 @@ public void onScroll(float scrollX, float scrollY) {
}
}


private void setupAnimation(GVRAnimation animation) {
animation.setRepeatMode(GVRRepeatMode.REPEATED).setRepeatCount(-1);
continuousAnimationList.add(animation);
Expand All @@ -395,4 +373,28 @@ private void animateClockwise(GVRTransform transform, float duration) {
0.0f, 0.0f, 0.0f));
}

private void takeScreenshot() {
mContext.captureScreenLeft(new GVRScreenshotCallback() {
@Override
public void onScreenCaptured(Bitmap bitmap) {
try {
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, 100, bytes);
int imageIndex = 0;
File f;
String fileName;
do {
fileName = Integer.toString(imageIndex) + ".png";
imageIndex++;
} while ((f = new File(Environment.getExternalStorageDirectory().getPath() + "/" + fileName)).exists());
FileOutputStream fo = new FileOutputStream(f);
fo.write(bytes.toByteArray());
fo.close();
mActivity.createVrToastOnUiThread("Saved screen to " + fileName);
} catch (Exception e) {
mActivity.createVrToastOnUiThread("Screenshot error: " + e.getMessage());
}
}
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

public class StarLoader {
private static final String TAG = "StarLoader";
public static final float MAX_STAR_MAGNITUDE = 4.7f;
public static final float MAX_STAR_MAGNITUDE = 4.5f;
public static final float DEFAULT_DISTANCE_STAR = 500f;

private static GVRMesh starMesh;
Expand Down
Binary file added art/__default_splash_screen__.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added art/cover_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added art/hero_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
710 changes: 339 additions & 371 deletions art/ic_launcher_512.pdn

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e79d6f2

Please sign in to comment.