Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3ba5bd0f authored by wangqi's avatar wangqi Committed by Copybara-Service
Browse files

Add ripple effect to RTT incall buttons.

Bug: 67596257
Test: manual
PiperOrigin-RevId: 187564625
Change-Id: I7e848e975bbab19e605d09283dee24eeb02550f1
parent c378fb17
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -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);
  }

+6 −1
Original line number Diff line number Diff line
@@ -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