packages/apps/Eleven
Revision | 360c9611ff19b00dfa48bad6ad33d4bdcb0c2e12 (tree) |
---|---|
Time | 2019-03-20 05:56:33 |
Author | Alexander Martinz <amartinz@shif...> |
Commiter | Michael Bestas |
no_results: also tint image drawable
If we are setting color for it, the drawable got ignored, resulting
in eg white text and a black drawable.
Tint drawable as well when setting text to make all match.
Change-Id: I29cda801a0319699bb87213bc702e3a28ec4fae8
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
@@ -27,6 +27,7 @@ | ||
27 | 27 | android:visibility="gone"> |
28 | 28 | |
29 | 29 | <ImageView |
30 | + android:id="@+id/no_results_image" | |
30 | 31 | android:layout_width="@dimen/white_note_width" |
31 | 32 | android:layout_height="@dimen/white_note_height" |
32 | 33 | android:layout_gravity="center_horizontal" |
@@ -16,8 +16,10 @@ | ||
16 | 16 | package org.lineageos.eleven.widgets; |
17 | 17 | |
18 | 18 | import android.content.Context; |
19 | +import android.graphics.PorterDuff; | |
19 | 20 | import android.util.AttributeSet; |
20 | 21 | import android.view.View; |
22 | +import android.widget.ImageView; | |
21 | 23 | import android.widget.LinearLayout; |
22 | 24 | import android.widget.TextView; |
23 | 25 |
@@ -43,7 +45,7 @@ public class NoResultsContainer extends LinearLayout { | ||
43 | 45 | } |
44 | 46 | |
45 | 47 | public void setMainHighlightText(final String text) { |
46 | - final TextView hightlightText = (TextView)findViewById(R.id.no_results_main_highlight_text); | |
48 | + final TextView hightlightText = findViewById(R.id.no_results_main_highlight_text); | |
47 | 49 | |
48 | 50 | if (text == null || text.isEmpty()) { |
49 | 51 | hightlightText.setVisibility(View.GONE); |
@@ -58,8 +60,9 @@ public class NoResultsContainer extends LinearLayout { | ||
58 | 60 | } |
59 | 61 | |
60 | 62 | public void setTextColor(int color) { |
63 | + ((ImageView)findViewById(R.id.no_results_image)).setColorFilter(color, PorterDuff.Mode.SRC_IN); | |
61 | 64 | ((TextView)findViewById(R.id.no_results_main_text)).setTextColor(color); |
62 | 65 | ((TextView)findViewById(R.id.no_results_main_highlight_text)).setTextColor(color); |
63 | 66 | ((TextView)findViewById(R.id.no_results_secondary_text)).setTextColor(color); |
64 | 67 | } |
65 | -} | |
\ No newline at end of file | ||
68 | +} |