mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-12 16:08:36 -07:00
revert archive fixes temporarily
This commit is contained in:
@@ -335,12 +335,6 @@ static bool browser_is_list_load_required(FileBrowserModel* model) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static void browser_list_rollover(FileBrowserModel* model) {
|
||||
if(!model->list_loading && items_array_size(model->items) < model->item_cnt) {
|
||||
items_array_reset(model->items);
|
||||
}
|
||||
}
|
||||
|
||||
static void browser_update_offset(FileBrowser* browser) {
|
||||
furi_assert(browser);
|
||||
|
||||
@@ -423,7 +417,7 @@ static void browser_list_load_cb(void* context, uint32_t list_load_offset) {
|
||||
}
|
||||
}
|
||||
},
|
||||
false);
|
||||
true);
|
||||
|
||||
BrowserItem_t_clear(&back_item);
|
||||
}
|
||||
@@ -468,15 +462,14 @@ static void browser_list_item_cb(
|
||||
(browser->hide_ext) && (item.type == BrowserItemTypeFile));
|
||||
}
|
||||
|
||||
// We shouldn't update screen on each item if custom callback is not set
|
||||
// Otherwise it will cause screen flickering
|
||||
bool instant_update = (browser->item_callback != NULL);
|
||||
with_view_model(
|
||||
browser->view,
|
||||
FileBrowserModel * model,
|
||||
{ items_array_push_back(model->items, item); },
|
||||
instant_update);
|
||||
|
||||
{
|
||||
items_array_push_back(model->items, item);
|
||||
// TODO: calculate if element is visible
|
||||
},
|
||||
false);
|
||||
furi_string_free(item.display_name);
|
||||
furi_string_free(item.path);
|
||||
if(item.custom_icon_data) {
|
||||
@@ -689,13 +682,11 @@ static bool file_browser_view_input_callback(InputEvent* event, void* context) {
|
||||
if(model->item_idx < scroll_speed) {
|
||||
model->button_held_for_ticks = 0;
|
||||
model->item_idx = model->item_cnt - 1;
|
||||
browser_list_rollover(model);
|
||||
} else {
|
||||
model->item_idx =
|
||||
((model->item_idx - scroll_speed) + model->item_cnt) %
|
||||
model->item_cnt;
|
||||
}
|
||||
|
||||
if(browser_is_list_load_required(model)) {
|
||||
model->list_loading = true;
|
||||
int32_t load_offset = CLAMP(
|
||||
@@ -709,14 +700,13 @@ static bool file_browser_view_input_callback(InputEvent* event, void* context) {
|
||||
|
||||
model->button_held_for_ticks += 1;
|
||||
} else if(event->key == InputKeyDown) {
|
||||
if(model->item_idx + scroll_speed >= (int32_t)model->item_cnt) {
|
||||
int32_t count = model->item_cnt;
|
||||
if(model->item_idx + scroll_speed >= count) {
|
||||
model->button_held_for_ticks = 0;
|
||||
model->item_idx = 0;
|
||||
browser_list_rollover(model);
|
||||
} else {
|
||||
model->item_idx = (model->item_idx + scroll_speed) % model->item_cnt;
|
||||
}
|
||||
|
||||
if(browser_is_list_load_required(model)) {
|
||||
model->list_loading = true;
|
||||
int32_t load_offset = CLAMP(
|
||||
|
||||
Reference in New Issue
Block a user