Преглед на файлове

Measure media box to hide it

Instead of using post
Wayne преди 5 години
родител
ревизия
add23d1fa9
променени са 1 файла, в които са добавени 4 реда и са изтрити 4 реда
  1. 4 4
      reader/src/main/java/com/kdanmobile/reader/screen/view/ViewerEditView.kt

+ 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() {