Project

General

Profile

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

magiccube / src / main / java / org / distorted / dialogs / RubikDialogSolved.java @ 4bd09fe2

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 7bb30586 leszek
import org.distorted.playui.PlayActivity;
21 e41e7dc3 Leszek Koltunski
22
///////////////////////////////////////////////////////////////////////////////////////////////////
23
24 c02fa107 Leszek Koltunski
public class RubikDialogSolved extends RubikDialogAbstract
25 e41e7dc3 Leszek Koltunski
  {
26 f8a21f6b Leszek Koltunski
  public int getResource()      { return R.layout.dialog_solved; }
27
  public int getTitleResource() { return R.string.solved; }
28
  public boolean hasArgument()  { return true; }
29
  public int getPositive()      { return R.string.ok; }
30
  public int getNegative()      { return -1; }
31 c02fa107 Leszek Koltunski
32
///////////////////////////////////////////////////////////////////////////////////////////////////
33
34 f8a21f6b Leszek Koltunski
  public void positiveAction()
35 c02fa107 Leszek Koltunski
    {
36 7bb30586 leszek
    PlayActivity act = (PlayActivity)getActivity();
37
    if( act!=null ) act.finish();
38 c02fa107 Leszek Koltunski
    }
39
40
///////////////////////////////////////////////////////////////////////////////////////////////////
41
42 f8a21f6b Leszek Koltunski
  public void negativeAction()
43 c02fa107 Leszek Koltunski
    {
44
45
    }
46 85248b04 Leszek Koltunski
47 c02fa107 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
48 fb37b424 Leszek Koltunski
49 c02fa107 Leszek Koltunski
  public void prepareBody(Dialog dialog, View view, FragmentActivity act, float size)
50
    {
51
    TextView text = view.findViewById(R.id.solved_time);
52
    text.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
53 4483b119 Leszek Koltunski
    text.setText(mArgument);
54 e41e7dc3 Leszek Koltunski
    }
55 dca3888a Leszek Koltunski
56
///////////////////////////////////////////////////////////////////////////////////////////////////
57
58
  public static String getDialogTag()
59
    {
60
    return "DialogSolved";
61
    }
62 e41e7dc3 Leszek Koltunski
  }