Quellcode durchsuchen

Measure media box to hide it

Instead of using post
Wayne vor 5 Jahren
Ursprung
Commit
add23d1fa9

+ 4 - 4
reader/src/main/java/com/kdanmobile/reader/screen/view/ViewerEditView.kt

@@ -59,10 +59,10 @@ class ViewerEditView : ConstraintLayout {
         setupTabView()
 
         /** Move media box view to bottom of parent(hide it) **/
-        post {
-            val v = view_viewEdit_content
-            v.y = v.top + v.height.toFloat()
-        }
+        val size = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED)
+        val v = view_viewEdit_content
+        v.measure(size, size)
+        v.y = v.top + v.measuredHeight.toFloat()
     }
 
     fun show() {