Skip to content

Commit e227efa

Browse files
committed
Version 3.3.1
1 parent 485a099 commit e227efa

9 files changed

Lines changed: 48 additions & 32 deletions

.idea/libraries/Gradle__androidx_constraintlayout_constraintlayout_2_0_4_aar.xml

Lines changed: 0 additions & 11 deletions
This file was deleted.

.idea/libraries/Gradle__androidx_constraintlayout_constraintlayout_2_1_0_aar.xml

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/libraries/Gradle__androidx_constraintlayout_constraintlayout_solver_2_0_4.xml

Lines changed: 0 additions & 9 deletions
This file was deleted.

.idea/workspace.xml

Lines changed: 12 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ android {
77
applicationId "net.studymongolian.chimee"
88
minSdkVersion 14
99
targetSdkVersion 30
10-
versionCode 32
11-
versionName "3.3.0"
10+
versionCode 33
11+
versionName "3.3.1"
1212
}
1313

1414
buildTypes {
@@ -25,6 +25,6 @@ dependencies {
2525
testImplementation 'junit:junit:4.13.1'
2626
implementation 'androidx.appcompat:appcompat:1.3.1'
2727
implementation 'androidx.recyclerview:recyclerview:1.2.1'
28-
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
28+
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
2929
implementation 'net.studymongolian:mongol-library:2.1.0'
3030
}

app/release/app-release.apk

-5.08 MB
Binary file not shown.

app/release/output-metadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
{
1111
"type": "SINGLE",
1212
"filters": [],
13-
"versionCode": 32,
14-
"versionName": "3.3.0",
13+
"versionCode": 33,
14+
"versionName": "3.3.1",
1515
"outputFile": "app-release.apk"
1616
}
1717
]

app/src/main/java/net/studymongolian/chimee/FileUtils.java

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import java.io.InputStreamReader;
2626
import java.io.OutputStream;
2727
import java.io.OutputStreamWriter;
28+
import java.nio.file.Files;
2829
import java.util.ArrayList;
2930
import java.util.Arrays;
3031
import java.util.Date;
@@ -344,8 +345,23 @@ private static boolean saveBitmapToCacheDir(Context context, Bitmap bitmap) {
344345
File cachePath = new File(context.getCacheDir(), TEMP_CACHE_SUBDIR);
345346
//noinspection ResultOfMethodCallIgnored
346347
cachePath.mkdirs();
347-
FileOutputStream stream =
348-
new FileOutputStream(cachePath + File.separator + TEMP_CACHE_FILENAME);
348+
String filename = cachePath + File.separator + TEMP_CACHE_FILENAME;
349+
350+
// Delete the old file.
351+
// Some users complain of the previous message getting sent. At least in one case this
352+
// apparently happened when the user's storage was full. Hopefully deleting the old
353+
// message will at least prevent resending an old image.
354+
File oldFile = new File(filename);
355+
if (oldFile.exists()) {
356+
boolean successfullyDeleted = oldFile.delete();
357+
if (!successfullyDeleted) {
358+
Log.e("Chimee", "The old message image existed but couldn't be deleted.");
359+
return false;
360+
}
361+
}
362+
363+
// Save new file
364+
FileOutputStream stream = new FileOutputStream(filename);
349365
bitmap.compress(Bitmap.CompressFormat.PNG, 100, stream);
350366
stream.close();
351367
} catch (IOException e) {

app/src/main/java/net/studymongolian/chimee/MainActivity.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,16 +244,13 @@ public boolean onMenuItemClick(MongolMenuItem item) {
244244
}
245245
return true;
246246
}
247-
248-
249247
};
250248

251249
private void openColorChooserDialog() {
252250
int bgColor = getInputWindowBackgroundColor();
253251
int fgColor = getSelectedTextColor();
254252
DialogFragment dialog = ColorChooserDialogFragment.newInstance(bgColor, fgColor);
255253
dialog.show(getSupportFragmentManager(), "ColorChooserDialogFragment");
256-
257254
}
258255

259256
private int getInputWindowBackgroundColor() {

0 commit comments

Comments
 (0)