Revision d26274d1
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/bandaged/BandagedCreatorActivity.java | ||
---|---|---|
260 | 260 |
|
261 | 261 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
262 | 262 |
|
263 |
public void deleteObject(String name) |
|
263 |
public void deleteObject(String name, int numCubits)
|
|
264 | 264 |
{ |
265 | 265 |
mScreen.deleteObject(this,name); |
266 | 266 |
|
267 | 267 |
RubikFiles files = RubikFiles.getInstance(); |
268 | 268 |
files.deleteIcon(this,name); |
269 | 269 |
files.deleteJsonObject(this,name); |
270 |
|
|
271 |
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this); |
|
272 |
SharedPreferences.Editor editor = preferences.edit(); |
|
273 |
String objName = name+" "; |
|
274 |
for(int i=0; i<numCubits; i++) editor.remove(objName+i); |
|
275 |
editor.apply(); |
|
270 | 276 |
} |
271 | 277 |
|
272 | 278 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
src/main/java/org/distorted/dialogs/RubikDialogBandagedDelete.java | ||
---|---|---|
90 | 90 |
|
91 | 91 |
if( bact!=null ) |
92 | 92 |
{ |
93 |
bact.deleteObject(objectName); |
|
93 |
bact.deleteObject(objectName,26);
|
|
94 | 94 |
} |
95 | 95 |
} |
96 | 96 |
}); |
Also available in: Unified diff
Simplify the way we remember cubit quats, and delete those from SharedPrefs when we delete a bandaged object.