Skip to content
This repository was archived by the owner on Jul 27, 2019. It is now read-only.

Commit f84c367

Browse files
committed
Toggling ProgressBar visibility.
1 parent e07877c commit f84c367

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

send-to-desktop-api/app/src/main/java/com/adobe/sendtodesktopapi/MainActivity.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,19 @@ public void onClick(View v) {
113113
@Override
114114
public void onClick(View v) {
115115

116+
mSendToDesktopProgressBar.setVisibility(View.VISIBLE);
117+
116118
if (mSelectedImageUri != null) {
117119
try {
118120
sendToDesktop();
119121
} catch (IOException e) {
120122
e.printStackTrace();
123+
124+
mSendToDesktopProgressBar.setVisibility(View.INVISIBLE);
121125
}
122126
}
123127
else {
128+
mSendToDesktopProgressBar.setVisibility(View.INVISIBLE);
124129
Toast.makeText(MainActivity.this, "Select an image from the Gallery", Toast.LENGTH_LONG).show();
125130
}
126131
}
@@ -141,6 +146,7 @@ private void sendToDesktop() throws IOException {
141146
@Override
142147
public void onSuccess() {
143148
// Success case example
149+
mSendToDesktopProgressBar.setVisibility(View.INVISIBLE);
144150
Toast.makeText(MainActivity.this, "Opening in Photoshop on your desktop!", Toast.LENGTH_LONG).show();
145151
}
146152

0 commit comments

Comments
 (0)