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