Minor layout changes
This commit is contained in:
parent
d12a9bd38e
commit
a80425b547
4 changed files with 16 additions and 14 deletions
|
@ -21,8 +21,6 @@
|
||||||
|
|
||||||
<!--<intent-filter> -->
|
<!--<intent-filter> -->
|
||||||
<!--<action android:name="android.intent.action.MAIN" />-->
|
<!--<action android:name="android.intent.action.MAIN" />-->
|
||||||
|
|
||||||
|
|
||||||
<!--<category android:name="android.intent.category.LAUNCHER" /> -->
|
<!--<category android:name="android.intent.category.LAUNCHER" /> -->
|
||||||
<!--</intent-filter> -->
|
<!--</intent-filter> -->
|
||||||
</activity>
|
</activity>
|
||||||
|
|
|
@ -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(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||||
// RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(1,1);
|
// RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(1,1);
|
||||||
params.addRule(RelativeLayout.CENTER_IN_PARENT,RelativeLayout.TRUE);
|
params.addRule(RelativeLayout.CENTER_IN_PARENT,RelativeLayout.TRUE);
|
||||||
|
// 10% margin:
|
||||||
|
params.leftMargin = (int) 120;
|
||||||
|
params.rightMargin = params.leftMargin;
|
||||||
cameraPreview.setLayoutParams(params);
|
cameraPreview.setLayoutParams(params);
|
||||||
videoLayout.addView(cameraPreview,0);
|
videoLayout.addView(cameraPreview,0);
|
||||||
|
|
||||||
|
@ -242,6 +245,7 @@ public class GamingActivity extends AppCompatActivity implements Detector.ImageL
|
||||||
if (list == null)
|
if (list == null)
|
||||||
return;
|
return;
|
||||||
if (list.size() == 0) {
|
if (list.size() == 0) {
|
||||||
|
setText("No face found...");
|
||||||
// mContentView.setText("NO FACE FOUND"); // this happens in onFaceDetectionStopped
|
// mContentView.setText("NO FACE FOUND"); // this happens in onFaceDetectionStopped
|
||||||
} else {
|
} else {
|
||||||
hideText(); // hide textView as we want as few elements as possible.
|
hideText(); // hide textView as we want as few elements as possible.
|
||||||
|
@ -300,7 +304,6 @@ public class GamingActivity extends AppCompatActivity implements Detector.ImageL
|
||||||
@Override
|
@Override
|
||||||
public void onFaceDetectionStopped()
|
public void onFaceDetectionStopped()
|
||||||
{
|
{
|
||||||
setText("No face found...");
|
|
||||||
currentScenario.pause();
|
currentScenario.pause();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -344,7 +347,7 @@ public class GamingActivity extends AppCompatActivity implements Detector.ImageL
|
||||||
}
|
}
|
||||||
|
|
||||||
public void finishLevel() {
|
public void finishLevel() {
|
||||||
setText("LEVEL ENDED");
|
// setText("LEVEL ENDED");
|
||||||
stopDetector();
|
stopDetector();
|
||||||
// restartButton.setVisibility(View.VISIBLE);
|
// restartButton.setVisibility(View.VISIBLE);
|
||||||
// if(!currentScenario.isFinalLevel()) {
|
// if(!currentScenario.isFinalLevel()) {
|
||||||
|
|
|
@ -105,14 +105,14 @@ public class ScenarioView extends SurfaceView implements SurfaceHolder.Callback
|
||||||
|
|
||||||
for(Emotion emotion: Emotion.values()) {
|
for(Emotion emotion: Emotion.values()) {
|
||||||
Paint emoPaint = new Paint();
|
Paint emoPaint = new Paint();
|
||||||
emoPaint.setTextSize(20);
|
emoPaint.setTextSize(22);
|
||||||
emoPaint.setColor(emotion.getColor());
|
emoPaint.setColor(emotion.getColor());
|
||||||
emoPaints.put(emotion, emoPaint);
|
emoPaints.put(emotion, emoPaint);
|
||||||
|
|
||||||
Paint emoPaintOutline = new Paint();
|
Paint emoPaintOutline = new Paint();
|
||||||
emoPaintOutline.setColor(emotion.getColor());
|
emoPaintOutline.setColor(emotion.getColor());
|
||||||
emoPaintOutline.setStyle(Paint.Style.STROKE);
|
emoPaintOutline.setStyle(Paint.Style.STROKE);
|
||||||
emoPaintOutline.setStrokeWidth(2);
|
emoPaintOutline.setStrokeWidth(3);
|
||||||
emoOutlinePaints.put(emotion, emoPaintOutline);
|
emoOutlinePaints.put(emotion, emoPaintOutline);
|
||||||
|
|
||||||
Paint emoScoredPaint = new Paint();
|
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, 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, emoPaints.get(emotion.ordinal()));
|
||||||
canvas.drawCircle(cx, cy, max_ball_radius * value/100, attrScorePaint);
|
canvas.drawCircle(cx, cy, max_ball_radius * value/100, attrScorePaint);
|
||||||
|
|
||||||
Path emoNamePath = new Path();
|
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:
|
// 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.rCubicTo(width*0.1f,0, width*0.1f, height*0.2f,width*0.2f,height*0.2f);
|
||||||
emoNamePath.rLineTo(1000,1000);
|
emoNamePath.rLineTo(1000,1000);
|
||||||
|
@ -242,8 +242,9 @@ public class ScenarioView extends SurfaceView implements SurfaceHolder.Callback
|
||||||
public void surfaceCreated(SurfaceHolder holder) {
|
public void surfaceCreated(SurfaceHolder holder) {
|
||||||
setWillNotDraw(false); //Allows us to use invalidate() to call onDraw()
|
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.TRANSPARENT);
|
||||||
|
// holder.setFormat(PixelFormat.TRANSLUCENT);
|
||||||
|
|
||||||
// Log.e("TEST2", "Jaa2!");
|
// Log.e("TEST2", "Jaa2!");
|
||||||
_thread = new PanelThread(getHolder(), this); //Start the thread that
|
_thread = new PanelThread(getHolder(), this); //Start the thread that
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<string name="nextLvl">Next Level!</string>
|
<string name="nextLvl">Next Level!</string>
|
||||||
<string name="start">Start</string>
|
<string name="start">Start</string>
|
||||||
<string name="continueBtn">Continue</string>
|
<string name="continueBtn">Continue</string>
|
||||||
<string name="highscores">Highscores</string>
|
<string name="highscores">Levels</string>
|
||||||
<string name="credits">Credits</string>
|
<string name="credits">Credits</string>
|
||||||
<string name="title_activity_highscore">HighscoreActivity</string>
|
<string name="title_activity_highscore">HighscoreActivity</string>
|
||||||
<string name="action_settings">Settings</string>
|
<string name="action_settings">Settings</string>
|
||||||
|
|
Loading…
Reference in a new issue