Home | History | Annotate | Download | only in vo
      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.vo;
     17 
     18 import android.databinding.Bindable;
     19 import android.graphics.PorterDuff;
     20 import android.graphics.drawable.ColorDrawable;
     21 import android.graphics.drawable.Drawable;
     22 
     23 public class ImageViewBindingObject extends BindingAdapterBindingObject {
     24     @Bindable
     25     private int mTint;
     26 
     27     @Bindable
     28     private Drawable mSrc;
     29 
     30     @Bindable
     31     private PorterDuff.Mode mTintMode = PorterDuff.Mode.DARKEN;
     32 
     33     public int getTint() {
     34         return mTint;
     35     }
     36 
     37     public Drawable getSrc() {
     38         return mSrc;
     39     }
     40 
     41     public PorterDuff.Mode getTintMode() {
     42         return mTintMode;
     43     }
     44 
     45     public void changeValues() {
     46         mTint = 0xFF111111;
     47         mSrc = new ColorDrawable(0xFF00FF00);
     48         mTintMode = PorterDuff.Mode.LIGHTEN;
     49         notifyChange();
     50     }
     51 }
     52