Example #1
0
 @UiThreadTest
 public void testDisable() {
   singleMessageTest(R.string.connection_failed, true);
   statusViewer.disable();
   statusViewer.setMessage(R.string.cancel, false);
   checkSingleMessage(R.string.connection_failed, View.GONE, View.GONE);
 }
Example #2
0
 @UiThreadTest
 public void testEnable() {
   testDisable();
   statusViewer.enable();
   checkSingleMessage(R.string.empty, View.VISIBLE, View.INVISIBLE);
   singleMessageTest(R.string.app_name, false);
 }
Example #3
0
 @Override
 protected void setUp() {
   progressBar = new ProgressBar(getActivity());
   message = new TextView(getActivity());
   statusViewer = new StatusViewer(getActivity());
   statusViewer.updateViews(progressBar, message);
 }
Example #4
0
 private void singleMessageTest(int messageResource, boolean visibility) {
   statusViewer.setMessage(messageResource, visibility);
   int progressBarVisibility;
   if (visibility) {
     progressBarVisibility = View.VISIBLE;
   } else {
     progressBarVisibility = View.INVISIBLE;
   }
   checkSingleMessage(messageResource, View.VISIBLE, progressBarVisibility);
 }