Project

General

Profile

« Previous | Next » 

Revision a41e3c94

Added by Leszek Koltunski about 2 years ago

Remember the list of locally created Bandaged 3x3s.

View differences:

src/main/java/org/distorted/bandaged/BandagedCreatorScreen.java
27 27
import android.widget.ImageView;
28 28
import android.widget.LinearLayout;
29 29

  
30
import org.distorted.external.RubikFiles;
30 31
import org.distorted.helpers.TransparentImageButton;
31 32
import org.distorted.main.R;
32 33
import org.distorted.main.RubikActivity;
......
137 138
    layout.addView(layoutRight);
138 139
    }
139 140

  
141
///////////////////////////////////////////////////////////////////////////////////////////////////
142

  
143
  boolean objectDoesntExist(String name)
144
    {
145
    for( BandagedCreatorObjectView view : mViews )
146
      {
147
      String viewName = view.getName();
148
      if( viewName.equals(name) ) return false;
149
      }
150

  
151
    return true;
152
    }
153

  
154
///////////////////////////////////////////////////////////////////////////////////////////////////
155

  
156
  void addObjects(BandagedCreatorActivity act, String objectString)
157
    {
158
    if( objectString.length()>0 )
159
      {
160
      String[] objects = objectString.split(" ");
161
      RubikFiles files = RubikFiles.getInstance();
162

  
163
      for(String object : objects)
164
        {
165
        if( objectDoesntExist(object) )
166
          {
167
          addObject(act, object);
168
          Bitmap bmp = files.getIcon(act, object + ".png");
169
          iconCreationDone(act, bmp);
170
          }
171
        }
172
      }
173
    }
174

  
140 175
///////////////////////////////////////////////////////////////////////////////////////////////////
141 176

  
142 177
  void addObject(BandagedCreatorActivity act, String name)
......
213 248
        }
214 249
      }
215 250
    }
251

  
252
///////////////////////////////////////////////////////////////////////////////////////////////////
253

  
254
  String generateObjectStrings()
255
    {
256
    String result = "";
257
    int numViews = mViews.size();
258

  
259
    for( int v=0; v<numViews; v++ )
260
      {
261
      BandagedCreatorObjectView view = mViews.get(v);
262
      String name = view.getName();
263

  
264
      if( v>0 ) result += " ";
265
      result += name;
266
      }
267

  
268
    return result;
269
    }
216 270
}

Also available in: Unified diff