mirror of
https://github.com/oxen-io/session-android.git
synced 2025-04-20 07:21:30 +00:00
parent
185d22809e
commit
a39d9bf132
@ -27,6 +27,7 @@ import android.net.Uri;
|
|||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
|
import android.support.v4.view.ViewCompat;
|
||||||
import android.support.v7.app.AlertDialog;
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
import android.text.Spanned;
|
import android.text.Spanned;
|
||||||
@ -222,7 +223,7 @@ public class ConversationItem extends LinearLayout
|
|||||||
content.getPaddingTop() + groupSenderHolder.getMeasuredHeight());
|
content.getPaddingTop() + groupSenderHolder.getMeasuredHeight());
|
||||||
|
|
||||||
|
|
||||||
if (DynamicLanguage.getLayoutDirection(context) == LAYOUT_DIRECTION_RTL) {
|
if (ViewCompat.getLayoutDirection(groupSenderProfileName) == ViewCompat.LAYOUT_DIRECTION_RTL) {
|
||||||
groupSenderProfileName.layout(groupSenderHolder.getPaddingLeft(),
|
groupSenderProfileName.layout(groupSenderHolder.getPaddingLeft(),
|
||||||
groupSenderHolder.getPaddingTop(),
|
groupSenderHolder.getPaddingTop(),
|
||||||
groupSenderHolder.getPaddingLeft() + groupSenderProfileName.getWidth(),
|
groupSenderHolder.getPaddingLeft() + groupSenderProfileName.getWidth(),
|
||||||
|
@ -3,6 +3,7 @@ package org.thoughtcrime.securesms.components;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.TypedArray;
|
import android.content.res.TypedArray;
|
||||||
import android.graphics.Typeface;
|
import android.graphics.Typeface;
|
||||||
|
import android.support.v4.view.ViewCompat;
|
||||||
import android.text.Spannable;
|
import android.text.Spannable;
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
import android.text.SpannableStringBuilder;
|
import android.text.SpannableStringBuilder;
|
||||||
@ -61,7 +62,7 @@ public class FromTextView extends EmojiTextView {
|
|||||||
profileName.setSpan(new TypefaceSpan("sans-serif-light"), 0, profileName.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
profileName.setSpan(new TypefaceSpan("sans-serif-light"), 0, profileName.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||||
profileName.setSpan(new ForegroundColorSpan(ResUtil.getColor(getContext(), R.attr.conversation_list_item_subject_color)), 0, profileName.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
profileName.setSpan(new ForegroundColorSpan(ResUtil.getColor(getContext(), R.attr.conversation_list_item_subject_color)), 0, profileName.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||||
|
|
||||||
if (DynamicLanguage.getLayoutDirection(getContext()) == LAYOUT_DIRECTION_RTL){
|
if (ViewCompat.getLayoutDirection(this) == ViewCompat.LAYOUT_DIRECTION_RTL){
|
||||||
builder.append(profileName);
|
builder.append(profileName);
|
||||||
builder.append(fromSpan);
|
builder.append(fromSpan);
|
||||||
} else {
|
} else {
|
||||||
|
@ -8,6 +8,7 @@ import android.content.Intent;
|
|||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.os.Build.VERSION;
|
import android.os.Build.VERSION;
|
||||||
import android.os.Build.VERSION_CODES;
|
import android.os.Build.VERSION_CODES;
|
||||||
|
import android.support.annotation.RequiresApi;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
@ -42,7 +43,7 @@ public class DynamicLanguage {
|
|||||||
return currentLocale;
|
return currentLocale;
|
||||||
}
|
}
|
||||||
|
|
||||||
@TargetApi(VERSION_CODES.JELLY_BEAN_MR1)
|
@RequiresApi(VERSION_CODES.JELLY_BEAN_MR1)
|
||||||
public static int getLayoutDirection(Context context) {
|
public static int getLayoutDirection(Context context) {
|
||||||
Configuration configuration = context.getResources().getConfiguration();
|
Configuration configuration = context.getResources().getConfiguration();
|
||||||
return configuration.getLayoutDirection();
|
return configuration.getLayoutDirection();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user