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 
     17 package android.databinding.testapp.vo;
     18 import android.databinding.BaseObservable;
     19 import android.databinding.Bindable;
     20 import android.databinding.testapp.BR;
     21 
     22 public class BasicObject extends BaseObservable {
     23     @Bindable
     24     private String mField1;
     25     @Bindable
     26     private String mField2;
     27 
     28     public String getField1() {
     29         return mField1;
     30     }
     31 
     32     public void setField1(String field1) {
     33         this.mField1 = field1;
     34         notifyPropertyChanged(BR.field1);
     35     }
     36 
     37     public String getField2() {
     38         return mField2;
     39     }
     40 
     41     public void setField2(String field2) {
     42         this.mField2 = field2;
     43         notifyPropertyChanged(BR.field1);
     44     }
     45 
     46     @Bindable
     47     public boolean isThisNameDoesNotMatchAnythingElse1() {
     48         // see: https://code.google.com/p/android/issues/detail?id=190207
     49         return false;
     50     }
     51 
     52     @Bindable
     53     public boolean getThisNameDoesNotMatchAnythingElse2() {
     54         return false;
     55     }
     56 
     57     public String boolMethod(boolean value) {
     58         return value ? "true" : "false";
     59     }
     60 }
     61