Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix buttons not taking a translucent background color #3027

Merged
merged 3 commits into from
Nov 21, 2023

Conversation

ewpatton
Copy link
Member

Change-Id: I7781e710b4c3efd41c9585e2e5cd4c6cc2d50736

Change-Id: I7781e710b4c3efd41c9585e2e5cd4c6cc2d50736
@ewpatton
Copy link
Member Author

Note that I have not yet tested this on a version of Android lower than SDK 21 Lollipop.

@ewpatton
Copy link
Member Author

Here is an example of what this looks like. Button2 has a blue background with 50% transparency which yields a purple tint, Button3 has a yellow background with 50% transparency which yields an orange tint, and Button4 has no background, which also needs the shadow suppressed (the state/outline manipulation is responsible for this).

Screenshot_20231012-211325

Copy link
Member

@jisqyv jisqyv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FATAL EXCEPTION: main │
│E/AndroidRuntime( 3067): java.lang.NoClassDefFoundError: android/view/ViewOutlineProvider

on KitKat

Change-Id: I508ff593e0f5d60eeaaa18a529c6c7318898962d
Change-Id: I1f5a5dfe587a0a3a2d328d50cbaaec1709f0971a
@ewpatton
Copy link
Member Author

@jisqyv I've pushed two changes. The first fixes the crash on Android versions prior to 5.0. The second one removes a check that no longer seems to be need which forces the background color in Device Default and other themes to be white. The latter was something I bumped into when testing using the old emulator running Android 2.x using the button test project previously shared. We may want to keep the last commit separate since it's somewhat independent of the original reason for this change (but needed if testing the change on an old version of Android).

@ewpatton
Copy link
Member Author

Screenshot 2023-10-30 at 3 48 19 PM

@jisqyv
Copy link
Member

jisqyv commented Nov 6, 2023

@ewpatton I've tested this on KitKat (emulated) and on my phone. The Companion no longer crashes on KitKat. However the test app doesn't look the same (different colors) and on KitKat the "Screen 1" text does not show up. Here is a link to a zip file with screenshots from both the KitKat (emulated) and my phone.

https://r2.qyv.net/share/QeNyMz4L
(note: Link may have a limited lifetime, if you are viewing this comment in the future, it may not work)

@jisqyv jisqyv self-requested a review November 21, 2023 17:54
Copy link
Member

@jisqyv jisqyv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jisqyv jisqyv merged commit 66229a7 into mit-cml:ucr Nov 21, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants