aboutsummaryrefslogtreecommitdiff
path: root/src/github/daneren2005
diff options
context:
space:
mode:
Diffstat (limited to 'src/github/daneren2005')
-rw-r--r--src/github/daneren2005/dsub/view/SongView.java15
-rw-r--r--src/github/daneren2005/dsub/view/UpdateView.java11
2 files changed, 16 insertions, 10 deletions
diff --git a/src/github/daneren2005/dsub/view/SongView.java b/src/github/daneren2005/dsub/view/SongView.java
index 8e10a97f..24e2df0f 100644
--- a/src/github/daneren2005/dsub/view/SongView.java
+++ b/src/github/daneren2005/dsub/view/SongView.java
@@ -19,6 +19,7 @@
package github.daneren2005.dsub.view;
import android.content.Context;
+import android.content.res.TypedArray;
import android.media.MediaMetadataRetriever;
import android.util.Log;
import android.view.LayoutInflater;
@@ -42,8 +43,7 @@ import java.text.DateFormat;
*/
public class SongView extends UpdateView implements Checkable {
private static final String TAG = SongView.class.getSimpleName();
-
- private Context context;
+
private MusicDirectory.Entry song;
private CheckedTextView checkedTextView;
@@ -67,7 +67,6 @@ public class SongView extends UpdateView implements Checkable {
public SongView(Context context) {
super(context);
- this.context = context;
LayoutInflater.from(context).inflate(R.layout.song_list_item, this, true);
checkedTextView = (CheckedTextView) findViewById(R.id.song_check);
@@ -197,14 +196,16 @@ public class SongView extends UpdateView implements Checkable {
int rightImage = 0;
if (isWorkDone) {
- int moreImage = isSaved ? R.drawable.list_item_more_saved : R.drawable.list_item_more_shaded;
+ int moreImage = isSaved ? R.drawable.download_pinned : R.drawable.download_cached;
if(moreImage != this.moreImage) {
moreButton.setImageResource(moreImage);
this.moreImage = moreImage;
}
- } else if(this.moreImage != R.drawable.list_item_more) {
- moreButton.setImageResource(R.drawable.list_item_more);
- this.moreImage = R.drawable.list_item_more;
+ } else if(true) {
+ int[] attrs = new int[] {R.attr.download_none};
+ TypedArray typedArray = context.obtainStyledAttributes(attrs);
+ moreButton.setImageResource(typedArray.getResourceId(0, 0));
+ this.moreImage = R.drawable.download_none_light;
}
if (downloadFile.isDownloading() && !downloadFile.isDownloadCancelled() && partialFileExists) {
diff --git a/src/github/daneren2005/dsub/view/UpdateView.java b/src/github/daneren2005/dsub/view/UpdateView.java
index 20f9db9f..05b17417 100644
--- a/src/github/daneren2005/dsub/view/UpdateView.java
+++ b/src/github/daneren2005/dsub/view/UpdateView.java
@@ -19,6 +19,7 @@
package github.daneren2005.dsub.view;
import android.content.Context;
+import android.content.res.TypedArray;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
@@ -41,7 +42,8 @@ public class UpdateView extends LinearLayout {
private static Handler backgroundHandler;
private static Handler uiHandler;
private static Runnable updateRunnable;
-
+
+ protected Context context;
protected ImageButton starButton;
protected ImageView moreButton;
@@ -52,6 +54,7 @@ public class UpdateView extends LinearLayout {
public UpdateView(Context context) {
super(context);
+ this.context = context;
setLayoutParams(new AbsListView.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,
@@ -168,12 +171,14 @@ public class UpdateView extends LinearLayout {
if(moreButton != null) {
if(exists) {
if(!shaded) {
- moreButton.setImageResource(R.drawable.list_item_more_shaded);
+ moreButton.setImageResource(R.drawable.download_cached);
shaded = true;
}
} else {
if(shaded) {
- moreButton.setImageResource(R.drawable.list_item_more);
+ int[] attrs = new int[] {R.attr.download_none};
+ TypedArray typedArray = context.obtainStyledAttributes(attrs);
+ moreButton.setImageResource(typedArray.getResourceId(0, 0));
shaded = false;
}
}