Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b42491bc authored by Austin Wang's avatar Austin Wang
Browse files

Fix missing clock on clock setting screen

clockHostView tries to add clockView before removeAllView has finished.
Post adding clockView to the next round.

Flag: EXEMPT bugfix
Fixes: 396984345
Test: preview clock
Change-Id: I6fd30ab82e30da52a6926a4484baca412808a039
parent 0fbc6a22
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -207,10 +207,14 @@ object ClockSettingsBinder {
                                    ClockSize.DYNAMIC -> clockViewFactory.getLargeView(clockId)
                                    ClockSize.SMALL -> clockViewFactory.getSmallView(clockId)
                                }

                            // Wait for previous removeAllViews to finish, and add the clockView
                            clockHostView.post {
                                // The clock view might still be attached to an existing parent.
                                // Detach before adding to another parent.
                                (clockView.parent as? ViewGroup)?.removeView(clockView)
                                clockHostView.addView(clockView)
                            }

                            when (size) {
                                ClockSize.DYNAMIC -> {