Stay organized with collections
Save and categorize content based on your preferences.
Orientation
class Orientation
Controls how the gradient is oriented relative to the drawable's bounds
Summary
Enum values |
draw the gradient from the bottom-left to the top-right
|
draw the gradient from the bottom to the top
|
draw the gradient from the bottom-right to the top-left
|
draw the gradient from the left to the right
|
draw the gradient from the right to the left
|
draw the gradient from the top-left to the bottom-right
|
draw the gradient from the top to the bottom
|
draw the gradient from the top-right to the bottom-left
|
Enum values
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# GradientDrawable.Orientation\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nOrientation\n===========\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/graphics/drawable/GradientDrawable.Orientation \"View this page in Java\") \n\n```\nclass Orientation\n```\n\n|---|---|-------------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) |||\n| ↳ | [kotlin.Enum](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html)\\\u003c[android.graphics.drawable.GradientDrawable.Orientation](#)\\\u003e ||\n| | ↳ | [android.graphics.drawable.GradientDrawable.Orientation](#) |\n\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [GradientDrawable.Orientation.BL_TR](#ENUM_VALUE:BL_TR), [GradientDrawable.Orientation.BOTTOM_TOP](#ENUM_VALUE:BOTTOM_TOP), [GradientDrawable.Orientation.BR_TL](#ENUM_VALUE:BR_TL), [GradientDrawable.Orientation.LEFT_RIGHT](#ENUM_VALUE:LEFT_RIGHT), [GradientDrawable.Orientation.RIGHT_LEFT](#ENUM_VALUE:RIGHT_LEFT), [GradientDrawable.Orientation.TL_BR](#ENUM_VALUE:TL_BR), [GradientDrawable.Orientation.TOP_BOTTOM](#ENUM_VALUE:TOP_BOTTOM), [GradientDrawable.Orientation.TR_BL](#ENUM_VALUE:TR_BL) |-------------------------------------------------------------------|---------------------------------------------------------| | [GradientDrawable.Orientation.BL_TR](#ENUM_VALUE:BL_TR) | draw the gradient from the bottom-left to the top-right | | [GradientDrawable.Orientation.BOTTOM_TOP](#ENUM_VALUE:BOTTOM_TOP) | draw the gradient from the bottom to the top | | [GradientDrawable.Orientation.BR_TL](#ENUM_VALUE:BR_TL) | draw the gradient from the bottom-right to the top-left | | [GradientDrawable.Orientation.LEFT_RIGHT](#ENUM_VALUE:LEFT_RIGHT) | draw the gradient from the left to the right | | [GradientDrawable.Orientation.RIGHT_LEFT](#ENUM_VALUE:RIGHT_LEFT) | draw the gradient from the right to the left | | [GradientDrawable.Orientation.TL_BR](#ENUM_VALUE:TL_BR) | draw the gradient from the top-left to the bottom-right | | [GradientDrawable.Orientation.TOP_BOTTOM](#ENUM_VALUE:TOP_BOTTOM) | draw the gradient from the top to the bottom | | [GradientDrawable.Orientation.TR_BL](#ENUM_VALUE:TR_BL) | draw the gradient from the top-right to the bottom-left | |\n\nControls how the gradient is oriented relative to the drawable's bounds\n\nSummary\n-------\n\n| Enum values ||\n|------------------------------------------------------------------------------------|---|\n| [BL_TR](#ENUM_VALUE:BL_TR) draw the gradient from the bottom-left to the top-right |\n| [BOTTOM_TOP](#ENUM_VALUE:BOTTOM_TOP) draw the gradient from the bottom to the top |\n| [BR_TL](#ENUM_VALUE:BR_TL) draw the gradient from the bottom-right to the top-left |\n| [LEFT_RIGHT](#ENUM_VALUE:LEFT_RIGHT) draw the gradient from the left to the right |\n| [RIGHT_LEFT](#ENUM_VALUE:RIGHT_LEFT) draw the gradient from the right to the left |\n| [TL_BR](#ENUM_VALUE:TL_BR) draw the gradient from the top-left to the bottom-right |\n| [TOP_BOTTOM](#ENUM_VALUE:TOP_BOTTOM) draw the gradient from the top to the bottom |\n| [TR_BL](#ENUM_VALUE:TR_BL) draw the gradient from the top-right to the bottom-left |\n\nEnum values\n-----------\n\n### BL_TR\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val BL_TR : GradientDrawable.Orientation\n```\n\ndraw the gradient from the bottom-left to the top-right \n\n### BOTTOM_TOP\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val BOTTOM_TOP : GradientDrawable.Orientation\n```\n\ndraw the gradient from the bottom to the top \n\n### BR_TL\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val BR_TL : GradientDrawable.Orientation\n```\n\ndraw the gradient from the bottom-right to the top-left \n\n### LEFT_RIGHT\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val LEFT_RIGHT : GradientDrawable.Orientation\n```\n\ndraw the gradient from the left to the right \n\n### RIGHT_LEFT\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val RIGHT_LEFT : GradientDrawable.Orientation\n```\n\ndraw the gradient from the right to the left \n\n### TL_BR\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val TL_BR : GradientDrawable.Orientation\n```\n\ndraw the gradient from the top-left to the bottom-right \n\n### TOP_BOTTOM\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val TOP_BOTTOM : GradientDrawable.Orientation\n```\n\ndraw the gradient from the top to the bottom \n\n### TR_BL\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val TR_BL : GradientDrawable.Orientation\n```\n\ndraw the gradient from the top-right to the bottom-left"]]