Project

General

Profile

« Previous | Next » 

Revision f4ee4d70

Added by Leszek Koltunski about 4 years ago

Do not allow more than 15 characters in the NAME.

View differences:

build.gradle
3 3
apply plugin: 'com.google.firebase.crashlytics'
4 4

  
5 5
android {
6
    signingConfigs {
7
        release {
8
            storeFile file('/Users/leszek/Programs/Examples/threedcell.keystore')
9
            keyAlias = 'distorted'
10
        }
11
    }
6 12
    compileSdkVersion 29
7 13

  
8 14
    defaultConfig {
......
17 23
        release {
18 24
            minifyEnabled false
19 25
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
26
            signingConfig signingConfigs.release
20 27
        }
21 28
    }
22 29

  
src/main/java/org/distorted/dialogs/RubikDialogSetName.java
47 47

  
48 48
public class RubikDialogSetName extends AppCompatDialogFragment
49 49
  {
50
  private static final int MAX_NAME_LEN = 15;
50 51
  private EditText mEdit;
51 52

  
52 53
///////////////////////////////////////////////////////////////////////////////////////////////////
......
119 120
      public void onClick(DialogInterface dialog, int which)
120 121
        {
121 122
        String name = mEdit.getText().toString();
123
        int len = name.length();
122 124

  
123
        if( name.length()>0 )
125
        if( len>0 )
124 126
          {
127
          if( len>MAX_NAME_LEN )
128
            {
129
            name = name.substring(0,MAX_NAME_LEN);
130
            }
131

  
125 132
          RubikActivity act = (RubikActivity)getActivity();
126 133
          RubikState.switchState(act,RubikState.PLAY);
127 134
          RubikScores.getInstance().setName(name);

Also available in: Unified diff