Fix #1131: Update min sdk version and remove redundant checks (#2608)

This commit is contained in:
Vivek Maskara 2019-03-16 17:51:51 +05:30 committed by Adam Jones
parent 900bd4ff2f
commit 6cbce9d283
8 changed files with 15 additions and 45 deletions

View file

@ -127,9 +127,7 @@ public class SpinnerLanguagesAdapter extends ArrayAdapter {
if (languageCodesList.get(position).isEmpty()) {
tvLanguage.setText(languageNamesList.get(position));
tvLanguage.setTextColor(Color.GRAY);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
tvLanguage.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
}
tvLanguage.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
} else {
tvLanguage.setText(
String.format("%s [%s]", languageNamesList.get(position), languageCodesList.get(position)));

View file

@ -567,9 +567,7 @@ public class UploadActivity extends BaseActivity implements UploadView, SimilarI
}
private void configureCategories() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
categoryFrameLayout.setLayoutDirection(View.LAYOUT_DIRECTION_LTR);
}
categoryFrameLayout.setLayoutDirection(View.LAYOUT_DIRECTION_LTR);
categoriesAdapter = new UploadCategoriesAdapterFactory(categoriesModel).create(new ArrayList<>());
categoriesList.setLayoutManager(new LinearLayoutManager(this));
categoriesList.setAdapter(categoriesAdapter);

View file

@ -33,7 +33,7 @@ public class UploadCategoriesRenderer extends Renderer<CategoryItem> {
protected void setUpView(View view) {
ButterKnife.bind(this, view);
Configuration config = getContext().getResources().getConfiguration();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 && config.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL) {
if (config.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL) {
checkedView.setLayoutDirection(View.LAYOUT_DIRECTION_LTR);
}
}