Project

General

Profile

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

magiccube / src / main / java / org / distorted / dialogs / RubikDialogPrivacy.java @ e9245b7b

1 b1e9596b Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2020 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 b1e9596b Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
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 c02fa107 Leszek Koltunski
public class RubikDialogPrivacy extends RubikDialogAbstract
25 b1e9596b Leszek Koltunski
  {
26 f8a21f6b Leszek Koltunski
  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 b1e9596b Leszek Koltunski
32 c02fa107 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
33 b1e9596b Leszek Koltunski
34 f8a21f6b Leszek Koltunski
  public void positiveAction()
35 c02fa107 Leszek Koltunski
    {
36 ada8ab26 leszek
    //final RubikActivity act = (RubikActivity)getContext();
37
    //if( act!=null ) act.acceptPrivacy();
38 c02fa107 Leszek Koltunski
    }
39 b1e9596b Leszek Koltunski
40 c02fa107 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
41 ffd68f35 Leszek Koltunski
42 f8a21f6b Leszek Koltunski
  public void negativeAction()
43 c02fa107 Leszek Koltunski
    {
44 ada8ab26 leszek
    //final RubikActivity act = (RubikActivity)getContext();
45
    //if( act!=null ) act.declinePrivacy();
46 c02fa107 Leszek Koltunski
    }
47 ffd68f35 Leszek Koltunski
48 c02fa107 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
49 b1e9596b Leszek Koltunski
50 c02fa107 Leszek Koltunski
  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 b1e9596b Leszek Koltunski
    }
56
  }