Skip to content

Commit bcd17df

Browse files
committed
Clean up stray buttons in report UIs.
Signed-off-by: Katharine Berry <ktbry@google.com>
1 parent 25f489e commit bcd17df

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

app/src/c/converse/report_window.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ typedef struct {
3737
VectorSequenceLayer *loading_layer;
3838
Layer *scroll_indicator_down;
3939
StatusBarLayer *status_bar_layer;
40+
bool busy;
4041
} ReportWindowData;
4142

4243
static void prv_window_load(Window *window);
@@ -123,6 +124,8 @@ static void prv_window_load(Window *window) {
123124
vector_sequence_layer_set_sequence(data->loading_layer, data->loading_sequence);
124125

125126
data->event_handle = events_app_message_register_inbox_received(prv_app_message_received, window);
127+
128+
data->busy = false;
126129
}
127130

128131
static void prv_window_unload(Window *window) {
@@ -148,7 +151,12 @@ static void prv_click_config_provider() {
148151
static void prv_select_clicked(ClickRecognizerRef recognizer, void *context) {
149152
Window *window = context;
150153
ReportWindowData *data = window_get_user_data(window);
154+
if (data->busy) {
155+
return;
156+
}
151157
layer_remove_from_parent(scroll_layer_get_layer(data->scroll_layer));
158+
layer_remove_from_parent(bitmap_layer_get_layer(data->select_indicator_layer));
159+
data->busy = true;
152160
layer_add_child(window_get_root_layer(window), vector_sequence_layer_get_layer(data->loading_layer));
153161
vector_sequence_layer_play(data->loading_layer);
154162
DictionaryIterator *iter;

app/src/c/menus/feedback_window.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ typedef struct {
3636
VectorSequenceLayer *loading_layer;
3737
Layer *scroll_indicator_down;
3838
StatusBarLayer *status_bar_layer;
39+
bool busy;
3940
} FeedbackWindowData;
4041

4142
static void prv_window_load(Window *window);
@@ -126,6 +127,8 @@ static void prv_window_load(Window *window) {
126127
dictation_session_enable_confirmation(data->dict_session, true);
127128

128129
data->event_handle = events_app_message_register_inbox_received(prv_app_message_received, window);
130+
131+
data->busy = false;
129132
}
130133

131134
static void prv_window_unload(Window *window) {
@@ -152,6 +155,9 @@ static void prv_click_config_provider() {
152155
static void prv_select_clicked(ClickRecognizerRef recognizer, void *context) {
153156
Window *window = context;
154157
FeedbackWindowData *data = window_get_user_data(window);
158+
if (data->busy) {
159+
return;
160+
}
155161
dictation_session_start(data->dict_session);
156162
}
157163

@@ -161,7 +167,9 @@ static void prv_dictation_status_callback(DictationSession *session, DictationSe
161167
if (status != DictationSessionStatusSuccess) {
162168
return;
163169
}
170+
data->busy = true;
164171
layer_remove_from_parent(scroll_layer_get_layer(data->scroll_layer));
172+
layer_remove_from_parent(bitmap_layer_get_layer(data->select_indicator_layer));
165173
layer_add_child(window_get_root_layer(window), vector_sequence_layer_get_layer(data->loading_layer));
166174
vector_sequence_layer_play(data->loading_layer);
167175
DictionaryIterator *iter;

0 commit comments

Comments
 (0)