Minor layout changes

This commit is contained in:
Ruben 2016-08-30 18:06:18 +01:00
parent d12a9bd38e
commit a80425b547
4 changed files with 16 additions and 14 deletions

View file

@ -21,8 +21,6 @@
<!--<intent-filter> -->
<!--<action android:name="android.intent.action.MAIN" />-->
<!--<category android:name="android.intent.category.LAUNCHER" /> -->
<!--</intent-filter> -->
</activity>

View file

@ -146,6 +146,9 @@ public class GamingActivity extends AppCompatActivity implements Detector.ImageL
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);
videoLayout.addView(cameraPreview,0);
@ -242,6 +245,7 @@ public class GamingActivity extends AppCompatActivity implements Detector.ImageL
if (list == null)
return;
if (list.size() == 0) {
setText("No face found...");
// mContentView.setText("NO FACE FOUND"); // this happens in onFaceDetectionStopped
} else {
hideText(); // hide textView as we want as few elements as possible.
@ -300,7 +304,6 @@ public class GamingActivity extends AppCompatActivity implements Detector.ImageL
@Override
public void onFaceDetectionStopped()
{
setText("No face found...");
currentScenario.pause();
}
@ -344,7 +347,7 @@ public class GamingActivity extends AppCompatActivity implements Detector.ImageL
}
public void finishLevel() {
setText("LEVEL ENDED");
// setText("LEVEL ENDED");
stopDetector();
// restartButton.setVisibility(View.VISIBLE);
// if(!currentScenario.isFinalLevel()) {

View file

@ -105,14 +105,14 @@ public class ScenarioView extends SurfaceView implements SurfaceHolder.Callback
for(Emotion emotion: Emotion.values()) {
Paint emoPaint = new Paint();
emoPaint.setTextSize(20);
emoPaint.setTextSize(22);
emoPaint.setColor(emotion.getColor());
emoPaints.put(emotion, emoPaint);
Paint emoPaintOutline = new Paint();
emoPaintOutline.setColor(emotion.getColor());
emoPaintOutline.setStyle(Paint.Style.STROKE);
emoPaintOutline.setStrokeWidth(2);
emoPaintOutline.setStrokeWidth(3);
emoOutlinePaints.put(emotion, emoPaintOutline);
Paint emoScoredPaint = new Paint();
@ -168,13 +168,13 @@ public class ScenarioView extends SurfaceView implements SurfaceHolder.Callback
canvas.drawCircle(cx, cy, max_ball_radius, mainPaint);
canvas.drawCircle(cx, cy, max_ball_radius, emoOutlinePaints.get(emotion));
canvas.drawCircle(cx, cy, max_ball_radius + 5, emoOutlinePaints.get(emotion));
// canvas.drawCircle(cx, cy, max_ball_radius * value/100, emoPaints.get(emotion.ordinal()));
canvas.drawCircle(cx, cy, max_ball_radius * value/100, attrScorePaint);
Path emoNamePath = new Path();
emoNamePath.moveTo(cx, cy + max_ball_radius * 1.5f);
emoNamePath.moveTo(cx, cy + max_ball_radius * 1.55f);
// more curly line to draw on:
// emoNamePath.rCubicTo(width*0.1f,0, width*0.1f, height*0.2f,width*0.2f,height*0.2f);
emoNamePath.rLineTo(1000,1000);
@ -242,8 +242,9 @@ public class ScenarioView extends SurfaceView implements SurfaceHolder.Callback
public void surfaceCreated(SurfaceHolder holder) {
setWillNotDraw(false); //Allows us to use invalidate() to call onDraw()
// this.setZOrderOnTop(true);
// this.setZOrderOnTop(true); // performance impact
// holder.setFormat(PixelFormat.TRANSPARENT);
// holder.setFormat(PixelFormat.TRANSLUCENT);
// Log.e("TEST2", "Jaa2!");
_thread = new PanelThread(getHolder(), this); //Start the thread that

View file

@ -8,7 +8,7 @@
<string name="nextLvl">Next Level!</string>
<string name="start">Start</string>
<string name="continueBtn">Continue</string>
<string name="highscores">Highscores</string>
<string name="highscores">Levels</string>
<string name="credits">Credits</string>
<string name="title_activity_highscore">HighscoreActivity</string>
<string name="action_settings">Settings</string>