0
  1. In my Fragment is has PopupWindow.

  2. the PopupWindow is show fullscreen.

  3. Inside PopupWindow is has EditText.

  4. When i click in EditText the SoftKeyboard is show and push my PopupWindow up.

  5. When i hide SoftKeyboard my PopupWindow not pull down. Why? How to solve it's

I try to set android:windowSoftInputMode="adjustPan" and android:windowSoftInputMode="adjustResize" but it's not working(my PopupWindow not pull down)

EDIT

1.This is Edittext in my popup layout

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content">
<RelativeLayout
    android:layout_marginTop="20dp"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <EditText
        android:id="@+id/edt_popname"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:minHeight="68dp"
        android:minWidth="300dp"
        android:gravity="center_horizontal|center_vertical"
        android:textSize="30dp"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:imeOptions="actionNext"/>

</RelativeLayout>

<RelativeLayout
    android:layout_marginTop="20dp"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <EditText
        android:id="@+id/edt_popprice"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:minHeight="68dp"
        android:minWidth="300dp"
        android:gravity="center_horizontal|center_vertical"
        android:textSize="30dp"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:imeOptions="actionNext"/>
</RelativeLayout>
</LinearLayout>

2.This code is mypopup

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    if (rootView == null) {
        rootView = inflater.inflate(R.layout.fragment_order, container, false);

        final View actionview = inflater.inflate(R.layout.order_popup, (ViewGroup)(getActivity().findViewById(R.id.rl_orderpopup)));
        this.popupWindow = new PopupWindow(actionview, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, true);
        this.popupWindow.setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
        this.popupWindow.setOutsideTouchable(false);
        this.popupWindow.setAnimationStyle(R.style.Animation);
    }
    return rootView;
}

3.This code for show popup

private AdapterView.OnItemClickListener ItemGridViewItemClickListener = new AdapterView.OnItemClickListener() {
    @Override
    public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {
        ItemInfo info = (ItemInfo) adapterView.getItemAtPosition(position);
        Log.i("ItemClick", info.getName());
        popupWindow.showAtLocation(rootView, Gravity.CENTER, 0, 0);

    }
};

4.This is activity in manifest

<activity
        android:name=".MainActivity"
        android:clearTaskOnLaunch="true"
        android:label="@string/app_name"
        android:screenOrientation="portrait"
        android:windowSoftInputMode="adjustPan">
    </activity>
user2955394
  • 1,063
  • 4
  • 17
  • 34

1 Answers1

1

I tired similar code in myself, and pop up was resizing for me, so for your case and to tackle this scenario, this is what you can do.

  1. Detect when keybord is inflated, resize will happen here
  2. Once keyboard is gone, just resize everything back again

this is how you detect when keyboard become visible.

Please follow above, and let me in case you face any other trouble.

Community
  • 1
  • 1
Techfist
  • 4,314
  • 6
  • 22
  • 32
  • thank you very much. Your suggestion is work well.But i can solve it's by use Dialog instead of PopupWindow. it's work very well for me. – user2955394 Sep 17 '14 at 01:40