Project

General

Profile

Download (2.16 KB) Statistics
| Branch: | Tag: | Revision:

magiccube / src / main / java / org / distorted / dialogs / RubikDialogError.java @ 7d1ba3d2

1 2d9fc972 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2020 Leszek Koltunski                                                               //
3
//                                                                                               //
4
// This file is part of Magic Cube.                                                              //
5
//                                                                                               //
6 68191e7d Leszek Koltunski
// Magic Cube is proprietary software licensed under an EULA which you should have received      //
7
// along with the code. If not, check https://distorted.org/magic/License-Magic-Cube.html        //
8 2d9fc972 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
9
10
package org.distorted.dialogs;
11
12
import android.app.Dialog;
13 fb37b424 Leszek Koltunski
import android.util.TypedValue;
14 2d9fc972 Leszek Koltunski
import android.view.View;
15
import android.widget.TextView;
16
17
import androidx.fragment.app.FragmentActivity;
18
19
import org.distorted.main.R;
20
21
///////////////////////////////////////////////////////////////////////////////////////////////////
22
23 c02fa107 Leszek Koltunski
public class RubikDialogError extends RubikDialogAbstract
24 2d9fc972 Leszek Koltunski
  {
25 f8a21f6b Leszek Koltunski
  public int getResource()      { return R.layout.dialog_error; }
26
  public int getTitleResource() { return R.string.opengl_error; }
27
  public boolean hasArgument()  { return false; }
28
  public int getPositive()      { return R.string.ok; }
29
  public int getNegative()      { return -1; }
30 c02fa107 Leszek Koltunski
31
///////////////////////////////////////////////////////////////////////////////////////////////////
32
33 f8a21f6b Leszek Koltunski
  public void positiveAction()
34 c02fa107 Leszek Koltunski
    {
35
    final FragmentActivity act = getActivity();
36 f8a21f6b Leszek Koltunski
    if( act!=null ) act.finish();
37 c02fa107 Leszek Koltunski
    }
38 2d9fc972 Leszek Koltunski
39 c02fa107 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
40 2d9fc972 Leszek Koltunski
41 f8a21f6b Leszek Koltunski
  public void negativeAction()
42 c02fa107 Leszek Koltunski
    {
43 2d9fc972 Leszek Koltunski
44 c02fa107 Leszek Koltunski
    }
45 ffd68f35 Leszek Koltunski
46 c02fa107 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
47 fb37b424 Leszek Koltunski
48 c02fa107 Leszek Koltunski
  public void prepareBody(Dialog dialog, View view, FragmentActivity act, float size)
49
    {
50
    TextView text = view.findViewById(R.id.error_string);
51
    text.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
52
    text.setText(R.string.opengl_error_text);
53 2d9fc972 Leszek Koltunski
    }
54
  }