Project

General

Profile

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

magiccube / src / main / java / org / distorted / dialogs / RubikDialogBandagedDelete.java @ e1637420

1
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2022 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.util.TypedValue;
14
import android.view.View;
15
import android.widget.TextView;
16

    
17
import androidx.fragment.app.FragmentActivity;
18

    
19
import org.distorted.bandaged.BandagedActivity;
20
import org.distorted.main.R;
21

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

    
24
public class RubikDialogBandagedDelete extends RubikDialogAbstract
25
  {
26
  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
  public void negativeAction()  { }
32

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

    
35
  public void positiveAction()
36
    {
37
    BandagedActivity bact = (BandagedActivity)getContext();
38
    if( bact!=null ) bact.deleteObject(mArgument);
39
    }
40

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

    
43
  public void prepareBody(Dialog dialog, View view, FragmentActivity act, float size)
44
    {
45
    TextView save = view.findViewById(R.id.delete_object_text);
46
    save.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
47
    }
48

    
49
///////////////////////////////////////////////////////////////////////////////////////////////////
50

    
51
  public static String getDialogTag()
52
    {
53
    return "DialogBandagedDelete";
54
    }
55
  }
(4-4/25)