Fix download wikivoyage

This commit is contained in:
Victor Shcherb 2018-04-28 18:50:39 +03:00
parent 3730300a16
commit 65535f0705
2 changed files with 7 additions and 0 deletions

View file

@ -72,6 +72,7 @@
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/search_box"
android:layout_marginLeft="@dimen/text_margin_small"
android:layout_marginRight="@dimen/text_margin_small"
android:background="@drawable/wikivoyage_search_card_bg">

View file

@ -136,12 +136,14 @@ public class WikivoyageExploreDialogFragment extends WikivoyageBaseDialogFragmen
return false;
}
});
updateSearchVisibility();
populateData();
return mainView;
}
protected void onDataLoaded() {
mainView.findViewById(R.id.progress_bar).setVisibility(View.GONE);
updateSearchVisibility();
if(exploreTabFragment != null) {
exploreTabFragment.populateData();
}
@ -150,6 +152,10 @@ public class WikivoyageExploreDialogFragment extends WikivoyageBaseDialogFragmen
}
}
private void updateSearchVisibility() {
mainView.findViewById(R.id.search_box).setVisibility(getMyApplication().getTravelDbHelper().getSelectedTravelBook() == null ? View.GONE : View.VISIBLE);
}
public void populateData() {
mainView.findViewById(R.id.progress_bar).setVisibility(View.VISIBLE);
new LoadWikivoyageData(this).execute();