Added disabled state for download button in dashboard when other download is running

This commit is contained in:
Bars107 2014-12-09 13:00:11 +02:00
parent 8c19b4d3db
commit f6d752cfd9
6 changed files with 11 additions and 5 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_download_cancel_tap" />
</selector>

View file

@ -3,6 +3,7 @@ package net.osmand.plus.dashboard;
import java.util.ArrayList;
import java.util.List;
import android.widget.*;
import net.osmand.plus.R;
import net.osmand.plus.base.BasicProgressAsyncTask;
import net.osmand.plus.download.BaseDownloadActivity;
@ -15,10 +16,6 @@ import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
/**
* Created by Denis on 21.11.2014.
@ -140,7 +137,11 @@ public class DashUpdatesFragment extends DashBaseFragment {
if (!visible) {
return;
}
for(ImageButton button : downloadButtons){
if (!button.equals(cancelButton)){
button.setImageResource(R.drawable.ic_download_disabled);
}
}
cancelButton.setImageResource(R.drawable.cancel_button);
cancelButton.setOnClickListener(new View.OnClickListener() {
@Override