198e4b7a419c91797a7ef66158fa0ce9aaacc8817George Mount/* 298e4b7a419c91797a7ef66158fa0ce9aaacc8817George Mount * Copyright (C) 2015 The Android Open Source Project 398e4b7a419c91797a7ef66158fa0ce9aaacc8817George Mount * Licensed under the Apache License, Version 2.0 (the "License"); 498e4b7a419c91797a7ef66158fa0ce9aaacc8817George Mount * you may not use this file except in compliance with the License. 598e4b7a419c91797a7ef66158fa0ce9aaacc8817George Mount * You may obtain a copy of the License at 698e4b7a419c91797a7ef66158fa0ce9aaacc8817George Mount * http://www.apache.org/licenses/LICENSE-2.0 798e4b7a419c91797a7ef66158fa0ce9aaacc8817George Mount * Unless required by applicable law or agreed to in writing, software 898e4b7a419c91797a7ef66158fa0ce9aaacc8817George Mount * distributed under the License is distributed on an "AS IS" BASIS, 998e4b7a419c91797a7ef66158fa0ce9aaacc8817George Mount * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1098e4b7a419c91797a7ef66158fa0ce9aaacc8817George Mount * See the License for the specific language governing permissions and 1198e4b7a419c91797a7ef66158fa0ce9aaacc8817George Mount * limitations under the License. 1298e4b7a419c91797a7ef66158fa0ce9aaacc8817George Mount */ 1398e4b7a419c91797a7ef66158fa0ce9aaacc8817George Mount 14fead9ca09b117136b35bc5bf137340a754f9edddGeorge Mountpackage android.databinding.testapp.vo; 1598e4b7a419c91797a7ef66158fa0ce9aaacc8817George Mount 16fead9ca09b117136b35bc5bf137340a754f9edddGeorge Mountimport android.databinding.BaseObservable; 17fead9ca09b117136b35bc5bf137340a754f9edddGeorge Mountimport android.databinding.Bindable; 18fead9ca09b117136b35bc5bf137340a754f9edddGeorge Mountimport android.databinding.testapp.BR; 19fead9ca09b117136b35bc5bf137340a754f9edddGeorge Mountimport android.databinding.testapp.R; 2098e4b7a419c91797a7ef66158fa0ce9aaacc8817George Mount 2198e4b7a419c91797a7ef66158fa0ce9aaacc8817George Mountpublic class PublicFinalWithObservableTestVo { 2298e4b7a419c91797a7ef66158fa0ce9aaacc8817George Mount public final int myField; 2398e4b7a419c91797a7ef66158fa0ce9aaacc8817George Mount public final MyVo myFinalVo = new MyVo(); 2498e4b7a419c91797a7ef66158fa0ce9aaacc8817George Mount 2598e4b7a419c91797a7ef66158fa0ce9aaacc8817George Mount public PublicFinalWithObservableTestVo(int field) { 2698e4b7a419c91797a7ef66158fa0ce9aaacc8817George Mount myField = field; 2798e4b7a419c91797a7ef66158fa0ce9aaacc8817George Mount } 2898e4b7a419c91797a7ef66158fa0ce9aaacc8817George Mount 2998e4b7a419c91797a7ef66158fa0ce9aaacc8817George Mount public static class MyVo extends BaseObservable { 3098e4b7a419c91797a7ef66158fa0ce9aaacc8817George Mount @Bindable 3198e4b7a419c91797a7ef66158fa0ce9aaacc8817George Mount private int val = R.string.app_name; 3298e4b7a419c91797a7ef66158fa0ce9aaacc8817George Mount 3398e4b7a419c91797a7ef66158fa0ce9aaacc8817George Mount public int getVal() { 3498e4b7a419c91797a7ef66158fa0ce9aaacc8817George Mount return val; 3598e4b7a419c91797a7ef66158fa0ce9aaacc8817George Mount } 3698e4b7a419c91797a7ef66158fa0ce9aaacc8817George Mount 3798e4b7a419c91797a7ef66158fa0ce9aaacc8817George Mount public void setVal(int val) { 3898e4b7a419c91797a7ef66158fa0ce9aaacc8817George Mount this.val = val; 39a6e4583962e19e8e93b4ca3f9fe3d34560b6d96cYigit Boyar notifyPropertyChanged(BR.val); 4098e4b7a419c91797a7ef66158fa0ce9aaacc8817George Mount } 4198e4b7a419c91797a7ef66158fa0ce9aaacc8817George Mount } 4298e4b7a419c91797a7ef66158fa0ce9aaacc8817George Mount} 43