Created
July 5, 2016 19:16
-
-
Save cecyurbina/e9feb59d960b799bd2541bff22fc6d18 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void createDialog(){ | |
progressDialog = new ProgressDialog(this); | |
//progressDialog.vis | |
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); | |
progressDialog.setCancelable(false); | |
progressDialog.setMessage(getString(R.string.pager_wait_record)); | |
progressDialog.show(); | |
} | |
private void updateProgress(int total, int count){ | |
//progressDialog.setMax(total); | |
//progressDialog.setProgress(count); | |
String mMessageUpdate = getString(R.string.sync_current_get_forms, | |
String.valueOf(count), | |
String.valueOf(total)); | |
progressDialog.setMessage(mMessageUpdate); | |
} | |
private void closeDialog(){ | |
if (progressDialog.isShowing()) { | |
progressDialog.dismiss(); | |
} | |
} | |
@Subscribe(threadMode = ThreadMode.MAIN) | |
public void onMessageProgress(EBProgress event) { | |
Log.d(">>>>>>>", "progress"); | |
switch (event.option){ | |
case SHOW_DIALOG: | |
Log.d(">>>>>>>", "show dialog"); | |
createDialog(); | |
break; | |
case CLOSE_DIALOG: | |
Log.d(">>>>>>>", "close dialog"); | |
closeDialog(); | |
break; | |
case UPDATE_PROGRESS_DIALOG: | |
Log.d(">>>>>>>", "update dialog"); | |
updateProgress(event.total, event.count); | |
break; | |
default: | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
private void createDialog(){
progressDialog = new ProgressDialog(this);