Java Code Examples for android.widget.TextView#setTextDirection()

The following examples show how to use android.widget.TextView#setTextDirection() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: reacteu-app   File: Notification.java    License: MIT License 5 votes vote down vote up
@SuppressLint("NewApi")
private void changeTextDirection(Builder dlg){
    int currentapiVersion = android.os.Build.VERSION.SDK_INT;
    dlg.create();
    AlertDialog dialog =  dlg.show();
    if (currentapiVersion >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1) {
        TextView messageview = (TextView)dialog.findViewById(android.R.id.message);
        messageview.setTextDirection(android.view.View.TEXT_DIRECTION_LOCALE);
    }
}
 
Example 2
Source Project: showCaseCordova   File: Notification.java    License: Apache License 2.0 5 votes vote down vote up
@SuppressLint("NewApi")
private void changeTextDirection(Builder dlg){
    int currentapiVersion = android.os.Build.VERSION.SDK_INT;
    dlg.create();
    AlertDialog dialog =  dlg.show();
    if (currentapiVersion >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1) {
        TextView messageview = (TextView)dialog.findViewById(android.R.id.message);
        messageview.setTextDirection(android.view.View.TEXT_DIRECTION_LOCALE);
    }
}
 
Example 3
Source Project: cordova-dialog-gps   File: DialogGPS.java    License: MIT License 5 votes vote down vote up
@SuppressLint("NewApi")
private void changeTextDirection(Builder dlg){
    int currentapiVersion = android.os.Build.VERSION.SDK_INT;
    dlg.create();
    AlertDialog dialog =  dlg.show();
    if (currentapiVersion >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1) {
        TextView messageview = (TextView)dialog.findViewById(android.R.id.message);
        messageview.setTextDirection(android.view.View.TEXT_DIRECTION_LOCALE);
    }
}
 
Example 4
Source Project: reader   File: Notification.java    License: MIT License 5 votes vote down vote up
@SuppressLint("NewApi")
private void changeTextDirection(Builder dlg){
    int currentapiVersion = android.os.Build.VERSION.SDK_INT;
    dlg.create();
    AlertDialog dialog =  dlg.show();
    if (currentapiVersion >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1) {
        TextView messageview = (TextView)dialog.findViewById(android.R.id.message);
        messageview.setTextDirection(android.view.View.TEXT_DIRECTION_LOCALE);
    }
}
 
Example 5
Source Project: reader   File: Notification.java    License: MIT License 5 votes vote down vote up
@SuppressLint("NewApi")
private void changeTextDirection(Builder dlg){
    int currentapiVersion = android.os.Build.VERSION.SDK_INT;
    dlg.create();
    AlertDialog dialog =  dlg.show();
    if (currentapiVersion >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1) {
        TextView messageview = (TextView)dialog.findViewById(android.R.id.message);
        messageview.setTextDirection(android.view.View.TEXT_DIRECTION_LOCALE);
    }
}
 
Example 6
Source Project: reader   File: Notification.java    License: MIT License 5 votes vote down vote up
@SuppressLint("NewApi")
private void changeTextDirection(Builder dlg){
    int currentapiVersion = android.os.Build.VERSION.SDK_INT;
    dlg.create();
    AlertDialog dialog =  dlg.show();
    if (currentapiVersion >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1) {
        TextView messageview = (TextView)dialog.findViewById(android.R.id.message);
        messageview.setTextDirection(android.view.View.TEXT_DIRECTION_LOCALE);
    }
}
 
Example 7
Source Project: reader   File: Notification.java    License: MIT License 5 votes vote down vote up
@SuppressLint("NewApi")
private void changeTextDirection(Builder dlg){
    int currentapiVersion = android.os.Build.VERSION.SDK_INT;
    dlg.create();
    AlertDialog dialog =  dlg.show();
    if (currentapiVersion >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1) {
        TextView messageview = (TextView)dialog.findViewById(android.R.id.message);
        messageview.setTextDirection(android.view.View.TEXT_DIRECTION_LOCALE);
    }
}
 
Example 8
Source Project: sealrtc-android   File: SeekBarCompatDontCrash.java    License: MIT License 4 votes vote down vote up
public static void setTextDirection(TextView number, int textDirection) {
    number.setTextDirection(textDirection);
}
 
Example 9
public static void setTextDirection(TextView number, int textDirection) {
    number.setTextDirection(textDirection);
}
 
Example 10
Source Project: Musicoco   File: SeekBarCompatDontCrash.java    License: Apache License 2.0 4 votes vote down vote up
public static void setTextDirection(TextView number, int textDirection) {
    number.setTextDirection(textDirection);
}
 
Example 11
public static void setTextDirection(TextView number, int textDirection) {
    number.setTextDirection(textDirection);
}
 
Example 12
public static void setTextDirection(TextView number, int textDirection) {
    number.setTextDirection(textDirection);
}
 
Example 13
static View makeTextViewMessage(int maxsize, boolean hasEmoji, boolean hasLink) {

        if (hasEmoji) {
            EmojiTextViewE emojiTextViewE = new EmojiTextViewE(context);
            emojiTextViewE.setLayoutParams(new LinearLayoutCompat.LayoutParams(LinearLayoutCompat.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));
//            if (G.isDarkTheme) {
            emojiTextViewE.setTextColor(Color.parseColor(G.textBubble));
//            } else {
//                emojiTextViewE.setTextColor(Color.parseColor("#333333"));
//            }

            emojiTextViewE.setId(R.id.messageSenderTextMessage);
            emojiTextViewE.setPadding(10, 4, 10, 4);
            emojiTextViewE.setTypeface(G.typeface_IRANSansMobile);
            setTextSizeDirect(emojiTextViewE, G.userTextSize);
            emojiTextViewE.setEmojiSize(i_Dp(R.dimen.dp18));
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
                emojiTextViewE.setTextDirection(View.TEXT_DIRECTION_FIRST_STRONG);
            }
            setLayoutDirection(emojiTextViewE, View.LAYOUT_DIRECTION_LOCALE);
            if (hasLink) {
                emojiTextViewE.setMovementMethod(LinkMovementMethod.getInstance());
            }

            if (maxsize > 0) {
                emojiTextViewE.setMaxWidth(maxsize);
            }

            return emojiTextViewE;
        } else {
            TextView textView = new TextView(context);
            textView.setLayoutParams(new LinearLayoutCompat.LayoutParams(LinearLayoutCompat.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));
//            if (G.isDarkTheme) {
            textView.setTextColor(Color.parseColor(G.textBubble));
//            } else {
//                textView.setTextColor(Color.parseColor("#333333"));
//            }

            textView.setId(R.id.messageSenderTextMessage);
            textView.setPadding(10, 0, 10, 0);
            textView.setTypeface(G.typeface_IRANSansMobile);
            setTextSizeDirect(textView, G.userTextSize);
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
                textView.setTextDirection(View.TEXT_DIRECTION_FIRST_STRONG);
            }
            setLayoutDirection(textView, View.LAYOUT_DIRECTION_LOCALE);
            if (hasLink) {
                textView.setMovementMethod(LinkMovementMethod.getInstance());
            }
            if (maxsize > 0) {
                textView.setMaxWidth(maxsize);
            }

            return textView;
        }
    }
 
Example 14
public static void setTextDirection(TextView number, int textDirection) {
    number.setTextDirection(textDirection);
}
 
Example 15
public static void setTextDirection(TextView number, int textDirection) {
    number.setTextDirection(textDirection);
}
 
Example 16
public static void setTextDirection(TextView number, int textDirection) {
    number.setTextDirection(textDirection);
}
 
Example 17
public static void setTextDirection(TextView number, int textDirection) {
    number.setTextDirection(textDirection);
}
 
Example 18
public static void setTextDirection(TextView number, int textDirection) {
    number.setTextDirection(textDirection);
}
 
Example 19
Source Project: Genius-Android   File: UiCompatNotCrash.java    License: Apache License 2.0 4 votes vote down vote up
static void setTextDirection(TextView number, int textDirection) {
    number.setTextDirection(textDirection);
}
 
Example 20
public static void setTextDirection(TextView number, int textDirection) {
    number.setTextDirection(textDirection);
}