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

Group View Rewards Screen not taking whole screen width #2090

Open
ntietje1 opened this issue Oct 6, 2024 · 1 comment
Open

Group View Rewards Screen not taking whole screen width #2090

ntietje1 opened this issue Oct 6, 2024 · 1 comment

Comments

@ntietje1
Copy link

ntietje1 commented Oct 6, 2024

Describe the bug
The group rewards screen will have an incorrect width when animating in, then correct itself once the animation finishes. However, if the content is reloaded for any reason such as pulling up to refresh or putting the app into the background and reopening, the content displays squished against the left side of the screen.

It seems that the element is wrapping the size of the chest icon rather than filling the available width. However, that's just my assumption.

To Reproduce

  1. Have no items in the group rewards screen
  2. Go to the rewards screen
  3. Reload the content in any way (refresh or minimize app)

Expected behavior
The "You don't have any Rewards" component should take up the entire width of the screen.

Screenshots
habatica_rewards_bug

Smartphone (please complete the following information):

  • Device: Samsung S22 Ultra
  • OS: Android 14
  • App Version: 4.4.1 (8001)
  • Habitica Username: HypePixel

Additional context
N/A

@ntietje1
Copy link
Author

ntietje1 commented Oct 6, 2024

I did some more investigating and it seems that the emptyView for some reason isn't matching its parent's height, despite having match_parent for its width. In the "onCreateViewHolder" function, I explicitly set the width of the emptyView to the width of it's parent, which seems to fix the issue. Is there a better way to do this?

Here's the link to the branch with the fix: Fix Code

Layout Inspector when emptyView is not taking up the whole width:
image

Layout Inspector when emptyView is taking up the whole width:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant