From 544b09dc39ac09eddb11aae6e3d598287cca6331 Mon Sep 17 00:00:00 2001 From: r-ca Date: Mon, 25 Dec 2023 11:55:42 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=87=E3=83=90=E3=83=83=E3=82=B0=E3=83=A1?= =?UTF-8?q?=E3=83=8B=E3=83=A5=E3=83=BC=E3=83=AD=E3=82=B8=E3=83=83=E3=82=AF?= =?UTF-8?q?=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DebugMenuFileManagerTesterFragment.java | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/feature/debug/src/main/java/one/nem/lacerta/feature/debug/DebugMenuFileManagerTesterFragment.java b/feature/debug/src/main/java/one/nem/lacerta/feature/debug/DebugMenuFileManagerTesterFragment.java index a0c9a489..b7d903d8 100644 --- a/feature/debug/src/main/java/one/nem/lacerta/feature/debug/DebugMenuFileManagerTesterFragment.java +++ b/feature/debug/src/main/java/one/nem/lacerta/feature/debug/DebugMenuFileManagerTesterFragment.java @@ -1,5 +1,9 @@ package one.nem.lacerta.feature.debug; +import android.graphics.Bitmap; +import android.graphics.Canvas; +import android.graphics.Color; +import android.graphics.Paint; import android.os.Bundle; import androidx.fragment.app.Fragment; @@ -15,8 +19,6 @@ import one.nem.lacerta.source.file.factory.FileManagerFactory; import one.nem.lacerta.utils.repository.DeviceInfoUtils; -import org.eclipse.jgit.diff.Edit; - import javax.inject.Inject; /** @@ -65,6 +67,20 @@ public class DebugMenuFileManagerTesterFragment extends Fragment { fileManager.createDir(dirName); }); + view.findViewById(R.id.button_save_item).setOnClickListener(v -> { + FileManager fileManager = fileManagerFactory.create(deviceInfoUtils.getExternalStorageDirectory()); + fileManager.createDir("test"); + fileManager.changeDir("test"); + Bitmap bitmap = Bitmap.createBitmap(100, 100, Bitmap.Config.ARGB_8888); + // Bitmapに描画処理を行う + Canvas canvas = new Canvas(bitmap); + Paint paint = new Paint(); + paint.setColor(Color.RED); + canvas.drawCircle(50, 50, 50, paint); + + fileManager.saveBitmapAtCurrent(bitmap, "test.bmp"); + }); + return view; } } \ No newline at end of file