Compare commits

..

No commits in common. "master" and "kioskmode" have entirely different histories.

8 changed files with 10 additions and 33 deletions

View file

@ -33,7 +33,7 @@ dependencies {
})
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.android.support:support-v4:24.2.0'
compile 'com.affectiva.android:affdexsdk:3.2'
compile 'com.affectiva.android:affdexsdk:3.1.2'
compile 'com.google.code.gson:gson:2.4'
compile 'com.android.support:design:24.2.0'
compile 'com.loopj.android:android-async-http:1.4.9'

View file

@ -10,9 +10,6 @@
<uses-permission android:name="android.permission.REORDER_TASKS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.READ_LOGS"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application
android:name=".AppContext"
android:allowBackup="true"

View file

@ -2,6 +2,7 @@ package com.rubenvandeven.emotionhero;
import android.graphics.Bitmap;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
/**
* Created by ruben on 10/09/16.

View file

@ -41,7 +41,7 @@ import cz.msebera.android.httpclient.entity.StringEntity;
*/
public class ApiRestClient {
private static final String BASE_URL = "https://api.emotionhero.com";
private static final String BASE_URL = "https://api.emotionhero.com"; // TODO: https!
/**
* For some reason validation of SSL certificate needs to be disabled (using true).

View file

@ -10,13 +10,6 @@ import android.os.PowerManager;
* For kioskmode only!
* See http://www.andreas-schrade.de/2015/02/16/android-tutorial-how-to-create-a-kiosk-mode-in-android/
*/
@ReportsCrashes(
buildConfigClass=BuildConfig.class,
formUri="http://crashes.rubenvandeven.com/api",
formUriBasicAuthLogin="com.rubenvandeven.emotion_hero.kiosk",
formUriBasicAuthPassword="4fkpp89Q+VKdbVj3VIbBFKTT",
mode=ReportingInteractionMode.TOAST,
resToastText=R.string.crash_toast_text)
public class AppContext extends Application {
private AppContext instance;
private PowerManager.WakeLock wakeLock;
@ -27,10 +20,8 @@ public class AppContext extends Application {
public void onCreate() {
super.onCreate();
instance = this;
if (!ACRA.isACRASenderServiceProcess()) {
registerKioskModeScreenOffReceiver();
startKioskService();
}
registerKioskModeScreenOffReceiver();
startKioskService();
}
private void registerKioskModeScreenOffReceiver() {
@ -40,12 +31,6 @@ public class AppContext extends Application {
registerReceiver(onScreenOffReceiver, filter);
}
protected void attachBaseContext(Context paramContext)
{
super.attachBaseContext(paramContext);
ACRA.init(this, new ConfigurationBuilder(this).setReportField(ReportField.USER_COMMENT, false), true);
}
public PowerManager.WakeLock getWakeLock() {
if(wakeLock == null) {
// lazy loading: first call, create wakeLock via PowerManager.

View file

@ -115,7 +115,6 @@ public class MirrorMenuActivity extends AppCompatActivity implements Detector.Im
int maxHeight = MirrorMenuActivity.this.getWindow().getDecorView().getHeight();
int width;
int height;
Log.i(LOG_TAG, "Change the camera preview: " + previewWidth + " + " + measureWidth);
if (previewHeight == 0 || previewWidth == 0) {
width = measureWidth;
height = measureHeight;
@ -147,13 +146,13 @@ public class MirrorMenuActivity extends AppCompatActivity implements Detector.Im
setMeasuredDimension(width,height);
}
};
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
// RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(1,1);
params.addRule(RelativeLayout.CENTER_IN_PARENT,RelativeLayout.TRUE);
// 10% margin:
// params.leftMargin = (int) 120;
// params.rightMargin = params.leftMargin;
cameraPreview.setLayoutParams(params);
cameraPreview.setWillNotDraw(false);
videoContentLayout.addView(cameraPreview,0);
scenarioView = new ScenarioView(this, null);
@ -322,7 +321,7 @@ public class MirrorMenuActivity extends AppCompatActivity implements Detector.Im
// SurfaceView surfaceView = (SurfaceView) findViewById(R.id.surfaceView);
detector = new CameraDetector(this, CameraDetector.CameraType.CAMERA_FRONT, cameraPreview, 1, Detector.FaceDetectorMode.LARGE_FACES);
// detector.setLicensePath("emotionhero_dev.license");
detector.setLicensePath("emotionhero_dev.license");
detector.setDetectAllEmotions(true);
detector.setDetectAllAppearances(false);
@ -376,7 +375,6 @@ public class MirrorMenuActivity extends AppCompatActivity implements Detector.Im
previewHeight = height;
previewWidth = width;
}
Log.i(LOG_TAG, "onCameraSize "+previewWidth +"x"+previewHeight);
cameraPreview.requestLayout();
}

View file

@ -147,8 +147,6 @@ public class ScenarioView extends SurfaceView implements SurfaceHolder.Callback
float height = canvas.getHeight();
float width = canvas.getWidth();
Log.i("ScenarioView", "onDraw "+ width+" x " +height);
if(_scenario != null)
{

View file

@ -23,6 +23,4 @@
<string name="permission_yes">Sure!</string>
<string name="ending_winner">You are the one and only <i>Emotion Hero</i>!</string>
<string name="ending_loser">You have finished all steps in the training, and many peers have done the same. It is too bad that many scored better than you. Try smiling better next time!</string>
<string name="crash_toast_text">Sorry, Emotion Hero just crashed.</string>
</resources>