Do not use View.getLayoutDirection().

This value doesn't populate until after the first layout pass. Instead,
it appears to be safer to just read it from the Configuration.
This commit is contained in:
Greyson Parrelli
2021-02-11 10:41:40 -05:00
committed by GitHub
parent 432a732e7c
commit 2a3f85008b
13 changed files with 68 additions and 35 deletions

View File

@@ -60,6 +60,7 @@ import org.thoughtcrime.securesms.util.AsynchronousCallback;
import org.thoughtcrime.securesms.util.DateUtils;
import org.thoughtcrime.securesms.util.FeatureFlags;
import org.thoughtcrime.securesms.util.LifecycleCursorWrapper;
import org.thoughtcrime.securesms.util.ViewUtil;
import org.thoughtcrime.securesms.util.views.LearnMoreTextView;
import org.thoughtcrime.securesms.util.views.SimpleProgressDialog;
import org.thoughtcrime.securesms.wallpaper.ChatWallpaperActivity;
@@ -261,8 +262,8 @@ public class ManageGroupFragment extends LoggingFragment {
threadPhotoRailView.setListener(mediaRecord ->
startActivityForResult(MediaPreviewActivity.intentFromMediaRecord(context,
mediaRecord,
ViewCompat.getLayoutDirection(threadPhotoRailView) == ViewCompat.LAYOUT_DIRECTION_LTR),
RETURN_FROM_MEDIA));
ViewUtil.isLtr(threadPhotoRailView)),
RETURN_FROM_MEDIA));
groupLinkCard.setVisibility(vs.getGroupRecipient().requireGroupId().isV2() ? View.VISIBLE : View.GONE);
});