मेरे पास एक गतिविधि थी (होम एक्टिविटी कहें) और जब मैं अपनी होमएक्टिविटी से एक नई गतिविधि (अगली एक्टिविटी कहता हूं) शुरू करता हूं, तो मैं इसे एनीमेशन प्रभाव देना चाहता हूं जैसे इसे नीचे से दिखाना। एंड्रॉइड में यह संभव है?एंड्रॉइड में एनीमेशन
6
A
उत्तर
2
आप अपने इरादे में Intent.FLAG_ACTIVITY_NO_ANIMATION ध्वज के साथ डिफ़ॉल्ट एनीमेशन (दाईं ओर से स्लाइड) को रोक सकते हैं।
यानी .:
Intent myIntent = new Intent(context, MyActivity.class);
myIntent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
context.startActivity(myIntent);
तो अपनी गतिविधि में तो आप बस अपने खुद के एनीमेशन निर्दिष्ट करना होगा।
6
startActivity
पर कॉल करने के बाद, overridePendingTransition
पर आईडी के एक्सएमएल परिभाषित एनिमेशन के साथ कॉल करें, एक गतिविधि से बाहर निकलने के लिए, एक प्रवेश करने के लिए। इस विधि के लिए दस्तावेज़ देखें here
1
TopListActivity topList;
Vector<BitmapDrawable> images;
int count = 0;
public AnimationAlphaTimer(TopListActivity _topList)
{
this.topList = _topList;
this.images = new Vector<BitmapDrawable>();
for (int i = 0; ; i++) {
// LOAD IMAGES HERE
}
if (this.images.size() > 0) {
this.topList.slide_0.setBackgroundDrawable(this.images.get(0));
if (this.images.size() > 1) {
this.topList.slide_1.setBackgroundDrawable(this.images.get(1));
}
}
this.count = 1;
}
public void launch()
{
if (this.images.size() >= 2) {
(new Timer(false)).schedule(this, 100);
}
}
@Override
public void run()
{
this.doit();
this.cancel();
}
private void doit()
{
if ((this.count % 2) == 0) {
AlphaAnimation animation = new AlphaAnimation(1.0f, 0.0f);
animation.setStartOffset(3000);
animation.setDuration(3000);
animation.setFillAfter(true);
animation.setAnimationListener(this);
this.topList.slide_1.startAnimation(animation);
} else {
AlphaAnimation animation = new AlphaAnimation(0.0f, 1.0f);
animation.setStartOffset(3000);
animation.setDuration(3000);
animation.setFillAfter(true);
animation.setAnimationListener(this);
this.topList.slide_1.startAnimation(animation);
}
}
public void onAnimationEnd(Animation animation)
{
if ((this.count % 2) == 0) {
this.topList.slide_1.setBackgroundDrawable(
this.images.get((this.count + 1) % (this.images.size()))
);
} else {
this.topList.slide_0.setBackgroundDrawable(
this.images.get((this.count + 1) % (this.images.size()))
);
}
this.count++;
this.doit();
}
public void onAnimationRepeat(Animation animation) {
}
public void onAnimationStart(Animation animation) {
}}
यह कोशिश करें कि मुझे लगता है कि यह काम करेगा।
संबंधित मुद्दे
- 1. एंड्रॉइड अल्फा एनीमेशन: एनीमेशन
- 2. एंड्रॉइड - एनीमेशन
- 3. एनीमेशन एंड्रॉइड
- 4. पेज एंड्रॉइड में कर्ल एनीमेशन?
- 5. java.util.ConcurrentModification एंड्रॉइड एनीमेशन में अपवाद
- 6. एंड्रॉइड लोडिंग एनीमेशन
- 7. एंड्रॉइड: एनीमेशन दृश्य स्थिति
- 8. एंड्रॉइड एनीमेशन अनुक्रम
- 9. एंड्रॉइड मानक एनीमेशन
- 10. एंड्रॉइड: स्क्रॉलर एनीमेशन?
- 11. लेआउट एनीमेशन एंड्रॉइड [फेसबुक]
- 12. एंड्रॉइड पेज कर्ल एनीमेशन
- 13. एंड्रॉइड बटन एनीमेशन
- 14. एंड्रॉइड 3 डी एनीमेशन
- 15. एंड्रॉइड एनिमेटिंग एनीमेशन-सूची
- 16. एंड्रॉइड फ्लिपबोर्ड एनीमेशन
- 17. एंड्रॉइड लिस्ट व्यू एनीमेशन
- 18. एंड्रॉइड। एनीमेशन प्रदर्शन
- 19. एंड्रॉइड एनीमेशन-सूची
- 20. एंड्रॉइड व्यूफ्लिपर एनीमेशन
- 21. एंड्रॉइड में एनीमेशन तकनीकों के प्रकार?
- 22. एंड्रॉइड में स्लाइड लेआउट एनीमेशन कैसे बनाएं?
- 23. एंड्रॉइड समस्या में एनीमेशन हटाने योग्य
- 24. एंड्रॉइड अल्फा एनीमेशन: एनीमेशन पूर्ण होने पर अंतिम एनीमेशन फ्रेम में रहना
- 25. एंड्रॉइड: एंड्रॉइड में एनीमेशन के लिए एक्सएमएल का उपयोग कर फ्लिप एनीमेशन
- 26. एनीमेशन?
- 27. एंड्रॉइड ड्रैग/दृश्यों का एनीमेशन
- 28. एंड्रॉइड अल्फा फीड एनीमेशन इश्यू
- 29. एंड्रॉइड एनीमेशन स्टटर/चटनी/अंतराल
- 30. एंड्रॉइड और एसवीजी एनीमेशन खेलना