ckChangeLog icon indicating copy to clipboard operation
ckChangeLog copied to clipboard

Missing title padding after update of support:appcompat-v7

Open johnjohndoe opened this issue 10 years ago • 6 comments

Recently, I updated the support:appcompat-v7 library in my app project. I noticed that the title header of the dialog looks odd after the update - as if some bottom padding is missing.

Dialog with support:appcompat-v7 20.0.0

appcompat-v7-20 0 0

Dialog with support:appcompat-v7 22.1.1

appcompat-v7-22 1 1

I was able to isolate the effect to the version increase. At this point in time I did not define any custom styling for the dialog in the application theme - at least to my knowledge :-)


Further, the gray background for the header and footer is not present for dialogs I created myself with v.22.1.1. I am not sure if this intended? I found issue #19 but it did not solve the problem for me to add custom CSS.

johnjohndoe avatar May 02 '15 22:05 johnjohndoe

https://github.com/cketti/ckChangeLog/blob/e9a81ad3e043357e80922aa7c149241af73223d3/ckChangeLog/src/main/java/de/cketti/library/changelog/ChangeLog.java#L286

The code to create the dialog is not very fancy. I don't see how this could be caused by the library.

cketti avatar May 02 '15 23:05 cketti

I could be a side effect of the support:appcompat-v7 library. Google might have misconfigured the styles for android.app.AlertDialog in v.22.1.1 while styles are okay for android.support.v7.app.AlertDialog.

johnjohndoe avatar May 02 '15 23:05 johnjohndoe

I created issue #171512 in the Android issue tracker.

johnjohndoe avatar May 03 '15 10:05 johnjohndoe

Sorry to necro this issue, but I should note that this issue still persists as of AppCompat v23.1.1. Looking at the issue @johnjohndoe opened on the Android issue tracker I saw the response:

@tobias : You need to set the content spacing using:

builder.setView(content, 0, dpToPx(16), 0, 0); // 16dp is the top padding for the tit

I can confirm that this does indeed resolve the issue. If you'd like, I could submit a PR.

NateShoffner avatar Mar 12 '16 11:03 NateShoffner

@NateShoffner Please note that @cketti is working on a new version of the library which allows you to create the UI representation of the changelog yourself. Try out the version_2 branch.

johnjohndoe avatar Mar 12 '16 11:03 johnjohndoe

@NateShoffner I use support:appcompat-v7:23.1.1 AlertDialogs quite extensively and often with just the convenience methods setTitle, setAdapter/setMessage, setButtons, etc but in these cases the top padding (or rather view spacing) cannot be specified. So unfortunately the setView method only solves a certain usage of the support AlertDialog

francoisNova avatar Jul 20 '16 11:07 francoisNova