Valeur par défaut du nombre de points réalisés

This commit is contained in:
ynerant 2019-12-05 19:23:45 +01:00
parent 7a8f29f29d
commit 1047c06b79
1 changed files with 6 additions and 7 deletions

View File

@ -21,8 +21,6 @@ import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProviders; import androidx.lifecycle.ViewModelProviders;
import org.apache.commons.io.IOUtils;
import java.io.IOException; import java.io.IOException;
import java.net.HttpURLConnection; import java.net.HttpURLConnection;
import java.net.URL; import java.net.URL;
@ -38,12 +36,9 @@ import fr.ynerant.tarot.ui.home.HomeFragment;
public class NewGameFragment extends Fragment { public class NewGameFragment extends Fragment {
private NewGameViewModel newGameViewModel;
public View onCreateView(@NonNull LayoutInflater inflater, public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) { ViewGroup container, Bundle savedInstanceState) {
newGameViewModel = ViewModelProviders.of(this).get(NewGameViewModel.class);
ViewModelProviders.of(this).get(NewGameViewModel.class);
final View root = inflater.inflate(R.layout.fragment_new_game, container, false); final View root = inflater.inflate(R.layout.fragment_new_game, container, false);
if (PreferenceManager.getDefaultSharedPreferences(MainActivity.INSTANCE).getString("token", null) == null) { if (PreferenceManager.getDefaultSharedPreferences(MainActivity.INSTANCE).getString("token", null) == null) {
@ -398,15 +393,19 @@ public class NewGameFragment extends Fragment {
switch (progress) { switch (progress) {
case 1: case 1:
textView.setText(R.string.one_end); textView.setText(R.string.one_end);
attack_points.setProgress(51);
break; break;
case 2: case 2:
textView.setText(R.string.two_ends); textView.setText(R.string.two_ends);
attack_points.setProgress(41);
break; break;
case 3: case 3:
textView.setText(R.string.three_ends); textView.setText(R.string.three_ends);
attack_points.setProgress(36);
break; break;
default: default:
textView.setText(R.string.null_end); textView.setText(R.string.null_end);
attack_points.setProgress(56);
break; break;
} }
@ -460,7 +459,7 @@ public class NewGameFragment extends Fragment {
} }
}); });
attack_points.setProgress(46); attack_points.setProgress(51);
View.OnClickListener onHandleClick = new View.OnClickListener() { View.OnClickListener onHandleClick = new View.OnClickListener() {
@Override @Override