|
@@ -4,7 +4,6 @@
|
|
|
#include <assets_icons.h>
|
|
#include <assets_icons.h>
|
|
|
#include <notification/notification.h>
|
|
#include <notification/notification.h>
|
|
|
#include <notification/notification_messages.h>
|
|
#include <notification/notification_messages.h>
|
|
|
-#include <notification/notification_app.h>
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Opens a file browser dialog and returns the filepath of the selected file
|
|
* Opens a file browser dialog and returns the filepath of the selected file
|
|
@@ -15,7 +14,14 @@
|
|
|
* @returns true if a file is selected
|
|
* @returns true if a file is selected
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
-NotificationApp* notifications = 0;
|
|
|
|
|
|
|
+static NotificationApp* barcode_notifications;
|
|
|
|
|
+
|
|
|
|
|
+const NotificationSequence sequence_display_backlight_barcode = {
|
|
|
|
|
+ &message_force_display_brightness_setting_1f,
|
|
|
|
|
+ &message_display_backlight_on,
|
|
|
|
|
+ &message_do_not_reset,
|
|
|
|
|
+ NULL,
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
static bool select_file(const char* folder, FuriString* file_path) {
|
|
static bool select_file(const char* folder, FuriString* file_path) {
|
|
|
DialogsApp* dialogs = furi_record_open(RECORD_DIALOGS);
|
|
DialogsApp* dialogs = furi_record_open(RECORD_DIALOGS);
|
|
@@ -148,6 +154,8 @@ void select_barcode_item(BarcodeApp* app) {
|
|
|
},
|
|
},
|
|
|
true);
|
|
true);
|
|
|
|
|
|
|
|
|
|
+ notification_message(barcode_notifications, &sequence_display_backlight_barcode);
|
|
|
|
|
+
|
|
|
view_dispatcher_switch_to_view(app->view_dispatcher, BarcodeView);
|
|
view_dispatcher_switch_to_view(app->view_dispatcher, BarcodeView);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -303,11 +311,11 @@ void free_app(BarcodeApp* app) {
|
|
|
free(app);
|
|
free(app);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-void set_backlight_brightness(float brightness) {
|
|
|
|
|
- NotificationApp* notifications = furi_record_open(RECORD_NOTIFICATION);
|
|
|
|
|
- notifications->settings.display_brightness = brightness;
|
|
|
|
|
- notification_message(notifications, &sequence_display_backlight_on);
|
|
|
|
|
-}
|
|
|
|
|
|
|
+/*void set_backlight_brightness(float brightness) {
|
|
|
|
|
+ NotificationApp* barcode_notifications = furi_record_open(RECORD_NOTIFICATION);
|
|
|
|
|
+ barcode_notifications->settings.display_brightness = brightness;
|
|
|
|
|
+ notification_message(barcode_notifications, &sequence_display_backlight_on);
|
|
|
|
|
+}*/
|
|
|
|
|
|
|
|
int32_t barcode_main(void* p) {
|
|
int32_t barcode_main(void* p) {
|
|
|
UNUSED(p);
|
|
UNUSED(p);
|
|
@@ -329,12 +337,12 @@ int32_t barcode_main(void* p) {
|
|
|
|
|
|
|
|
submenu_add_item(app->main_menu, "Edit Barcode", EditBarcodeItem, submenu_callback, app);
|
|
submenu_add_item(app->main_menu, "Edit Barcode", EditBarcodeItem, submenu_callback, app);
|
|
|
|
|
|
|
|
- NotificationApp* notifications = furi_record_open(RECORD_NOTIFICATION);
|
|
|
|
|
|
|
+ barcode_notifications = furi_record_open(RECORD_NOTIFICATION);
|
|
|
// Save original brightness
|
|
// Save original brightness
|
|
|
- float originalBrightness = notifications->settings.display_brightness;
|
|
|
|
|
|
|
+ //float originalBrightness = barcode_notifications->settings.display_brightness;
|
|
|
// force backlight and increase brightness
|
|
// force backlight and increase brightness
|
|
|
- notification_message_block(notifications, &sequence_display_backlight_enforce_on);
|
|
|
|
|
- set_backlight_brightness(10); // set to highest
|
|
|
|
|
|
|
+ //notification_message(barcode_notifications, &sequence_display_backlight_enforce_on);
|
|
|
|
|
+ //set_backlight_brightness(10); // set to highest
|
|
|
|
|
|
|
|
/*****************************
|
|
/*****************************
|
|
|
* Creating Text Input View
|
|
* Creating Text Input View
|
|
@@ -441,8 +449,9 @@ int32_t barcode_main(void* p) {
|
|
|
view_dispatcher_run(app->view_dispatcher);
|
|
view_dispatcher_run(app->view_dispatcher);
|
|
|
|
|
|
|
|
free_app(app);
|
|
free_app(app);
|
|
|
- notification_message_block(notifications, &sequence_display_backlight_enforce_auto);
|
|
|
|
|
- set_backlight_brightness(originalBrightness);
|
|
|
|
|
|
|
+ notification_message_block(barcode_notifications, &sequence_display_backlight_enforce_auto);
|
|
|
|
|
+ //set_backlight_brightness(originalBrightness);
|
|
|
|
|
+ furi_record_close(RECORD_NOTIFICATION);
|
|
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|