این وبسایت یک نسخه آزمایشی از سایت developer android می‌باشد که در حال ترجمه می‌باشد.
برای پیوستن به تیم ترجمه و خواندن مستندات اینجا کلیک کنید.
DrawableTinting / res / layout /

tinting_fragment.xml

1
<!--
2
 Copyright 2014 The Android Open Source Project
3
 
4
 Licensed under the Apache License, Version 2.0 (the "License");
5
 you may not use this file except in compliance with the License.
6
 You may obtain a copy of the License at
7
 
8
     http://www.apache.org/licenses/LICENSE-2.0
9
 
10
 Unless required by applicable law or agreed to in writing, software
11
 distributed under the License is distributed on an "AS IS" BASIS,
12
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 See the License for the specific language governing permissions and
14
 limitations under the License.
15
-->
16
 
17
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
18
    android:layout_width="match_parent"
19
    android:layout_height="match_parent">
20
 
21
    <LinearLayout
22
        android:layout_width="match_parent"
23
        android:layout_height="match_parent"
24
        android:layout_marginBottom="@dimen/vertical_page_margin"
25
        android:layout_marginEnd="@dimen/horizontal_page_margin"
26
        android:layout_marginStart="@dimen/horizontal_page_margin"
27
        android:layout_marginTop="@dimen/vertical_page_margin"
28
        android:orientation="vertical"
29
        android:paddingBottom="@dimen/horizontal_page_margin">
30
 
31
        <TextView
32
            android:layout_width="wrap_content"
33
            android:layout_height="wrap_content"
34
            android:text="@string/resource_tint_label" />
35
 
36
        <!-- Button on which the background is set to a Drawable resource that references a
37
          color state list to define its tint. The color varies based on the state of the View. -->
38
        <Button
39
            android:id="@+id/button"
40
            android:layout_width="wrap_content"
41
            android:layout_height="wrap_content"
42
            android:layout_gravity="center_horizontal"
43
            android:background="@drawable/buttonbackground"
44
            android:paddingEnd="7dp"
45
            android:paddingStart="7dp"
46
            android:text="@string/resource_tint_button" />
47
 
48
        <!-- Image -->
49
        <TextView
50
            android:layout_width="wrap_content"
51
            android:layout_height="wrap_content"
52
            android:text="@string/prog_tint_label" />
53
 
54
        <ImageView
55
            android:id="@+id/image"
56
            android:layout_width="200dp"
57
            android:layout_height="50dp"
58
            android:layout_gravity="center_horizontal"
59
            android:scaleType="fitXY"
60
            android:tint="#330000FF" />
61
 
62
        <!-- Blend mode -->
63
        <TextView
64
            android:layout_width="wrap_content"
65
            android:layout_height="wrap_content"
66
            android:layout_marginBottom="0dp"
67
            android:text="@string/blend_mode_label" />
68
 
69
        <Spinner
70
            android:id="@+id/blendSpinner"
71
            android:layout_width="wrap_content"
72
            android:layout_height="wrap_content" />
73
 
74
        <!-- Alpha -->
75
        <TextView
76
            android:id="@+id/alphaText"
77
            android:layout_width="wrap_content"
78
            android:layout_height="wrap_content" />
79
 
80
        <SeekBar
81
            android:id="@+id/alphaSeek"
82
            android:layout_width="match_parent"
83
            android:layout_height="wrap_content"
84
            android:max="255"
85
            android:progress="255" />
86
 
87
        <!-- Red -->
88
        <TextView
89
            android:id="@+id/redText"
90
            android:layout_width="wrap_content"
91
            android:layout_height="wrap_content" />
92
 
93
        <SeekBar
94
            android:id="@+id/redSeek"
95
            android:layout_width="match_parent"
96
            android:layout_height="wrap_content"
97
            android:max="255" />
98
 
99
        <!-- Green -->
100
        <TextView
101
            android:id="@+id/greenText"
102
            android:layout_width="wrap_content"
103
            android:layout_height="wrap_content" />
104
 
105
        <SeekBar
106
            android:id="@+id/greenSeek"
107
            android:layout_width="match_parent"
108
            android:layout_height="wrap_content"
109
            android:max="255" />
110
 
111
        <!-- Blue -->
112
        <TextView
113
            android:id="@+id/blueText"
114
            android:layout_width="wrap_content"
115
            android:layout_height="wrap_content" />
116
 
117
        <SeekBar
118
            android:id="@+id/blueSeek"