Project

General

Profile

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

magiccube / src / main / java / org / distorted / dialogs / RubikDialogPrivacy.java @ 017f24b3

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.text.method.LinkMovementMethod;
14
import android.text.method.MovementMethod;
15
import android.view.View;
16
import android.widget.TextView;
17

    
18
import androidx.fragment.app.FragmentActivity;
19

    
20
import org.distorted.main.R;
21

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

    
24
public class RubikDialogPrivacy extends RubikDialogAbstract
25
  {
26
  public int getResource()      { return R.layout.dialog_privacy; }
27
  public int getTitleResource() { return R.string.privacy_policy; }
28
  public boolean hasArgument()  { return false; }
29
  public int getPositive()      { return R.string.accept; }
30
  public int getNegative()      { return R.string.decline; }
31

    
32
///////////////////////////////////////////////////////////////////////////////////////////////////
33

    
34
  public void positiveAction()
35
    {
36
    //final RubikActivity act = (RubikActivity)getContext();
37
    //if( act!=null ) act.acceptPrivacy();
38
    }
39

    
40
///////////////////////////////////////////////////////////////////////////////////////////////////
41

    
42
  public void negativeAction()
43
    {
44
    //final RubikActivity act = (RubikActivity)getContext();
45
    //if( act!=null ) act.declinePrivacy();
46
    }
47

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

    
50
  public void prepareBody(Dialog dialog, View view, FragmentActivity act, float size)
51
    {
52
    MovementMethod mm = LinkMovementMethod.getInstance();
53
    TextView text = view.findViewById(R.id.privacy_string);
54
    text.setMovementMethod(mm);
55
    }
56
  }
(16-16/32)