Ripple to header and button when click happens

bug:320701510
Test: manual video: https://drive.google.com/file/d/11X7vUetuMN1J34Now4zlQZ0WaOnryLpA/view?usp=sharing
Flag: None

Change-Id: Ibe22d02b59da5b1133f02ebd936520b97a63e44a
This commit is contained in:
Brandon Dayauon
2024-04-03 14:29:32 -07:00
parent 520d91f93b
commit c3281ee18a
3 changed files with 26 additions and 16 deletions

View File

@@ -14,9 +14,13 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="@dimen/ps_container_corner_radius" />
<solid android:color="?attr/materialColorSurfaceContainerHigh" />
</shape>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/accent_ripple_color">
<item>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="@dimen/ps_container_corner_radius" />
<solid android:color="?attr/materialColorSurfaceContainerHigh" />
</shape>
</item>
</ripple>

View File

@@ -15,13 +15,17 @@
~ limitations under the License.
-->
<inset xmlns:android="http://schemas.android.com/apk/res/android"
android:inset="4dp">
<shape android:shape="rectangle">
<corners android:radius="@dimen/ps_lock_corner_radius" />
<solid android:color="?attr/materialColorPrimaryFixedDim" />
<padding
android:left="@dimen/ps_lock_button_background_padding"
android:right="@dimen/ps_lock_button_background_padding" />
</shape>
</inset>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/accent_ripple_color">
<item>
<inset android:inset="4dp">
<shape android:shape="rectangle">
<corners android:radius="@dimen/ps_lock_corner_radius" />
<solid android:color="?attr/materialColorPrimaryFixedDim" />
<padding
android:left="@dimen/ps_lock_button_background_padding"
android:right="@dimen/ps_lock_button_background_padding" />
</shape>
</inset>
</item>
</ripple>

View File

@@ -379,8 +379,10 @@ public class PrivateProfileManager extends UserProfileManager {
private void addHeaderOnClickListener(RelativeLayout header) {
if (getCurrentState() == STATE_DISABLED) {
header.setOnClickListener(view -> lockingAction(/* lock */ false));
header.setClickable(true);
} else {
header.setOnClickListener(null);
header.setClickable(false);
}
}