Example usage for android.view View TEXT_DIRECTION_INHERIT

List of usage examples for android.view View TEXT_DIRECTION_INHERIT

Introduction

In this page you can find the example usage for android.view View TEXT_DIRECTION_INHERIT.

Prototype

int TEXT_DIRECTION_INHERIT

To view the source code for android.view View TEXT_DIRECTION_INHERIT.

Click Source Link

Document

Text direction is inherited through ViewGroup

Usage

From source file:com.android.incallui.CallCardFragment.java

@Override
public void setPrimaryName(String name, boolean nameIsNumber) {
    if (TextUtils.isEmpty(name)) {
        mPrimaryName.setText(null);//w  w  w  .  jav a 2s .c  o m
    } else {
        mPrimaryName.setText(nameIsNumber ? PhoneNumberUtilsCompat.createTtsSpannable(name) : name);

        // Set direction of the name field
        int nameDirection = View.TEXT_DIRECTION_INHERIT;
        if (nameIsNumber) {
            nameDirection = View.TEXT_DIRECTION_LTR;
        }
        mPrimaryName.setTextDirection(nameDirection);
    }
}

From source file:com.android.incallui.CallCardFragment.java

@Override
public void setSecondary(boolean show, String name, boolean nameIsNumber, String label, String providerLabel,
        boolean isConference, boolean isVideoCall, boolean isFullscreen) {

    if (show) {//from   w w  w . j a  va 2  s .  c  o  m
        mHasSecondaryCallInfo = true;
        boolean hasProvider = !TextUtils.isEmpty(providerLabel);
        initializeSecondaryCallInfo(hasProvider);

        // Do not show the secondary caller info in fullscreen mode, but ensure it is populated
        // in case fullscreen mode is exited in the future.
        setSecondaryInfoVisible(!isFullscreen);

        mSecondaryCallConferenceCallIcon.setVisibility(isConference ? View.VISIBLE : View.GONE);
        mSecondaryCallVideoCallIcon.setVisibility(isVideoCall ? View.VISIBLE : View.GONE);

        mSecondaryCallName.setText(nameIsNumber ? PhoneNumberUtilsCompat.createTtsSpannable(name) : name);
        if (hasProvider) {
            mSecondaryCallProviderLabel.setText(providerLabel);
        }

        int nameDirection = View.TEXT_DIRECTION_INHERIT;
        if (nameIsNumber) {
            nameDirection = View.TEXT_DIRECTION_LTR;
        }
        mSecondaryCallName.setTextDirection(nameDirection);
    } else {
        mHasSecondaryCallInfo = false;
        setSecondaryInfoVisible(false);
    }
}