Commit 5138decb authored by rakam's avatar rakam
Browse files

Changement de la liste des matchs en fonction du jour

parent bdd48462
......@@ -16,8 +16,11 @@ import com.google.gson.JsonObject;
import com.koushikdutta.async.future.FutureCallback;
import com.koushikdutta.ion.Ion;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import fr.istic.masteru.android.R;
import fr.istic.masteru.android.activities.MatchSetupActivity;
......@@ -66,8 +69,20 @@ public class SelectMatchFragment extends SetupFragment implements OnMatchSelecte
}
private void loadMatches() {
SimpleDateFormat sdf = new SimpleDateFormat("EEEE", Locale.ENGLISH);
Date d = new Date();
String dayOfTheWeek = sdf.format(d);
String tableau = null;
if (dayOfTheWeek.equals("Sunday"))
tableau = "finale";
else if (dayOfTheWeek.equals("Saturday"))
tableau = "1/2";
else if (dayOfTheWeek.equals("Friday"))
tableau = "1/4";
final JsonObject param = new JsonObject();
param.addProperty("tableau", "1/4");// todo changer en fonction du jour
param.addProperty("tableau", tableau);
Ion.with(matchSetupActivity)
.load(API_URLS.MATCHS)
.setTimeout(1000 * 10)
......
......@@ -47,7 +47,7 @@ public class Util {
if (countryCode.equals("RUS"))
return R.string.russia;
if (countryCode.equals("IRL"))
return R.string.belgium;
return R.string.ireland;
if (countryCode.equals("BEL"))
return R.string.belgium;
return -1;
......
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