1

The activity theme is Theme.AppCompat.Light.DialogWhenLarge. I can not get the activity to resize when keyboard is up. Configuring android:windowSoftInputMode="adjustResize" or getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE); has no effect, all I'm getting is adjustPan behaviour. However, I can confirm that adjustNothing works. Any ideas how to make an activity with DialogWhenLarge theme to resize with keyboard?

Result with adjustResize: Result with adjustResize

Result with adjustNothing: Result with adjustNothing

dobridog
  • 380
  • 4
  • 12

1 Answers1

0

I've found a workaround, but would still like to hear if anyone had a similar problem.

Workaround:

  1. Replaced Activity's theme DialogWhenLarge with Theme.AppCompat.Light.Dialog. This allows the adjustResize to behave as expected with ActionBarActivity
  2. Added toolbar.xml layout as android.support.v7.widget.Toolbar

  3. Assigned the toolbar as action bar in my Activity

  4. Set activity's height for 10' tablets layout-sw720dp to 500dp for better presentation

Configure toolbar as action bar:

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout...);

    Toolbar toolbar = (Toolbar) findViewById(R.id.my_awesome_toolbar);
    setSupportActionBar(toolbar);
}

More on toolbar at android developer blog and stackoverflow

Community
  • 1
  • 1
dobridog
  • 380
  • 4
  • 12