13561e3e665698843b1c664385a842e779198960bGeorge Mount/*
23561e3e665698843b1c664385a842e779198960bGeorge Mount * Copyright (C) 2015 The Android Open Source Project
33561e3e665698843b1c664385a842e779198960bGeorge Mount *
43561e3e665698843b1c664385a842e779198960bGeorge Mount * Licensed under the Apache License, Version 2.0 (the "License");
53561e3e665698843b1c664385a842e779198960bGeorge Mount * you may not use this file except in compliance with the License.
63561e3e665698843b1c664385a842e779198960bGeorge Mount * You may obtain a copy of the License at
73561e3e665698843b1c664385a842e779198960bGeorge Mount *
83561e3e665698843b1c664385a842e779198960bGeorge Mount *      http://www.apache.org/licenses/LICENSE-2.0
93561e3e665698843b1c664385a842e779198960bGeorge Mount *
103561e3e665698843b1c664385a842e779198960bGeorge Mount * Unless required by applicable law or agreed to in writing, software
113561e3e665698843b1c664385a842e779198960bGeorge Mount * distributed under the License is distributed on an "AS IS" BASIS,
123561e3e665698843b1c664385a842e779198960bGeorge Mount * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
133561e3e665698843b1c664385a842e779198960bGeorge Mount * See the License for the specific language governing permissions and
143561e3e665698843b1c664385a842e779198960bGeorge Mount * limitations under the License.
153561e3e665698843b1c664385a842e779198960bGeorge Mount */
16fead9ca09b117136b35bc5bf137340a754f9edddGeorge Mountpackage android.databinding.adapters;
173561e3e665698843b1c664385a842e779198960bGeorge Mount
183561e3e665698843b1c664385a842e779198960bGeorge Mountimport android.annotation.TargetApi;
19fead9ca09b117136b35bc5bf137340a754f9edddGeorge Mountimport android.databinding.BindingAdapter;
20fead9ca09b117136b35bc5bf137340a754f9edddGeorge Mountimport android.databinding.BindingMethod;
21fead9ca09b117136b35bc5bf137340a754f9edddGeorge Mountimport android.databinding.BindingMethods;
223561e3e665698843b1c664385a842e779198960bGeorge Mountimport android.os.Build;
233561e3e665698843b1c664385a842e779198960bGeorge Mountimport android.widget.Switch;
243561e3e665698843b1c664385a842e779198960bGeorge Mount
253561e3e665698843b1c664385a842e779198960bGeorge Mount@BindingMethods({
26c619d8f69127c1200103d8119101c5f0675661d0George Mount        @BindingMethod(type = android.widget.Switch.class, attribute = "android:thumb", method = "setThumbDrawable"),
27c619d8f69127c1200103d8119101c5f0675661d0George Mount        @BindingMethod(type = android.widget.Switch.class, attribute = "android:track", method = "setTrackDrawable"),
283561e3e665698843b1c664385a842e779198960bGeorge Mount})
293561e3e665698843b1c664385a842e779198960bGeorge Mount@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
303561e3e665698843b1c664385a842e779198960bGeorge Mountpublic class SwitchBindingAdapter {
313561e3e665698843b1c664385a842e779198960bGeorge Mount
3210960eb5f73fd587c2f8d18cfc61873c04017512George Mount    @BindingAdapter({"android:switchTextAppearance"})
333561e3e665698843b1c664385a842e779198960bGeorge Mount    public static void setSwitchTextAppearance(Switch view, int value) {
343561e3e665698843b1c664385a842e779198960bGeorge Mount        view.setSwitchTextAppearance(null, value);
353561e3e665698843b1c664385a842e779198960bGeorge Mount    }
363561e3e665698843b1c664385a842e779198960bGeorge Mount}
37