-
Notifications
You must be signed in to change notification settings - Fork 122
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
base: master
Are you sure you want to change the base?
Conversation
After migrating to AndroidX, The icon space is reserved by default in preference screens. This behavior is fixed by overriding the preference file.
There was a problem hiding this 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"?> |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
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--> |
There was a problem hiding this comment.
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 🙂
There was a problem hiding this comment.
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.
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.