Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize sync progress views once #1026

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ public class DrawerMenuView implements View.OnClickListener, BaseDrawerContract.
private TextView operatorTextView;
private TextView p2pSyncTextView;

private ProgressBar progressBar;
private TextView progressLabel;
private TextView syncButton;
private TextView syncBadge;

private DrawerLayout mDrawerLayout;

private BaseDrawerContract.Presenter presenter;
Expand Down Expand Up @@ -150,6 +155,11 @@ public void onGlobalLayout() {
operatorTextView = headerView.findViewById(R.id.operator_label);
p2pSyncTextView = headerView.findViewById(R.id.btn_navMenu_p2pSyncBtn);

progressBar = headerView.findViewById(R.id.sync_progress_bar);
progressLabel = headerView.findViewById(R.id.sync_progress_bar_label);
syncButton = headerView.findViewById(R.id.sync_button);
syncBadge = headerView.findViewById(R.id.sync_label);

TextView offlineMapTextView = headerView.findViewById(R.id.btn_navMenu_offline_maps);

TextView summaryFormsTextView = headerView.findViewById(R.id.btn_navMenu_summaryForms);
Expand Down Expand Up @@ -380,10 +390,6 @@ public void checkSynced() {

@Override
public void toggleProgressBarView(boolean syncing) {
ProgressBar progressBar = this.activity.getActivity().findViewById(R.id.sync_progress_bar);
TextView progressLabel = this.activity.getActivity().findViewById(R.id.sync_progress_bar_label);
TextView syncButton = this.activity.getActivity().findViewById(R.id.sync_button);
TextView syncBadge = this.activity.getActivity().findViewById(R.id.sync_label);
if (progressBar == null || syncBadge == null)
return;
if (syncing && NetworkUtils.isNetworkAvailable()) { //only hide the sync button when there is internet connection
Expand Down