Skip to content

Commit

Permalink
Merge pull request #3682 from Catrobat/hotfix-0.9.73
Browse files Browse the repository at this point in the history
Hotfix 0.9.73
  • Loading branch information
wslany authored Jul 17, 2020
2 parents c32f774 + bc38695 commit 430402e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 19 deletions.
4 changes: 2 additions & 2 deletions catroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ android {
targetSdkVersion 28
applicationId appId
testInstrumentationRunner 'org.catrobat.catroid.runner.UiTestApplicationRunner'
versionCode 75
versionName "0.9.71"
versionCode 78
versionName "0.9.73"
println "VersionCode is $versionCode"
println "VersionName is $versionName"
multiDexEnabled true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonIOException;
import com.google.gson.JsonSyntaxException;

import org.catrobat.catroid.common.Backpack;
import org.catrobat.catroid.content.Script;
Expand Down Expand Up @@ -89,13 +87,11 @@ public Backpack loadBackpack() {
try {
BufferedReader bufferedReader = new BufferedReader(new FileReader(backpackFile));
return backpackGson.fromJson(bufferedReader, Backpack.class);
} catch (FileNotFoundException e) {
Log.e(TAG, "FileNotFoundException: Could not create buffered Writer with file: "
+ backpackFile.getAbsolutePath());
return new Backpack();
} catch (JsonSyntaxException | JsonIOException jsonException) {
Log.e(TAG, "Cannot load Backpack. Creating new Backpack File.", jsonException);
backpackFile.delete();
} catch (Exception e) {
if (!(e instanceof FileNotFoundException)) {
backpackFile.delete();
}
Log.e(TAG, "Cannot load Backpack. Creating new Backpack File.", e);
return new Backpack();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,7 @@ public void onClick(View v) {
parent.findViewById(R.id.current_project).setOnClickListener(listener);
parent.findViewById(R.id.floating_action_button).setOnClickListener(listener);

updateMyProjects();
if (myProjects.size() != 0) {
currentProject = myProjects.get(0).getName();
} else {
currentProject = Utils.getCurrentProjectName(getContext());
}
loadProjectImage();

setAndLoadCurrentProject();
setShowProgressBar(false);
}

Expand Down Expand Up @@ -169,12 +162,19 @@ public void onResume() {
getActivity().getIntent().removeExtra(EXTRA_PROJECT_NAME);
loadDownloadedProject(projectName);
}
setAndLoadCurrentProject();
}

private void setAndLoadCurrentProject() {
updateMyProjects();
if (myProjects.size() != 0) {
currentProject = myProjects.get(0).getName();
} else {
currentProject = Utils.getCurrentProjectName(getContext());
}
File projectDir = new File(DEFAULT_ROOT_DIRECTORY,
FileMetaDataExtractor.encodeSpecialCharsForFileSystem(currentProject));
ProjectLoadTask.task(projectDir, getContext());
loadProjectImage();
}

Expand Down

0 comments on commit 430402e

Please sign in to comment.