1716ba89e7f459f49ea85070d4710c1d79d715298George Mount/* 2716ba89e7f459f49ea85070d4710c1d79d715298George Mount * Copyright (C) 2015 The Android Open Source Project 3716ba89e7f459f49ea85070d4710c1d79d715298George Mount * 4716ba89e7f459f49ea85070d4710c1d79d715298George Mount * Licensed under the Apache License, Version 2.0 (the "License"); 5716ba89e7f459f49ea85070d4710c1d79d715298George Mount * you may not use this file except in compliance with the License. 6716ba89e7f459f49ea85070d4710c1d79d715298George Mount * You may obtain a copy of the License at 7716ba89e7f459f49ea85070d4710c1d79d715298George Mount * 8716ba89e7f459f49ea85070d4710c1d79d715298George Mount * http://www.apache.org/licenses/LICENSE-2.0 9716ba89e7f459f49ea85070d4710c1d79d715298George Mount * 10716ba89e7f459f49ea85070d4710c1d79d715298George Mount * Unless required by applicable law or agreed to in writing, software 11716ba89e7f459f49ea85070d4710c1d79d715298George Mount * distributed under the License is distributed on an "AS IS" BASIS, 12716ba89e7f459f49ea85070d4710c1d79d715298George Mount * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13716ba89e7f459f49ea85070d4710c1d79d715298George Mount * See the License for the specific language governing permissions and 14716ba89e7f459f49ea85070d4710c1d79d715298George Mount * limitations under the License. 15716ba89e7f459f49ea85070d4710c1d79d715298George Mount */ 16716ba89e7f459f49ea85070d4710c1d79d715298George Mountpackage android.databinding.testapp.adapter; 17716ba89e7f459f49ea85070d4710c1d79d715298George Mount 18716ba89e7f459f49ea85070d4710c1d79d715298George Mountimport android.annotation.TargetApi; 19716ba89e7f459f49ea85070d4710c1d79d715298George Mountimport android.databinding.BindingAdapter; 20716ba89e7f459f49ea85070d4710c1d79d715298George Mountimport android.os.Build.VERSION_CODES; 21716ba89e7f459f49ea85070d4710c1d79d715298George Mountimport android.view.View; 22716ba89e7f459f49ea85070d4710c1d79d715298George Mount 23716ba89e7f459f49ea85070d4710c1d79d715298George Mountpublic class WeirdListeners { 24716ba89e7f459f49ea85070d4710c1d79d715298George Mount @BindingAdapter("android:onFoo") 25716ba89e7f459f49ea85070d4710c1d79d715298George Mount public static void setListener(View view, OnFoo onFoo) {} 26716ba89e7f459f49ea85070d4710c1d79d715298George Mount 27716ba89e7f459f49ea85070d4710c1d79d715298George Mount @BindingAdapter("android:onFoo2") 28716ba89e7f459f49ea85070d4710c1d79d715298George Mount public static void setListener(View view, OnFoo2 onFoo) {} 29716ba89e7f459f49ea85070d4710c1d79d715298George Mount 30716ba89e7f459f49ea85070d4710c1d79d715298George Mount @TargetApi(VERSION_CODES.ICE_CREAM_SANDWICH) 31716ba89e7f459f49ea85070d4710c1d79d715298George Mount public static abstract class OnFoo { 32716ba89e7f459f49ea85070d4710c1d79d715298George Mount public abstract void onFoo(); 33716ba89e7f459f49ea85070d4710c1d79d715298George Mount 34716ba89e7f459f49ea85070d4710c1d79d715298George Mount public void onBar() {} 35716ba89e7f459f49ea85070d4710c1d79d715298George Mount } 36716ba89e7f459f49ea85070d4710c1d79d715298George Mount 37716ba89e7f459f49ea85070d4710c1d79d715298George Mount public interface OnFoo2 { 38716ba89e7f459f49ea85070d4710c1d79d715298George Mount void onFoo(); 39716ba89e7f459f49ea85070d4710c1d79d715298George Mount } 40716ba89e7f459f49ea85070d4710c1d79d715298George Mount} 41