Project

General

Profile

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

magiccube / src / main / java / org / distorted / dialogs / RubikDialogBandagedDelete.java @ 65bc1da3

1 61a7b812 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2022 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 61a7b812 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
9
10
package org.distorted.dialogs;
11
12
import android.app.Dialog;
13
import android.util.TypedValue;
14
import android.view.View;
15
import android.widget.TextView;
16
17
import androidx.fragment.app.FragmentActivity;
18
19 72e386ef Leszek Koltunski
import org.distorted.bandaged.BandagedCreatorActivity;
20 61a7b812 Leszek Koltunski
import org.distorted.main.R;
21
22
///////////////////////////////////////////////////////////////////////////////////////////////////
23
24 b5c2adb4 Leszek Koltunski
public class RubikDialogBandagedDelete extends RubikDialogAbstract
25 61a7b812 Leszek Koltunski
  {
26 f8a21f6b Leszek Koltunski
  public int getResource()      { return R.layout.dialog_delete_object; }
27
  public int getTitleResource() { return R.string.delete_object; }
28
  public boolean hasArgument()  { return true; }
29
  public int getPositive()      { return R.string.yes; }
30
  public int getNegative()      { return R.string.no; }
31 6647b730 Leszek Koltunski
32 c02fa107 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
33
34 f8a21f6b Leszek Koltunski
  public void positiveAction()
35 c02fa107 Leszek Koltunski
    {
36 f8a21f6b Leszek Koltunski
    BandagedCreatorActivity bact = (BandagedCreatorActivity)getContext();
37
    if( bact!=null ) bact.deleteObject(mArgument);
38 b5c2adb4 Leszek Koltunski
    }
39
40
///////////////////////////////////////////////////////////////////////////////////////////////////
41 61a7b812 Leszek Koltunski
42 f8a21f6b Leszek Koltunski
  public void negativeAction()
43 b5c2adb4 Leszek Koltunski
    {
44
45
    }
46 61a7b812 Leszek Koltunski
47 b5c2adb4 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
48 61a7b812 Leszek Koltunski
49 c02fa107 Leszek Koltunski
  public void prepareBody(Dialog dialog, View view, FragmentActivity act, float size)
50 b5c2adb4 Leszek Koltunski
    {
51
    TextView save = view.findViewById(R.id.delete_object_text);
52
    save.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
53 61a7b812 Leszek Koltunski
    }
54 6647b730 Leszek Koltunski
55
///////////////////////////////////////////////////////////////////////////////////////////////////
56
57
  public static String getDialogTag()
58
    {
59
    return "DialogBandagedDelete";
60
    }
61 61a7b812 Leszek Koltunski
  }