| 37 |
37 |
|
| 38 |
38 |
import org.distorted.main.R;
|
| 39 |
39 |
import org.distorted.main.RubikActivity;
|
|
40 |
import org.distorted.main.RubikPreRender;
|
|
41 |
import org.distorted.objects.TwistyObject;
|
| 40 |
42 |
|
| 41 |
43 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
| 42 |
44 |
|
| ... | ... | |
| 54 |
56 |
act.getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
|
| 55 |
57 |
final float titleSize= displaymetrics.widthPixels * RubikActivity.MENU_BIG_TEXT_SIZE;
|
| 56 |
58 |
final float okSize = displaymetrics.widthPixels * RubikActivity.DIALOG_BUTTON_SIZE;
|
|
59 |
TwistyObject object = getObject();
|
|
60 |
int numLayers = object.getNumLayers();
|
| 57 |
61 |
|
| 58 |
62 |
TextView tv = (TextView) inflater.inflate(R.layout.dialog_title, null);
|
| 59 |
63 |
tv.setTextSize(TypedValue.COMPLEX_UNIT_PX, titleSize);
|
| 60 |
|
tv.setText(R.string.opengl_error);
|
|
64 |
tv.setText(object.getObjectName(numLayers));
|
| 61 |
65 |
builder.setCustomTitle(tv);
|
| 62 |
66 |
|
| 63 |
67 |
final View view = inflater.inflate(R.layout.dialog_error, null);
|
| 64 |
68 |
TextView text = view.findViewById(R.id.error_string);
|
| 65 |
|
text.setText(R.string.opengl_error_text);
|
|
69 |
text.setText(R.string.tutorial);
|
| 66 |
70 |
|
| 67 |
|
builder.setPositiveButton( R.string.ok, new DialogInterface.OnClickListener()
|
|
71 |
builder.setPositiveButton( R.string.yes, new DialogInterface.OnClickListener()
|
|
72 |
{
|
|
73 |
@Override
|
|
74 |
public void onClick(DialogInterface dialog, int which)
|
|
75 |
{
|
|
76 |
|
|
77 |
}
|
|
78 |
});
|
|
79 |
|
|
80 |
builder.setNegativeButton( R.string.no, new DialogInterface.OnClickListener()
|
| 68 |
81 |
{
|
| 69 |
82 |
@Override
|
| 70 |
83 |
public void onClick(DialogInterface dialog, int which)
|
| ... | ... | |
| 92 |
105 |
{
|
| 93 |
106 |
Button btnPositive = ((AlertDialog)dialog).getButton(Dialog.BUTTON_POSITIVE);
|
| 94 |
107 |
btnPositive.setTextSize(TypedValue.COMPLEX_UNIT_PX, okSize);
|
|
108 |
Button btnNegative = ((AlertDialog)dialog).getButton(Dialog.BUTTON_NEGATIVE);
|
|
109 |
btnNegative.setTextSize(TypedValue.COMPLEX_UNIT_PX, okSize);
|
| 95 |
110 |
}
|
| 96 |
111 |
});
|
| 97 |
112 |
|
| 98 |
113 |
return dialog;
|
| 99 |
114 |
}
|
|
115 |
|
|
116 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
117 |
|
|
118 |
private TwistyObject getObject()
|
|
119 |
{
|
|
120 |
RubikActivity act = (RubikActivity)getContext();
|
|
121 |
return act.getObject();
|
|
122 |
}
|
| 100 |
123 |
}
|
Progress with the Info Dialog