android-split-pane-layout icon indicating copy to clipboard operation
android-split-pane-layout copied to clipboard

remeasure method called twice

Open rpstew opened this issue 9 years ago • 0 comments

I am calling setSplitterSize() and setSplitterPositionPercent() in our app to show and hide a Google Street View. Unfortunately both of those methods force the remeasure() method to be called which seems to cause performance issues. Here is how I hide the street view and the splitter:

       splitPaneLayout.setSplitterSize( 0 );
       splitPaneLayout.setSplitterPositionPercent( 0.0001f );

Here is the code I use to later show the street view and splitter:

        splitPaneLayout.setSplitterSize( 20 );
        splitPaneLayout.setSplitterPositionPercent( 0.5f );

The street view is initially hidden:

<SplitPaneLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:spl="http://schemas.android.com/apk/res-auto" android:id="@+id/fragmentLayout" android:layout_width="match_parent" android:layout_height="match_parent" spl:orientation="vertical" spl:splitterSize="0dip" spl:splitterPosition="0.0001%" >

I did not see a way to subclass SplitPaneLayout to avoid remeasure being called twice.

rpstew avatar Jan 02 '16 23:01 rpstew