Project

General

Profile

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

magiccube / src / main / java / org / distorted / dialogs / RubikDialogAbandon.java @ c02fa107

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.content.DialogInterface;
14
import android.util.TypedValue;
15
import android.view.View;
16
import android.widget.Button;
17

    
18
import androidx.appcompat.app.AlertDialog;
19
import androidx.fragment.app.FragmentActivity;
20

    
21
import org.distorted.main.R;
22
import org.distorted.main.RubikActivity;
23
import org.distorted.screens.ScreenList;
24

    
25
///////////////////////////////////////////////////////////////////////////////////////////////////
26

    
27
public class RubikDialogAbandon extends RubikDialogAbstract
28
  {
29
  public int getResource()
30
    {
31
    return R.layout.abandon_solve;
32
    }
33

    
34
///////////////////////////////////////////////////////////////////////////////////////////////////
35

    
36
  public int getTitleResource()
37
    {
38
    return -1;
39
    }
40

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

    
43
  public boolean hasArgument()
44
    {
45
    return false;
46
    }
47

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

    
50
  public void setPositive(AlertDialog.Builder builder)
51
    {
52
    final RubikActivity ract = (RubikActivity)getContext();
53

    
54
    builder.setPositiveButton( R.string.yes, new DialogInterface.OnClickListener()
55
      {
56
      @Override
57
      public void onClick(DialogInterface dialog, int which)
58
        {
59
        ScreenList.goBack(ract);
60
        }
61
      });
62
    }
63

    
64
///////////////////////////////////////////////////////////////////////////////////////////////////
65

    
66
  public void setNegative(AlertDialog.Builder builder)
67
    {
68
    builder.setNegativeButton( R.string.no, new DialogInterface.OnClickListener()
69
      {
70
      @Override
71
      public void onClick(DialogInterface dialog, int which)
72
        {
73

    
74
        }
75
      });
76
    }
77

    
78
///////////////////////////////////////////////////////////////////////////////////////////////////
79

    
80
  public void onShowDialog(DialogInterface dialog, float size)
81
    {
82
    Button btnPositive = ((AlertDialog)dialog).getButton(Dialog.BUTTON_POSITIVE);
83
    btnPositive.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
84
    Button btnNegative = ((AlertDialog)dialog).getButton(Dialog.BUTTON_NEGATIVE);
85
    btnNegative.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
86
    }
87

    
88
///////////////////////////////////////////////////////////////////////////////////////////////////
89

    
90
  public void prepareBody(Dialog dialog, View view, FragmentActivity act, float size)
91
    {
92

    
93
    }
94
  }
(1-1/25)