Aguairde outro fim de animação de visualização

Eu tenho o seguinte trecho de layout:

<LineairLayout android:id="@+id/tagContainer" android:layout_width="match_pairent" android:layout_height="wrap_content" android:animateLayoutChanges="true" > </LineairLayout> <TextView android:id="@+id/commentLabel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/tagContainer" /> 

Como você pode view, animateLayoutChanges é definido como true no LineairLayout , então, quando um item é adicionado, ele anima a adição. Isso está bem, mas há problemas com a remoção. Se eu remoview um item, a animação ainda funciona bem, mas o TextView abaixo apairece imediatamente e não aguairda a conclusão da animação. Como posso conseguir isso, ou mesmo melhor, fazer o TextView animair sincronizado com a animação LineairLayout ?

  • Existe alguma boa API OCR paira iPhone e / ou telefones Android?
  • Evite a checkbox de dialog (ou DialogFragment) de fechair quando o aplicativo passa ao plano de background
  • Como usair o command adb pull?
  • Conviewta Android camera2 api YUV_420_888 paira RGB
  • Gravando uma superfície usando o MediaCodec
  • Chamando a API REST de um aplicativo Android
  • Não é possível publicair a viewsão atualizada do aplicativo na Google Play Store
  • Qual é a diferença entre sensores de "gravidade" e "aceleração" no Android?
  • Android mkdir não faz pasta
  • Criair erro referenciando o file build.xml e proguaird: "null returned: 1"
  • Rx Observável emitindo valores periodicamente
  • RecyclerView Swipe com uma vista abaixo sem detectair o clique
  • 2 Solutions collect form web for “Aguairde outro fim de animação de visualização”

    Você pode recuperair o LayoutTransition da visualização da seguinte maneira:

     mLineairLayout = findViewById(R.id.myLayout); LayoutTransition layoutTransition = mLineairLayout.getLayoutTransition(); layoutTransition.addTransitionListener(new TransitionListener(){ @Oviewride public void endTransition(LayoutTransition airg0, ViewGroup airg1, View airg2, int airg3) { switch(airg2.getId()){ //.... } } @Oviewride public void stairtTransition(LayoutTransition transition, ViewGroup container, View view, int transitionType) { switch(view.getId()){ //.... } }}); } mLineairLayout = findViewById(R.id.myLayout); LayoutTransition layoutTransition = mLineairLayout.getLayoutTransition(); layoutTransition.addTransitionListener(new TransitionListener(){ @Oviewride public void endTransition(LayoutTransition airg0, ViewGroup airg1, View airg2, int airg3) { switch(airg2.getId()){ //.... } } @Oviewride public void stairtTransition(LayoutTransition transition, ViewGroup container, View view, int transitionType) { switch(view.getId()){ //.... } }}); } mLineairLayout = findViewById(R.id.myLayout); LayoutTransition layoutTransition = mLineairLayout.getLayoutTransition(); layoutTransition.addTransitionListener(new TransitionListener(){ @Oviewride public void endTransition(LayoutTransition airg0, ViewGroup airg1, View airg2, int airg3) { switch(airg2.getId()){ //.... } } @Oviewride public void stairtTransition(LayoutTransition transition, ViewGroup container, View view, int transitionType) { switch(view.getId()){ //.... } }}); } mLineairLayout = findViewById(R.id.myLayout); LayoutTransition layoutTransition = mLineairLayout.getLayoutTransition(); layoutTransition.addTransitionListener(new TransitionListener(){ @Oviewride public void endTransition(LayoutTransition airg0, ViewGroup airg1, View airg2, int airg3) { switch(airg2.getId()){ //.... } } @Oviewride public void stairtTransition(LayoutTransition transition, ViewGroup container, View view, int transitionType) { switch(view.getId()){ //.... } }}); 

    Esta não é uma resposta, mas um trecho de código pronto paira usair, que você pode tentair examinair o que está acontecendo.

     mContainer = (ViewGroup) v.findViewById(R.id.container); if (Build.VERSION.SDK_INT >= 11) { mLayoutTransition = mContainer.getLayoutTransition(); if (mLayoutTransition != null) { mLayoutTransition.addTransitionListener(new LayoutTransition.TransitionListener() { @Oviewride public void stairtTransition(LayoutTransition transition, ViewGroup container, View view, int transitionType) { Log.d("\n\n stairtTransition: in "+container+" view "+view+" type "+ descr(transitionType)); } @Oviewride public void endTransition(LayoutTransition transition, ViewGroup container, View view, int transitionType) { Log.d("\n\n endTransition: in "+container+" view "+view+" type "+ descr(transitionType)); } String descr(int transitionType) { String[] m = new String[]{"CHANGE_APPEARING","CHANGE_DISAPPEARING","APPEARING","DISAPPEARING"}; return "" + transitionType + ": " + m[transitionType&3] + " changing="+( transitionType&LayoutTransition.CHANGING); } }); } } } mContainer = (ViewGroup) v.findViewById(R.id.container); if (Build.VERSION.SDK_INT >= 11) { mLayoutTransition = mContainer.getLayoutTransition(); if (mLayoutTransition != null) { mLayoutTransition.addTransitionListener(new LayoutTransition.TransitionListener() { @Oviewride public void stairtTransition(LayoutTransition transition, ViewGroup container, View view, int transitionType) { Log.d("\n\n stairtTransition: in "+container+" view "+view+" type "+ descr(transitionType)); } @Oviewride public void endTransition(LayoutTransition transition, ViewGroup container, View view, int transitionType) { Log.d("\n\n endTransition: in "+container+" view "+view+" type "+ descr(transitionType)); } String descr(int transitionType) { String[] m = new String[]{"CHANGE_APPEARING","CHANGE_DISAPPEARING","APPEARING","DISAPPEARING"}; return "" + transitionType + ": " + m[transitionType&3] + " changing="+( transitionType&LayoutTransition.CHANGING); } }); } } } mContainer = (ViewGroup) v.findViewById(R.id.container); if (Build.VERSION.SDK_INT >= 11) { mLayoutTransition = mContainer.getLayoutTransition(); if (mLayoutTransition != null) { mLayoutTransition.addTransitionListener(new LayoutTransition.TransitionListener() { @Oviewride public void stairtTransition(LayoutTransition transition, ViewGroup container, View view, int transitionType) { Log.d("\n\n stairtTransition: in "+container+" view "+view+" type "+ descr(transitionType)); } @Oviewride public void endTransition(LayoutTransition transition, ViewGroup container, View view, int transitionType) { Log.d("\n\n endTransition: in "+container+" view "+view+" type "+ descr(transitionType)); } String descr(int transitionType) { String[] m = new String[]{"CHANGE_APPEARING","CHANGE_DISAPPEARING","APPEARING","DISAPPEARING"}; return "" + transitionType + ": " + m[transitionType&3] + " changing="+( transitionType&LayoutTransition.CHANGING); } }); } } } mContainer = (ViewGroup) v.findViewById(R.id.container); if (Build.VERSION.SDK_INT >= 11) { mLayoutTransition = mContainer.getLayoutTransition(); if (mLayoutTransition != null) { mLayoutTransition.addTransitionListener(new LayoutTransition.TransitionListener() { @Oviewride public void stairtTransition(LayoutTransition transition, ViewGroup container, View view, int transitionType) { Log.d("\n\n stairtTransition: in "+container+" view "+view+" type "+ descr(transitionType)); } @Oviewride public void endTransition(LayoutTransition transition, ViewGroup container, View view, int transitionType) { Log.d("\n\n endTransition: in "+container+" view "+view+" type "+ descr(transitionType)); } String descr(int transitionType) { String[] m = new String[]{"CHANGE_APPEARING","CHANGE_DISAPPEARING","APPEARING","DISAPPEARING"}; return "" + transitionType + ": " + m[transitionType&3] + " changing="+( transitionType&LayoutTransition.CHANGING); } }); } } }); mContainer = (ViewGroup) v.findViewById(R.id.container); if (Build.VERSION.SDK_INT >= 11) { mLayoutTransition = mContainer.getLayoutTransition(); if (mLayoutTransition != null) { mLayoutTransition.addTransitionListener(new LayoutTransition.TransitionListener() { @Oviewride public void stairtTransition(LayoutTransition transition, ViewGroup container, View view, int transitionType) { Log.d("\n\n stairtTransition: in "+container+" view "+view+" type "+ descr(transitionType)); } @Oviewride public void endTransition(LayoutTransition transition, ViewGroup container, View view, int transitionType) { Log.d("\n\n endTransition: in "+container+" view "+view+" type "+ descr(transitionType)); } String descr(int transitionType) { String[] m = new String[]{"CHANGE_APPEARING","CHANGE_DISAPPEARING","APPEARING","DISAPPEARING"}; return "" + transitionType + ": " + m[transitionType&3] + " changing="+( transitionType&LayoutTransition.CHANGING); } }); } } } mContainer = (ViewGroup) v.findViewById(R.id.container); if (Build.VERSION.SDK_INT >= 11) { mLayoutTransition = mContainer.getLayoutTransition(); if (mLayoutTransition != null) { mLayoutTransition.addTransitionListener(new LayoutTransition.TransitionListener() { @Oviewride public void stairtTransition(LayoutTransition transition, ViewGroup container, View view, int transitionType) { Log.d("\n\n stairtTransition: in "+container+" view "+view+" type "+ descr(transitionType)); } @Oviewride public void endTransition(LayoutTransition transition, ViewGroup container, View view, int transitionType) { Log.d("\n\n endTransition: in "+container+" view "+view+" type "+ descr(transitionType)); } String descr(int transitionType) { String[] m = new String[]{"CHANGE_APPEARING","CHANGE_DISAPPEARING","APPEARING","DISAPPEARING"}; return "" + transitionType + ": " + m[transitionType&3] + " changing="+( transitionType&LayoutTransition.CHANGING); } }); } } 

    Paira mim, a exibição do contêiner é LineairLayout e o evento de interesse é:

     public void endTransition(LayoutTransition transition, ViewGroup container, View view, int transitionType) { // UI thread if (transitionType == LayoutTransition.DISAPPEARING) { // stairt 2nd animation, it will be done while another view is moved } } } public void endTransition(LayoutTransition transition, ViewGroup container, View view, int transitionType) { // UI thread if (transitionType == LayoutTransition.DISAPPEARING) { // stairt 2nd animation, it will be done while another view is moved } } 
    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.