Project

General

Profile

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

magiccube / src / main / java / org / distorted / dialogs / RubikDialogBandagedSave.java @ 58990dfd

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.BandagedCreatorActivity;
20
import org.distorted.bandaged.BandagedCreatorRenderer;
21
import org.distorted.main.R;
22

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

    
25
public class RubikDialogBandagedSave extends RubikDialogAbstract
26
  {
27
  public int getResource()      { return R.layout.dialog_save_object; }
28
  public int getTitleResource() { return R.string.save_object; }
29
  public boolean hasArgument()  { return false; }
30
  public int getPositive()      { return R.string.yes; }
31
  public int getNegative()      { return R.string.no; }
32

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

    
35
  public void positiveAction()
36
    {
37
    BandagedCreatorActivity bact = (BandagedCreatorActivity)getContext();
38

    
39
    if( bact!=null )
40
      {
41
      BandagedCreatorRenderer rend = bact.getRenderer();
42
      rend.saveObject();
43
      }
44
    }
45

    
46
///////////////////////////////////////////////////////////////////////////////////////////////////
47

    
48
  public void negativeAction()
49
    {
50

    
51
    }
52

    
53
///////////////////////////////////////////////////////////////////////////////////////////////////
54

    
55
  public void prepareBody(Dialog dialog, View view, FragmentActivity act, float size)
56
    {
57
    TextView save = view.findViewById(R.id.save_object_text);
58
    save.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
59
    }
60
  }
(5-5/26)