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/RubikDialogPattern.java
46 46
  {
47 47
  private RubikDialogPatternPagerAdapter mPagerAdapter;
48 48

  
49
///////////////////////////////////////////////////////////////////////////////////////////////////
50

  
51
  @Override
52
  public void onStart()
53
    {
54
    super.onStart();
55

  
56
    Dialog dialog = getDialog();
57

  
58
    if( dialog!=null )
59
      {
60
      dialog.setCanceledOnTouchOutside(false);
61

  
62
      Window window = dialog.getWindow();
63

  
64
      if( window!=null )
65
        {
66
        window.setFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL,
67
                        WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL);
68
        window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
69
        }
70
      }
71
    }
72

  
73 49
///////////////////////////////////////////////////////////////////////////////////////////////////
74 50

  
75 51
  @NonNull
......
119 95
      if(tab!=null) tab.setCustomView(imageView);
120 96
      }
121 97

  
122
    return builder.create();
98
    Dialog dialog = builder.create();
99

  
100
    dialog.setCanceledOnTouchOutside(false);
101

  
102
    Window window = dialog.getWindow();
103

  
104
    if( window!=null )
105
      {
106
      window.setFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL,
107
                      WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL);
108
      window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
109
      }
110

  
111
    return dialog;
123 112
    }
124 113

  
125 114
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff