new plotter
This commit is contained in:
BIN
android-app-core/res/drawable-hdpi/ab_camera.png
Normal file
BIN
android-app-core/res/drawable-hdpi/ab_camera.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
BIN
android-app-core/res/drawable-ldpi/ab_camera.png
Normal file
BIN
android-app-core/res/drawable-ldpi/ab_camera.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
BIN
android-app-core/res/drawable-mdpi/ab_camera.png
Normal file
BIN
android-app-core/res/drawable-mdpi/ab_camera.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 981 B |
BIN
android-app-core/res/drawable-xhdpi/ab_camera.png
Normal file
BIN
android-app-core/res/drawable-xhdpi/ab_camera.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
@@ -298,6 +298,8 @@
|
||||
<string name="cpp_dash_dotted_line_style">Dash dotted (-.-.-)</string>
|
||||
|
||||
<string name="cpp_plotter">Function plotter</string>
|
||||
|
||||
<string name="cpp_plot_screenshot">Capture screenshot</string>
|
||||
<string name="cpp_plot_screenshot_saved">Screenshot successfully saved: %1$s!</string>
|
||||
<string name="cpp_plot_unable_to_save_screenshot">Screenshot cannot be saved as sdcard is not mounted. Mount sdcard and try again!</string>
|
||||
|
||||
</resources>
|
@@ -6,7 +6,6 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.Environment;
|
||||
import android.util.Log;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -67,20 +66,16 @@ public final class AndroidUtils2 {
|
||||
public static String saveBitmap(@NotNull Bitmap bitmap,
|
||||
@NotNull String path,
|
||||
@NotNull String fileName) {
|
||||
final File sdcardPath = Environment.getExternalStorageDirectory();
|
||||
final File filePath = new File(sdcardPath, path);
|
||||
|
||||
final File filePath = new File(path);
|
||||
filePath.mkdirs();
|
||||
|
||||
final String fullFileName = fileName + "_" + System.currentTimeMillis() + ".png";
|
||||
|
||||
final File file = new File(path, fullFileName);
|
||||
final File file = new File(path, fileName);
|
||||
if (!file.exists()) {
|
||||
final String name = file.getAbsolutePath();
|
||||
|
||||
FileOutputStream fos = null;
|
||||
try {
|
||||
fos = new FileOutputStream(name);
|
||||
fos = new FileOutputStream(name);
|
||||
bitmap.compress(Bitmap.CompressFormat.PNG, 100, fos);
|
||||
fos.flush();
|
||||
} catch (FileNotFoundException e) {
|
||||
|
Reference in New Issue
Block a user