diff options
author | Scott Jackson <daneren2005@gmail.com> | 2015-07-18 18:19:13 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2015-07-18 18:19:13 -0700 |
commit | 569281e423b93cf67db2141b49f04103036d4db5 (patch) | |
tree | af0def4c718a3ae42841b45bbae0c24c936befed /app/src/main/java/github/daneren2005/dsub/view/UpdateView.java | |
parent | 32ab835977f1544dd299508f66861881528004be (diff) | |
download | dsub-569281e423b93cf67db2141b49f04103036d4db5.tar.gz dsub-569281e423b93cf67db2141b49f04103036d4db5.tar.bz2 dsub-569281e423b93cf67db2141b49f04103036d4db5.zip |
Update action mode to support albums, color when selected
Diffstat (limited to 'app/src/main/java/github/daneren2005/dsub/view/UpdateView.java')
-rw-r--r-- | app/src/main/java/github/daneren2005/dsub/view/UpdateView.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/view/UpdateView.java b/app/src/main/java/github/daneren2005/dsub/view/UpdateView.java index e639eaa8..fd74c872 100644 --- a/app/src/main/java/github/daneren2005/dsub/view/UpdateView.java +++ b/app/src/main/java/github/daneren2005/dsub/view/UpdateView.java @@ -20,6 +20,7 @@ package github.daneren2005.dsub.view; import android.content.Context; import android.content.res.TypedArray; +import android.graphics.drawable.Drawable; import android.os.Handler; import android.os.Looper; import android.support.v7.widget.RecyclerView; @@ -64,6 +65,7 @@ public abstract class UpdateView<T> extends LinearLayout { protected int isRated = 0; protected int rating = 0; protected SilentBackgroundTask<Void> imageTask = null; + protected Drawable startBackgroundDrawable; protected final boolean autoUpdate; protected boolean checkable; @@ -270,7 +272,14 @@ public abstract class UpdateView<T> extends LinearLayout { return checkable; } public void setChecked(boolean checked) { - + View child = getChildAt(0); + if (checked && startBackgroundDrawable == null) { + startBackgroundDrawable = child.getBackground(); + child.setBackgroundColor(DrawableTint.getColorRes(context, R.attr.colorPrimary)); + } else if (!checked && startBackgroundDrawable != null) { + child.setBackgroundDrawable(startBackgroundDrawable); + startBackgroundDrawable = null; + } } public void onClick() { |