1 |
1cbcc6bf
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2 |
|
|
// Copyright 2019 Leszek Koltunski //
|
3 |
|
|
// //
|
4 |
fdec60a3
|
Leszek Koltunski
|
// This file is part of Magic Cube. //
|
5 |
1cbcc6bf
|
Leszek Koltunski
|
// //
|
6 |
fdec60a3
|
Leszek Koltunski
|
// Magic Cube is free software: you can redistribute it and/or modify //
|
7 |
1cbcc6bf
|
Leszek Koltunski
|
// it under the terms of the GNU General Public License as published by //
|
8 |
|
|
// the Free Software Foundation, either version 2 of the License, or //
|
9 |
|
|
// (at your option) any later version. //
|
10 |
|
|
// //
|
11 |
fdec60a3
|
Leszek Koltunski
|
// Magic Cube is distributed in the hope that it will be useful, //
|
12 |
1cbcc6bf
|
Leszek Koltunski
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
13 |
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
14 |
|
|
// GNU General Public License for more details. //
|
15 |
|
|
// //
|
16 |
|
|
// You should have received a copy of the GNU General Public License //
|
17 |
fdec60a3
|
Leszek Koltunski
|
// along with Magic Cube. If not, see <http://www.gnu.org/licenses/>. //
|
18 |
1cbcc6bf
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
19 |
|
|
|
20 |
|
|
package org.distorted.magic;
|
21 |
|
|
|
22 |
|
|
import android.app.Dialog;
|
23 |
|
|
import android.content.DialogInterface;
|
24 |
|
|
import android.os.Bundle;
|
25 |
|
|
import android.support.annotation.NonNull;
|
26 |
|
|
import android.support.v4.app.FragmentActivity;
|
27 |
|
|
import android.support.v7.app.AlertDialog;
|
28 |
|
|
import android.support.v7.app.AppCompatDialogFragment;
|
29 |
|
|
import android.view.LayoutInflater;
|
30 |
|
|
import android.view.View;
|
31 |
|
|
|
32 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
33 |
|
|
|
34 |
5560eea9
|
Leszek Koltunski
|
public class RubikAbout extends AppCompatDialogFragment
|
35 |
1cbcc6bf
|
Leszek Koltunski
|
{
|
36 |
|
|
@NonNull
|
37 |
|
|
@Override
|
38 |
|
|
public Dialog onCreateDialog(Bundle savedInstanceState)
|
39 |
|
|
{
|
40 |
|
|
FragmentActivity act = getActivity();
|
41 |
|
|
AlertDialog.Builder builder = new AlertDialog.Builder(act);
|
42 |
|
|
|
43 |
5560eea9
|
Leszek Koltunski
|
builder.setTitle(R.string.app_version);
|
44 |
|
|
builder.setIcon(R.drawable.button3);
|
45 |
1cbcc6bf
|
Leszek Koltunski
|
builder.setCancelable(false);
|
46 |
|
|
builder.setPositiveButton( R.string.ok, new DialogInterface.OnClickListener()
|
47 |
|
|
{
|
48 |
|
|
@Override
|
49 |
|
|
public void onClick(DialogInterface dialog, int which)
|
50 |
|
|
{
|
51 |
|
|
|
52 |
|
|
}
|
53 |
|
|
});
|
54 |
|
|
|
55 |
|
|
LayoutInflater inflater = act.getLayoutInflater();
|
56 |
5560eea9
|
Leszek Koltunski
|
final View view = inflater.inflate(R.layout.about, null);
|
57 |
1cbcc6bf
|
Leszek Koltunski
|
builder.setView(view);
|
58 |
|
|
|
59 |
|
|
return builder.create();
|
60 |
|
|
}
|
61 |
|
|
}
|