Project

General

Profile

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

magiccube / src / main / java / org / distorted / dialogs / RubikDialogSolved.java @ 4483b119

1 e41e7dc3 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 e41e7dc3 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
9
10 1f9772f3 Leszek Koltunski
package org.distorted.dialogs;
11 e41e7dc3 Leszek Koltunski
12
import android.app.Dialog;
13 66e777b0 Leszek Koltunski
import androidx.fragment.app.FragmentActivity;
14 fb37b424 Leszek Koltunski
15
import android.util.TypedValue;
16 e41e7dc3 Leszek Koltunski
import android.view.View;
17
import android.widget.TextView;
18
19 1f9772f3 Leszek Koltunski
import org.distorted.main.R;
20
import org.distorted.main.RubikActivity;
21 fcd5b990 Leszek Koltunski
import org.distorted.screens.ScreenList;
22 e41e7dc3 Leszek Koltunski
23
///////////////////////////////////////////////////////////////////////////////////////////////////
24
25 c02fa107 Leszek Koltunski
public class RubikDialogSolved extends RubikDialogAbstract
26 e41e7dc3 Leszek Koltunski
  {
27 f8a21f6b Leszek Koltunski
  public int getResource()      { return R.layout.dialog_solved; }
28
  public int getTitleResource() { return R.string.solved; }
29
  public boolean hasArgument()  { return true; }
30
  public int getPositive()      { return R.string.ok; }
31
  public int getNegative()      { return -1; }
32 c02fa107 Leszek Koltunski
33
///////////////////////////////////////////////////////////////////////////////////////////////////
34
35 f8a21f6b Leszek Koltunski
  public void positiveAction()
36 c02fa107 Leszek Koltunski
    {
37 f8a21f6b Leszek Koltunski
    RubikActivity act = (RubikActivity)getActivity();
38
    ScreenList.switchScreen(act, ScreenList.PLAY);
39 c02fa107 Leszek Koltunski
    }
40
41
///////////////////////////////////////////////////////////////////////////////////////////////////
42
43 f8a21f6b Leszek Koltunski
  public void negativeAction()
44 c02fa107 Leszek Koltunski
    {
45
46
    }
47 85248b04 Leszek Koltunski
48 c02fa107 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
49 fb37b424 Leszek Koltunski
50 c02fa107 Leszek Koltunski
  public void prepareBody(Dialog dialog, View view, FragmentActivity act, float size)
51
    {
52
    TextView text = view.findViewById(R.id.solved_time);
53
    text.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
54 4483b119 Leszek Koltunski
    text.setText(mArgument);
55 e41e7dc3 Leszek Koltunski
    }
56 dca3888a Leszek Koltunski
57
///////////////////////////////////////////////////////////////////////////////////////////////////
58
59
  public static String getDialogTag()
60
    {
61
    return "DialogSolved";
62
    }
63 e41e7dc3 Leszek Koltunski
  }