Project

General

Profile

« Previous | Next » 

Revision 2d942f35

Added by Leszek Koltunski over 4 years ago

Bugfix in DialogSetName - before it would not dim the OK button initially

View differences:

src/main/java/org/distorted/dialogs/RubikDialogSetName.java
49 49
  {
50 50
  private EditText mEdit;
51 51

  
52
///////////////////////////////////////////////////////////////////////////////////////////////////
53

  
54
  @Override
55
  public void onStart()
56
    {
57
    super.onStart();
58

  
59
    AlertDialog dialog = (AlertDialog)getDialog();
60

  
61
    if( dialog!=null )
62
      {
63
      Button positiveButton = dialog.getButton(Dialog.BUTTON_POSITIVE);
64

  
65
      if( positiveButton!=null )
66
        {
67
        String editName = mEdit.getText().toString();
68
        positiveButton.setEnabled(editName.length()>0);
69
        }
70
      }
71
    }
72

  
52 73
///////////////////////////////////////////////////////////////////////////////////////////////////
53 74

  
54 75
  @NonNull
......
151 172
      window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
152 173
      }
153 174

  
154
    Button positiveButton = ((AlertDialog)dialog).getButton(Dialog.BUTTON_POSITIVE);
155

  
156
    if( positiveButton!=null )
157
      {
158
      String editName = mEdit.getText().toString();
159
      positiveButton.setEnabled(editName.length()>0);
160
      }
161

  
162 175
    return dialog;
163 176
    }
164 177
  }

Also available in: Unified diff