android-support-preference icon indicating copy to clipboard operation
android-support-preference copied to clipboard

RingonePreference XpRingtonePreferenceDialogFragment doesn't show up with latest appcompat

Open dirkam opened this issue 3 years ago • 12 comments

Hi,

If androidx.appcompat:appcompat is updated to 1.3.0 or 1.3.1 then XpRingtonePreferenceDialogFragment dialog doesn't show up. It shows the backdrop shadow as if the dialog was visible, but the dialog is actually not visible.

Can you please test this on your end? Is there a workaround or fix that could be applied?

Thanks

dirkam avatar Jul 23 '21 09:07 dirkam

This is how I used to show the ringtone picker dialog from code:

XpRingtonePreferenceDialogFragment ringtonePicker = 
    XpRingtonePreferenceDialogFragment.newInstance(ringtonePreference.getKey());
ringtonePicker.setTargetFragment(SettingsFragment.this, 0);
ringtonePicker.show(getFragmentManager(), DIALOG_FRAGMENT_TAG);

dirkam avatar Jul 23 '21 11:07 dirkam

@consp1racy can you please take a look at this?

dirkam avatar Apr 24 '22 17:04 dirkam

Looks like it's caused by the workaround introduced here https://github.com/consp1racy/android-support-preference/issues/87#issuecomment-370004822.

It appears, removing the workaround in conjunction with updating the Fragment library solves the underlying issue.

consp1racy avatar Apr 25 '22 09:04 consp1racy

Thanks for the update. Is there a way for us to fix this on our end?

dirkam avatar Apr 25 '22 09:04 dirkam

Non-trivial. Try pulling in commit c13d5890a6 via jitpack.io and verify this works for you. It uses latest stable releases of AndroidX, except Preference.

Will update to Preference 1.2.0 later.

consp1racy avatar Apr 25 '22 10:04 consp1racy

Perhaps a noob question, but how can I do that? implementation 'net.xpece.android:support-preference:c13d5890a6' doesn't seem to work Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve net.xpece.android:support-preference:c13d5890a6.

dirkam avatar Apr 25 '22 15:04 dirkam

Hi, sorry, you can follow the instructions here https://jitpack.io/docs/

consp1racy avatar Apr 25 '22 17:04 consp1racy

@consp1racy I tried that. I think I'm doing everything right. It seems there is a build failure for this commit.

c13d5890a6 3.x-dev-SNAPSHOT

dirkam avatar Apr 25 '22 18:04 dirkam

@consp1racy I also tried to download the branch and load it as a module but gradle build fails locally as well, so I couldn't verify this fix for the initial issue. I'd appreciate if you could have a look at this. Thanks!

dirkam avatar Apr 26 '22 11:04 dirkam

It seems I broke publishing to Jitpack when I set up publishing to Maven Central.

The correct coordinates with the fix should be

dependencies {
  implementation("com.github.consp1racy.android-support-preference:support-preference:b8a9625ede")
  implementation("com.github.consp1racy.android-support-preference:support-preference-color:b8a9625ede")
  implementation("com.github.consp1racy.android-support-preference:support-spinner:b8a9625ede")
}
repositories {
  maven("https://jitpack.io")
}

consp1racy avatar Apr 26 '22 21:04 consp1racy

Thanks. This fixes the initial issue for me. It raises a question though, will this bring #87 issue back?

dirkam avatar Apr 27 '22 04:04 dirkam

I understand your concern.

The AndroidX team completely replaced the FragmentManager implementation, which shoukd, among other things, fix any ordering issues. I have high hopes it affects this case as well.

The sample app doesn't crash.

I think it may be possible to write a test that triggers the flow a large number of times in an attempt to encounter crash.

consp1racy avatar Apr 27 '22 07:04 consp1racy