FileDocCategorySizeDatePackage
EmergencyCarrierArea.javaAPI DocAndroid 5.1 API2310Thu Mar 12 22:22:42 GMT 2015com.android.keyguard

EmergencyCarrierArea

public class EmergencyCarrierArea extends AlphaOptimizedLinearLayout

Fields Summary
private CarrierText
mCarrierText
private EmergencyButton
mEmergencyButton
Constructors Summary
public EmergencyCarrierArea(android.content.Context context)

        super(context);
    
public EmergencyCarrierArea(android.content.Context context, android.util.AttributeSet attrs)

        super(context, attrs);
    
Methods Summary
protected voidonFinishInflate()

        super.onFinishInflate();
        mCarrierText = (CarrierText) findViewById(R.id.carrier_text);
        mEmergencyButton = (EmergencyButton) findViewById(R.id.emergency_call_button);

        // The emergency button overlaps the carrier text, only noticeable when highlighted.
        // So temporarily hide the carrier text while the emergency button is pressed.
        mEmergencyButton.setOnTouchListener(new OnTouchListener(){
            @Override
            public boolean onTouch(View v, MotionEvent event) {
                if (mCarrierText.getVisibility() != View.VISIBLE) return false;
                switch(event.getAction()) {
                    case MotionEvent.ACTION_DOWN:
                        mCarrierText.animate().alpha(0);
                        break;
                    case MotionEvent.ACTION_UP:
                        mCarrierText.animate().alpha(1);
                        break;
                }
                return false;
            }});
    
public voidsetCarrierTextVisible(boolean visible)

        mCarrierText.setVisibility(visible ? View.VISIBLE : View.GONE);