add ripple effect to headline row image view buttons
This commit is contained in:
parent
209b82a1da
commit
69e916684f
@ -816,12 +816,20 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TypedValue tvAccent = new TypedValue();
|
||||||
|
m_activity.getTheme().resolveAttribute(R.attr.colorAccent, tvAccent, true);
|
||||||
|
|
||||||
if (holder.markedView != null) {
|
if (holder.markedView != null) {
|
||||||
TypedValue tv = new TypedValue();
|
TypedValue tv = new TypedValue();
|
||||||
m_activity.getTheme().resolveAttribute(article.marked ? R.attr.ic_star : R.attr.ic_star_outline, tv, true);
|
m_activity.getTheme().resolveAttribute(article.marked ? R.attr.ic_star : R.attr.ic_star_outline, tv, true);
|
||||||
|
|
||||||
holder.markedView.setImageResource(tv.resourceId);
|
holder.markedView.setImageResource(tv.resourceId);
|
||||||
|
|
||||||
|
if (article.marked)
|
||||||
|
holder.markedView.setColorFilter(tvAccent.data);
|
||||||
|
else
|
||||||
|
holder.markedView.setColorFilter(null);
|
||||||
|
|
||||||
holder.markedView.setOnClickListener(new OnClickListener() {
|
holder.markedView.setOnClickListener(new OnClickListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -841,6 +849,11 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
|
|||||||
|
|
||||||
holder.publishedView.setImageResource(tv.resourceId);
|
holder.publishedView.setImageResource(tv.resourceId);
|
||||||
|
|
||||||
|
if (article.published)
|
||||||
|
holder.publishedView.setColorFilter(tvAccent.data);
|
||||||
|
else
|
||||||
|
holder.publishedView.setColorFilter(null);
|
||||||
|
|
||||||
holder.publishedView.setOnClickListener(new OnClickListener() {
|
holder.publishedView.setOnClickListener(new OnClickListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
4
org.fox.ttrss/src/main/res/drawable-v21/ripple.xml
Normal file
4
org.fox.ttrss/src/main/res/drawable-v21/ripple.xml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ripple
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:color="?android:colorControlHighlight" />
|
8
org.fox.ttrss/src/main/res/drawable/ripple.xml
Normal file
8
org.fox.ttrss/src/main/res/drawable/ripple.xml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- no ripple support before api21 so its a dummy transparent bg -->
|
||||||
|
<shape
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||||
|
|
||||||
|
<solid android:color="@android:color/transparent" />
|
||||||
|
|
||||||
|
</shape>
|
@ -154,6 +154,7 @@
|
|||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/marked"
|
android:id="@+id/marked"
|
||||||
|
android:background="@drawable/ripple"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="24dp"
|
android:layout_height="24dp"
|
||||||
android:paddingLeft="4dp"
|
android:paddingLeft="4dp"
|
||||||
@ -164,6 +165,7 @@
|
|||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/published"
|
android:id="@+id/published"
|
||||||
|
android:background="@drawable/ripple"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="24dp"
|
android:layout_height="24dp"
|
||||||
android:paddingLeft="4dp"
|
android:paddingLeft="4dp"
|
||||||
@ -174,6 +176,7 @@
|
|||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/article_menu_button"
|
android:id="@+id/article_menu_button"
|
||||||
|
android:background="@drawable/ripple"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="16dp"
|
android:layout_height="16dp"
|
||||||
android:layout_weight="0"
|
android:layout_weight="0"
|
||||||
|
@ -106,6 +106,7 @@
|
|||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/marked"
|
android:id="@+id/marked"
|
||||||
|
android:background="@drawable/ripple"
|
||||||
android:layout_width="24dp"
|
android:layout_width="24dp"
|
||||||
android:layout_gravity="bottom|right"
|
android:layout_gravity="bottom|right"
|
||||||
android:layout_height="24dp"
|
android:layout_height="24dp"
|
||||||
|
@ -108,6 +108,7 @@
|
|||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/marked"
|
android:id="@+id/marked"
|
||||||
|
android:background="@drawable/ripple"
|
||||||
android:tint="?headlineFooterColor"
|
android:tint="?headlineFooterColor"
|
||||||
android:layout_width="24dp"
|
android:layout_width="24dp"
|
||||||
android:layout_gravity="bottom|right"
|
android:layout_gravity="bottom|right"
|
||||||
|
@ -156,6 +156,7 @@
|
|||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/marked"
|
android:id="@+id/marked"
|
||||||
|
android:background="@drawable/ripple"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="24dp"
|
android:layout_height="24dp"
|
||||||
android:paddingLeft="4dp"
|
android:paddingLeft="4dp"
|
||||||
@ -166,6 +167,7 @@
|
|||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/published"
|
android:id="@+id/published"
|
||||||
|
android:background="@drawable/ripple"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="24dp"
|
android:layout_height="24dp"
|
||||||
android:paddingLeft="4dp"
|
android:paddingLeft="4dp"
|
||||||
@ -176,6 +178,7 @@
|
|||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/article_menu_button"
|
android:id="@+id/article_menu_button"
|
||||||
|
android:background="@drawable/ripple"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="16dp"
|
android:layout_height="16dp"
|
||||||
android:layout_weight="0"
|
android:layout_weight="0"
|
||||||
|
@ -108,6 +108,7 @@
|
|||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/marked"
|
android:id="@+id/marked"
|
||||||
|
android:background="@drawable/ripple"
|
||||||
android:layout_width="24dp"
|
android:layout_width="24dp"
|
||||||
android:layout_gravity="bottom|right"
|
android:layout_gravity="bottom|right"
|
||||||
android:layout_height="24dp"
|
android:layout_height="24dp"
|
||||||
|
Loading…
Reference in New Issue
Block a user