Commit 4651038d authored by rakam's avatar rakam

InfoMatch (new api)

parent 23f9c3ba
......@@ -92,26 +92,20 @@ public class HomeActivity extends Activity {
String tableau = jsonMatch.getAsJsonPrimitive("Tableau").getAsString();
final PlayerInfo playerA1, playerA2, playerB1, playerB2;
String nameA = jsonMatch.getAsJsonPrimitive("NamePlayers_A").getAsString();
String nameB = jsonMatch.getAsJsonPrimitive("NamePlayers_B").getAsString();
int idPlayerA1 = jsonMatch.getAsJsonPrimitive("IdPlayerA_1").getAsInt();
int idPlayerB1 = jsonMatch.getAsJsonPrimitive("IdPlayerB_1").getAsInt();
String nameA1 = Utils.getStringFromJson(jsonMatch, "Player_A1");
String nameB1 = Utils.getStringFromJson(jsonMatch, "Player_B1");
playerA1 = new PlayerInfo(idPlayerA1, PlayerInfo.MAN, nameA1, teamA.getISO());
playerB1 = new PlayerInfo(idPlayerB1, PlayerInfo.MAN, nameB1, teamB.getISO());
if (category.contains("D")) {
int idPlayerA1 = jsonMatch.getAsJsonPrimitive("IdPlayerA_1").getAsInt();
int idPlayerA2 = jsonMatch.getAsJsonPrimitive("IdPlayerA_2").getAsInt();
int idPlayerB1 = jsonMatch.getAsJsonPrimitive("IdPlayerB_1").getAsInt();
int idPlayerB2 = jsonMatch.getAsJsonPrimitive("IdPlayerB_2").getAsInt();
String nameA1 = nameA.split("/")[0];
String nameA2 = nameA.split("/")[1];
String nameB1 = nameB.split("/")[0];
String nameB2 = nameB.split("/")[1];
playerA1 = new PlayerInfo(idPlayerA1, PlayerInfo.MAN, nameA1, teamA.getISO());
String nameA2 = Utils.getStringFromJson(jsonMatch, "Player_A2");
String nameB2 = Utils.getStringFromJson(jsonMatch, "Player_B2");
playerA2 = new PlayerInfo(idPlayerA2, PlayerInfo.MAN, nameA2, teamA.getISO());
playerB1 = new PlayerInfo(idPlayerB1, PlayerInfo.MAN, nameB1, teamB.getISO());
playerB2 = new PlayerInfo(idPlayerB2, PlayerInfo.MAN, nameB2, teamB.getISO());
} else {
int idPlayerA = jsonMatch.getAsJsonPrimitive("IdPlayerA_1").getAsInt();
int idPlayerB = jsonMatch.getAsJsonPrimitive("IdPlayerB_1").getAsInt();
playerA1 = new PlayerInfo(idPlayerA, PlayerInfo.MAN, nameA, teamA.getISO());
playerB1 = new PlayerInfo(idPlayerB, PlayerInfo.MAN, nameB, teamB.getISO());
playerA2 = null;
playerB2 = null;
}
......
......@@ -72,8 +72,10 @@ public class MatchAdapter extends BaseAdapter {
final MatchInfo match = matches.get(position);
ViewHolder viewHolder = (ViewHolder) itemView.getTag();
Ion.with(viewHolder.drapeauA)
.fadeIn(false)
.load(match.getTeamA().getFlagUrl());
Ion.with(viewHolder.drapeauB)
.fadeIn(false)
.load(match.getTeamB().getFlagUrl());
viewHolder.paysA.setText(match.getTeamA().getName());
viewHolder.paysB.setText(match.getTeamB().getName());
......
......@@ -9,7 +9,7 @@
<item name="android:layout_margin">@dimen/stats_button_margin</item>
<item name="android:background">@drawable/ac_button_background</item>
<item name="android:textColor">@color/ac_button_color</item>
<item name="android:textSize">30sp</item>
<item name="android:textSize">20sp</item>
<item name="android:textStyle">bold</item>
</style>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment