Added disabled state for download button in dashboard when other download is running
This commit is contained in:
parent
8c19b4d3db
commit
f6d752cfd9
6 changed files with 11 additions and 5 deletions
BIN
OsmAnd/res/drawable-hdpi/ic_download_disabled.png
Normal file
BIN
OsmAnd/res/drawable-hdpi/ic_download_disabled.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
BIN
OsmAnd/res/drawable-mdpi/ic_download_disabled.png
Normal file
BIN
OsmAnd/res/drawable-mdpi/ic_download_disabled.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
BIN
OsmAnd/res/drawable-xhdpi/ic_download_disabled.png
Normal file
BIN
OsmAnd/res/drawable-xhdpi/ic_download_disabled.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
BIN
OsmAnd/res/drawable-xxhdpi/ic_download_disabled.png
Normal file
BIN
OsmAnd/res/drawable-xxhdpi/ic_download_disabled.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
5
OsmAnd/res/drawable/download_disabled.xml
Normal file
5
OsmAnd/res/drawable/download_disabled.xml
Normal 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>
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue