Project

General

Profile

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

magiccube / src / main / java / org / distorted / dialogs / RubikDialogSolved.java @ 988e3d33

1
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2020 Leszek Koltunski                                                               //
3
//                                                                                               //
4
// This file is part of Magic Cube.                                                              //
5
//                                                                                               //
6
// 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
///////////////////////////////////////////////////////////////////////////////////////////////////
9

    
10
package org.distorted.dialogs;
11

    
12
import android.app.Dialog;
13
import androidx.fragment.app.FragmentActivity;
14

    
15
import android.util.TypedValue;
16
import android.view.View;
17
import android.widget.TextView;
18

    
19
import org.distorted.main.R;
20
import org.distorted.playui.PlayActivity;
21

    
22
///////////////////////////////////////////////////////////////////////////////////////////////////
23

    
24
public class RubikDialogSolved extends RubikDialogAbstract
25
  {
26
  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

    
32
///////////////////////////////////////////////////////////////////////////////////////////////////
33

    
34
  public void positiveAction()
35
    {
36
    PlayActivity act = (PlayActivity)getActivity();
37
    if( act!=null ) act.finish();
38
    }
39

    
40
///////////////////////////////////////////////////////////////////////////////////////////////////
41

    
42
  public void negativeAction()
43
    {
44

    
45
    }
46

    
47
///////////////////////////////////////////////////////////////////////////////////////////////////
48

    
49
  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
    text.setText(mArgument);
54
    }
55

    
56
///////////////////////////////////////////////////////////////////////////////////////////////////
57

    
58
  public static String getDialogTag()
59
    {
60
    return "DialogSolved";
61
    }
62
  }
(18-18/24)