Project

General

Profile

« Previous | Next » 

Revision 80218b07

Added by Leszek Koltunski about 4 years ago

Progress with the Info Dialog

View differences:

src/main/java/org/distorted/dialogs/RubikDialogInfo.java
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
  }
src/main/res/values/strings.xml
35 35
    <string name="new_name_try_again">The name you have chosen, %s, is already taken. Try again:</string>
36 36
    <string name="downloading">Downloading…</string>
37 37
    <string name="submitting">Submitting…</string>
38
    <string name="tutorial">Learn how to solve it?</string>
39

  
38 40
    <string name="credits1">Open Source app developed using the Distorted graphics library. Licensed under <a href="https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html">GPL version 2</a> or - at your option - any later version.</string>
39 41
    <string name="credits2">Pretty Patterns by Walter Randelshofer. See <a href="http://www.randelshofer.ch">http://www.randelshofer.ch</a></string>
40 42
    <string name="credits3">Download code, take a look at tutorials, learn how to add your own graphics effect, learn how to code your own object, contribute a Pretty Pattern, implement your own solver, or report a bug: \n\n<a href="https://distorted.org/redmine/projects/magic-cube/wiki">Distorted.org</a></string>

Also available in: Unified diff