デフォルトで可視性が「Gone」に設定されている LinearLayout があります。このビューが表示されるときにスライドアウトアニメーションを実行するには、このビューの高さを取得する必要があります。レイアウトが呼び出されていないときに View.getHeight がゼロを返すため、表示状態の合計の高さを取得するにはどうすればよいですか。
<LinearLayout
android:id="@+id/card_checkin_layout_termsconditionsconfirmation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:gravity="center_horizontal"
android:background="#d0d0d0"
android:visibility="invisible"
android:orientation="vertical" >
<Button
android:id="@+id/card_checkin_button_confirmdetails"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:background="@drawable/shape_checkin_buttons2"
android:text="> Confirm your details"
android:paddingLeft="8dp"
android:gravity="left|center_vertical"
android:textColor="@color/card_checkin_button_textcolor_blue"
/>
<Button
android:id="@+id/card_checkin_button_termsandconditions"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
android:paddingLeft="8dp"
android:background="@drawable/shape_checkin_buttons2"
android:text="> Terms and Conditions"
android:gravity="left|center_vertical"
android:textColor="@color/card_checkin_button_textcolor_blue"
/>
</LinearLayout>