Skip to content

Commit

Permalink
🐛 Fix Android X compatibility (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
rkbhochalya authored Jan 24, 2021
1 parent 3d8a91b commit 8b77539
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,13 @@ private void displaySnackbar(View view, ReadableMap options, final Callback call
}
View snackbarView = snackbar.getView();

TextView textView = (TextView) snackbarView.findViewById(android.support.design.R.id.snackbar_text);
textView.setMaxLines(numberOfLines);

if (rtl && Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
snackbarView.setLayoutDirection(View.LAYOUT_DIRECTION_RTL);
snackbarView.setTextDirection(View.TEXT_DIRECTION_RTL);
}

TextView snackbarText = snackbarView.findViewById(com.google.android.material.R.id.snackbar_text);
snackbarText.setMaxLines(numberOfLines);
snackbarText.setTextColor(textColor);

if (font != null) {
Expand Down

0 comments on commit 8b77539

Please sign in to comment.