191d538470c011e19fa4375cc3531b5dd9ae01d55George Mount/* 291d538470c011e19fa4375cc3531b5dd9ae01d55George Mount * Copyright (C) 2015 The Android Open Source Project 391d538470c011e19fa4375cc3531b5dd9ae01d55George Mount * 491d538470c011e19fa4375cc3531b5dd9ae01d55George Mount * Licensed under the Apache License, Version 2.0 (the "License"); 591d538470c011e19fa4375cc3531b5dd9ae01d55George Mount * you may not use this file except in compliance with the License. 691d538470c011e19fa4375cc3531b5dd9ae01d55George Mount * You may obtain a copy of the License at 791d538470c011e19fa4375cc3531b5dd9ae01d55George Mount * 891d538470c011e19fa4375cc3531b5dd9ae01d55George Mount * http://www.apache.org/licenses/LICENSE-2.0 991d538470c011e19fa4375cc3531b5dd9ae01d55George Mount * 1091d538470c011e19fa4375cc3531b5dd9ae01d55George Mount * Unless required by applicable law or agreed to in writing, software 1191d538470c011e19fa4375cc3531b5dd9ae01d55George Mount * distributed under the License is distributed on an "AS IS" BASIS, 1291d538470c011e19fa4375cc3531b5dd9ae01d55George Mount * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1391d538470c011e19fa4375cc3531b5dd9ae01d55George Mount * See the License for the specific language governing permissions and 1491d538470c011e19fa4375cc3531b5dd9ae01d55George Mount * limitations under the License. 1591d538470c011e19fa4375cc3531b5dd9ae01d55George Mount */ 1691d538470c011e19fa4375cc3531b5dd9ae01d55George Mountpackage android.databinding.testapp; 1791d538470c011e19fa4375cc3531b5dd9ae01d55George Mount 1891d538470c011e19fa4375cc3531b5dd9ae01d55George Mountimport android.content.Context; 1991d538470c011e19fa4375cc3531b5dd9ae01d55George Mountimport android.util.AttributeSet; 2091d538470c011e19fa4375cc3531b5dd9ae01d55George Mountimport android.view.View; 2191d538470c011e19fa4375cc3531b5dd9ae01d55George Mount 2291d538470c011e19fa4375cc3531b5dd9ae01d55George Mountimport java.util.List; 2391d538470c011e19fa4375cc3531b5dd9ae01d55George Mount 2491d538470c011e19fa4375cc3531b5dd9ae01d55George Mountpublic class GenericView<T> extends View { 25b9e4aa96812692a7dcf468445e64bc5b30d3c79aGeorge Mount private List<T> mList; 2691d538470c011e19fa4375cc3531b5dd9ae01d55George Mount 2791d538470c011e19fa4375cc3531b5dd9ae01d55George Mount public GenericView(Context context) { 2891d538470c011e19fa4375cc3531b5dd9ae01d55George Mount super(context); 2991d538470c011e19fa4375cc3531b5dd9ae01d55George Mount } 3091d538470c011e19fa4375cc3531b5dd9ae01d55George Mount 3191d538470c011e19fa4375cc3531b5dd9ae01d55George Mount public GenericView(Context context, AttributeSet attrs) { 3291d538470c011e19fa4375cc3531b5dd9ae01d55George Mount super(context, attrs); 3391d538470c011e19fa4375cc3531b5dd9ae01d55George Mount } 3491d538470c011e19fa4375cc3531b5dd9ae01d55George Mount 3591d538470c011e19fa4375cc3531b5dd9ae01d55George Mount public GenericView(Context context, AttributeSet attrs, int defStyleAttr) { 3691d538470c011e19fa4375cc3531b5dd9ae01d55George Mount super(context, attrs, defStyleAttr); 3791d538470c011e19fa4375cc3531b5dd9ae01d55George Mount } 3891d538470c011e19fa4375cc3531b5dd9ae01d55George Mount 3991d538470c011e19fa4375cc3531b5dd9ae01d55George Mount public GenericView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { 4091d538470c011e19fa4375cc3531b5dd9ae01d55George Mount super(context, attrs, defStyleAttr, defStyleRes); 4191d538470c011e19fa4375cc3531b5dd9ae01d55George Mount } 4291d538470c011e19fa4375cc3531b5dd9ae01d55George Mount 43b9e4aa96812692a7dcf468445e64bc5b30d3c79aGeorge Mount public void setList(List<T> list) { 44b9e4aa96812692a7dcf468445e64bc5b30d3c79aGeorge Mount mList = list; 45b9e4aa96812692a7dcf468445e64bc5b30d3c79aGeorge Mount } 46b9e4aa96812692a7dcf468445e64bc5b30d3c79aGeorge Mount 47b9e4aa96812692a7dcf468445e64bc5b30d3c79aGeorge Mount public List<T> getList() { 48b9e4aa96812692a7dcf468445e64bc5b30d3c79aGeorge Mount return mList; 49b9e4aa96812692a7dcf468445e64bc5b30d3c79aGeorge Mount } 5091d538470c011e19fa4375cc3531b5dd9ae01d55George Mount} 51