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 the settings screen layout issue #415

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DKillWorld
Copy link
Contributor

@DKillWorld DKillWorld commented Jul 21, 2019

Screenshot_2019-07-29-08-39-48-926_com dv apps purpleplayerpro
After migrating to AndroidX, The icon space is reserved by default in preference screens. This behavior is fixed by overriding the preference file.

Testing Steps

Open the Settings from the App and observe the space in the left is gone.

Update: Screenshot attached of the Settings screen. I dont have previous version of app on my phone now, but I guess you already know the issue.

After migrating to AndroidX, The icon space is reserved by default in preference screens. This behavior is fixed by overriding the preference file.
Copy link
Collaborator

@marverenic marverenic left a comment

Choose a reason for hiding this comment

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

Sorry for the delay on this review. I haven't run this on a device, but from the code itself I have a few concerns about overriding private resources since they can change on us at any time.

Do you mind also adding screenshots to the PR description?

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this in values-sw-360dp-v13? Couldn't it just be in values?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried it putting it in values but it didn't work. You can refer to this thread, https://stackoverflow.com/questions/18509369/android-how-to-remove-margin-padding-in-preference-screen


<!--Created By Me to fix the appearance issue caused by migrating to AndroidX-->
<resources xmlns:tools="http://schemas.android.com/tools">
<bool name="config_materialPreferenceIconSpaceReserved" tools:ignore="MissingDefaultResource,PrivateResource">false</bool>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Seems like this should be overridden in the theme itself. Does it help to change preferenceTheme in styles.xml with a new style that contains this attribute?

<item name="iconSpaceReserved">false</item>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This may work, I think. But this attribute doesn't work for PreferenceCategory (The title of the preference).

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>

<!--Created By Me to fix the appearance issue caused by migrating to AndroidX-->
Copy link
Collaborator

Choose a reason for hiding this comment

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

We shouldn't need a comment for this -- the git history can add this context 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nvm about that comment. i have changed so many files till now. I have put there everywhere in my local copy just incase if anything breaks, I know exactly where to look at. 😄

Edit:Screenshot Updated.

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.

None yet

3 participants