FileDocCategorySizeDatePackage
AddressView.javaAPI DocAndroid 5.1 API1818Thu Mar 12 22:22:44 GMT 2015com.google.android.test.shared_library

AddressView

public class AddressView extends android.widget.LinearLayout

Fields Summary
private android.widget.TextView
mNameView
private android.widget.TextView
mStreetView
private android.widget.TextView
mCityStateZipView
private android.widget.TextView
mCountryView
Constructors Summary
public AddressView(android.content.Context context, android.util.AttributeSet attrs)

        super(context, attrs);
        setOrientation(VERTICAL);

        View view = LayoutInflater.from(context).inflate(R.layout.address, this);
        mNameView = (TextView) view.findViewById(R.id.name);
        mStreetView = (TextView) view.findViewById(R.id.street);
        mCityStateZipView = (TextView) view.findViewById(R.id.cityStateZip);
        mCountryView = (TextView) view.findViewById(R.id.country);

        TypedArray a = context.getTheme().obtainStyledAttributes(
                attrs,
                R.styleable.AddressView,
                0, 0);
        try {
            mNameView.setText(a.getString(R.styleable.AddressView_name));
            int streetNumber = a.getInteger(R.styleable.AddressView_streetNumber, -1);
            mStreetView.setText((streetNumber <= 0 ? "" : Integer.toString(streetNumber)) +
                    " " + a.getString(R.styleable.AddressView_streetName));
            mCityStateZipView.setText(a.getString(R.styleable.AddressView_city) + ", " +
                    a.getString(R.styleable.AddressView_state) + " " +
                    a.getString(R.styleable.AddressView_zip));
            mCountryView.setText(a.getString(R.styleable.AddressView_country));
        } finally {
            a.recycle();
        }
    
Methods Summary