Project

General

Profile

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

magiccube / src / main / java / org / distorted / dialogs / DialogInterrupt.java @ 36aa1f22

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 android.view.View;
14
import android.widget.TextView;
15

    
16
import androidx.fragment.app.FragmentActivity;
17

    
18
import org.distorted.main.R;
19
import org.distorted.solvers.SolverActivity;
20

    
21
///////////////////////////////////////////////////////////////////////////////////////////////////
22

    
23
public class DialogInterrupt extends DialogAbstract
24
  {
25
  public int getResource()            { return R.layout.dialog_message; }
26
  public int getTitleResource()       { return -1; }
27
  public boolean hasArgument()        { return false; }
28
  public int getPositive()            { return R.string.interrupt; }
29
  public int getNegative()            { return -1; }
30
  public void negativeAction()        { }
31
  public static String getDialogTag() { return "DialogInterrupt"; }
32

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

    
35
  public void positiveAction()
36
    {
37
    final SolverActivity act = (SolverActivity)getContext();
38
    if( act!=null ) act.interruptSolve();
39
    }
40

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

    
43
  public void prepareBody(Dialog dialog, View view, FragmentActivity act, float size)
44
    {
45
    TextView mess = view.findViewById(R.id.dialog_message);
46
    mess.setText(R.string.solving);
47
    }
48
  }
(10-10/27)