ViewBindingObject.java revision 8533f27db6c31b0c295ae62d314dbf07ea640571
1/*
2 * Copyright (C) 2015 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 */
16package android.databinding.testapp.vo;
17
18import android.databinding.Bindable;
19import android.databinding.adapters.ViewBindingAdapter;
20import android.databinding.testapp.R;
21import android.view.View;
22
23public class ViewBindingObject extends BindingAdapterBindingObject {
24    @Bindable
25    private int mBackgroundTint = 0xFF00FF00;
26    @Bindable
27    private boolean mFadeScrollbars = true;
28    @Bindable
29    private int mNextFocusForward = R.id.padding;
30    @Bindable
31    private int mNextFocusLeft = R.id.paddingStartEnd;
32    @Bindable
33    private int mNextFocusRight = R.id.paddingTopBottom;
34    @Bindable
35    private int mNextFocusUp = R.id.backgroundTint;
36    @Bindable
37    private int mNextFocusDown = R.id.fadeScrollbars;
38    @Bindable
39    private int mRequiresFadingEdge = ViewBindingAdapter.FADING_EDGE_VERTICAL;
40    @Bindable
41    private int mScrollbarDefaultDelayBeforeFade = 300;
42    @Bindable
43    private int mScrollbarFadeDuration = 400;
44    @Bindable
45    private int mScrollbarSize = 10;
46    @Bindable
47    private int mScrollbarStyle = View.SCROLLBARS_INSIDE_OVERLAY;
48    @Bindable
49    private float mTransformPivotX = 9;
50    @Bindable
51    private float mTransformPivotY = 8;
52    @Bindable
53    private int mPadding = 11;
54    @Bindable
55    private int mPaddingBottom = 12;
56    @Bindable
57    private int mPaddingTop = 13;
58    @Bindable
59    private int mPaddingLeft = 14;
60    @Bindable
61    private int mPaddingRight = 15;
62    @Bindable
63    private int mPaddingStart = 16;
64    @Bindable
65    private int mPaddingEnd = 17;
66
67    public int getBackgroundTint() {
68        return mBackgroundTint;
69    }
70
71    public int getScrollbarFadeDuration() {
72        return mScrollbarFadeDuration;
73    }
74
75    public boolean getFadeScrollbars() {
76        return mFadeScrollbars;
77    }
78
79    public int getNextFocusDown() {
80        return mNextFocusDown;
81    }
82
83    public int getNextFocusForward() {
84        return mNextFocusForward;
85    }
86
87    public int getNextFocusLeft() {
88        return mNextFocusLeft;
89    }
90
91    public int getNextFocusRight() {
92        return mNextFocusRight;
93    }
94
95    public int getNextFocusUp() {
96        return mNextFocusUp;
97    }
98
99    public int getRequiresFadingEdge() {
100        return mRequiresFadingEdge;
101    }
102
103    public int getScrollbarDefaultDelayBeforeFade() {
104        return mScrollbarDefaultDelayBeforeFade;
105    }
106
107    public int getScrollbarSize() {
108        return mScrollbarSize;
109    }
110
111    public int getScrollbarStyle() {
112        return mScrollbarStyle;
113    }
114
115    public float getTransformPivotX() {
116        return mTransformPivotX;
117    }
118
119    public float getTransformPivotY() {
120        return mTransformPivotY;
121    }
122
123    public int getPadding() {
124        return mPadding;
125    }
126
127    public int getPaddingBottom() {
128        return mPaddingBottom;
129    }
130
131    public int getPaddingEnd() {
132        return mPaddingEnd;
133    }
134
135    public int getPaddingLeft() {
136        return mPaddingLeft;
137    }
138
139    public int getPaddingRight() {
140        return mPaddingRight;
141    }
142
143    public int getPaddingStart() {
144        return mPaddingStart;
145    }
146
147    public int getPaddingTop() {
148        return mPaddingTop;
149    }
150
151    public void changeValues() {
152        mBackgroundTint = 0xFFFF0000;
153        mFadeScrollbars = false;
154        mNextFocusForward = R.id.paddingStartEnd;
155        mNextFocusLeft = R.id.paddingTopBottom;
156        mNextFocusRight = R.id.backgroundTint;
157        mNextFocusUp = R.id.fadeScrollbars;
158        mNextFocusDown = R.id.padding;
159        mRequiresFadingEdge = ViewBindingAdapter.FADING_EDGE_HORIZONTAL;
160        mScrollbarDefaultDelayBeforeFade = 400;
161        mScrollbarFadeDuration = 500;
162        mScrollbarSize = 11;
163        mScrollbarStyle = View.SCROLLBARS_INSIDE_INSET;
164        mTransformPivotX = 7;
165        mTransformPivotY = 6;
166        mPadding = 110;
167        mPaddingBottom = 120;
168        mPaddingTop = 130;
169        mPaddingLeft = 140;
170        mPaddingRight = 150;
171        mPaddingStart = 160;
172        mPaddingEnd = 170;
173        notifyChange();
174    }
175}
176