Merge "Make DialogLaunchAnimator.showFromDialog more lenient" into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
0d5d95b08d
@@ -304,10 +304,16 @@ constructor(
|
|||||||
) {
|
) {
|
||||||
val view =
|
val view =
|
||||||
openedDialogs.firstOrNull { it.dialog == animateFrom }?.dialogContentWithBackground
|
openedDialogs.firstOrNull { it.dialog == animateFrom }?.dialogContentWithBackground
|
||||||
?: throw IllegalStateException(
|
if (view == null) {
|
||||||
"The animateFrom dialog was not animated using " +
|
Log.w(
|
||||||
"DialogLaunchAnimator.showFrom(View|Dialog)"
|
TAG,
|
||||||
)
|
"Showing dialog $dialog normally as the dialog it is shown from was not shown " +
|
||||||
|
"using DialogLaunchAnimator"
|
||||||
|
)
|
||||||
|
dialog.show()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
showFromView(
|
showFromView(
|
||||||
dialog,
|
dialog,
|
||||||
view,
|
view,
|
||||||
|
|||||||
@@ -268,6 +268,12 @@ class DialogLaunchAnimatorTest : SysuiTestCase() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun showFromDialogDoesNotCrashWhenShownFromRandomDialog() {
|
||||||
|
val dialog = createDialogAndShowFromDialog(animateFrom = TestDialog(context))
|
||||||
|
dialog.dismiss()
|
||||||
|
}
|
||||||
|
|
||||||
private fun createAndShowDialog(
|
private fun createAndShowDialog(
|
||||||
animator: DialogLaunchAnimator = dialogLaunchAnimator,
|
animator: DialogLaunchAnimator = dialogLaunchAnimator,
|
||||||
): TestDialog {
|
): TestDialog {
|
||||||
|
|||||||
Reference in New Issue
Block a user