diff options
Diffstat (limited to 'java/com')
-rw-r--r-- | java/com/android/incallui/rtt/impl/RttCheckableButton.java | 13 | ||||
-rw-r--r-- | java/com/android/incallui/rtt/impl/res/values/styles.xml | 7 |
2 files changed, 15 insertions, 5 deletions
diff --git a/java/com/android/incallui/rtt/impl/RttCheckableButton.java b/java/com/android/incallui/rtt/impl/RttCheckableButton.java index ba15ca985..c0c8599a4 100644 --- a/java/com/android/incallui/rtt/impl/RttCheckableButton.java +++ b/java/com/android/incallui/rtt/impl/RttCheckableButton.java @@ -22,11 +22,11 @@ import android.os.Parcel; import android.os.Parcelable; import android.util.AttributeSet; import android.view.SoundEffectConstants; +import android.widget.Button; import android.widget.Checkable; -import android.widget.TextView; /** Image button that maintains a checked state. */ -public class RttCheckableButton extends TextView implements Checkable { +public class RttCheckableButton extends Button implements Checkable { private static final int[] CHECKED_STATE_SET = {android.R.attr.state_checked}; @@ -47,11 +47,16 @@ public class RttCheckableButton extends TextView implements Checkable { } public RttCheckableButton(Context context, AttributeSet attrs) { - this(context, attrs, 0); + this(context, attrs, android.R.attr.imageButtonStyle); } public RttCheckableButton(Context context, AttributeSet attrs, int defStyleAttr) { - super(context, attrs, defStyleAttr); + this(context, attrs, defStyleAttr, 0); + } + + public RttCheckableButton( + Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { + super(context, attrs, defStyleAttr, defStyleRes); init(context, attrs); } diff --git a/java/com/android/incallui/rtt/impl/res/values/styles.xml b/java/com/android/incallui/rtt/impl/res/values/styles.xml index 515e0dfcf..bbacde813 100644 --- a/java/com/android/incallui/rtt/impl/res/values/styles.xml +++ b/java/com/android/incallui/rtt/impl/res/values/styles.xml @@ -22,6 +22,10 @@ <item name="android:textSize">16sp</item> </style> + <style name="ButtonTheme"> + <item name="android:colorControlHighlight">#33000000</item> + </style> + <style name="RttButton"> <item name="android:layout_width">match_parent</item> <item name="android:layout_height">wrap_content</item> @@ -33,6 +37,7 @@ <item name="android:drawableTint">@color/rtt_checkable_button_color</item> <item name="android:textSize">16sp</item> <item name="android:textColor">@color/rtt_checkable_button_color</item> - <item name="android:colorControlHighlight">#33000000</item> + <item name="android:theme">@style/ButtonTheme</item> + <item name="android:background">?attr/selectableItemBackground</item> </style> </resources>
\ No newline at end of file |