android解决阿拉伯语下通话记录的显示问题

路径如下

alps/vendor/mediatek/proprietary/packages/apps/Contacts

src/com/android/contacts/quickcontact/ExpandingEntryCardView.java

public class ExpandingEntryCardView extends CardView {

............

 final ImageView icon = (ImageView) view.findViewById(R.id.icon);
        icon.setVisibility(iconVisibility);
        if (entry.getIcon() != null) {
            icon.setImageDrawable(entry.getIcon());
        }
        final TextView header = (TextView) view.findViewById(R.id.header);
        //modify 20180512
        String headerText = entry.getHeader();
        if (!TextUtils.isEmpty(headerText)) {
            if (ContactDisplayUtils.isPossiblePhoneNumber(headerText)) {
                header.setTextDirection(View.TEXT_DIRECTION_LTR);
            }else{
                int index = headerText.indexOf("+");
                if(index > 0){
                    String numberString = headerText.substring(index);
                    if(ContactDisplayUtils.isPossiblePhoneNumber(numberString)){
                        numberString = '\u202D'+ numberString +'\u202C';
                        String thirdAppString = headerText.substring(0,index);
                        headerText = thirdAppString+numberString;
                    }
                }
            }
            header.setText(headerText);
        } else {

猜你喜欢

转载自blog.csdn.net/fan380485838/article/details/80909409