From 5bc86ce49a459007b053e75fc23b91d6a444f3ad Mon Sep 17 00:00:00 2001 From: ChronosX88 Date: Mon, 28 Jan 2019 19:01:03 +0400 Subject: [PATCH] Added clearing tree view before refreshing. --- .../main/java/ru/volgorobot/vrcatalog/view/MainActivity.java | 2 ++ .../java/ru/volgorobot/vrcatalog/view/SearchableActivity.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/app/src/main/java/ru/volgorobot/vrcatalog/view/MainActivity.java b/app/src/main/java/ru/volgorobot/vrcatalog/view/MainActivity.java index 1bbe158..bb41b27 100644 --- a/app/src/main/java/ru/volgorobot/vrcatalog/view/MainActivity.java +++ b/app/src/main/java/ru/volgorobot/vrcatalog/view/MainActivity.java @@ -128,6 +128,8 @@ public class MainActivity extends AppCompatActivity mConnectionErrorImageView.setVisibility(View.INVISIBLE); mErrorTextView.setVisibility(View.INVISIBLE); mTreeViewContainer.setVisibility(View.VISIBLE); + rootNode.setChildren(new ArrayList()); + treeView.refreshTreeView(); mPresenter.getFirstLevel(); } diff --git a/app/src/main/java/ru/volgorobot/vrcatalog/view/SearchableActivity.java b/app/src/main/java/ru/volgorobot/vrcatalog/view/SearchableActivity.java index a83a8e1..f3a1de9 100644 --- a/app/src/main/java/ru/volgorobot/vrcatalog/view/SearchableActivity.java +++ b/app/src/main/java/ru/volgorobot/vrcatalog/view/SearchableActivity.java @@ -109,6 +109,8 @@ public class SearchableActivity extends AppCompatActivity implements MainContrac mConnectionErrorImageView.setVisibility(View.INVISIBLE); mErrorTextView.setVisibility(View.INVISIBLE); mTreeViewContainer.setVisibility(View.VISIBLE); + rootNode.setChildren(new ArrayList()); + treeView.refreshTreeView(); searchablePresenter.fetchDetailsTreeByName(detailName); }