Home | History | Annotate | Download | only in vo
      1 /*
      2  * Copyright (C) 2016 The Android Open Source Project
      3  * Licensed under the Apache License, Version 2.0 (the "License");
      4  * you may not use this file except in compliance with the License.
      5  * You may obtain a copy of the License at
      6  *      http://www.apache.org/licenses/LICENSE-2.0
      7  * Unless required by applicable law or agreed to in writing, software
      8  * distributed under the License is distributed on an "AS IS" BASIS,
      9  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     10  * See the License for the specific language governing permissions and
     11  * limitations under the License.
     12  */
     13 package android.databinding.testapp.vo;
     14 
     15 import android.databinding.BaseObservable;
     16 import android.databinding.Bindable;
     17 import android.databinding.ObservableField;
     18 import android.databinding.ObservableInt;
     19 
     20 public class ViewModel extends BaseObservable {
     21     @Bindable
     22     public ObservableInt publicObservable = new ObservableInt();
     23 
     24     @Bindable
     25     private ObservableField<String> fieldObservable = new ObservableField<>();
     26 
     27     private ObservableInt methodObservable = new ObservableInt();
     28 
     29 
     30     public ObservableField<String> getFieldObservable() {
     31         return fieldObservable;
     32     }
     33 
     34     @Bindable
     35     public ObservableInt getMethodObservable() {
     36         return methodObservable;
     37     }
     38 
     39     public void setFieldObservable(ObservableField<String> fieldObservable) {
     40         this.fieldObservable = fieldObservable;
     41     }
     42 
     43     public void setMethodObservable(ObservableInt methodObservable) {
     44         this.methodObservable = methodObservable;
     45     }
     46 }
     47