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/RubikDialogScores.java
42 42

  
43 43
public class RubikDialogScores extends AppCompatDialogFragment
44 44
  {
45
  RubikDialogScoresPagerAdapter mPagerAdapter;
46

  
47
///////////////////////////////////////////////////////////////////////////////////////////////////
48

  
49
  @Override
50
  public void onStart()
51
    {
52
    super.onStart();
53

  
54
    Dialog dialog = getDialog();
55

  
56
    if( dialog!=null )
57
      {
58
      dialog.setCanceledOnTouchOutside(false);
59

  
60
      Window window = dialog.getWindow();
61

  
62
      if( window!=null )
63
        {
64
        window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
65
        }
66
      }
67
    }
45
  private RubikDialogScoresPagerAdapter mPagerAdapter;
68 46

  
69 47
///////////////////////////////////////////////////////////////////////////////////////////////////
70 48

  
......
133 111
        }
134 112
      }
135 113

  
136
    return builder.create();
114
    Dialog dialog = builder.create();
115

  
116
    dialog.setCanceledOnTouchOutside(false);
117

  
118
    Window window = dialog.getWindow();
119

  
120
    if( window!=null )
121
      {
122
      window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
123
      }
124

  
125
    return dialog;
137 126
    }
138 127
  }

Also available in: Unified diff