Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions PR_DESCRIPTION_Amitjoiya_185.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
### Overview
This PR re-submits the clean version of my previous contribution that adds a **"Custom" option** on the image screen (similar to Arduino).

### Features
- Added "Custom" option to image screen.
- Opens a configuration screen for:
- Custom screen size
- Display driver/SDK
- Color selection
- Activity type

### Notes
- Only relevant changes are included.
- No formatting or unrelated file modifications.
- All code written manually following project conventions.

Thank you for the feedback earlier — I’ve created this clean PR as requested.
51 changes: 51 additions & 0 deletions lib/view/image_editor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ import 'package:magicepaperapp/constants/color_constants.dart';
import 'package:magicepaperapp/l10n/app_localizations.dart';
import '../util/app_logger.dart';
import 'package:magicepaperapp/provider/getitlocator.dart';
import 'package:magicepaperapp/view/widget/configurable_epd_dialog.dart';
import 'package:magicepaperapp/util/epd/configurable_editor.dart';
import 'package:magicepaperapp/provider/color_palette_provider.dart';

AppLocalizations appLocalizations = getIt.get<AppLocalizations>();

Expand Down Expand Up @@ -722,6 +725,54 @@ class BottomActionMenu extends StatelessWidget {
}
},
),
_buildActionButton(
context: context,
icon: Icons.developer_mode_outlined,
label: 'Custom',
onTap: () async {
// Open the existing configurable EPD dialog used by the drawer/Arduino flow
final configurable = ConfigurableEpd(
modelId: 'NA',
width: 400,
height: 300,
colors: [Colors.white, Colors.black, Colors.red],
);

final result = await showDialog<CustomEpdConfig>(
context: context,
builder: (context) => ConfigurableEpdDialog(
initialWidth: configurable.width,
initialHeight: configurable.height,
initialColors: List<Color>.from(configurable.colors),
),
);

if (result != null) {
final customEpd = ConfigurableEpd(
width: result.width,
height: result.height,
colors: result.colors,
name: result.presetName,
modelId: result.presetName,
);

try {
context.read<ColorPaletteProvider>().updateColors(customEpd.colors);
} catch (e, stackTrace) {
// provider may not be available in some contexts; log for debugging
debugPrint('ColorPaletteProvider unavailable: $e\n$stackTrace');
}

// Open export-only ImageEditor with the custom display
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ImageEditor(isExportOnly: true, device: customEpd),
),
);
}
},
),
],
),
),
Expand Down