Revision 85b09df4
Added by Leszek Koltunski about 4 years ago
src/main/java/org/distorted/dialogs/RubikDialogScoresView.java | ||
---|---|---|
69 | 69 |
|
70 | 70 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
71 | 71 |
|
72 |
LinearLayout createSection(FragmentActivity act, int tab, int scramble, final String[] country, final String[] name, final float[] time)
|
|
72 |
LinearLayout createSection(FragmentActivity act, int tab, int level, final String[] country, final String[] name, final float[] time)
|
|
73 | 73 |
{ |
74 |
LinearLayout level = (LinearLayout)inflate(act, R.layout.dialog_scores_scramble_title, null); |
|
75 |
TextView text = level.findViewById(R.id.scoresScrambleTitle); |
|
76 |
text.setText(act.getString(R.string.sc_placeholder,(scramble+1)));
|
|
74 |
LinearLayout levelLayout = (LinearLayout)inflate(act, R.layout.dialog_scores_scramble_title, null);
|
|
75 |
TextView text = levelLayout.findViewById(R.id.scoresScrambleTitle);
|
|
76 |
text.setText(act.getString(R.string.lv_placeholder,level+1));
|
|
77 | 77 |
|
78 | 78 |
Resources res = act.getResources(); |
79 | 79 |
String packageName = act.getPackageName(); |
... | ... | |
83 | 83 |
RubikScores scores = RubikScores.getInstance(); |
84 | 84 |
|
85 | 85 |
boolean inserted = false; |
86 |
long myRecordInMillis = scores.getRecord(object, size, scramble);
|
|
86 |
long myRecordInMillis = scores.getRecord(object, size, level);
|
|
87 | 87 |
float myRecordInSeconds = (myRecordInMillis/100)/10.0f; |
88 |
boolean mySubmitted = scores.isSubmitted(object, size, scramble);
|
|
88 |
boolean mySubmitted = scores.isSubmitted(object, size, level);
|
|
89 | 89 |
String myName = scores.getName(); |
90 | 90 |
if( myName.length()==0 ) myName = act.getString(R.string.you); |
91 | 91 |
int myCountryID = res.getIdentifier( scores.getCountry(), "drawable", packageName); |
... | ... | |
105 | 105 |
{ |
106 | 106 |
inserted = true; |
107 | 107 |
View row = createRow(act, myCountryID, myName, myRecord, red); |
108 |
level.addView(row); |
|
108 |
levelLayout.addView(row);
|
|
109 | 109 |
} |
110 | 110 |
|
111 | 111 |
equals = name[j].equals(myName); |
... | ... | |
116 | 116 |
theirCountryID = res.getIdentifier( country[j], "drawable", packageName); |
117 | 117 |
theirTime = Float.toString(time[j]); |
118 | 118 |
View row = createRow(act, theirCountryID, name[j], theirTime, equals ? red:white); |
119 |
level.addView(row); |
|
119 |
levelLayout.addView(row);
|
|
120 | 120 |
} |
121 | 121 |
} |
122 | 122 |
} |
... | ... | |
124 | 124 |
if( !inserted ) |
125 | 125 |
{ |
126 | 126 |
View row = createRow(act, myCountryID, myName, myRecord, red); |
127 |
level.addView(row); |
|
127 |
levelLayout.addView(row);
|
|
128 | 128 |
} |
129 | 129 |
|
130 |
return level; |
|
130 |
return levelLayout;
|
|
131 | 131 |
} |
132 | 132 |
|
133 | 133 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Reorganize UI of the Play state.