Optimisations graphiques

This commit is contained in:
ynerant 2019-12-04 23:58:04 +01:00
parent c7691639e4
commit edb1183f95
6 changed files with 257 additions and 168 deletions

View File

@ -1,5 +1,6 @@
package fr.ynerant.tarot; package fr.ynerant.tarot;
import android.annotation.SuppressLint;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.util.SparseArray; import android.util.SparseArray;
@ -32,20 +33,26 @@ public class Game {
private int id; private int id;
private Date date; private Date date;
private GameType gameType; private GameType gameType;
@SuppressWarnings("unused")
private Player player1, player2, player3, player4, player5, player6; private Player player1, player2, player3, player4, player5, player6;
private List<Player> players; private List<Player> players;
@SuppressWarnings("unused")
private int nb_players; private int nb_players;
private Bet bet; private Bet bet;
private Player attacker; private Player attacker;
private Player follower; private Player follower;
private int attackScore; private int attack_score;
// private boolean little, twenty_one, excuse; // private boolean little_end, twenty_one, excuse;
private int ends; private int ends;
private int handle; @SuppressWarnings("unused")
private int handle1, handle2, handle3, handle4, handle5, handle6;
private List<Integer> handles;
@SuppressWarnings("unused")
private boolean misery1, misery2, misery3, misery4, misery5, misery6; private boolean misery1, misery2, misery3, misery4, misery5, misery6;
private List<Boolean> miseries; private List<Boolean> miseries;
private boolean littleForAttacker, littleForDefender; private int little_end;
private boolean chelemAnnounced, chelemRealized; private boolean chelem_announced, chelem_realized;
@SuppressWarnings("unused")
private int score1, score2, score3, score4, score5, score6; private int score1, score2, score3, score4, score5, score6;
private List<Integer> points; private List<Integer> points;
@ -92,6 +99,7 @@ public class Game {
return Game.GameType.values()[3 + in.nextInt()]; return Game.GameType.values()[3 + in.nextInt()];
} }
}).registerTypeAdapter(Date.class, new TypeAdapter<Date>() { }).registerTypeAdapter(Date.class, new TypeAdapter<Date>() {
@SuppressLint("SimpleDateFormat")
final DateFormat FORMAT = new SimpleDateFormat("yyyy-mm-dd HH:MM:ss"); final DateFormat FORMAT = new SimpleDateFormat("yyyy-mm-dd HH:MM:ss");
@Override @Override
@ -163,11 +171,11 @@ public class Game {
} }
public int getAttackScore() { public int getAttackScore() {
return attackScore; return attack_score;
} }
public void setAttackScore(int attackScore) { public void setAttackScore(int attack_score) {
this.attackScore = attackScore; this.attack_score = attack_score;
} }
public int getEnds() { public int getEnds() {
@ -178,12 +186,16 @@ public class Game {
this.ends = ends; this.ends = ends;
} }
public int getHandle() { public int getHandle(Player player) {
return handle; return handles.get(players.indexOf(player));
} }
public void setHandle(int handle) { public List<Integer> getHandles() {
this.handle = handle; return handles;
}
public void setHandles(List<Integer> handles) {
this.handles = handles;
} }
public List<Boolean> getMiseries() { public List<Boolean> getMiseries() {
@ -194,36 +206,28 @@ public class Game {
this.miseries = miseries; this.miseries = miseries;
} }
public boolean isLittleForAttacker() { public int getLittleEnd() {
return littleForAttacker; return little_end;
} }
public void setLittleForAttacker(boolean littleForAttacker) { public void setLittleEnd(int little_end) {
this.littleForAttacker = littleForAttacker; this.little_end = little_end;
}
public boolean isLittleForDefender() {
return littleForDefender;
}
public void setLittleForDefender(boolean littleForDefender) {
this.littleForDefender = littleForDefender;
} }
public boolean isChelemAnnounced() { public boolean isChelemAnnounced() {
return chelemAnnounced; return chelem_announced;
} }
public void setChelemAnnounced(boolean chelemAnnounced) { public void setChelemAnnounced(boolean chelem_announced) {
this.chelemAnnounced = chelemAnnounced; this.chelem_announced = chelem_announced;
} }
public boolean isChelemRealized() { public boolean isChelemRealized() {
return chelemRealized; return chelem_realized;
} }
public void setChelemRealized(boolean chelemRealized) { public void setChelemRealized(boolean chelem_realized) {
this.chelemRealized = chelemRealized; this.chelem_realized = chelem_realized;
} }
public int getPoints(Player player) { public int getPoints(Player player) {
@ -235,36 +239,39 @@ public class Game {
} }
public void calculateScores() { public void calculateScores() {
// int ends = (little ? 1 : 0) + (twenty_one ? 1 : 0) + (excuse ? 1 : 0); // int ends = (little_end ? 1 : 0) + (twenty_one ? 1 : 0) + (excuse ? 1 : 0);
int bound = ends == 0 ? 56 : ends == 1 ? 51 : ends == 2 ? 41 : 36; int bound = ends == 0 ? 56 : ends == 1 ? 51 : ends == 2 ? 41 : 36;
boolean win = attackScore >= bound; boolean win = attack_score >= bound;
int gain = Math.abs(attackScore - bound); int gain = Math.abs(attack_score - bound);
int score = 25; int score = 25;
score += gain; score += gain;
score *= bet.getMultiplier(); score *= bet.getMultiplier();
if (handle != 0) for (int i = 0; i < getGameType().getNbPlayers(); ++i) {
score += 10 * (Math.abs(handle) + 1); Player player = getPlayers().get(i);
if (getHandle(player) > 0)
score += 10 * (getHandle(player) + 1);
}
if (!win) if (!win)
score = -score; score = -score;
if (littleForAttacker) if (little_end != 0 && (players.get(little_end - 1) == attacker || players.get(little_end - 1) == follower))
score += 10; score += 10;
else if (littleForDefender) else if (little_end != 0)
score -= 10; score -= 10;
if (chelemAnnounced) { if (chelem_announced) {
if (chelemRealized) if (chelem_realized)
score += 400; score += 400;
else else
score -= 200; score -= 200;
} }
else if (chelemRealized) else if (chelem_realized)
score += 200; score += 200;
attackScore = score; attack_score = score;
Map<Player, Integer> scores = new HashMap<>(); Map<Player, Integer> scores = new HashMap<>();
@ -389,6 +396,17 @@ public class Game {
if (g.player6 != null) if (g.player6 != null)
g.getPlayers().add(g.player6); g.getPlayers().add(g.player6);
g.handles = new ArrayList<>();
g.getHandles().add(g.handle1);
g.getHandles().add(g.handle2);
g.getHandles().add(g.handle3);
if (g.player4 != null)
g.getHandles().add(g.handle4);
if (g.player5 != null)
g.getHandles().add(g.handle5);
if (g.player6 != null)
g.getHandles().add(g.handle6);
g.miseries = new ArrayList<>(); g.miseries = new ArrayList<>();
g.getMiseries().add(g.misery1); g.getMiseries().add(g.misery1);
g.getMiseries().add(g.misery2); g.getMiseries().add(g.misery2);
@ -411,8 +429,6 @@ public class Game {
if (g.player6 != null) if (g.player6 != null)
g.points.add(g.score6); g.points.add(g.score6);
System.out.println(g.toJson());
for (Player p : g.getPlayers()) { for (Player p : g.getPlayers()) {
p.addScore(g.getGameType(), g.getPoints(p)); p.addScore(g.getGameType(), g.getPoints(p));
} }

View File

@ -15,6 +15,7 @@ import java.net.HttpURLConnection;
import java.net.URL; import java.net.URL;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.Comparator;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -81,7 +82,6 @@ public class Player {
} }
public static void updatePlayers() { public static void updatePlayers() {
System.err.println(getAllPlayers());
Executors.newSingleThreadExecutor().execute(new Runnable() { Executors.newSingleThreadExecutor().execute(new Runnable() {
@Override @Override
public void run() { public void run() {
@ -117,7 +117,14 @@ public class Player {
} }
public static Collection<Player> getAllPlayers() { public static Collection<Player> getAllPlayers() {
return PLAYERS.values(); List<Player> list = new ArrayList<>(PLAYERS.values());
list.sort(new Comparator<Player>() {
@Override
public int compare(Player o1, Player o2) {
return String.CASE_INSENSITIVE_ORDER.compare(o1.getName(), o2.getName());
}
});
return list;
} }
public static Player getPlayerById(int id) { public static Player getPlayerById(int id) {

View File

@ -98,7 +98,20 @@ public class NewGameFragment extends Fragment {
final Switch chelem_announced = root.findViewById(R.id.chelem_announced); final Switch chelem_announced = root.findViewById(R.id.chelem_announced);
final Switch chelem_realized = root.findViewById(R.id.chelem_realized); final Switch chelem_realized = root.findViewById(R.id.chelem_realized);
final SeekBar little_end = root.findViewById(R.id.little_end); final SeekBar little_end = root.findViewById(R.id.little_end);
final SeekBar handle = root.findViewById(R.id.handle); final Button handle1 = root.findViewById(R.id.player1_handle);
final Button handle2 = root.findViewById(R.id.player2_handle);
final Button handle3 = root.findViewById(R.id.player3_handle);
final Button handle4 = root.findViewById(R.id.player4_handle);
final Button handle5 = root.findViewById(R.id.player5_handle);
final Button handle6 = root.findViewById(R.id.player6_handle);
final Button[] handles = new Button[]{handle1, handle2, handle3, handle4, handle5, handle6};
final TextView handle1Text = root.findViewById(R.id.player1_handle_text);
final TextView handle2Text = root.findViewById(R.id.player2_handle_text);
final TextView handle3Text = root.findViewById(R.id.player3_handle_text);
final TextView handle4Text = root.findViewById(R.id.player4_handle_text);
final TextView handle5Text = root.findViewById(R.id.player5_handle_text);
final TextView handle6Text = root.findViewById(R.id.player6_handle_text);
final TextView[] handleTexts = new TextView[]{handle1Text, handle2Text, handle3Text, handle4Text, handle5Text, handle6Text};
final ToggleButton misery1 = root.findViewById(R.id.player1_misery); final ToggleButton misery1 = root.findViewById(R.id.player1_misery);
final ToggleButton misery2 = root.findViewById(R.id.player2_misery); final ToggleButton misery2 = root.findViewById(R.id.player2_misery);
final ToggleButton misery3 = root.findViewById(R.id.player3_misery); final ToggleButton misery3 = root.findViewById(R.id.player3_misery);
@ -112,6 +125,7 @@ public class NewGameFragment extends Fragment {
final TextView misery4Text = root.findViewById(R.id.player4_misery_text); final TextView misery4Text = root.findViewById(R.id.player4_misery_text);
final TextView misery5Text = root.findViewById(R.id.player5_misery_text); final TextView misery5Text = root.findViewById(R.id.player5_misery_text);
final TextView misery6Text = root.findViewById(R.id.player6_misery_text); final TextView misery6Text = root.findViewById(R.id.player6_misery_text);
final TextView[] miseryTexts = new TextView[]{misery1Text, misery2Text, misery3Text, misery4Text, misery5Text, misery6Text};
final TextView points1 = root.findViewById(R.id.player1_points); final TextView points1 = root.findViewById(R.id.player1_points);
final TextView points2 = root.findViewById(R.id.player2_points); final TextView points2 = root.findViewById(R.id.player2_points);
final TextView points3 = root.findViewById(R.id.player3_points); final TextView points3 = root.findViewById(R.id.player3_points);
@ -125,6 +139,7 @@ public class NewGameFragment extends Fragment {
final TextView points4Text = root.findViewById(R.id.player4_points_text); final TextView points4Text = root.findViewById(R.id.player4_points_text);
final TextView points5Text = root.findViewById(R.id.player5_points_text); final TextView points5Text = root.findViewById(R.id.player5_points_text);
final TextView points6Text = root.findViewById(R.id.player6_points_text); final TextView points6Text = root.findViewById(R.id.player6_points_text);
final TextView[] pointsText = new TextView[]{points1Text, points2Text, points3Text, points4Text, points5Text, points6Text};
final Runnable updateScore = new Runnable() { final Runnable updateScore = new Runnable() {
@Override @Override
@ -146,11 +161,13 @@ public class NewGameFragment extends Fragment {
game.setPlayers(players); game.setPlayers(players);
game.setBet(Game.Bet.values()[bet.getProgress()]); game.setBet(Game.Bet.values()[bet.getProgress()]);
game.setEnds(nb_ends.getProgress()); game.setEnds(nb_ends.getProgress());
game.setHandle(handle.getProgress()); List<Integer> handle = new ArrayList<>();
for (int i = 0; i < game.getGameType().getNbPlayers(); ++i)
handle.add((int) (1024.0F * (1.0F - handles[i].getAlpha())));
game.setHandles(handle);
game.setChelemAnnounced(chelem_announced.isChecked()); game.setChelemAnnounced(chelem_announced.isChecked());
game.setChelemRealized(chelem_realized.isChecked()); game.setChelemRealized(chelem_realized.isChecked());
game.setLittleForAttacker(little_end.getProgress() == 1); game.setLittleEnd(little_end.getProgress());
game.setLittleForDefender(little_end.getProgress() == 2);
List<Boolean> miseriesList = new ArrayList<>(); List<Boolean> miseriesList = new ArrayList<>();
for (int i = 0; i < game.getGameType().getNbPlayers(); ++i) for (int i = 0; i < game.getGameType().getNbPlayers(); ++i)
miseriesList.add(miseries[i].isChecked()); miseriesList.add(miseries[i].isChecked());
@ -182,18 +199,11 @@ public class NewGameFragment extends Fragment {
dealer.setAdapter(adapter); dealer.setAdapter(adapter);
follower.setAdapter(adapter); follower.setAdapter(adapter);
misery1Text.setText(((Player) player1.getSelectedItem()).getName()); for (int i = 0; i < 6; ++i) {
misery2Text.setText(((Player) player2.getSelectedItem()).getName()); miseryTexts[i].setText(((Player) spinners[i].getSelectedItem()).getName());
misery3Text.setText(((Player) player3.getSelectedItem()).getName()); pointsText[i].setText(((Player) spinners[i].getSelectedItem()).getName());
misery4Text.setText(((Player) player4.getSelectedItem()).getName()); handleTexts[i].setText(((Player) spinners[i].getSelectedItem()).getName());
misery5Text.setText(((Player) player5.getSelectedItem()).getName()); }
misery6Text.setText(((Player) player6.getSelectedItem()).getName());
points1Text.setText(((Player) player1.getSelectedItem()).getName());
points2Text.setText(((Player) player2.getSelectedItem()).getName());
points3Text.setText(((Player) player3.getSelectedItem()).getName());
points4Text.setText(((Player) player4.getSelectedItem()).getName());
points5Text.setText(((Player) player5.getSelectedItem()).getName());
points6Text.setText(((Player) player6.getSelectedItem()).getName());
updateScore.run(); updateScore.run();
} }
@ -221,21 +231,13 @@ public class NewGameFragment extends Fragment {
}; };
updatePlayers.onItemSelected(null, null, 0, 0); updatePlayers.onItemSelected(null, null, 0, 0);
player1.setOnItemSelectedListener(updatePlayers); for (int i = 0; i < 6; ++i) {
player2.setOnItemSelectedListener(updatePlayers); spinners[i].setOnItemSelectedListener(updatePlayers);
player3.setOnItemSelectedListener(updatePlayers); miseries[i].setOnCheckedChangeListener(justUpdate2);
player4.setOnItemSelectedListener(updatePlayers); }
player5.setOnItemSelectedListener(updatePlayers);
player6.setOnItemSelectedListener(updatePlayers);
attacker.setOnItemSelectedListener(justUpdate); attacker.setOnItemSelectedListener(justUpdate);
follower.setOnItemSelectedListener(justUpdate); follower.setOnItemSelectedListener(justUpdate);
dealer.setOnItemSelectedListener(justUpdate); dealer.setOnItemSelectedListener(justUpdate);
misery1.setOnCheckedChangeListener(justUpdate2);
misery2.setOnCheckedChangeListener(justUpdate2);
misery3.setOnCheckedChangeListener(justUpdate2);
misery4.setOnCheckedChangeListener(justUpdate2);
misery5.setOnCheckedChangeListener(justUpdate2);
misery6.setOnCheckedChangeListener(justUpdate2);
nb_players.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { nb_players.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override @Override
@ -259,16 +261,22 @@ public class NewGameFragment extends Fragment {
nb_players_info.setText(resource); nb_players_info.setText(resource);
player4_layout.setVisibility(View.GONE); player4_layout.setVisibility(View.GONE);
handle4Text.setVisibility(View.GONE);
handle4.setVisibility(View.GONE);
misery4Text.setVisibility(View.GONE); misery4Text.setVisibility(View.GONE);
misery4.setVisibility(View.GONE); misery4.setVisibility(View.GONE);
points4Text.setVisibility(View.GONE); points4Text.setVisibility(View.GONE);
points4.setVisibility(View.GONE); points4.setVisibility(View.GONE);
player5_layout.setVisibility(View.GONE); player5_layout.setVisibility(View.GONE);
handle5Text.setVisibility(View.GONE);
handle5.setVisibility(View.GONE);
misery5Text.setVisibility(View.GONE); misery5Text.setVisibility(View.GONE);
misery5.setVisibility(View.GONE); misery5.setVisibility(View.GONE);
points5Text.setVisibility(View.GONE); points5Text.setVisibility(View.GONE);
points5.setVisibility(View.GONE); points5.setVisibility(View.GONE);
player6_layout.setVisibility(View.GONE); player6_layout.setVisibility(View.GONE);
handle6Text.setVisibility(View.GONE);
handle6.setVisibility(View.GONE);
misery6Text.setVisibility(View.GONE); misery6Text.setVisibility(View.GONE);
misery6.setVisibility(View.GONE); misery6.setVisibility(View.GONE);
points6Text.setVisibility(View.GONE); points6Text.setVisibility(View.GONE);
@ -278,12 +286,16 @@ public class NewGameFragment extends Fragment {
switch (progress + 3) { switch (progress + 3) {
case 6: case 6:
player6_layout.setVisibility(View.VISIBLE); player6_layout.setVisibility(View.VISIBLE);
handle6Text.setVisibility(View.VISIBLE);
handle6.setVisibility(View.VISIBLE);
misery6Text.setVisibility(View.VISIBLE); misery6Text.setVisibility(View.VISIBLE);
misery6.setVisibility(View.VISIBLE); misery6.setVisibility(View.VISIBLE);
points6Text.setVisibility(View.VISIBLE); points6Text.setVisibility(View.VISIBLE);
points6.setVisibility(View.VISIBLE); points6.setVisibility(View.VISIBLE);
case 5: case 5:
player5_layout.setVisibility(View.VISIBLE); player5_layout.setVisibility(View.VISIBLE);
handle5Text.setVisibility(View.VISIBLE);
handle5.setVisibility(View.VISIBLE);
misery5Text.setVisibility(View.VISIBLE); misery5Text.setVisibility(View.VISIBLE);
misery5.setVisibility(View.VISIBLE); misery5.setVisibility(View.VISIBLE);
points5Text.setVisibility(View.VISIBLE); points5Text.setVisibility(View.VISIBLE);
@ -291,6 +303,8 @@ public class NewGameFragment extends Fragment {
follower_layout.setVisibility(View.VISIBLE); follower_layout.setVisibility(View.VISIBLE);
case 4: case 4:
player4_layout.setVisibility(View.VISIBLE); player4_layout.setVisibility(View.VISIBLE);
handle4Text.setVisibility(View.VISIBLE);
handle4.setVisibility(View.VISIBLE);
misery4Text.setVisibility(View.VISIBLE); misery4Text.setVisibility(View.VISIBLE);
misery4.setVisibility(View.VISIBLE); misery4.setVisibility(View.VISIBLE);
points4Text.setVisibility(View.VISIBLE); points4Text.setVisibility(View.VISIBLE);
@ -298,6 +312,8 @@ public class NewGameFragment extends Fragment {
} }
little_end.setMax(progress + 3);
updatePlayers.onItemSelected(null, null, 0, 0); updatePlayers.onItemSelected(null, null, 0, 0);
updateScore.run(); updateScore.run();
} }
@ -407,17 +423,13 @@ public class NewGameFragment extends Fragment {
@Override @Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
TextView textView = root.findViewById(R.id.little_end_info); TextView textView = root.findViewById(R.id.little_end_info);
switch (progress) { if (progress == 0)
case 1: textView.setText(R.string.nobody);
textView.setText(R.string.for_attacker); else
break; textView.setText(((Player) spinners[progress - 1].getSelectedItem()).getName());
case 2:
textView.setText(R.string.for_defenser); if (!fromUser)
break; return;
default:
textView.setText(R.string.no);
break;
}
updateScore.run(); updateScore.run();
} }
@ -433,45 +445,32 @@ public class NewGameFragment extends Fragment {
attack_points.setProgress(46); attack_points.setProgress(46);
handle.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { View.OnClickListener onHandleClick = new View.OnClickListener() {
@Override @Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { public void onClick(View v) {
TextView textView = root.findViewById(R.id.handle_info); Button b = (Button) v;
switch (progress) { int x = ((int) (1024.0F * (1.0F - b.getAlpha())) + 1) % 4;
case -3: b.setAlpha(1.0F - x / 1024.0F);
textView.setText(R.string.handle_3d); switch (x) {
break; case 0:
case -2: b.setText(R.string.handle0);
textView.setText(R.string.handle_2d);
break;
case -1:
textView.setText(R.string.handle_1d);
break; break;
case 1: case 1:
textView.setText(R.string.handle_1a); b.setText(R.string.handle1);
break; break;
case 2: case 2:
textView.setText(R.string.handle_2a); b.setText(R.string.handle2);
break; break;
case 3: case 3:
textView.setText(R.string.handle_3a); b.setText(R.string.handle3);
break;
default:
textView.setText(R.string.no_handle);
break; break;
} }
updateScore.run(); updateScore.run();
} }
};
@Override for (int i = 0; i < 6; ++i)
public void onStartTrackingTouch(SeekBar seekBar) { handles[i].setOnClickListener(onHandleClick);
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
});
final Button btn = root.findViewById(R.id.add_game_button); final Button btn = root.findViewById(R.id.add_game_button);
btn.setOnClickListener(new View.OnClickListener() { btn.setOnClickListener(new View.OnClickListener() {
@ -491,6 +490,7 @@ public class NewGameFragment extends Fragment {
co.setRequestProperty("json", g.toJson()); co.setRequestProperty("json", g.toJson());
co.connect(); co.connect();
co.getResponseCode(); co.getResponseCode();
System.out.println(IOUtils.readLines(co.getInputStream()));
co.disconnect(); co.disconnect();
Game.updateGames(); Game.updateGames();
@ -512,11 +512,13 @@ public class NewGameFragment extends Fragment {
game.setPlayers(players); game.setPlayers(players);
game.setBet(Game.Bet.values()[bet.getProgress()]); game.setBet(Game.Bet.values()[bet.getProgress()]);
game.setEnds(nb_ends.getProgress()); game.setEnds(nb_ends.getProgress());
game.setHandle(handle.getProgress()); List<Integer> handle = new ArrayList<>();
for (int i = 0; i < game.getGameType().getNbPlayers(); ++i)
handle.add((int) (1024.0F * (1.0F - handles[i].getAlpha())));
game.setHandles(handle);
game.setChelemAnnounced(chelem_announced.isChecked()); game.setChelemAnnounced(chelem_announced.isChecked());
game.setChelemRealized(chelem_realized.isChecked()); game.setChelemRealized(chelem_realized.isChecked());
game.setLittleForAttacker(little_end.getProgress() == 1); game.setLittleEnd(little_end.getProgress());
game.setLittleForDefender(little_end.getProgress() == 2);
List<Boolean> miseriesList = new ArrayList<>(); List<Boolean> miseriesList = new ArrayList<>();
for (int i = 0; i < game.getGameType().getNbPlayers(); ++i) for (int i = 0; i < game.getGameType().getNbPlayers(); ++i)
miseriesList.add(miseries[i].isChecked()); miseriesList.add(miseries[i].isChecked());

View File

@ -384,7 +384,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:max="2" android:max="4"
android:progress="0" /> android:progress="0" />
<TextView <TextView
@ -392,48 +392,116 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:text="@string/no" android:text="@string/nobody"
android:textAlignment="center" /> android:textAlignment="center" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<TextView
android:id="@+id/textView12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Poignée :" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <HorizontalScrollView
android:id="@+id/textView12"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content">
android:layout_weight="1"
android:text="Poignée :" />
<LinearLayout <TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<SeekBar
android:id="@+id/handle"
style="@style/Widget.AppCompat.SeekBar.Discrete"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_weight="1" android:orientation="horizontal"
android:max="3" android:textAlignment="center">
android:min="-3"
android:progress="0" />
<TextView <TableRow
android:id="@+id/handle_info" android:layout_width="match_parent"
android:layout_width="match_parent" android:layout_height="match_parent">
android:layout_height="wrap_content"
android:layout_weight="1" <TextView
android:text="@string/no_handle" android:id="@+id/player1_handle_text"
android:textAlignment="center" /> android:layout_width="wrap_content"
</LinearLayout> android:layout_height="wrap_content" />
<TextView
android:id="@+id/player2_handle_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/player3_handle_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/player4_handle_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/player5_handle_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone" />
<TextView
android:id="@+id/player6_handle_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/player1_handle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/handle0" />
<Button
android:id="@+id/player2_handle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/handle0" />
<Button
android:id="@+id/player3_handle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/handle0" />
<Button
android:id="@+id/player4_handle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/handle0" />
<Button
android:id="@+id/player5_handle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/handle0"
android:visibility="gone" />
<Button
android:id="@+id/player6_handle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/handle0"
android:visibility="gone" />
</TableRow>
</TableLayout>
</HorizontalScrollView>
</LinearLayout> </LinearLayout>

View File

@ -13,27 +13,25 @@
<string name="attack_points">Points attaquants</string> <string name="attack_points">Points attaquants</string>
<string name="defense_points">Points défenseurs</string> <string name="defense_points">Points défenseurs</string>
<string name="no">Non</string> <string name="no">Non</string>
<string name="for_attacker">Pour l\'attaquant</string> <string name="null_end">Pas de bout</string>
<string name="for_defenser">Pour le défenseur</string>
<string name="null_end">Pas de bout</string>
<string name="one_end">Un bout</string> <string name="one_end">Un bout</string>
<string name="two_ends">Deux bouts</string> <string name="two_ends">Deux bouts</string>
<string name="three_ends">Trois bouts</string> <string name="three_ends">Trois bouts</string>
<string name="little">Petite</string> <string name="little_end">Petit au bout</string>
<string name="guard">Garde</string> <string name="guard">Garde</string>
<string name="guard_without">Garde sans</string> <string name="guard_without">Garde sans</string>
<string name="guard_against">Garde contre</string> <string name="guard_against">Garde contre</string>
<string name="no_handle">Pas de poignée</string> <string name="handle1">Petite poignée</string>
<string name="handle_1a">Petite poignée (pour l\'attaquant)</string> <string name="handle2">Moyenne poignée</string>
<string name="handle_2a">Moyenne poignée (pour l\'attaquant)</string> <string name="handle3">Grande poignée</string>
<string name="handle_3a">Grande poignée (pour l\'attaquant)</string>
<string name="handle_1d">Petite poignée (pour le défenseur)</string>
<string name="handle_2d">Moyenne poignée (pour le défenseur)</string>
<string name="handle_3d">Grande poignée (pour le défenseur)</string>
<string name="login">Se connecter</string> <string name="login">Se connecter</string>
<string name="players3">3 joueurs</string> <string name="players3">3 joueurs</string>
<string name="players4">4 joueurs</string> <string name="players4">4 joueurs</string>
<string name="players5">5 joueurs</string> <string name="players5">5 joueurs</string>
<string name="players6">6 joueurs</string> <string name="players6">6 joueurs</string>
<string name="personal_stats">Statistiques individuelles</string> <string name="personal_stats">Statistiques individuelles</string>
<string name="handle0">Pas de poignée</string>
<string name="nobody">Personne</string>
<string name="yes">Oui</string>
<string name="little">Petite</string>
</resources> </resources>

View File

@ -13,27 +13,25 @@
<string name="attack_points">Points attaquants</string> <string name="attack_points">Points attaquants</string>
<string name="defense_points">Points défenseurs</string> <string name="defense_points">Points défenseurs</string>
<string name="no">Non</string> <string name="no">Non</string>
<string name="for_attacker">Pour l\'attaquant</string>
<string name="for_defenser">Pour le défenseur</string>
<string name="null_end">Pas de bout</string> <string name="null_end">Pas de bout</string>
<string name="one_end">Un bout</string> <string name="one_end">Un bout</string>
<string name="two_ends">Deux bouts</string> <string name="two_ends">Deux bouts</string>
<string name="three_ends">Trois bouts</string> <string name="three_ends">Trois bouts</string>
<string name="little">Petite</string> <string name="little_end">Petit au bout</string>
<string name="guard">Garde</string> <string name="guard">Guard</string>
<string name="guard_without">Garde sans</string> <string name="guard_without">Guard without</string>
<string name="guard_against">Garde contre</string> <string name="guard_against">Guard against</string>
<string name="no_handle">Pas de poignée</string> <string name="handle1">Little handle</string>
<string name="handle_1a">Petite poignée (pour l\'attaquant)</string> <string name="handle2">Middle handle</string>
<string name="handle_2a">Moyenne poignée (pour l\'attaquant)</string> <string name="handle3">Big handle</string>
<string name="handle_3a">Grande poignée (pour l\'attaquant)</string>
<string name="handle_1d">Petite poignée (pour le défenseur)</string>
<string name="handle_2d">Moyenne poignée (pour le défenseur)</string>
<string name="handle_3d">Grande poignée (pour le défenseur)</string>
<string name="login">Se connecter</string> <string name="login">Se connecter</string>
<string name="players3">3 joueurs</string> <string name="players3">3 joueurs</string>
<string name="players4">4 joueurs</string> <string name="players4">4 joueurs</string>
<string name="players5">5 joueurs</string> <string name="players5">5 joueurs</string>
<string name="players6">6 joueurs</string> <string name="players6">6 joueurs</string>
<string name="personal_stats">Statistiques individuelles</string> <string name="personal_stats">Statistiques individuelles</string>
<string name="handle0">No handle</string>
<string name="nobody">Nobody</string>
<string name="yes">Yes</string>
<string name="little">Little</string>
</resources> </resources>