2016-04-25 6 views
7

के साथ आइटम डिक्रेशन मूविंग बनाना मैंने अपने रीसाइक्लिंग व्यू में आइटम डिस्क्रिप्शन को एक एनीमेशन के साथ लागू किया जो आरवी लोड होने पर खेलता है। हालांकि, मैंने देखा कि सजावट पहले से ही एनीमेशन पूर्ण होने से पहले सीमाओं पर दिखाई देती है, और मैं सजावट को एक ही समय में एनीमेशन के साथ ले जाना चाहता हूं। यह मैं कैसे करूंगा?एनीमेशन

अब तक, मैं बहुत की तरह एनीमेशन में प्रवेश किया गया है:

@Override 
    public void onBindViewHolder(final RecyclerVH recyclerVH, final int position) { 
    currentNote = data.get(position); 
    final String currentTitle = currentNote.getTitle(); 
    final String currentContent = currentNote.getContent(); 
    final int currentPosition = currentNote.getPosition(); 
    String currentAlarmDate = currentNote.getAlarm(); 

    Log.d("RecyclerView", "onBindVH called: " + currentTitle); 
    Log.d("RecyclerView", "Position at: " + currentPosition + " and Adapter Position at: " + recyclerVH.getAdapterPosition()); 

    // final Info currentObject = data.get(position); 
    // Current Info object retrieved for current RecyclerView item - USED FOR DELETE 
    recyclerVH.listTitle.setText(currentTitle); 
    recyclerVH.listContent.setText(currentContent); 
    Log.d("RecyclerAdapter", "currentAlarmDate is: '" + currentAlarmDate + "'"); 
    if (currentAlarmDate != null && !currentAlarmDate.equals(" ")) { 
     Log.d("RecyclerAdapter", "Current Alarm set for: " + currentAlarmDate); 
     recyclerVH.alarm.setText(currentAlarmDate); 
    } else 
     recyclerVH.alarm.setText(R.string.no_alarm); 

    /*recyclerVH.listTitle.setOnClickListener(new View.OnClickListener() { 
     @Override 
     public void onClick(View v) { 
      // Open new Activity containing note content 
      Toast.makeText(this, "Opening: " + currentObject.title, Toast.LENGTH_LONG).show(); 
     } 
    });*/ 
    runEnterAnimation(recyclerVH.itemView, position); 
} 


private void runEnterAnimation(View itemView, int position) { 
    // Starts Animation 

    Animation animation = AnimationUtils.loadAnimation(context, 
      position >= lastAnimatedPosition ? R.anim.up_from_bottom : R.anim.down_from_top); 
    // If true, up_from_button is loaded 
    itemView.startAnimation(animation); 
    lastAnimatedPosition = position; 
    Log.d("RecyclerAdapter", "lastAnimatedPosition is now: " + lastAnimatedPosition); 
} 
+0

क्या आपको इसके लिए कोई समाधान मिला है? – ernazm

+0

@ernazm दुर्भाग्य से, नहीं। –

+1

क्या आप आरवी आइटम एनिमेटर का उपयोग कर रहे हैं? इस मामले में [इस पोस्ट] को देखें (http://stackoverflow.com/questions/29061450/how-to-disable-recyclerview-item-decoration-drawing-for-the-duration-of-item-ani) –

उत्तर

-1

आप documentation

पढ़ सकते हैं या यदि एनिमेटेड सजावट की जरूरत आप इस कोशिश कर सकते हैं:

https://github.com/slidenerd/materialtest

धन्यवाद, अगर आपको इससे कोई समाधान नहीं मिलता है तो कृपया मुझसे पूछें कि मैं आपको बेहतर समाधान देने के लिए अपना सर्वश्रेष्ठ प्रयास करूंगा। :)

+0

लिंक के लिए धन्यवाद, लेकिन दस्तावेज़ीकरण यह नहीं बताता कि यह 'देरी' सजावट कैसे कर सकता है। आपकी आस्तीन और कुछ और? –

+0

देरी सजावट से आपका क्या मतलब है? क्या आप आलसी लोडिंग के बारे में मतलब है? या कुछ और? –

+0

मेरा मतलब सजावट में देरी है क्योंकि सजावट एनीमेशन के बाद या मेरे मूल प्रश्न की तरह एनीमेशन के साथ दिखाई देती है। –