تعریف انیمیشن های سفارشی
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
این صفحه منسوخ شده است. برای مکان جدید برای اسنادی که قبلاً اینجا بود، به زیر مراجعه کنید.
بازخورد لمسی را سفارشی کنید
بازخورد لمسی در طراحی متریال، هنگامی که کاربران با عناصر رابط کاربری تعامل دارند، تأیید بصری آنی را در نقطه تماس فراهم میکند. انیمیشنهای بازخورد لمسی پیشفرض برای دکمهها از کلاس جدید RippleDrawable
استفاده میکنند که بین حالتهای مختلف با جلوه موج دار انتقال مییابد.
در بیشتر موارد، باید این قابلیت را در view XML خود با تعیین پسزمینه view به صورت زیر اعمال کنید:
-
?android:attr/selectableItemBackground
برای یک ریپل محدود. -
?android:attr/selectableItemBackgroundBorderless
برای ریپلی که فراتر از نما گسترش می یابد. بر روی نزدیکترین والد نمای با پسزمینه غیر پوچ کشیده میشود و توسط آن محدود میشود.
توجه: selectableItemBackgroundBorderless
یک ویژگی جدید است که در سطح 21 API معرفی شده است.
همچنین، می توانید یک RippleDrawable
را به عنوان یک منبع XML با استفاده از عنصر ripple
تعریف کنید.
شما می توانید یک رنگ به اشیاء RippleDrawable
اختصاص دهید. برای تغییر رنگ پیشفرض بازخورد لمسی، از ویژگی android:colorControlHighlight
تم استفاده کنید.
برای اطلاعات بیشتر، به مرجع API برای کلاس RippleDrawable
مراجعه کنید.
از Reveal Effect استفاده کنید
به ایجاد یک انیمیشن آشکار دایره ای مراجعه کنید.
انتقال فعالیت را سفارشی کنید
به شروع یک فعالیت با یک انیمیشن مراجعه کنید.
از حرکت منحنی استفاده کنید
به استفاده از حرکت منحنی مراجعه کنید.
متحرک کردن تغییرات حالت نمایش
به استفاده از StateListAnimator برای متحرک سازی تغییرات حالت مشاهده مراجعه کنید.
متحرک سازی وکتور Drawables
انیمیشن گرافیکی قابل ترسیم را ببینید.
محتوا و نمونه کدها در این صفحه مشمول پروانههای توصیفشده در پروانه محتوا هستند. جاوا و OpenJDK علامتهای تجاری یا علامتهای تجاری ثبتشده Oracle و/یا وابستههای آن هستند.
تاریخ آخرین بهروزرسانی 2025-07-29 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","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-29 بهوقت ساعت هماهنگ جهانی."],[],[],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)."]]