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.content.DialogInterface;
|
14
|
import android.util.TypedValue;
|
15
|
import android.view.View;
|
16
|
import android.widget.Button;
|
17
|
import android.widget.TextView;
|
18
|
|
19
|
import androidx.appcompat.app.AlertDialog;
|
20
|
import androidx.fragment.app.FragmentActivity;
|
21
|
|
22
|
import org.distorted.main.R;
|
23
|
|
24
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
25
|
|
26
|
public class RubikDialogStarsExplain extends RubikDialogAbstract
|
27
|
{
|
28
|
public int getResource()
|
29
|
{
|
30
|
return R.layout.dialog_stars_explain;
|
31
|
}
|
32
|
|
33
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
34
|
|
35
|
public int getTitleResource()
|
36
|
{
|
37
|
return -1;
|
38
|
}
|
39
|
|
40
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
41
|
|
42
|
public boolean hasArgument()
|
43
|
{
|
44
|
return false;
|
45
|
}
|
46
|
|
47
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
48
|
|
49
|
public void setPositive(AlertDialog.Builder builder)
|
50
|
{
|
51
|
builder.setPositiveButton( R.string.ok, new DialogInterface.OnClickListener()
|
52
|
{
|
53
|
@Override
|
54
|
public void onClick(DialogInterface dialog, int which)
|
55
|
{
|
56
|
|
57
|
}
|
58
|
});
|
59
|
}
|
60
|
|
61
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
62
|
|
63
|
public void setNegative(AlertDialog.Builder builder)
|
64
|
{
|
65
|
|
66
|
}
|
67
|
|
68
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
69
|
|
70
|
public void onShowDialog(DialogInterface dialog, float size)
|
71
|
{
|
72
|
Button btnPositive = ((AlertDialog)dialog).getButton(Dialog.BUTTON_POSITIVE);
|
73
|
btnPositive.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
|
74
|
}
|
75
|
|
76
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
77
|
|
78
|
public void prepareBody(Dialog dialog, View view, FragmentActivity act, float size)
|
79
|
{
|
80
|
TextView text = view.findViewById(R.id.stars_dialog_explain);
|
81
|
text.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
|
82
|
}
|
83
|
}
|