0% found this document useful (0 votes)
46 views3 pages

Time Picker

The document describes various attributes that can be set for different view components in Android layout XML files. It lists attributes for general views as well as specific attributes for TimePicker, DatePicker, and NumberPicker views. The attributes control aspects like IDs, dimensions, padding/margins, backgrounds, colors, animations, and accessibility.

Uploaded by

Ari Purnawan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views3 pages

Time Picker

The document describes various attributes that can be set for different view components in Android layout XML files. It lists attributes for general views as well as specific attributes for TimePicker, DatePicker, and NumberPicker views. The attributes control aspects like IDs, dimensions, padding/margins, backgrounds, colors, animations, and accessibility.

Uploaded by

Ari Purnawan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

// General attributes.

<....
android:id="@+id/view" //Supply an identifier name for this view.
android:layout_width="wrap_content" //wrap_content | match_parent | fill_parent |
dimens //Specifies the basic width of the view.
android:layout_height="match_parent" //wrap_content | match_parent | fill_parent |
dimens //Specifies the basic height of the view.
android:padding="1dp" //Sets the padding, in pixels, of all four edges
android:paddingLeft="1dp"
android:paddingStart="1dp"
android:paddingRight="1dp"
android:paddingEnd="1dp"
android:paddingTop="1dp"
android:paddingBottom="1dp"
android:layout_margin="1dp" //Specifies extra space on the left, top, right and
bottom sides of this view.
android:layout_marginLeft="1dp"
android:layout_marginStart="1dp"
android:layout_marginRight="1dp"
android:layout_marginEnd="1dp"
android:layout_marginBottom="1dp"
android:layout_marginTop="1dp"
android:layout_gravity="center" //center | top | bottom | left | right | start |
end | fill | fill_horizontal | fill_vertical | center_horizontal | center_vertical
| clip_horizontal | clip_vertical.
android:gravity="center" //center | top | bottom | left | right | start | end |
fill | fill_horizontal | fill_vertical | center_horizontal | center_vertical |
clip_horizontal | clip_vertical.
android:visibility="visible" //gone | invisible | visible //Controls the initial
visibility of the view.
android:enabled="true" //true | false //Specifies whether the widget is enabled.
android:alpha="0.5" //alpha property of the view, as a value between 0 (completely
transparent) and 1 (completely opaque).
android:background="@drawable/app_wallpaper" //A drawable to use as the background.
This can be either a reference to a full drawable resource (such as a PNG image, 9-
patch, XML state list description, etc), or a solid color such as "#ff000000"
(black).
android:backgroundTint="@color/black" //Tint to apply to the background, Api >=21.
android:backgroundTintMode="screen" //add | multiply | screen | src_atop | src_in |
src_over //Blending mode used to apply the background tint, Api >=21.
android:elevation="30dp" //Base z depth of the view, must have background to show
elevation, Api >=21.
android:translationZ="20dp" //Translation in z of the view. This value is added to
its elevation, Api >=21.
android:outlineSpotShadowColor="@color/red" //Sets the color of the spot shadow
that is drawn when the view has a positive Z or elevation value, Api >=28.
android:outlineAmbientShadowColor="@color/purple" //Sets the color of the ambient
shadow that is drawn when the view has a positive Z or elevation value, Api >=28.
android:outlineProvider="paddedBounds" // background | bounds | none | paddedBounds
//Used to determine the View's Outline.
android:layoutDirection="ltr" //ltr | rtl | locale | inherit //Defines the
direction of layout drawing.
android:tag="@string/tag" //Allow to use same function by set different tag to each
view.
android:theme="@style/Theme.MaterialComponents" //Specifies a theme override for a
view.
style="@style/Theme.MaterialComponents"
android:drawableStart="@drawable/image1" //The drawable to be drawn to the
start,left,end,right,top and bottom of the view.
android:drawableLeft="@drawable/image1"
android:drawableRight="@drawable/image1"
android:drawableEnd="@drawable/image1"
android:drawableTop="@drawable/image1"
android:drawableBottom="@drawable/image1"
android:drawableTint="@color/black" //Tint to apply to the drawable, Api >=23.
android:drawableTintMode="screen" //add | multiply | screen | src_atop | src_in |
src_over //Blending mode used to apply the drawable tint, Api >=23.
android:drawablePadding="10dp" //The padding between the drawables and the view.
android:fitsSystemWindows="true" //true | false //Boolean internal attribute to
adjust view layout based on system windows such as the status bar. If true, adjusts
the padding of this view to leave space for the system windows.
android:rotation="90" //Rotation of the view, in degrees.
android:rotationX="45"
android:rotationY="45"
android:onClick="method" //Name of the method in this View's context to invoke when
the view is clicked.
android:clickable="true" //true | false //Defines whether this view reacts to
click events.
android:contextClickable="true" //true | false //Defines whether this view reacts
to context click events, refer to right click mouse, Api >=23.
android:keepScreenOn="true" //Controls whether the view's window should keep the
screen on while visible.
android:layerType="software" //software | hardware | none //Specifies the type of
layer backing this view. The default value is none.
android:layoutMode="clipBounds" //clipBounds | opticalBounds //Defines the layout
mode of this ViewGroup.
android:scaleX="0" //Scale of the view in the x direction.
android:scaleY="0" //Scale of the view in the y direction.
android:translationX="1dp" //translation in x of the view.
android:translationY="1dp" //translation in y of the view.
android:soundEffectsEnabled="true" //true | false //Boolean that controls whether a
view should have sound effects enabled for events such as clicking and touching.
android:requiresFadingEdge="vertical" //horizontal | none | vertical //Defines
which edges should be faded on scrolling.
android:touchscreenBlocksFocus="false" //true | false //Set to true if this
ViewGroup blocks focus in the presence of a touchscreen, Api >=21.
android:forceDarkAllowed="true" //true | false //Whether or not the force dark
feature is allowed to be applied to this View. Setting this to false will disable
the auto-dark feature on this View draws including any descendants, Api >=29.
android:animateLayoutChanges="true" //true | false //Enable transtion when width
changed.
android:accessibilityHeading="true" //true | false //Whether or not this view is a
heading for accessibility purposes, Api >=28.
android:accessibilityLiveRegion="assertive" //assertive | none | polite
//Indicates to accessibility services whether the user should be notified when this
view changes, Api >=19.
android:accessibilityPaneTitle="@string/title" //The title this view should present
to accessibility as a pane title, Api >=28.
android:accessibilityTraversalAfter="@id/view2" //Sets the id of a view after which
this one is visited in accessibility traversal. A screen-reader must visit the
content of the other view before the content of this one, Api >=22.
android:accessibilityTraversalBefore="@id/view1" //Sets the id of a view before
which this one is visited in accessibility traversal. A screen-reader must visit
the content of this view before the content of the one it precedes, Api >=22.
android:importantForAccessibility="auto" //auto | no | noHideDescendants | yes
//Describes whether or not this view is important for accessibility. If it is
important, the view fires accessibility events and is reported to accessibility
services that query the screen.
.../>

<TimePicker
android:numbersSelectorColor="@color/red" //The color for the hours/minutes
selector.
android:timePickerMode="clock" //clock | spinner //Defines the look of the widget,
Api >=21.
android:numbersTextColor="@color/purple" //The color for the hours/minutes numbers,
Api >=21.
android:numbersBackgroundColor="@color/gold" //The background color for the
hours/minutes numbers, Api >=21.
android:numbersInnerTextColor="@color/green" //The color for the inner hours
numbers used in 24-hour mode, Api >=21.
android:headerBackground="@color/green" //The background for the header containing
the currently selected time.
android:headerTextColor="@color/white" //The color for the header text
hours/minutes/am-pm, Api >=21.
/>

<DatePicker
android:calendarTextColor="@color/purple" //The text color list of the calendar,
Api >=21.
android:calendarViewShown="true" //Whether the calendar view is shown. Only valid
for "spinner" mode.
android:spinnersShown="true" //Whether the spinner view is shown. Only valid for
"spinner" mode.
android:datePickerMode="spinner" //calendar | spinner //Defines the look of the
widget, Api >21.
android:maxDate="12/3/2030" //The maximal date shown by this calendar view in
mm/dd/yyyy format.
android:minDate="1/1/1980" //The minimal date shown by this calendar view in
mm/dd/yyyy format.
android:headerBackground="@color/purple" //The background for the selected date
header.
/>

<NumberPicker
.../>
_________________________________________

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy