Project

General

Profile

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

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

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.main.RubikActivity;
21
import org.distorted.screens.ScreenList;
22

    
23
///////////////////////////////////////////////////////////////////////////////////////////////////
24

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

    
33
///////////////////////////////////////////////////////////////////////////////////////////////////
34

    
35
  public void positiveAction()
36
    {
37
    RubikActivity act = (RubikActivity)getActivity();
38
    ScreenList.switchScreen(act, ScreenList.PLAY);
39
    }
40

    
41
///////////////////////////////////////////////////////////////////////////////////////////////////
42

    
43
  public void negativeAction()
44
    {
45

    
46
    }
47

    
48
///////////////////////////////////////////////////////////////////////////////////////////////////
49

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

    
57
///////////////////////////////////////////////////////////////////////////////////////////////////
58

    
59
  public static String getDialogTag()
60
    {
61
    return "DialogSolved";
62
    }
63
  }
(17-17/26)