Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid custom fragment transition incomplete when software keyboard is visible
    primarykey
    data
    text
    <p>VIDEO of the broken animation: <a href="http://www.youtube.com/watch?v=xnPbEj-Wosg&amp;feature=youtu.be" rel="nofollow">http://www.youtube.com/watch?v=xnPbEj-Wosg&amp;feature=youtu.be</a> The original fragment has an all purple background, the target fragment has a white background, the transition is happening properly for only the top half of the screen.</p> <p>Currently my android app runs one main activity and uses FragmentManager to .replace() fragments to change the layout.</p> <p>In the initial fragment A, there exists a EditText which changes the active Fragment when "done" is pressed with the following code.</p> <pre><code>FragmentTransaction ft = getActivity() .getSupportFragmentManager().beginTransaction(); ft.setCustomAnimations(R.anim.right_slide_in, R.anim.right_slide_out); ft.replace(R.id.frameLayout_main, fragment); ft.addToBackStack(null); ft.commit(); </code></pre> <p>The above custom animation uses a pretty standard translation for sliding in and out:</p> <pre><code>&lt;set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/accelerate_decelerate_interpolator"&gt; &lt;translate android:fromXDelta="100%p" android:toXDelta="0" android:duration="400" /&gt; &lt;/set&gt; </code></pre> <p>In addition, I am using the following code to close the software keyboard during the transition:</p> <pre><code> InputMethodManager manager = (InputMethodManager)getActivity().getSystemService(Context.INPUT_METHOD_SERVICE); manager.toggleSoftInput(0, 0); </code></pre> <p>When this all happens, what I see on my 4.4 device is that the keyboard closes (slides down), the top half of my screen transitions (slides out), but the bottom half of my screen where the keyboard used to be is just white space during the transition animation period. </p> <p>I have tried various other methods of closing the soft keyboard, as well as moving the keyboard closing code to before/after the FragmentTransition code. Everything I have attempted leads to the same result as described above.</p> <p>The solution I'm looking for is one where the part of the original fragment covered by the soft keyboard is revealed and smoothly transitioned to the next fragment.</p> <p>EDIT: Tried android.app.Fragment instead of using the support.v4 ones and the result is the same.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload