Skip to content

Fix app detail screen crashing on Nougat#1241

Merged
Iamlooker merged 7 commits intoDroid-ify:mainfrom
xinkev:fix/app-details-crash-on-nougat
Mar 1, 2026
Merged

Fix app detail screen crashing on Nougat#1241
Iamlooker merged 7 commits intoDroid-ify:mainfrom
xinkev:fix/app-details-crash-on-nougat

Conversation

@xinkev
Copy link
Contributor

@xinkev xinkev commented Feb 25, 2026

Fixes #1199
This prevents a crash on Nougat which happens because AppDetailAdapter.kt is referencing android.R.attr.colorError, which was introduced in API 26.
A custom theme attribute (errorColor) was added to provide a fallback on pre-26 devices.

Verified on Nougat and Android 16.

This prevents crash on Nougat. AppDetailAdapter.kt referenced android.R.attr.colorError, introduced in API 26.
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="pitch_black">#000000</color>
<color name="colorError"></color>
Copy link
Member

Choose a reason for hiding this comment

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

Is this needed if its empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Haha my bad. I forgot to check before making the pull request. I will move #FC3E1B to here if that's the value you'd like.

Copy link
Member

@Iamlooker Iamlooker Mar 1, 2026

Choose a reason for hiding this comment

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

Use the following 2 error colors instead:
md_theme_l_error, md_theme_d_error

For light and dark theme respectively

<item name="android:colorBackground">@color/md_theme_l_background</item>
<item name="colorSurface">?android:attr/colorBackground</item>
<item name="android:colorPrimaryDark">?android:attr/colorBackground</item>
<item name="colorError">#FC3E1B</item>
Copy link
Member

Choose a reason for hiding this comment

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

Can you use ?android:attr/colorError? If possible

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Iamlooker
Actually, no. That's what's casing the problem in the first place. We have to use a custom color here.
However, we can use it in values-v26 though.
I will fix the PR. I hurriedly made it as a concept to show you how we can fix it and didn't check properly.

Copy link
Member

Choose a reason for hiding this comment

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

No worries, thanks for doing the hard work. It would have taken me sometime to find this solution

@Iamlooker
Copy link
Member

@xinkev Signing seems to be failing in actions. Could this be related to this PR?

@xinkev
Copy link
Contributor Author

xinkev commented Mar 1, 2026

@xinkev Signing seems to be failing in actions. Could this be related to this PR?

@Iamlooker
I don't think. I think something's wrong with the github action script.

@xinkev xinkev requested a review from Iamlooker March 1, 2026 09:48
@xinkev
Copy link
Contributor Author

xinkev commented Mar 1, 2026

@Iamlooker
I’ve cleaned up the implementation. I split the MainTheme into base themes: Base.MainTheme.Light and Base.MainTheme.Night variants, then inherited the relevant BaseTheme in the v26 files.
Let me know if you don't like the naming.
I also added colorError style to the night themes.

@Iamlooker
Copy link
Member

Will test this on my pc when I get home and will merge after that

@Iamlooker
Copy link
Member

Awesome work 😉

@Iamlooker Iamlooker merged commit c94c7c2 into Droid-ify:main Mar 1, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Crash when scrolling to the bottom of an app's details page

2 participants