mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-11 16:37:18 -04:00
Clean up
This commit is contained in:
parent
a619b6fcb8
commit
f8ec5e5f3d
@ -191,20 +191,6 @@ public class LibraryFragment extends Fragment
|
|||||||
TestingUtils.unbindResource(LibraryFragment.class);
|
TestingUtils.unbindResource(LibraryFragment.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void displayNetworkConfirmation() {
|
|
||||||
libraryList.removeFooterView(progressBar);
|
|
||||||
networkText.setText(R.string.download_over_network);
|
|
||||||
networkText.setVisibility(View.VISIBLE);
|
|
||||||
permissionButton.setVisibility(View.VISIBLE);
|
|
||||||
permissionButton.setOnClickListener(view -> {
|
|
||||||
presenter.loadBooks();
|
|
||||||
permissionButton.setVisibility(View.GONE);
|
|
||||||
networkText.setVisibility(View.GONE);
|
|
||||||
});
|
|
||||||
TestingUtils.unbindResource(LibraryFragment.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void noNetworkConnection() {
|
public void noNetworkConnection() {
|
||||||
displayNoNetworkConnection();
|
displayNoNetworkConnection();
|
||||||
}
|
}
|
||||||
@ -356,11 +342,9 @@ public class LibraryFragment extends Fragment
|
|||||||
NetworkInfo network = conMan.getActiveNetworkInfo();
|
NetworkInfo network = conMan.getActiveNetworkInfo();
|
||||||
|
|
||||||
if ((books == null || books.isEmpty()) && network != null && network.isConnected()) {
|
if ((books == null || books.isEmpty()) && network != null && network.isConnected()) {
|
||||||
if (KiwixMobileActivity.wifiOnly && !NetworkUtils.isWiFi(getContext())) {
|
presenter.loadBooks();
|
||||||
displayNetworkConfirmation();
|
permissionButton.setVisibility(View.GONE);
|
||||||
} else {
|
networkText.setVisibility(View.GONE);
|
||||||
displayNetworkConfirmation();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user