Commit 970edab1 authored by rakam's avatar rakam
Browse files

Unifies SingleMatchActivity and DoubleMatchActivity UI

parent 5e67feac
...@@ -2,27 +2,16 @@ package fr.istic.masteru.android.activities; ...@@ -2,27 +2,16 @@ package fr.istic.masteru.android.activities;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationSet;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import com.koushikdutta.async.future.FutureCallback; import com.koushikdutta.async.future.FutureCallback;
import com.koushikdutta.ion.Ion; import com.koushikdutta.ion.Ion;
import java.util.ArrayList;
import java.util.List;
import fr.istic.masteru.android.R; import fr.istic.masteru.android.R;
import fr.istic.masteru.android.automate.Automate; import fr.istic.masteru.android.automate.Automate;
import fr.istic.masteru.android.automate.AutomateDouble; import fr.istic.masteru.android.automate.AutomateDouble;
import fr.istic.masteru.android.automate.AutomateDoublePro; import fr.istic.masteru.android.automate.AutomateDoublePro;
import fr.istic.masteru.android.model.PlayerInfo;
import fr.istic.masteru.android.utils.Utils; import fr.istic.masteru.android.utils.Utils;
import fr.istic.masteru.android.views.SecureDelayButton;
/** /**
* Activity pour un match double. * Activity pour un match double.
...@@ -35,39 +24,12 @@ public class DoubleMatchActivity extends MatchActivity { ...@@ -35,39 +24,12 @@ public class DoubleMatchActivity extends MatchActivity {
public final static int TYPE_DOUBLE_PRO = 2; public final static int TYPE_DOUBLE_PRO = 2;
private int type; private int type;
private TextView playerLeft1Name, playerRight1Name;
private TextView playerLeft2Name, playerRight2Name;
private TextView playerLeftNat, playerRightNat;
private ImageView playerLeft1Photo, playerRight1Photo;
private ImageView playerLeft2Photo, playerRight2Photo;
private PlayerInfo playerInfoA1, playerInfoA2;
private PlayerInfo playerInfoB1, playerInfoB2;
private String nameA, nameB;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.double_match_activity);
if (!getIntent().getBooleanExtra(MatchActivity.RESUME_MATCH, false)) if (!getIntent().getBooleanExtra(MatchActivity.RESUME_MATCH, false))
type = getIntent().getIntExtra(REFEREEING_TYPE, 0); type = getIntent().getIntExtra(REFEREEING_TYPE, 0);
playerInfoA1 = (PlayerInfo) getIntent().getSerializableExtra(PLAYER_A1);
playerInfoA2 = (PlayerInfo) getIntent().getSerializableExtra(PLAYER_A2);
playerInfoB1 = (PlayerInfo) getIntent().getSerializableExtra(PLAYER_B1);
playerInfoB2 = (PlayerInfo) getIntent().getSerializableExtra(PLAYER_B2);
playerLeft1Name = (TextView) findViewById(R.id.playerLeft1NameTV);
playerLeft2Name = (TextView) findViewById(R.id.playerLeft2NameTV);
playerRight1Name = (TextView) findViewById(R.id.playerRight1NameTV);
playerRight2Name = (TextView) findViewById(R.id.playerRight2NameTV);
playerLeftNat = (TextView) findViewById(R.id.playerLeftNatTV);
playerRightNat = (TextView) findViewById(R.id.playerRightNatTV);
playerLeft1Photo = (ImageView) findViewById(R.id.playerLeft1Photo);
playerLeft2Photo = (ImageView) findViewById(R.id.playerLeft2Photo);
playerRight1Photo = (ImageView) findViewById(R.id.playerRight1Photo);
playerRight2Photo = (ImageView) findViewById(R.id.playerRight2Photo);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
nameA = playerInfoA1.getName() + "/" + playerInfoA2.getName(); nameA = playerInfoA1.getName() + "/" + playerInfoA2.getName();
...@@ -85,7 +47,6 @@ public class DoubleMatchActivity extends MatchActivity { ...@@ -85,7 +47,6 @@ public class DoubleMatchActivity extends MatchActivity {
return null; return null;
} }
@Override @Override
protected Automate getAutomateInstance(int service, boolean sideLeftA) { protected Automate getAutomateInstance(int service, boolean sideLeftA) {
if (type == TYPE_DOUBLE) if (type == TYPE_DOUBLE)
...@@ -196,123 +157,4 @@ public class DoubleMatchActivity extends MatchActivity { ...@@ -196,123 +157,4 @@ public class DoubleMatchActivity extends MatchActivity {
setStatsButtonsForPlayerARight(); setStatsButtonsForPlayerARight();
} }
@Override
protected void fadeIn(Runnable onComplete) {
List<View.OnClickListener> leftListeners = new ArrayList<>();
List<View.OnClickListener> rightListeners = new ArrayList<>();
Animation appearLeft = AnimationUtils.loadAnimation(DoubleMatchActivity.this, R.anim.appear_left);
Animation appearRight = AnimationUtils.loadAnimation(DoubleMatchActivity.this, R.anim.appear_right);
AnimationSet appearAnimationSet = new AnimationSet(true);
appearAnimationSet.addAnimation(appearLeft);
appearAnimationSet.addAnimation(appearRight);
playerLeft1Photo.setAnimation(appearLeft);
playerLeft2Photo.setAnimation(appearLeft);
playerLeft1Name.setAnimation(appearLeft);
playerLeft2Name.setAnimation(appearLeft);
playerLeftNat.setAnimation(appearLeft);
for (SecureDelayButton button : animatedLeftButtons) {
leftListeners.add(button.getOnClickListener());
button.setOnClickListener(null);
button.setAnimation(appearLeft);
}
playerRight1Photo.setAnimation(appearRight);
playerRight2Photo.setAnimation(appearRight);
playerRight1Name.setAnimation(appearRight);
playerRight2Name.setAnimation(appearRight);
playerRightNat.setAnimation(appearRight);
for (SecureDelayButton button : animatedRightButtons) {
rightListeners.add(button.getOnClickListener());
button.setOnClickListener(null);
button.setAnimation(appearRight);
}
appearAnimationSet.start();
playerLeft1Photo.setVisibility(View.VISIBLE);
playerLeft2Photo.setVisibility(View.VISIBLE);
playerLeftNat.setVisibility(View.VISIBLE);
playerLeft1Name.setVisibility(View.VISIBLE);
playerLeft2Name.setVisibility(View.VISIBLE);
int i = 0;
for (SecureDelayButton button : animatedLeftButtons) {
button.setVisibility(View.VISIBLE);
button.setOnClickListener(leftListeners.get(i++));
}
playerRight1Photo.setVisibility(View.VISIBLE);
playerRight2Photo.setVisibility(View.VISIBLE);
playerRightNat.setVisibility(View.VISIBLE);
playerRight1Name.setVisibility(View.VISIBLE);
playerRight2Name.setVisibility(View.VISIBLE);
i = 0;
for (SecureDelayButton button : animatedRightButtons) {
button.setVisibility(View.VISIBLE);
button.setOnClickListener(rightListeners.get(i++));
}
if (onComplete != null) {
new Handler().postDelayed(onComplete, appearAnimationSet.getDuration());
}
}
@Override
protected void fadeOut(final Runnable onComplete) {
for (SecureDelayButton button : animatedLeftButtons)
button.setOnClickListener(null);
for (SecureDelayButton button : animatedRightButtons)
button.setOnClickListener(null);
Animation disappearLeft = AnimationUtils.loadAnimation(this, R.anim.disappear_left);
Animation disappearRight = AnimationUtils.loadAnimation(this, R.anim.disappear_right);
final AnimationSet disappearAnimationSet = new AnimationSet(false);
disappearAnimationSet.addAnimation(disappearLeft);
disappearAnimationSet.addAnimation(disappearRight);
disappearAnimationSet.setRepeatCount(0);
playerLeft1Name.clearAnimation();
playerLeft1Name.clearAnimation();
playerRight1Name.clearAnimation();
playerRight2Name.clearAnimation();
playerLeft1Photo.setAnimation(disappearLeft);
playerLeft2Photo.setAnimation(disappearLeft);
playerLeft1Name.setAnimation(disappearLeft);
playerLeft2Name.setAnimation(disappearLeft);
playerLeftNat.setAnimation(disappearLeft);
for (SecureDelayButton button : animatedLeftButtons)
button.setAnimation(disappearLeft);
playerRight1Photo.setAnimation(disappearRight);
playerRight2Photo.setAnimation(disappearRight);
playerRight1Name.setAnimation(disappearRight);
playerRight2Name.setAnimation(disappearRight);
playerRightNat.setAnimation(disappearRight);
for (SecureDelayButton button : animatedRightButtons)
button.setAnimation(disappearRight);
disappearAnimationSet.start();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
playerLeft1Photo.setVisibility(View.INVISIBLE);
playerLeft2Photo.setVisibility(View.INVISIBLE);
playerLeftNat.setVisibility(View.INVISIBLE);
playerLeft1Name.setVisibility(View.INVISIBLE);
playerLeft2Name.setVisibility(View.INVISIBLE);
for (SecureDelayButton button : animatedLeftButtons)
button.setVisibility(View.INVISIBLE);
playerRight1Photo.setVisibility(View.INVISIBLE);
playerRight2Photo.setVisibility(View.INVISIBLE);
playerRightNat.setVisibility(View.INVISIBLE);
playerRight1Name.setVisibility(View.INVISIBLE);
playerRight2Name.setVisibility(View.INVISIBLE);
for (SecureDelayButton button : animatedRightButtons)
button.setVisibility(View.INVISIBLE);
if (onComplete != null)
onComplete.run();
}
}, disappearAnimationSet.getDuration());
}
} }
...@@ -6,8 +6,12 @@ import android.app.ProgressDialog; ...@@ -6,8 +6,12 @@ import android.app.ProgressDialog;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler;
import android.view.View; import android.view.View;
import android.view.WindowManager; import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.AnimationSet;
import android.view.animation.AnimationUtils;
import android.widget.Button; import android.widget.Button;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
...@@ -24,6 +28,7 @@ import fr.istic.masteru.android.automate.SimplePoint; ...@@ -24,6 +28,7 @@ import fr.istic.masteru.android.automate.SimplePoint;
import fr.istic.masteru.android.automate.Stats; import fr.istic.masteru.android.automate.Stats;
import fr.istic.masteru.android.listeners.OnSyncFinishListener; import fr.istic.masteru.android.listeners.OnSyncFinishListener;
import fr.istic.masteru.android.model.Match; import fr.istic.masteru.android.model.Match;
import fr.istic.masteru.android.model.PlayerInfo;
import fr.istic.masteru.android.utils.ScoreSyncManager; import fr.istic.masteru.android.utils.ScoreSyncManager;
import fr.istic.masteru.android.utils.Utils; import fr.istic.masteru.android.utils.Utils;
import fr.istic.masteru.android.views.MatchScoreView; import fr.istic.masteru.android.views.MatchScoreView;
...@@ -53,6 +58,16 @@ public abstract class MatchActivity extends Activity { ...@@ -53,6 +58,16 @@ public abstract class MatchActivity extends Activity {
private ImageView serviceLeft, serviceRight; private ImageView serviceLeft, serviceRight;
private Button backButton; private Button backButton;
private TextView gameTime; private TextView gameTime;
protected TextView playerLeft1Name, playerRight1Name;
protected TextView playerLeft2Name, playerRight2Name;
protected TextView playerLeftNat, playerRightNat;
protected ImageView playerLeft1Photo, playerRight1Photo;
protected ImageView playerLeft2Photo, playerRight2Photo;
protected PlayerInfo playerInfoA1, playerInfoA2;
protected PlayerInfo playerInfoB1, playerInfoB2;
protected String nameA, nameB;
protected View leftButtons, rightButtons; protected View leftButtons, rightButtons;
protected SecureDelayButton leftPointButton, rightPointButton; protected SecureDelayButton leftPointButton, rightPointButton;
protected SecureDelayButton leftAceButton, rightAceButton; protected SecureDelayButton leftAceButton, rightAceButton;
...@@ -65,8 +80,33 @@ public abstract class MatchActivity extends Activity { ...@@ -65,8 +80,33 @@ public abstract class MatchActivity extends Activity {
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
setContentView(R.layout.match_activity);
match = (Match) getIntent().getSerializableExtra(MATCH); match = (Match) getIntent().getSerializableExtra(MATCH);
matchScoreView = (MatchScoreView) findViewById(R.id.matchScoreView); matchScoreView = (MatchScoreView) findViewById(R.id.matchScoreView);
// Infos views
playerInfoA1 = (PlayerInfo) getIntent().getSerializableExtra(PLAYER_A1);
playerInfoA2 = (PlayerInfo) getIntent().getSerializableExtra(PLAYER_A2);
playerInfoB1 = (PlayerInfo) getIntent().getSerializableExtra(PLAYER_B1);
playerInfoB2 = (PlayerInfo) getIntent().getSerializableExtra(PLAYER_B2);
playerLeft1Name = (TextView) findViewById(R.id.playerLeft1NameTV);
playerLeft2Name = (TextView) findViewById(R.id.playerLeft2NameTV);
playerRight1Name = (TextView) findViewById(R.id.playerRight1NameTV);
playerRight2Name = (TextView) findViewById(R.id.playerRight2NameTV);
playerLeftNat = (TextView) findViewById(R.id.playerLeftNatTV);
playerRightNat = (TextView) findViewById(R.id.playerRightNatTV);
playerLeft1Photo = (ImageView) findViewById(R.id.playerLeft1Photo);
playerLeft2Photo = (ImageView) findViewById(R.id.playerLeft2Photo);
playerRight1Photo = (ImageView) findViewById(R.id.playerRight1Photo);
playerRight2Photo = (ImageView) findViewById(R.id.playerRight2Photo);
serviceLeft = (ImageView) findViewById(R.id.serviceLeft);
serviceRight = (ImageView) findViewById(R.id.serviceRight);
gameTime = (TextView) findViewById(R.id.gameTime);
backButton = (Button) findViewById(R.id.back);
// Stats views
leftButtons = findViewById(R.id.leftButtons); leftButtons = findViewById(R.id.leftButtons);
rightButtons = findViewById(R.id.rightButtons); rightButtons = findViewById(R.id.rightButtons);
...@@ -80,10 +120,6 @@ public abstract class MatchActivity extends Activity { ...@@ -80,10 +120,6 @@ public abstract class MatchActivity extends Activity {
animatedRightButtons.add(rightAceButton); animatedRightButtons.add(rightAceButton);
animatedRightButtons.add(rightPointButton); animatedRightButtons.add(rightPointButton);
serviceLeft = (ImageView) findViewById(R.id.serviceLeft);
serviceRight = (ImageView) findViewById(R.id.serviceRight);
gameTime = (TextView) findViewById(R.id.gameTime);
backButton = (Button) findViewById(R.id.back);
((TextView) findViewById(R.id.categorie)).setText(Utils.getCategorieName(match.getCategory())); ((TextView) findViewById(R.id.categorie)).setText(Utils.getCategorieName(match.getCategory()));
findViewById(R.id.optionsButton).setOnClickListener(new View.OnClickListener() { findViewById(R.id.optionsButton).setOnClickListener(new View.OnClickListener() {
@Override @Override
...@@ -347,26 +383,26 @@ public abstract class MatchActivity extends Activity { ...@@ -347,26 +383,26 @@ public abstract class MatchActivity extends Activity {
leftPointButton.setOnClickListener(new View.OnClickListener() { leftPointButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
updateUI(new Point(automate.point(1), new Stats(Stats.Type.NONE, false, leftPlayer))); updateUI(new Point(automate.point(leftPlayer), new Stats(Stats.Type.NONE, false, leftPlayer)));
} }
}); });
leftAceButton.setOnClickListener(new View.OnClickListener() { leftAceButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
updateUI(new Point(automate.point(1), new Stats(Stats.Type.ACE, false, leftPlayer))); updateUI(new Point(automate.point(leftPlayer), new Stats(Stats.Type.ACE, false, leftPlayer)));
} }
}); });
rightPointButton.setOnClickListener(new View.OnClickListener() { rightPointButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
updateUI(new Point(automate.point(0), new Stats(Stats.Type.NONE, false, rightPlayer))); updateUI(new Point(automate.point(rightPlayer), new Stats(Stats.Type.NONE, false, rightPlayer)));
} }
}); });
rightAceButton.setOnClickListener(new View.OnClickListener() { rightAceButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
updateUI(new Point(automate.point(0), new Stats(Stats.Type.ACE, false, rightPlayer))); updateUI(new Point(automate.point(rightPlayer), new Stats(Stats.Type.ACE, false, rightPlayer)));
} }
}); });
} }
...@@ -397,19 +433,126 @@ public abstract class MatchActivity extends Activity { ...@@ -397,19 +433,126 @@ public abstract class MatchActivity extends Activity {
*/ */
protected abstract void setPlayerARight(); protected abstract void setPlayerARight();
/**
* Translate in the UI. Run onComplete at the end if it is not null.
*
* @param onComplete
*/
protected abstract void fadeIn(final Runnable onComplete);
protected void fadeIn(Runnable onComplete) {
List<View.OnClickListener> leftListeners = new ArrayList<>();
List<View.OnClickListener> rightListeners = new ArrayList<>();
Animation appearLeft = AnimationUtils.loadAnimation(this, R.anim.appear_left);
Animation appearRight = AnimationUtils.loadAnimation(this, R.anim.appear_right);
AnimationSet appearAnimationSet = new AnimationSet(true);
appearAnimationSet.addAnimation(appearLeft);
appearAnimationSet.addAnimation(appearRight);
playerLeft1Photo.setAnimation(appearLeft);
playerLeft2Photo.setAnimation(appearLeft);
playerLeft1Name.setAnimation(appearLeft);
playerLeft2Name.setAnimation(appearLeft);
playerLeftNat.setAnimation(appearLeft);
for (SecureDelayButton button : animatedLeftButtons) {
leftListeners.add(button.getOnClickListener());
button.setOnClickListener(null);
button.setAnimation(appearLeft);
}
playerRight1Photo.setAnimation(appearRight);
playerRight2Photo.setAnimation(appearRight);
playerRight1Name.setAnimation(appearRight);
playerRight2Name.setAnimation(appearRight);
playerRightNat.setAnimation(appearRight);
for (SecureDelayButton button : animatedRightButtons) {
rightListeners.add(button.getOnClickListener());
button.setOnClickListener(null);
button.setAnimation(appearRight);
}
/** appearAnimationSet.start();
* Translate out the UI. Run onComplete at the end if it is not null.
* playerLeft1Photo.setVisibility(View.VISIBLE);
* @param onComplete playerLeft2Photo.setVisibility(View.VISIBLE);
*/ playerLeftNat.setVisibility(View.VISIBLE);
protected abstract void fadeOut(final Runnable onComplete); playerLeft1Name.setVisibility(View.VISIBLE);
playerLeft2Name.setVisibility(View.VISIBLE);
int i = 0;
for (SecureDelayButton button : animatedLeftButtons) {
button.setVisibility(View.VISIBLE);
button.setOnClickListener(leftListeners.get(i++));
}
playerRight1Photo.setVisibility(View.VISIBLE);
playerRight2Photo.setVisibility(View.VISIBLE);
playerRightNat.setVisibility(View.VISIBLE);
playerRight1Name.setVisibility(View.VISIBLE);
playerRight2Name.setVisibility(View.VISIBLE);
i = 0;
for (SecureDelayButton button : animatedRightButtons) {
button.setVisibility(View.VISIBLE);
button.setOnClickListener(rightListeners.get(i++));
}
if (onComplete != null) {
new Handler().postDelayed(onComplete, appearAnimationSet.getDuration());
}
}
protected void fadeOut(final Runnable onComplete) {
for (SecureDelayButton button : animatedLeftButtons) {
button.setOnClickListener(null);
button.clearAnimation();
}
for (SecureDelayButton button : animatedRightButtons) {
button.setOnClickListener(null);
button.clearAnimation();
}
Animation disappearLeft = AnimationUtils.loadAnimation(this, R.anim.disappear_left);
Animation disappearRight = AnimationUtils.loadAnimation(this, R.anim.disappear_right);
final AnimationSet disappearAnimationSet = new AnimationSet(false);
disappearAnimationSet.addAnimation(disappearLeft);
disappearAnimationSet.addAnimation(disappearRight);
disappearAnimationSet.setRepeatCount(0);
playerLeft1Name.clearAnimation();
playerLeft1Name.clearAnimation();
playerRight1Name.clearAnimation();
playerRight2Name.clearAnimation();
playerLeft1Photo.setAnimation(disappearLeft);
playerLeft2Photo.setAnimation(disappearLeft);
playerLeft1Name.setAnimation(disappearLeft);
playerLeft2Name.setAnimation(disappearLeft);
playerLeftNat.setAnimation(disappearLeft);
for (SecureDelayButton button : animatedLeftButtons)
button.setAnimation(disappearLeft);
playerRight1Photo.setAnimation(disappearRight);
playerRight2Photo.setAnimation(disappearRight);
playerRight1Name.setAnimation(disappearRight);
playerRight2Name.setAnimation(disappearRight);
playerRightNat.setAnimation(disappearRight);
for (SecureDelayButton button : animatedRightButtons)
button.setAnimation(disappearRight);
disappearAnimationSet.start();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
playerLeft1Photo.setVisibility(View.INVISIBLE);
playerLeft2Photo.setVisibility(View.INVISIBLE);
playerLeftNat.setVisibility(View.INVISIBLE);
playerLeft1Name.setVisibility(View.INVISIBLE);
playerLeft2Name.setVisibility(View.INVISIBLE);
for (SecureDelayButton button : animatedLeftButtons)
button.setVisibility(View.INVISIBLE);
playerRight1Photo.setVisibility(View.INVISIBLE);
playerRight2Photo.setVisibility(View.INVISIBLE);
playerRightNat.setVisibility(View.INVISIBLE);
playerRight1Name.setVisibility(View.INVISIBLE);
playerRight2Name.setVisibility(View.INVISIBLE);
for (SecureDelayButton button : animatedRightButtons)
button.setVisibility(View.INVISIBLE);
if (onComplete != null)
onComplete.run();
}
}, disappearAnimationSet.getDuration());
}
} }
...@@ -2,7 +2,7 @@ package fr.istic.masteru.android.activities; ...@@ -2,7 +2,7 @@ package fr.istic.masteru.android.activities;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.os.Bundle; import android.os.Bundle;
import android.widget.ImageView; import android.view.View;
import android.widget.TextView; import android.widget.TextView;
import com.koushikdutta.async.future.FutureCallback; import com.koushikdutta.async.future.FutureCallback;
...@@ -16,29 +16,15 @@ import fr.istic.masteru.android.utils.Utils; ...@@ -16,29 +16,15 @@ import fr.istic.masteru.android.utils.Utils;
public class SingleMatchActivity extends MatchActivity { public class SingleMatchActivity extends MatchActivity {
private TextView playerLeftName, playerRightName;
private TextView playerLeftNat, playerRightNat;
private ImageView playerLeftPhoto, playerRightPhoto;
private PlayerInfo playerInfoA;
private PlayerInfo playerInfoB;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.single_match_activity); playerInfoA1 = (PlayerInfo) getIntent().getSerializableExtra(PLAYER_A1);
playerInfoB1 = (PlayerInfo) getIntent().getSerializableExtra(PLAYER_B1);
playerInfoA = (PlayerInfo) getIntent().getSerializableExtra(PLAYER_A1);
playerInfoB = (PlayerInfo) getIntent().getSerializableExtra(PLAYER_B1);
playerLeftName = (TextView) findViewById(R.id.playerLeftNameTV);
playerRightName = (TextView) findViewById(R.id.playerRightNameTV);
playerLeftNat =