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/RubikDialogAbout.java
38 38

  
39 39
public class RubikDialogAbout 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)
......
89 67
    text.setText(getString(R.string.ap_placeholder,appName, appVers));
90 68
    builder.setView(view);
91 69

  
92
    return builder.create();
70
    Dialog dialog = builder.create();
71

  
72
    dialog.setCanceledOnTouchOutside(false);
73

  
74
    Window window = dialog.getWindow();
75

  
76
    if( window!=null )
77
      {
78
      window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
79
      }
80

  
81
    return dialog;
93 82
    }
94 83
  }

Also available in: Unified diff