カスタム アニメーションの定義
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
このページのサポートは終了しています。過去のドキュメントの新しい掲載場所については、下記をご覧ください。
タッチ フィードバックをカスタマイズする
マテリアル デザインのタッチ フィードバックは、ユーザーが UI 要素に触れて操作した時点で、視覚的な反応を瞬時に表します。ボタンのデフォルトのタッチ フィードバック アニメーションでは、新しい RippleDrawable
クラスを使用して、状態間を波紋効果で遷移します。
ほとんどの場合、次のようにビューの背景を指定することでビュー XML にこの機能を適用します。
?android:attr/selectableItemBackground
: 範囲が限定された波紋。
?android:attr/selectableItemBackgroundBorderless
: ビューの範囲外に広がる波紋効果。これは、背景が null ではない最も近くにある親ビュー上に表示されますが、その外側にはみ出ることはありません。
注: selectableItemBackgroundBorderless
は、API レベル 21 で導入された新しい属性です。
また、ripple
要素を使用して、RippleDrawable
を XML リソースとして定義することもできます。
RippleDrawable
オブジェクトには色を割り当てることができます。タッチ フィードバックのデフォルトの色を変更するには、テーマの android:colorControlHighlight
属性を使用します。
詳細については、API リファレンスの RippleDrawable
クラスをご覧ください。
出現エフェクトを使用する
円形の出現アニメーションを作成するをご覧ください。
アクティビティ遷移をカスタマイズする
アニメーションを使ってアクティビティを開始するをご覧ください。
曲線モーションを使用する
曲線モーションを使用する方法についての説明をご覧ください。
ビューの状態遷移にアニメーションを付ける
StateListAnimator を使用してビューの状態遷移にアニメーションを付ける方法をご覧ください。
ベクター型ドローアブルにアニメーションを付ける
ドローアブル グラフィックにアニメーションを付ける方法についての説明をご覧ください。
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-07-27 UTC。
[null,null,["最終更新日 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)."]]