From 0279a95ab3e177424945536dad86a46746b93a38 Mon Sep 17 00:00:00 2001 From: ChronosX88 Date: Tue, 20 Nov 2018 15:35:21 +0300 Subject: [PATCH] Fixed infinity refreshing (when error occured) for SwipeRefreshLayout. --- .idea/caches/build_file_checksums.ser | Bin 537 -> 531 bytes .../ru/volgorobot/vrcatalog/MainActivity.java | 5 ++++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser index d7683e43f225d67c8345a4445159f13dd1ab170e..84fb81ffdc8f80a138ab6242b13f24919e462979 100644 GIT binary patch delta 67 zcmV-J0KEU11d{}im;^Bd>(Y^&h?8jnL?pJvDxI;&CMo)L#HqL>i?wtBA}?rfZDlWW ZF)uD>a$#g_WiOM!0UMK70TPqH0b0Sp8p8kp delta 66 zcmV-I0KNZ{1epYom;@{TpdFE%hz}?)Xm4$0FJowOZ*FgMc$0$xHj^X)L=z+q8XH1f Y#TivHn_oTyB{_5e5tEDo8 list = new ArrayList<>(root.getChildren()); @@ -176,10 +176,12 @@ public class MainActivity extends AppCompatActivity } catch(Exception e) { Toast.makeText(MainActivity.this, "Ответ от сервера неверен! Перепроверьте данные подключения!", Toast.LENGTH_LONG).show(); Log.e("ERROR", "Answer of server is wrong! Re-check your connection credentials! Error: " + response.message()); + mSwipeRefreshLayout.setRefreshing(false); } fillRootNode(); } else { Log.e("ERROR", "Что-то пошло не так..."); + mSwipeRefreshLayout.setRefreshing(false); } } @@ -188,6 +190,7 @@ public class MainActivity extends AppCompatActivity public void onFailure(Call> call, Throwable t) { Toast.makeText(MainActivity.this, "Ошибка сети. Проверьте подключение к сети или данные подключения к API!", Toast.LENGTH_LONG).show(); Log.e("ERROR", "getFirstLevel() failed!"); + mSwipeRefreshLayout.setRefreshing(false); } }); }