Merge branch 'remove-install-cancel' into 'master'

Remove cancel button for install

Remove cancel button for install/uninstall progress

See merge request !325
This commit is contained in:
Daniel Martí 2016-06-08 13:01:56 +00:00
commit f779118d6b

View File

@ -554,7 +554,7 @@ public class AppDetails extends AppCompatActivity {
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
switch (intent.getAction()) { switch (intent.getAction()) {
case Installer.ACTION_INSTALL_STARTED: case Installer.ACTION_INSTALL_STARTED:
headerFragment.startProgress(); headerFragment.startProgress(false);
headerFragment.showIndeterminateProgress(getString(R.string.installing)); headerFragment.showIndeterminateProgress(getString(R.string.installing));
break; break;
case Installer.ACTION_INSTALL_COMPLETE: case Installer.ACTION_INSTALL_COMPLETE:
@ -607,7 +607,7 @@ public class AppDetails extends AppCompatActivity {
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
switch (intent.getAction()) { switch (intent.getAction()) {
case Installer.ACTION_UNINSTALL_STARTED: case Installer.ACTION_UNINSTALL_STARTED:
headerFragment.startProgress(); headerFragment.startProgress(false);
headerFragment.showIndeterminateProgress(getString(R.string.uninstalling)); headerFragment.showIndeterminateProgress(getString(R.string.uninstalling));
break; break;
case Installer.ACTION_UNINSTALL_COMPLETE: case Installer.ACTION_UNINSTALL_COMPLETE:
@ -986,7 +986,6 @@ public class AppDetails extends AppCompatActivity {
private void startInstall(Apk apk) { private void startInstall(Apk apk) {
activeDownloadUrlString = apk.getUrl(); activeDownloadUrlString = apk.getUrl();
registerDownloaderReceivers(); registerDownloaderReceivers();
headerFragment.startProgress();
InstallManagerService.queue(this, app, apk); InstallManagerService.queue(this, app, apk);
} }
@ -1532,6 +1531,11 @@ public class AppDetails extends AppCompatActivity {
* Displays empty, indeterminate progress bar and related views. * Displays empty, indeterminate progress bar and related views.
*/ */
public void startProgress() { public void startProgress() {
startProgress(true);
}
public void startProgress(boolean allowCancel) {
cancelButton.setVisibility(allowCancel ? View.VISIBLE : View.GONE);
showIndeterminateProgress(getString(R.string.download_pending)); showIndeterminateProgress(getString(R.string.download_pending));
updateViews(); updateViews();
} }
@ -1576,7 +1580,6 @@ public class AppDetails extends AppCompatActivity {
progressBar.setVisibility(state); progressBar.setVisibility(state);
progressSize.setVisibility(state); progressSize.setVisibility(state);
progressPercent.setVisibility(state); progressPercent.setVisibility(state);
cancelButton.setVisibility(state);
} }
/** /**
@ -1584,6 +1587,7 @@ public class AppDetails extends AppCompatActivity {
*/ */
public void removeProgress() { public void removeProgress() {
setProgressVisible(false); setProgressVisible(false);
cancelButton.setVisibility(View.GONE);
updateViews(); updateViews();
} }