MyTextView.java revision 8533f27db6c31b0c295ae62d314dbf07ea640571
1/* 2 * Copyright (C) 2015 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 14package android.databinding.testapp.view; 15 16import android.content.Context; 17import android.util.AttributeSet; 18import android.widget.TextView; 19 20public class MyTextView extends TextView { 21 private boolean mHasFixedSize; 22 public MyTextView(Context context) { 23 super(context); 24 } 25 public MyTextView(Context context, AttributeSet attrs) { 26 super(context, attrs); 27 } 28 29 public MyTextView(Context context, AttributeSet attrs, int defStyleAttr) { 30 super(context, attrs, defStyleAttr); 31 } 32 33 public MyTextView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { 34 super(context, attrs, defStyleAttr, defStyleRes); 35 } 36 37 public void setHasFixedSize(boolean hasFixedSize){ 38 mHasFixedSize = hasFixedSize; 39 } 40 41 public boolean hasFixedSize() { 42 return mHasFixedSize; 43 } 44} 45