24 |
24 |
import android.app.Activity;
|
25 |
25 |
import android.content.Context;
|
26 |
26 |
import android.content.SharedPreferences;
|
|
27 |
import android.content.res.Resources;
|
|
28 |
import android.graphics.drawable.Drawable;
|
27 |
29 |
import android.os.Build;
|
28 |
30 |
import android.os.Bundle;
|
29 |
31 |
import android.util.TypedValue;
|
... | ... | |
38 |
40 |
import android.widget.RelativeLayout;
|
39 |
41 |
import android.widget.TextView;
|
40 |
42 |
|
|
43 |
import androidx.core.content.ContextCompat;
|
|
44 |
|
41 |
45 |
import org.distorted.dialogs.RubikDialogUpdates;
|
42 |
46 |
import org.distorted.external.RubikNetwork;
|
43 |
47 |
import org.distorted.external.RubikScores;
|
... | ... | |
172 |
176 |
{
|
173 |
177 |
View popupView = mMenuPopup.getContentView();
|
174 |
178 |
popupView.setSystemUiVisibility(RubikActivity.FLAGS);
|
175 |
|
setupLevelColors();
|
|
179 |
setupLevelColors(act);
|
176 |
180 |
displayPopup(act,view,mMenuPopup,mMenuLayoutWidth,mMenuLayoutHeight,(int)(-mMenuLayoutWidth/2 + width/6),0);
|
177 |
181 |
}
|
178 |
182 |
}
|
... | ... | |
240 |
244 |
int ordinal = mainEntry.getOrdinal();
|
241 |
245 |
RubikObjectList.setCurrObject(ordinal);
|
242 |
246 |
act.changeObject(ordinal,true);
|
243 |
|
if( mMenuPopup!=null ) setupLevelColors();
|
|
247 |
if( mMenuPopup!=null ) setupLevelColors(act);
|
244 |
248 |
mMovesController.clearMoves(act);
|
245 |
249 |
}
|
246 |
250 |
else if( type==MainEntry.TYPE_CREATOR )
|
... | ... | |
461 |
465 |
levels.setTextSize(TypedValue.COMPLEX_UNIT_PX, mMenuTextSize);
|
462 |
466 |
|
463 |
467 |
setupLevelButtons(act,layout,padding);
|
464 |
|
setupLevelColors();
|
|
468 |
setupLevelColors(act);
|
465 |
469 |
}
|
466 |
470 |
|
467 |
471 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
... | ... | |
515 |
519 |
|
516 |
520 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
517 |
521 |
|
518 |
|
private void setupLevelColors()
|
|
522 |
private void setupLevelColors(RubikActivity act)
|
519 |
523 |
{
|
520 |
524 |
int currObject = RubikObjectList.getCurrObject();
|
521 |
525 |
int dbLevel = RubikObjectList.getDBLevel(currObject);
|
522 |
526 |
RubikScores scores = RubikScores.getInstance();
|
|
527 |
Resources res = act.getResources();
|
|
528 |
int colorG = res.getColor(R.color.green);
|
523 |
529 |
|
524 |
530 |
for(int i=0; i<=LEVELS_SHOWN; i++)
|
525 |
531 |
{
|
526 |
532 |
int level = i<LEVELS_SHOWN ? i : dbLevel;
|
527 |
533 |
boolean isSolved = scores.isSolved(currObject,level);
|
528 |
|
int icon = isSolved ? R.drawable.ui_solved : R.drawable.ui_notsolved;
|
529 |
|
mLevel[i].setCompoundDrawablesWithIntrinsicBounds(icon,0,0,0);
|
|
534 |
if( isSolved ) mLevel[i].setBackgroundColor(colorG);
|
530 |
535 |
}
|
531 |
536 |
}
|
532 |
537 |
|
Progress with colors in the Menu Level Buttons.