2

WHAT I HAVE DONE

I used the following function to resize the size of scrollview (used as a slidinglayout) the second child if slidinglayout is a map fragment. there is a button "select from map" where the sliding view is completely hided.

Problem

  1. problem is that sometimes when i select from map. the sliding layout collapses but the map fragment doesnt expand properly and it remains as previous . THUS A BIG WHITE SPACE IS LEFT BEHINF.

  2. KeyBoard soft input doesnt resize properly. I am usinf adjust pan but it scrambles the whole view and scroll view doesnt scroll till the end

public void resizeScrollView(final float slideOffset) {

    // The scrollViewHeight calculation would need to change based on what views are
    // in the sliding panel. The calculation below works because the layout has
    // 2 views. 1) The row with the drag view which is layout.getPanelHeight() high.
    // 2) The ScrollView.
    //  Log.d("resizeScrollView - height %d  panelHeight %d  slideOffset %f", mySlidinglayout.getHeight(), mySlidinglayout.getPanelHeight(), slideOffset);


    int scrollViewHeight = (int) mySlidinglayout.getPanelHeight();/*mySlidinglayout.getHeight() - mySlidinglayout.getPanelHeight()) * (1.0f - slideOffset)*/
    if(slideOffset==0.0f)
    {
        scrollViewHeight=(int)(mySlidinglayout.getHeight());
    }
    final ViewGroup.LayoutParams currentLayoutParams = scrollView.getLayoutParams();
    currentLayoutParams.height = scrollViewHeight-30;
    scrollView.setLayoutParams(currentLayoutParams);
}
Community
  • 1
  • 1
  • I am having the exact same problem, Slide Panel collapses but the map stays compressed and leaves a large blank area (correspondent to the area that the keyboard occupied before). Using android:windowSoftInputMode="adjustPan" on the activity works, but the keyboard covers the Slide Panel until the user minimizes it, which is not ideal. Have you ever found a solution? – Eduardo Nov 26 '15 at 18:08

0 Answers0