From 2304670d3aa5d94d95eb8c8df32827b1e60d8489 Mon Sep 17 00:00:00 2001 From: malinajirka Date: Fri, 22 Jun 2018 13:20:36 +0200 Subject: [PATCH 01/10] Replace Volley with Glide in EditPostSettingsFragment --- .../ui/posts/EditPostSettingsFragment.java | 76 ++++++++++--------- .../layout/edit_post_settings_fragment.xml | 5 +- WordPress/src/main/res/values/strings.xml | 1 + 3 files changed, 44 insertions(+), 38 deletions(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostSettingsFragment.java b/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostSettingsFragment.java index 3f07136db09a..5dcc80589f31 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostSettingsFragment.java +++ b/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostSettingsFragment.java @@ -9,7 +9,6 @@ import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; -import android.support.v7.app.AppCompatActivity; import android.support.v7.view.menu.MenuPopupHelper; import android.support.v7.widget.CardView; import android.support.v7.widget.PopupMenu; @@ -21,6 +20,8 @@ import android.view.View; import android.view.ViewGroup; import android.widget.Button; +import android.widget.ImageView; +import android.widget.ImageView.ScaleType; import android.widget.LinearLayout; import android.widget.TextView; @@ -39,6 +40,7 @@ import org.wordpress.android.R; import org.wordpress.android.WordPress; import org.wordpress.android.fluxc.Dispatcher; +import org.wordpress.android.fluxc.action.TaxonomyAction; import org.wordpress.android.fluxc.generated.SiteActionBuilder; import org.wordpress.android.fluxc.generated.TaxonomyActionBuilder; import org.wordpress.android.fluxc.model.MediaModel; @@ -54,6 +56,7 @@ import org.wordpress.android.fluxc.store.TaxonomyStore; import org.wordpress.android.fluxc.store.TaxonomyStore.OnTaxonomyChanged; import org.wordpress.android.ui.ActivityLauncher; +import org.wordpress.android.ui.ImageManager; import org.wordpress.android.ui.RequestCodes; import org.wordpress.android.ui.media.MediaBrowserType; import org.wordpress.android.ui.posts.PostDatePickerDialogFragment.PickerDialogType; @@ -69,8 +72,6 @@ import org.wordpress.android.util.PhotonUtils; import org.wordpress.android.util.SiteUtils; import org.wordpress.android.util.ToastUtils; -import org.wordpress.android.util.WPMediaUtils; -import org.wordpress.android.widgets.WPNetworkImageView; import java.lang.reflect.Field; import java.lang.reflect.Method; @@ -112,7 +113,7 @@ public class EditPostSettingsFragment extends Fragment { private TextView mPostFormatTextView; private TextView mPasswordTextView; private TextView mPublishDateTextView; - private WPNetworkImageView mFeaturedImageView; + private ImageView mFeaturedImageView; private Button mFeaturedImageButton; private PostLocation mPostLocation; @@ -124,6 +125,7 @@ public class EditPostSettingsFragment extends Fragment { @Inject MediaStore mMediaStore; @Inject TaxonomyStore mTaxonomyStore; @Inject Dispatcher mDispatcher; + @Inject ImageManager mImageManager; interface EditPostActivityHook { @@ -210,26 +212,27 @@ public void onDestroy() { } @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, + @Nullable Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.edit_post_settings_fragment, container, false); if (rootView == null) { return null; } - mExcerptTextView = (TextView) rootView.findViewById(R.id.post_excerpt); - mSlugTextView = (TextView) rootView.findViewById(R.id.post_slug); - mLocationTextView = (TextView) rootView.findViewById(R.id.post_location); - mCategoriesTextView = (TextView) rootView.findViewById(R.id.post_categories); - mTagsTextView = (TextView) rootView.findViewById(R.id.post_tags); - mStatusTextView = (TextView) rootView.findViewById(R.id.post_status); - mPostFormatTextView = (TextView) rootView.findViewById(R.id.post_format); - mPasswordTextView = (TextView) rootView.findViewById(R.id.post_password); - mPublishDateTextView = (TextView) rootView.findViewById(R.id.publish_date); + mExcerptTextView = rootView.findViewById(R.id.post_excerpt); + mSlugTextView = rootView.findViewById(R.id.post_slug); + mLocationTextView = rootView.findViewById(R.id.post_location); + mCategoriesTextView = rootView.findViewById(R.id.post_categories); + mTagsTextView = rootView.findViewById(R.id.post_tags); + mStatusTextView = rootView.findViewById(R.id.post_status); + mPostFormatTextView = rootView.findViewById(R.id.post_format); + mPasswordTextView = rootView.findViewById(R.id.post_password); + mPublishDateTextView = rootView.findViewById(R.id.publish_date); - mFeaturedImageView = (WPNetworkImageView) rootView.findViewById(R.id.post_featured_image); - mFeaturedImageButton = (Button) rootView.findViewById(R.id.post_add_featured_image_button); - CardView featuredImageCardView = (CardView) rootView.findViewById(R.id.post_featured_image_card_view); + mFeaturedImageView = rootView.findViewById(R.id.post_featured_image); + mFeaturedImageButton = rootView.findViewById(R.id.post_add_featured_image_button); + CardView featuredImageCardView = rootView.findViewById(R.id.post_featured_image_card_view); if (AppPrefs.isVisualEditorEnabled() || AppPrefs.isAztecEditorEnabled()) { registerForContextMenu(mFeaturedImageView); @@ -249,7 +252,7 @@ public void onClick(View view) { featuredImageCardView.setVisibility(View.GONE); } - mExcerptContainer = (LinearLayout) rootView.findViewById(R.id.post_excerpt_container); + mExcerptContainer = rootView.findViewById(R.id.post_excerpt_container); mExcerptContainer.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { @@ -257,7 +260,7 @@ public void onClick(View view) { } }); - final LinearLayout slugContainer = (LinearLayout) rootView.findViewById(R.id.post_slug_container); + final LinearLayout slugContainer = rootView.findViewById(R.id.post_slug_container); slugContainer.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { @@ -265,7 +268,7 @@ public void onClick(View view) { } }); - final LinearLayout locationContainer = (LinearLayout) rootView.findViewById(R.id.post_location_container); + final LinearLayout locationContainer = rootView.findViewById(R.id.post_location_container); locationContainer.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { @@ -273,7 +276,7 @@ public void onClick(View view) { } }); - mCategoriesContainer = (LinearLayout) rootView.findViewById(R.id.post_categories_container); + mCategoriesContainer = rootView.findViewById(R.id.post_categories_container); mCategoriesContainer.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { @@ -281,7 +284,7 @@ public void onClick(View view) { } }); - mTagsContainer = (LinearLayout) rootView.findViewById(R.id.post_tags_container); + mTagsContainer = rootView.findViewById(R.id.post_tags_container); mTagsContainer.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { @@ -289,7 +292,7 @@ public void onClick(View view) { } }); - final LinearLayout statusContainer = (LinearLayout) rootView.findViewById(R.id.post_status_container); + final LinearLayout statusContainer = rootView.findViewById(R.id.post_status_container); statusContainer.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { @@ -297,7 +300,7 @@ public void onClick(View view) { } }); - mFormatContainer = (LinearLayout) rootView.findViewById(R.id.post_format_container); + mFormatContainer = rootView.findViewById(R.id.post_format_container); mFormatContainer.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { @@ -305,7 +308,7 @@ public void onClick(View view) { } }); - final LinearLayout passwordContainer = (LinearLayout) rootView.findViewById(R.id.post_password_container); + final LinearLayout passwordContainer = rootView.findViewById(R.id.post_password_container); passwordContainer.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { @@ -313,7 +316,7 @@ public void onClick(View view) { } }); - final LinearLayout publishDateContainer = (LinearLayout) rootView.findViewById(R.id.publish_date_container); + final LinearLayout publishDateContainer = rootView.findViewById(R.id.publish_date_container); publishDateContainer.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { @@ -511,7 +514,7 @@ private void showStatusDialog() { } int index = getCurrentPostStatusIndex(); - FragmentManager fm = ((AppCompatActivity) getActivity()).getSupportFragmentManager(); + FragmentManager fm = getActivity().getSupportFragmentManager(); PostSettingsListDialogFragment fragment = PostSettingsListDialogFragment.newInstance(DialogType.POST_STATUS, index); fragment.show(fm, PostSettingsListDialogFragment.TAG); @@ -533,7 +536,7 @@ private void showPostFormatDialog() { } } - FragmentManager fm = ((AppCompatActivity) getActivity()).getSupportFragmentManager(); + FragmentManager fm = getActivity().getSupportFragmentManager(); PostSettingsListDialogFragment fragment = PostSettingsListDialogFragment.newInstance(DialogType.POST_FORMAT, checkedIndex); fragment.show(fm, PostSettingsListDialogFragment.TAG); @@ -564,7 +567,7 @@ private void showPostDateSelectionDialog() { Calendar calendar = getCurrentPublishDateAsCalendar(); PostDatePickerDialogFragment fragment = PostDatePickerDialogFragment.newInstance(PickerDialogType.DATE_PICKER, getPost(), calendar); - FragmentManager fm = ((AppCompatActivity) getActivity()).getSupportFragmentManager(); + FragmentManager fm = getActivity().getSupportFragmentManager(); fragment.show(fm, PostDatePickerDialogFragment.TAG_DATE); } @@ -576,7 +579,7 @@ private void showPostTimeSelectionDialog() { Calendar calendar = getCurrentPublishDateAsCalendar(); PostDatePickerDialogFragment fragment = PostDatePickerDialogFragment.newInstance(PickerDialogType.TIME_PICKER, getPost(), calendar); - FragmentManager fm = ((AppCompatActivity) getActivity()).getSupportFragmentManager(); + FragmentManager fm = getActivity().getSupportFragmentManager(); fragment.show(fm, PostDatePickerDialogFragment.TAG_TIME); } @@ -762,8 +765,11 @@ private int getCurrentPostStatusIndex() { return 2; case PRIVATE: return 3; + case TRASHED: + case UNKNOWN: + case PUBLISHED: + case SCHEDULED: default: - // PUBLISHED, SCHEDULED, UNKNOWN return 0; } } @@ -856,7 +862,7 @@ private void updateFeaturedImageView() { mediaUri = PhotonUtils.getPhotonImageUrl(mediaUri, size, 0); } - WPMediaUtils.loadNetworkImage(mediaUri, mFeaturedImageView); + mImageManager.load(mFeaturedImageView, mediaUri, null, ScaleType.FIT_CENTER); } private void launchFeaturedMediaPicker() { @@ -899,10 +905,8 @@ public void onTaxonomyChanged(OnTaxonomyChanged event) { AppLog.e(T.POSTS, "An error occurred while updating taxonomy with type: " + event.error.type); return; } - switch (event.causeOfChange) { - case FETCH_CATEGORIES: - updateCategoriesTextView(); - break; + if (event.causeOfChange == TaxonomyAction.FETCH_CATEGORIES) { + updateCategoriesTextView(); } } diff --git a/WordPress/src/main/res/layout/edit_post_settings_fragment.xml b/WordPress/src/main/res/layout/edit_post_settings_fragment.xml index 87b1347cb697..290665eac04b 100644 --- a/WordPress/src/main/res/layout/edit_post_settings_fragment.xml +++ b/WordPress/src/main/res/layout/edit_post_settings_fragment.xml @@ -140,13 +140,14 @@ android:layout_height="wrap_content" android:text="@string/post_settings_set_featured_image"/> - diff --git a/WordPress/src/main/res/values/strings.xml b/WordPress/src/main/res/values/strings.xml index 9099fb0a64cb..e4ac04ef9b1a 100644 --- a/WordPress/src/main/res/values/strings.xml +++ b/WordPress/src/main/res/values/strings.xml @@ -2118,6 +2118,7 @@ plugin banner plugin logo featured image + featured image play featured video Play video delete From d24c947c4e66aac119b751673a7bde10e292b249 Mon Sep 17 00:00:00 2001 From: malinajirka Date: Fri, 29 Jun 2018 17:25:54 +0200 Subject: [PATCH 02/10] Add fallthrough comment to switch --- .../wordpress/android/ui/posts/EditPostSettingsFragment.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostSettingsFragment.java b/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostSettingsFragment.java index 5dcc80589f31..a4f6d47e6740 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostSettingsFragment.java +++ b/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostSettingsFragment.java @@ -766,9 +766,13 @@ private int getCurrentPostStatusIndex() { case PRIVATE: return 3; case TRASHED: + // fallthrough case UNKNOWN: + // fallthrough case PUBLISHED: + // fallthrough case SCHEDULED: + // fallthrough default: return 0; } From acc9d22acac6855651572b1ef05f30e1a380c616 Mon Sep 17 00:00:00 2001 From: malinajirka Date: Tue, 3 Jul 2018 09:46:08 +0200 Subject: [PATCH 03/10] Add placeholder and error images to post feature image preview --- .../wordpress/android/ui/posts/EditPostSettingsFragment.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostSettingsFragment.java b/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostSettingsFragment.java index a4f6d47e6740..2002104a4205 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostSettingsFragment.java +++ b/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostSettingsFragment.java @@ -56,7 +56,6 @@ import org.wordpress.android.fluxc.store.TaxonomyStore; import org.wordpress.android.fluxc.store.TaxonomyStore.OnTaxonomyChanged; import org.wordpress.android.ui.ActivityLauncher; -import org.wordpress.android.ui.ImageManager; import org.wordpress.android.ui.RequestCodes; import org.wordpress.android.ui.media.MediaBrowserType; import org.wordpress.android.ui.posts.PostDatePickerDialogFragment.PickerDialogType; @@ -72,6 +71,8 @@ import org.wordpress.android.util.PhotonUtils; import org.wordpress.android.util.SiteUtils; import org.wordpress.android.util.ToastUtils; +import org.wordpress.android.util.image.ImageManager; +import org.wordpress.android.util.image.ImageType; import java.lang.reflect.Field; import java.lang.reflect.Method; @@ -866,7 +867,7 @@ private void updateFeaturedImageView() { mediaUri = PhotonUtils.getPhotonImageUrl(mediaUri, size, 0); } - mImageManager.load(mFeaturedImageView, mediaUri, null, ScaleType.FIT_CENTER); + mImageManager.load(mFeaturedImageView, ImageType.PHOTO, mediaUri, ScaleType.FIT_CENTER); } private void launchFeaturedMediaPicker() { From a2ef20b22ef923371e29115d8fb8ff242b11d1ae Mon Sep 17 00:00:00 2001 From: malinajirka Date: Tue, 3 Jul 2018 09:55:58 +0200 Subject: [PATCH 04/10] WPMediaUtils cleanup --- .../wordpress/android/util/WPMediaUtils.java | 43 ++++++------------- 1 file changed, 13 insertions(+), 30 deletions(-) diff --git a/WordPress/src/main/java/org/wordpress/android/util/WPMediaUtils.java b/WordPress/src/main/java/org/wordpress/android/util/WPMediaUtils.java index 1c25cda114a9..88cce08e8ca2 100644 --- a/WordPress/src/main/java/org/wordpress/android/util/WPMediaUtils.java +++ b/WordPress/src/main/java/org/wordpress/android/util/WPMediaUtils.java @@ -18,8 +18,6 @@ import android.view.ContextThemeWrapper; import android.view.ViewConfiguration; -import com.android.volley.toolbox.NetworkImageView; - import org.wordpress.android.R; import org.wordpress.android.analytics.AnalyticsTracker; import org.wordpress.android.fluxc.model.MediaModel; @@ -28,7 +26,6 @@ import org.wordpress.android.ui.RequestCodes; import org.wordpress.android.ui.prefs.AppPrefs; import org.wordpress.android.util.AppLog.T; -import org.wordpress.android.widgets.WPNetworkImageView; import org.wordpress.passcodelock.AppLockManager; import java.io.File; @@ -205,8 +202,19 @@ String getErrorMessage(final Context context, final MediaModel media, final Medi return context.getString(R.string.error_media_parse_error); case GENERIC_ERROR: return context.getString(R.string.error_generic_error); + case EXCEEDS_SITE_SPACE_QUOTA_LIMIT: + return null; + case NOT_AUTHENTICATED: + return null; + case INVALID_ID: + return null; + case NULL_MEDIA_ARG: + return null; + case MALFORMED_MEDIA_ARG: + return null; + case DB_QUERY_FAILURE: + return null; } - return null; } @@ -378,32 +386,6 @@ public static boolean canDeleteMedia(MediaModel mediaModel) { return state == null || (!state.equalsIgnoreCase("uploading") && !state.equalsIgnoreCase("deleted")); } - /** - * Loads the given network image URL into the {@link NetworkImageView}. - */ - public static void loadNetworkImage(String imageUrl, WPNetworkImageView imageView) { - if (imageUrl != null) { - Uri uri = Uri.parse(imageUrl); - String filepath = uri.getLastPathSegment(); - - // re-use the default background drawable as error image for now. - // See: https://github.com/wordpress-mobile/WordPress-Android/pull/6295#issuecomment-315129759 - imageView.setErrorImageResId(R.drawable.media_item_background); - - // default image while downloading - imageView.setDefaultImageResId(R.drawable.media_item_background); - - if (MediaUtils.isValidImage(filepath)) { - imageView.setTag(imageUrl); - imageView.setImageUrl(imageUrl, WPNetworkImageView.ImageType.PHOTO); - } else { - imageView.setImageResource(R.drawable.media_item_background); - } - } else { - imageView.setImageResource(0); - } - } - /** * Returns a poster (thumbnail) URL given a VideoPress video URL * @@ -440,6 +422,7 @@ public void onScanCompleted(String path, Uri uri) { /* * returns true if the current user has permission to upload new media to the passed site */ + @SuppressWarnings("SimplifiableIfStatement") public static boolean currentUserCanUploadMedia(@NonNull SiteModel site) { if (site.isUsingWpComRestApi()) { return site.getHasCapabilityUploadFiles(); From 8eaf4f5d098354e57699da34a64342df28ad5854 Mon Sep 17 00:00:00 2001 From: malinajirka Date: Tue, 3 Jul 2018 10:03:01 +0200 Subject: [PATCH 05/10] EditPostSettings switch cleanup --- .../android/ui/posts/EditPostSettingsFragment.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostSettingsFragment.java b/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostSettingsFragment.java index 2002104a4205..e5caf9435852 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostSettingsFragment.java +++ b/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostSettingsFragment.java @@ -37,6 +37,7 @@ import org.apache.commons.text.StringEscapeUtils; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; +import org.wordpress.android.BuildConfig; import org.wordpress.android.R; import org.wordpress.android.WordPress; import org.wordpress.android.fluxc.Dispatcher; @@ -767,16 +768,15 @@ private int getCurrentPostStatusIndex() { case PRIVATE: return 3; case TRASHED: - // fallthrough case UNKNOWN: - // fallthrough case PUBLISHED: - // fallthrough case SCHEDULED: - // fallthrough - default: return 0; } + if (BuildConfig.DEBUG) { + throw new IllegalStateException("Missing switch case."); + } + return 0; } // Post Format Helpers From 94b4bcf78f6035a8fb3ecd83880a44756654b72d Mon Sep 17 00:00:00 2001 From: malinajirka Date: Tue, 10 Jul 2018 11:33:21 +0200 Subject: [PATCH 06/10] Simplify if statement in WPMediaUtils --- .../java/org/wordpress/android/util/WPMediaUtils.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/WordPress/src/main/java/org/wordpress/android/util/WPMediaUtils.java b/WordPress/src/main/java/org/wordpress/android/util/WPMediaUtils.java index 88cce08e8ca2..3f786315b361 100644 --- a/WordPress/src/main/java/org/wordpress/android/util/WPMediaUtils.java +++ b/WordPress/src/main/java/org/wordpress/android/util/WPMediaUtils.java @@ -422,14 +422,10 @@ public void onScanCompleted(String path, Uri uri) { /* * returns true if the current user has permission to upload new media to the passed site */ - @SuppressWarnings("SimplifiableIfStatement") public static boolean currentUserCanUploadMedia(@NonNull SiteModel site) { - if (site.isUsingWpComRestApi()) { - return site.getHasCapabilityUploadFiles(); - } else { - // self-hosted sites don't have capabilities so always return true - return true; - } + boolean isSelfHosted = !site.isUsingWpComRestApi(); + // self-hosted sites don't have capabilities so always return true + return isSelfHosted || site.getHasCapabilityUploadFiles(); } public static boolean currentUserCanDeleteMedia(@NonNull SiteModel site) { From 101e325a7f2db214974947ef9fc5df2b7cc3071a Mon Sep 17 00:00:00 2001 From: malinajirka Date: Tue, 10 Jul 2018 11:36:38 +0200 Subject: [PATCH 07/10] Refactor switch in EditPostSettingFragment --- .../wordpress/android/ui/posts/EditPostSettingsFragment.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostSettingsFragment.java b/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostSettingsFragment.java index e5caf9435852..b654ab684493 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostSettingsFragment.java +++ b/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostSettingsFragment.java @@ -37,7 +37,6 @@ import org.apache.commons.text.StringEscapeUtils; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; -import org.wordpress.android.BuildConfig; import org.wordpress.android.R; import org.wordpress.android.WordPress; import org.wordpress.android.fluxc.Dispatcher; @@ -773,9 +772,6 @@ private int getCurrentPostStatusIndex() { case SCHEDULED: return 0; } - if (BuildConfig.DEBUG) { - throw new IllegalStateException("Missing switch case."); - } return 0; } From 2bacc14aea0c35311a6fde725abf05bc7c0b14b8 Mon Sep 17 00:00:00 2001 From: malinajirka Date: Tue, 10 Jul 2018 11:41:09 +0200 Subject: [PATCH 08/10] Fix string duplication --- WordPress/src/main/res/layout/edit_post_settings_fragment.xml | 2 +- WordPress/src/main/res/values/strings.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/WordPress/src/main/res/layout/edit_post_settings_fragment.xml b/WordPress/src/main/res/layout/edit_post_settings_fragment.xml index 290665eac04b..cc21a32517f4 100644 --- a/WordPress/src/main/res/layout/edit_post_settings_fragment.xml +++ b/WordPress/src/main/res/layout/edit_post_settings_fragment.xml @@ -146,7 +146,7 @@ android:layout_height="wrap_content" android:maxHeight="@dimen/post_settings_featured_image_height_max" android:minHeight="@dimen/post_settings_featured_image_height_min" - android:contentDescription="@string/post_settings_featured_desc" + android:contentDescription="@string/featured_image_desc" android:adjustViewBounds="true" android:visibility="gone"/> diff --git a/WordPress/src/main/res/values/strings.xml b/WordPress/src/main/res/values/strings.xml index 3b66e65625d8..2f5bd40658d4 100644 --- a/WordPress/src/main/res/values/strings.xml +++ b/WordPress/src/main/res/values/strings.xml @@ -2113,6 +2113,7 @@ Change photo + featured image check mark %s\'s profile picture remove %s @@ -2132,7 +2133,6 @@ plugin banner plugin logo featured image - featured image play featured video Play video delete From aa63ef52813575d71bf0ad86d9d69b38a0772054 Mon Sep 17 00:00:00 2001 From: malinajirka Date: Tue, 10 Jul 2018 11:41:38 +0200 Subject: [PATCH 09/10] Fix string duplication --- WordPress/src/main/res/layout/post_cardview.xml | 2 +- WordPress/src/main/res/values/strings.xml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/WordPress/src/main/res/layout/post_cardview.xml b/WordPress/src/main/res/layout/post_cardview.xml index 109bfcca3b5c..94c7b663745d 100644 --- a/WordPress/src/main/res/layout/post_cardview.xml +++ b/WordPress/src/main/res/layout/post_cardview.xml @@ -23,7 +23,7 @@ android:layout_height="@dimen/postlist_featured_image_height" android:scaleType="centerCrop" android:visibility="gone" - android:contentDescription="@string/post_cardview_featured_desc" + android:contentDescription="@string/featured_image_desc" tools:visibility="visible" /> pick from WordPress media plugin banner plugin logo - featured image play featured video Play video delete From 9a6e64324161dfb4d09a2d61de5b896d6ddd2b38 Mon Sep 17 00:00:00 2001 From: malinajirka Date: Tue, 10 Jul 2018 11:42:58 +0200 Subject: [PATCH 10/10] Revert switch statement refactoring --- .../org/wordpress/android/util/WPMediaUtils.java | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/WordPress/src/main/java/org/wordpress/android/util/WPMediaUtils.java b/WordPress/src/main/java/org/wordpress/android/util/WPMediaUtils.java index 3f786315b361..28a981bec2e9 100644 --- a/WordPress/src/main/java/org/wordpress/android/util/WPMediaUtils.java +++ b/WordPress/src/main/java/org/wordpress/android/util/WPMediaUtils.java @@ -202,18 +202,6 @@ String getErrorMessage(final Context context, final MediaModel media, final Medi return context.getString(R.string.error_media_parse_error); case GENERIC_ERROR: return context.getString(R.string.error_generic_error); - case EXCEEDS_SITE_SPACE_QUOTA_LIMIT: - return null; - case NOT_AUTHENTICATED: - return null; - case INVALID_ID: - return null; - case NULL_MEDIA_ARG: - return null; - case MALFORMED_MEDIA_ARG: - return null; - case DB_QUERY_FAILURE: - return null; } return null; }