summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorwangqi <wangqi@google.com>2018-03-01 18:12:18 -0800
committerCopybara-Service <copybara-piper@google.com>2018-03-02 10:14:51 -0800
commit3ba5bd0fda778c7739b46e3594f8714114e0b4f3 (patch)
treed3eec211161c105dd936eac12dadf8c5c41e53fe /java
parentc378fb17f0ae994b950273e0f91b5692ad7638cf (diff)
Add ripple effect to RTT incall buttons.
Bug: 67596257 Test: manual PiperOrigin-RevId: 187564625 Change-Id: I7e848e975bbab19e605d09283dee24eeb02550f1
Diffstat (limited to 'java')
-rw-r--r--java/com/android/incallui/rtt/impl/RttCheckableButton.java13
-rw-r--r--java/com/android/incallui/rtt/impl/res/values/styles.xml7
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