デバッグメニューロジック実装

This commit is contained in:
r-ca 2023-12-25 11:55:42 +09:00
parent bc42d59471
commit 544b09dc39
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9

View File

@ -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;
}
}