Skip to content

Commit

Permalink
Fixed a bug causing the app to crash on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
trife committed Dec 21, 2015
1 parent 54c2207 commit ef486a6
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 24 deletions.
7 changes: 4 additions & 3 deletions onekk/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.wheatgenetics.onekk"
android:versionCode="100"
android:versionName="1.0">
android:versionCode="101"
android:versionName="1.0.1">

<uses-feature android:name="android.hardware.usb.host" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Expand All @@ -37,6 +37,7 @@
android:launchMode="singleTask"
android:screenOrientation="sensorPortrait"
android:windowSoftInputMode="adjustResize">

<intent-filter>
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
</intent-filter>
Expand Down
11 changes: 6 additions & 5 deletions onekk/src/main/java/org/wheatgenetics/onekk/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -346,15 +346,16 @@ public void onManagerConnected(int status) {
private void startCamera() {
mCamera = getCameraInstance();

Camera.Parameters params = mCamera.getParameters();
params.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE);
mCamera.setParameters(params);
PackageManager pm = getPackageManager();
if(pm.hasSystemFeature(PackageManager.FEATURE_CAMERA_AUTOFOCUS)){
Camera.Parameters params = mCamera.getParameters();
params.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE);
mCamera.setParameters(params);
}

// Create our Preview view and set it as the content of our activity.
mPreview = new CameraPreview(this, mCamera);
preview.addView(mPreview);


}

private void goToTop() {
Expand Down
3 changes: 3 additions & 0 deletions onekk/src/main/res/raw/changelog_releases.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
3/1.0.1
Fixed a bug causing the app to crash on startup

2/1.0.0
Updated with new algorithm
New material layout
Expand Down
3 changes: 3 additions & 0 deletions onekk/src/main/res/raw/dev_changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
6
Fixed a bug that caused crashes on pre Lollipop devices

5
Added Other Apps dialog

Expand Down
5 changes: 0 additions & 5 deletions onekk/src/main/res/values-v14/styles.xml

This file was deleted.

11 changes: 0 additions & 11 deletions onekk/src/main/res/values-v21/styles.xml

This file was deleted.

0 comments on commit ef486a6

Please sign in to comment.