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

The following examples show how to use android.widget.TextView#setTextDirection() . 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 check out the related API usage on the sidebar.
Example 1
Source File: Notification.java    From reader with 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 File: Notification.java    From reader with 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 3
Source File: Notification.java    From reacteu-app with 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 File: Notification.java    From reader with 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 File: Notification.java    From reader with 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 File: Notification.java    From showCaseCordova with 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 7
Source File: DialogGPS.java    From cordova-dialog-gps with 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 File: SeekBarCompatDontCrash.java    From Panoramic-Screenshot with GNU General Public License v3.0 4 votes vote down vote up
public static void setTextDirection(TextView number, int textDirection) {
    number.setTextDirection(textDirection);
}
 
Example 9
Source File: SeekBarCompatDontCrash.java    From android-open-project-demo with Apache License 2.0 4 votes vote down vote up
public static void setTextDirection(TextView number, int textDirection) {
    number.setTextDirection(textDirection);
}
 
Example 10
Source File: UiCompatNotCrash.java    From Genius-Android with Apache License 2.0 4 votes vote down vote up
static void setTextDirection(TextView number, int textDirection) {
    number.setTextDirection(textDirection);
}
 
Example 11
Source File: SeekBarCompatDontCrash.java    From UltimateAndroid with Apache License 2.0 4 votes vote down vote up
public static void setTextDirection(TextView number, int textDirection) {
    number.setTextDirection(textDirection);
}
 
Example 12
Source File: SeekBarCompatDontCrash.java    From discreteSeekBar with Apache License 2.0 4 votes vote down vote up
public static void setTextDirection(TextView number, int textDirection) {
    number.setTextDirection(textDirection);
}
 
Example 13
Source File: SeekBarCompatDontCrash.java    From sealrtc-android with MIT License 4 votes vote down vote up
public static void setTextDirection(TextView number, int textDirection) {
    number.setTextDirection(textDirection);
}
 
Example 14
Source File: SeekBarCompatDontCrash.java    From Sky31Radio with Apache License 2.0 4 votes vote down vote up
public static void setTextDirection(TextView number, int textDirection) {
    number.setTextDirection(textDirection);
}
 
Example 15
Source File: SeekBarCompatDontCrash.java    From SwipeBack with GNU General Public License v3.0 4 votes vote down vote up
public static void setTextDirection(TextView number, int textDirection) {
    number.setTextDirection(textDirection);
}
 
Example 16
Source File: ViewMaker.java    From iGap-Android with GNU Affero General Public License v3.0 4 votes vote down vote up
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 17
Source File: SeekBarCompatDontCrash.java    From FuAgoraDemoDroid with MIT License 4 votes vote down vote up
public static void setTextDirection(TextView number, int textDirection) {
    number.setTextDirection(textDirection);
}
 
Example 18
Source File: SeekBarCompatDontCrash.java    From IdealMedia with Apache License 2.0 4 votes vote down vote up
public static void setTextDirection(TextView number, int textDirection) {
    number.setTextDirection(textDirection);
}
 
Example 19
Source File: SeekBarCompatDontCrash.java    From Musicoco with Apache License 2.0 4 votes vote down vote up
public static void setTextDirection(TextView number, int textDirection) {
    number.setTextDirection(textDirection);
}
 
Example 20
Source File: SeekBarCompatDontCrash.java    From PLDroidShortVideo with Apache License 2.0 4 votes vote down vote up
public static void setTextDirection(TextView number, int textDirection) {
    number.setTextDirection(textDirection);
}