कस्टम ऐनिमेशन तय करना
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
यह पेज अब काम नहीं करता. यहां मौजूद दस्तावेज़ों की नई जगह की जानकारी यहां दी गई है.
टच फ़ीडबैक को पसंद के मुताबिक बनाना
मटीरियल डिज़ाइन में टच फ़ीडबैक की सुविधा उपलब्ध होती है. इससे, जब उपयोगकर्ता यूज़र इंटरफ़ेस (यूआई) एलिमेंट से इंटरैक्ट करते हैं, तो उन्हें तुरंत विज़ुअल पुष्टि मिलती है. बटन के लिए, डिफ़ॉल्ट रूप से टच फ़ीडबैक ऐनिमेशन में नई RippleDrawable
क्लास का इस्तेमाल किया जाता है. यह क्लास, रिपल इफ़ेक्ट के साथ अलग-अलग स्थितियों के बीच ट्रांज़िशन करती है.
ज़्यादातर मामलों में, आपको इस सुविधा को अपने व्यू एक्सएमएल में लागू करना चाहिए. इसके लिए, व्यू
बैकग्राउंड को इस तरह से सेट करें:
?android:attr/selectableItemBackground
बाउंडेड रिपल के लिए.
?android:attr/selectableItemBackgroundBorderless
, व्यू से बाहर तक फैलने वाली रिपल के लिए. इसे व्यू के सबसे नज़दीकी पैरंट के हिसाब से बनाया जाएगा. साथ ही, यह व्यू के सबसे नज़दीकी पैरंट के हिसाब से तय होगा. इस पैरंट का बैकग्राउंड शून्य नहीं होना चाहिए.
ध्यान दें: selectableItemBackgroundBorderless
एक नया एट्रिब्यूट है. इसे एपीआई लेवल 21 में पेश किया गया है.
इसके अलावा, ripple
एलिमेंट का इस्तेमाल करके, RippleDrawable
को एक्सएमएल संसाधन के तौर पर तय किया जा सकता है.
RippleDrawable
ऑब्जेक्ट को कोई रंग असाइन किया जा सकता है. डिफ़ॉल्ट रूप से टच फ़ीडबैक के रंग को बदलने के लिए, थीम के android:colorControlHighlight
एट्रिब्यूट का इस्तेमाल करें.
ज़्यादा जानकारी के लिए, RippleDrawable
क्लास के लिए एपीआई रेफ़रंस देखें.
'दिखाएं' इफ़ेक्ट का इस्तेमाल करना
सर्कुलर रीवील ऐनिमेशन बनाना लेख पढ़ें.
गतिविधि ट्रांज़िशन को पसंद के मुताबिक बनाना
ऐनिमेशन के साथ कोई गतिविधि शुरू करना लेख पढ़ें.
कर्व्ड मोशन का इस्तेमाल करना
कर्व किए गए मोशन का इस्तेमाल करना लेख पढ़ें.
व्यू की स्थिति में हुए बदलावों को ऐनिमेट करना
व्यू की स्थिति में होने वाले बदलावों को ऐनिमेट करने के लिए, StateListAnimator का इस्तेमाल करना लेख पढ़ें.
वेक्टर ड्रॉ करने लायक इमेज को ऐनिमेट करना
ड्रॉएबल ग्राफ़िक को ऐनिमेट करना लेख पढ़ें.
इस पेज पर मौजूद कॉन्टेंट और कोड सैंपल कॉन्टेंट के लाइसेंस में बताए गए लाइसेंस के हिसाब से हैं. Java और OpenJDK, Oracle और/या इससे जुड़ी हुई कंपनियों के ट्रेडमार्क या रजिस्टर किए हुए ट्रेडमार्क हैं.
आखिरी बार 2025-07-27 (UTC) को अपडेट किया गया.
[[["समझने में आसान है","easyToUnderstand","thumb-up"],["मेरी समस्या हल हो गई","solvedMyProblem","thumb-up"],["अन्य","otherUp","thumb-up"]],[["वह जानकारी मौजूद नहीं है जो मुझे चाहिए","missingTheInformationINeed","thumb-down"],["बहुत मुश्किल है / बहुत सारे चरण हैं","tooComplicatedTooManySteps","thumb-down"],["पुराना","outOfDate","thumb-down"],["अनुवाद से जुड़ी समस्या","translationIssue","thumb-down"],["सैंपल / कोड से जुड़ी समस्या","samplesCodeIssue","thumb-down"],["अन्य","otherDown","thumb-down"]],["आखिरी बार 2025-07-27 (UTC) को अपडेट किया गया."],[],[],null,["# Defining Custom Animations\n\n**This page is deprecated.** See below for the new location for\ndocumentation that used to be here.\n\nCustomize Touch Feedback\n------------------------\n\nTouch feedback in material design provides an instantaneous visual confirmation at the\npoint of contact when users interact with UI elements. The default touch feedback animations\nfor buttons use the new [RippleDrawable](/reference/android/graphics/drawable/RippleDrawable) class, which transitions\nbetween different states with a ripple effect.\n\nIn most cases, you should apply this functionality in your view XML by specifying the view\nbackground as:\n\n- `?android:attr/selectableItemBackground` for a bounded ripple.\n- `?android:attr/selectableItemBackgroundBorderless` for a ripple that extends beyond the view. It will be drawn upon, and bounded by, the nearest parent of the view with a non-null background.\n\n**Note:** `selectableItemBackgroundBorderless` is a new\nattribute introduced in API level 21.\n\nAlternatively, you can define a [RippleDrawable](/reference/android/graphics/drawable/RippleDrawable)\nas an XML resource using the `ripple` element.\n\nYou can assign a color to [RippleDrawable](/reference/android/graphics/drawable/RippleDrawable) objects. To change\nthe default touch feedback color, use the theme's `android:colorControlHighlight`\nattribute.\n\nFor more information, see the API reference for the [RippleDrawable](/reference/android/graphics/drawable/RippleDrawable) class.\n\nUse the Reveal Effect\n---------------------\n\nSee [Create a circular reveal animation](/training/animation/reveal-or-hide-view#Reveal).\n\n\nCustomize Activity Transitions\n------------------------------\n\nSee [Start an Activity with an Animation](/training/transitions/start-activity).\n\nUse Curved Motion\n-----------------\n\nSee [Use curved motion](/training/animation/reposition-view#CurvedMotion).\n\nAnimate View State Changes\n--------------------------\n\nSee [Using StateListAnimator to\nanimate view state changes](/guide/topics/graphics/prop-animation#ViewState).\n\nAnimate Vector Drawables\n------------------------\n\nSee [Animate Drawable Graphics](/guide/topics/graphics/drawable-animation)."]]