Do not set download button state when cancelling download (#731)
This commit is contained in:
parent
937008a4bd
commit
a16cf771ee
|
@ -87,6 +87,11 @@ android {
|
||||||
exclude 'META-INF/LICENSE.txt'
|
exclude 'META-INF/LICENSE.txt'
|
||||||
exclude 'META-INF/NOTICE.txt'
|
exclude 'META-INF/NOTICE.txt'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
|
|
|
@ -269,13 +269,8 @@ public class MusicVideoInfoFragment extends AbstractInfoFragment
|
||||||
callbackHandler);
|
callbackHandler);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.setNegativeButton(android.R.string.cancel,
|
|
||||||
new DialogInterface.OnClickListener() {
|
.setNegativeButton(android.R.string.cancel, (dialog, which) -> dialog.cancel())
|
||||||
@Override
|
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
|
||||||
// Nothing to do
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.show();
|
.show();
|
||||||
} else {
|
} else {
|
||||||
FileDownloadHelper.downloadFiles(getActivity(), getHostInfo(),
|
FileDownloadHelper.downloadFiles(getActivity(), getHostInfo(),
|
||||||
|
|
|
@ -94,12 +94,6 @@ public class MovieInfoFragment extends AbstractInfoFragment
|
||||||
setOnDownloadListener(new View.OnClickListener() {
|
setOnDownloadListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
DialogInterface.OnClickListener noopClickListener =
|
|
||||||
new DialogInterface.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(DialogInterface dialog, int which) { }
|
|
||||||
};
|
|
||||||
|
|
||||||
// Check if the directory exists and whether to overwrite it
|
// Check if the directory exists and whether to overwrite it
|
||||||
File file = new File(movieDownloadInfo.getAbsoluteFilePath());
|
File file = new File(movieDownloadInfo.getAbsoluteFilePath());
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
|
@ -124,7 +118,7 @@ public class MovieInfoFragment extends AbstractInfoFragment
|
||||||
callbackHandler);
|
callbackHandler);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.setNegativeButton(android.R.string.cancel, noopClickListener)
|
.setNegativeButton(android.R.string.cancel, (dialog, which) -> dialog.cancel())
|
||||||
.show();
|
.show();
|
||||||
} else {
|
} else {
|
||||||
// Confirm that the user really wants to download the file
|
// Confirm that the user really wants to download the file
|
||||||
|
@ -140,7 +134,8 @@ public class MovieInfoFragment extends AbstractInfoFragment
|
||||||
callbackHandler);
|
callbackHandler);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.setNegativeButton(android.R.string.cancel, noopClickListener)
|
.setNegativeButton(android.R.string.cancel, (dialog, which) -> dialog.cancel())
|
||||||
|
.setOnCancelListener(dialog -> setDownloadButtonState(false))
|
||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -244,12 +244,6 @@ public class TVShowEpisodeInfoFragment extends AbstractInfoFragment
|
||||||
}
|
}
|
||||||
|
|
||||||
private void downloadEpisode() {
|
private void downloadEpisode() {
|
||||||
DialogInterface.OnClickListener noopClickListener =
|
|
||||||
new DialogInterface.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(DialogInterface dialog, int which) { }
|
|
||||||
};
|
|
||||||
|
|
||||||
// Check if the directory exists and whether to overwrite it
|
// Check if the directory exists and whether to overwrite it
|
||||||
File file = new File(fileDownloadHelper.getAbsoluteFilePath());
|
File file = new File(fileDownloadHelper.getAbsoluteFilePath());
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
|
@ -274,7 +268,7 @@ public class TVShowEpisodeInfoFragment extends AbstractInfoFragment
|
||||||
callbackHandler);
|
callbackHandler);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.setNegativeButton(android.R.string.cancel, noopClickListener)
|
.setNegativeButton(android.R.string.cancel, (dialog, which) -> dialog.cancel())
|
||||||
.show();
|
.show();
|
||||||
} else {
|
} else {
|
||||||
// Confirm that the user really wants to download the file
|
// Confirm that the user really wants to download the file
|
||||||
|
@ -290,7 +284,8 @@ public class TVShowEpisodeInfoFragment extends AbstractInfoFragment
|
||||||
callbackHandler);
|
callbackHandler);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.setNegativeButton(android.R.string.cancel, noopClickListener)
|
.setNegativeButton(android.R.string.cancel, (dialog, which) -> dialog.cancel())
|
||||||
|
.setOnCancelListener(dialog -> setDownloadButtonState(false))
|
||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue