Debian Codegraph @

integration-tests/TestApp/app/src/androidTestApi7/java/android/databinding/testapp/ProgressBarBindingAdapterTest.java

raw
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 */
16 package android.databinding.testapp;
17
18 import android.databinding.testapp.databinding.ProgressBarAdapterTestBinding;
19 import android.databinding.testapp.vo.ProgressBarBindingObject;
20
21 import android.os.Build;
22 import android.widget.ProgressBar;
23
24 public class ProgressBarBindingAdapterTest
25 extends BindingAdapterTestBase<ProgressBarAdapterTestBinding, ProgressBarBindingObject> {
26
27 ProgressBar mView;
28
29 public ProgressBarBindingAdapterTest() {
30 super(ProgressBarAdapterTestBinding.class, ProgressBarBindingObject.class,
31 R.layout.progress_bar_adapter_test);
32 }
33
34 @Override
35 protected void setUp() throws Exception {
36 super.setUp();
37 mView = mBinder.view;
38 }
39
40 public void testTint() throws Throwable {
41 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
42 assertEquals(mBindingObject.getIndeterminateTint(),
43 mView.getIndeterminateTintList().getDefaultColor());
44 assertEquals(mBindingObject.getProgressTint(),
45 mView.getProgressTintList().getDefaultColor());
46 assertEquals(mBindingObject.getSecondaryProgressTint(),
47 mView.getSecondaryProgressTintList().getDefaultColor());
48
49 changeValues();
50
51 assertEquals(mBindingObject.getIndeterminateTint(),
52 mView.getIndeterminateTintList().getDefaultColor());
53 assertEquals(mBindingObject.getProgressTint(),
54 mView.getProgressTintList().getDefaultColor());
55 assertEquals(mBindingObject.getSecondaryProgressTint(),
56 mView.getSecondaryProgressTintList().getDefaultColor());
57 }
58 }
59 }