From 6823445421fc6ce395422ac39defae7652e94a1f Mon Sep 17 00:00:00 2001 From: Paulo Coelho Filho Date: Tue, 8 Sep 2020 10:32:16 +0100 Subject: [PATCH] Implements onRefresh event (#3513) Co-authored-by: Paulo Coelho --- .../views/product/summary/SummaryProductFragment.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/openfoodfacts/github/scrachx/openfood/views/product/summary/SummaryProductFragment.java b/app/src/main/java/openfoodfacts/github/scrachx/openfood/views/product/summary/SummaryProductFragment.java index 2a57ba5f1e10..1317af97eee9 100644 --- a/app/src/main/java/openfoodfacts/github/scrachx/openfood/views/product/summary/SummaryProductFragment.java +++ b/app/src/main/java/openfoodfacts/github/scrachx/openfood/views/product/summary/SummaryProductFragment.java @@ -184,6 +184,11 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, return binding.getRoot(); } + @Override + public void onRefresh() { + refreshView(productState); + } + @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); @@ -233,7 +238,6 @@ public void refreshView(ProductState productState) { return; } - super.refreshView(productState); this.productState = productState; product = productState.getProduct(); presenter = new SummaryProductPresenter(product, this); @@ -423,6 +427,9 @@ public void refreshView(ProductState productState) { //to be sure that top of the product view is visible at start binding.textNameProduct.requestFocus(); binding.textNameProduct.clearFocus(); + + //Set refreshing animation to false after all processing is done + super.refreshView(productState); } private void refreshScoresLayout() {