Project

General

Profile

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

magiccube / src / main / java / org / distorted / magic / RubikDialogMain.java @ 6918030e

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.os.Bundle;
24
import android.support.annotation.NonNull;
25
import android.support.v4.app.FragmentActivity;
26
import android.support.v7.app.AlertDialog;
27
import android.support.v7.app.AppCompatDialogFragment;
28
import android.view.LayoutInflater;
29
import android.view.View;
30 4235de9b Leszek Koltunski
import android.view.Window;
31
import android.view.WindowManager;
32 1cbcc6bf Leszek Koltunski
33
///////////////////////////////////////////////////////////////////////////////////////////////////
34
35 0fd3ac1f Leszek Koltunski
public class RubikDialogMain extends AppCompatDialogFragment
36 1cbcc6bf Leszek Koltunski
  {
37 4235de9b Leszek Koltunski
  @Override
38
  public void onStart()
39
    {
40
    super.onStart();
41
42
    Window window = getDialog().getWindow();
43
    window.setFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL,
44
                    WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL);
45
    window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
46
    }
47
48
///////////////////////////////////////////////////////////////////////////////////////////////////
49
50 1cbcc6bf Leszek Koltunski
  @NonNull
51
  @Override
52
  public Dialog onCreateDialog(Bundle savedInstanceState)
53
    {
54
    FragmentActivity act = getActivity();
55
    AlertDialog.Builder builder = new AlertDialog.Builder(act);
56
    LayoutInflater inflater = act.getLayoutInflater();
57 4235de9b Leszek Koltunski
    final View view = inflater.inflate(R.layout.dialog_main, null);
58 1cbcc6bf Leszek Koltunski
    builder.setView(view);
59
60
    return builder.create();
61
    }
62 33499c56 Leszek Koltunski
63
///////////////////////////////////////////////////////////////////////////////////////////////////
64
65
  static String getDialogTag()
66
    {
67
    return "DialogMain";
68
    }
69 4235de9b Leszek Koltunski
  }