मैं अपने FragmentTransaction
संक्रमण को कस्टमाइज़ करने की कोशिश कर रहा हूं और मैं setTransitionStyle
विधि में आया हूं। यह एक शैली के लिए एक एक्सएमएल संसाधन आईडी लेता है, लेकिन मुझे नहीं पता कि एक्सएमएल संसाधन कैसा दिखता है। मुझे पता है कि आप गतिविधियों के लिए एनीमेशन शैलियों को परिभाषित कर सकते हैं, और मुझे लगता है कि इस विधि के लिए आवश्यक एक्सएमएल समान है, लेकिन मुझे आवश्यक प्रारूप पर कोई दस्तावेज नहीं मिल रहा है (उदाहरण के लिए इस काम को करने के लिए आवश्यक XML गुण/नोड्स)।एंड्रॉइड फ्रैगमेंट ट्रांज़ेक्शन सेट ट्रांजिशन स्टाइल
EDIT1 (यह क्या मैं अपने FragmentActivity में अब कर रहा हूँ है):
public void pushFolderFrag(Fragment folderFrag, String backStackID) {
FragmentTransaction transaction = getFragmentManager().beginTransaction();
transaction.replace(R.id.SplitView_MasterContainer, folderFrag);
transaction.addToBackStack(backStackID);
transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_CLOSE);
//transaction.setTransitionStyle(arg0);//what does the format for this resource look like??
// Commit the transaction
transaction.commit();
}
यह एक एनीमेशन वस्तु लेता है, हालांकि यह नहीं है स्पष्ट करें (मैंने एंड्रॉइड स्रोत में पर्याप्त गहराई से खोला नहीं है)। निम्नलिखित ने काम किया लेकिन कुछ भी नहीं किया: 'license.setTransitionStyle (android.R.attr.fragmentFadeExitAnimation);' – scorpiodawg