Project

General

Profile

« Previous | Next » 

Revision 79e752b3

Added by Leszek Koltunski almost 4 years ago

Solving time - display it more accurately.

View differences:

src/main/java/org/distorted/dialogs/RubikDialogScoresView.java
19 19

  
20 20
package org.distorted.dialogs;
21 21

  
22
import android.annotation.SuppressLint;
22 23
import android.content.Context;
23 24
import android.content.res.Resources;
24 25
import androidx.fragment.app.FragmentActivity;
......
74 75

  
75 76
///////////////////////////////////////////////////////////////////////////////////////////////////
76 77

  
78
  @SuppressLint("DefaultLocale")
77 79
  LinearLayout createSection(FragmentActivity act, int tab, int level, final String[] country, final String[] name, final float[] time)
78 80
    {
79 81
    LinearLayout levelLayout = (LinearLayout)inflate(act, R.layout.dialog_scores_scramble_title, null);
......
92 94

  
93 95
    boolean inserted = false;
94 96
    long myRecordInMillis = scores.getRecord(object, sizeIndex, level);
95
    float myRecordInSeconds = (myRecordInMillis/100)/10.0f;
97
    float myRecordInSeconds = (myRecordInMillis/10)/100.0f;
96 98
    boolean mySubmitted = scores.isSubmitted(object, sizeIndex, level);
97 99
    String myName = scores.getName();
98 100
    if( myName.length()==0 ) myName = act.getString(R.string.you);
99 101
    int myCountryID = res.getIdentifier( scores.getCountry(), "drawable", packageName);
100
    String myRecord = ( myRecordInMillis<RubikScores.NO_RECORD ) ? Float.toString(myRecordInSeconds) : "??";
102
    String myRecord = ( myRecordInMillis<RubikScores.NO_RECORD ) ? String.format("%.2f", myRecordInSeconds) : "??";
101 103
    String theirTime;
102 104
    int theirCountryID;
103 105

  
......
123 125
          {
124 126
          if( equals ) inserted=true;
125 127
          theirCountryID = res.getIdentifier( country[j], "drawable", packageName);
126
          theirTime = Float.toString(time[j]);
128
          theirTime = String.format("%.2f", time[j]);
127 129
          View row = createRow(act, theirCountryID, name[j], theirTime, height, equals ? red:white);
128 130
          levelLayout.addView(row);
129 131
          }

Also available in: Unified diff