Project

General

Profile

« Previous | Next » 

Revision 85248b04

Added by Leszek Koltunski about 4 years ago

Finally solve the bug on Samsung Android 9 and 10 phones that the Dialogs Main & patterns wouldn't be modeless: move the setting of this flag earlier, to the 'onCreateDialog()' function.

View differences:

src/main/java/org/distorted/dialogs/RubikDialogSolverError.java
38 38

  
39 39
public class RubikDialogSolverError extends AppCompatDialogFragment
40 40
  {
41
  @Override
42
  public void onStart()
43
    {
44
    super.onStart();
45

  
46
    Dialog dialog = getDialog();
47

  
48
    if( dialog!=null )
49
      {
50
      dialog.setCanceledOnTouchOutside(false);
51

  
52
      Window window = dialog.getWindow();
53

  
54
      if( window!=null )
55
        {
56
        window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
57
        }
58
      }
59
    }
60

  
61
///////////////////////////////////////////////////////////////////////////////////////////////////
62

  
63 41
  @NonNull
64 42
  @Override
65 43
  public Dialog onCreateDialog(Bundle savedInstanceState)
......
99 77
    text.setText(errorStr);
100 78
    builder.setView(view);
101 79

  
102
    return builder.create();
80
    Dialog dialog = builder.create();
81

  
82
    dialog.setCanceledOnTouchOutside(false);
83

  
84
    Window window = dialog.getWindow();
85

  
86
    if( window!=null )
87
      {
88
      window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
89
      }
90

  
91
    return dialog;
103 92
    }
104 93
  }

Also available in: Unified diff