Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Force update the hover button state after being disabled though bindi…
Browse files Browse the repository at this point in the history
…ngs (#2210)
  • Loading branch information
keianhzo authored and bluemarvin committed Nov 8, 2019
1 parent ee4ee68 commit ff51cf3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,11 @@ public void setEnabled(boolean enabled) {

mButton.setEnabled(enabled);
}

@Override
public void setHovered(boolean hovered) {
super.setHovered(hovered);

mButton.setHovered(hovered);
}
}
6 changes: 3 additions & 3 deletions app/src/main/res/drawable/rectangle_button_background.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"
<animated-selector xmlns:android="http://schemas.android.com/apk/res/android"
android:enterFadeDuration="@integer/ui_fadeAnimTime"
android:exitFadeDuration="@integer/ui_fadeAnimTime">
<item android:state_enabled="false">
Expand All @@ -20,10 +20,10 @@
<solid android:color="@color/fog" />
</shape>
</item>
<item android:state_hovered="false" android:state_pressed="false">
<item android:state_enabled="true">
<shape android:shape="rectangle">
<corners android:radius="5dp" />
<solid android:color="@color/iron" />
</shape>
</item>
</selector>
</animated-selector>

0 comments on commit ff51cf3

Please sign in to comment.