Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up after legacy editor #10565

Merged
merged 4 commits into from
Oct 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2591,11 +2591,6 @@ private void fillContentEditorFields() {
// Needed blog settings needed by the editor
mEditorFragment.setFeaturedImageSupported(mSite.isFeaturedImageSupported());

// Set up the placeholder text
mEditorFragment.setContentPlaceholder(getString(R.string.editor_content_placeholder));
mEditorFragment.setTitlePlaceholder(getString(mIsPage ? R.string.editor_page_title_placeholder
: R.string.editor_post_title_placeholder));

// Set post title and content
if (mPost != null) {
// don't avoid calling setContent() for GutenbergEditorFragment so RN gets initialized
Expand Down Expand Up @@ -3874,9 +3869,6 @@ public void onTrackableEvent(TrackableEvent event) throws IllegalArgumentExcepti
currentStat = Stat.EDITOR_TAPPED_LINK_ADDED;
hidePhotoPicker();
break;
case LINK_REMOVED_BUTTON_TAPPED:
currentStat = Stat.EDITOR_TAPPED_LINK_REMOVED;
break;
case LIST_BUTTON_TAPPED:
currentStat = Stat.EDITOR_TAPPED_LIST;
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import androidx.appcompat.widget.AppCompatEditText;

/**
* WPEditText which notifies when text is cut, copied, or pasted.
* EditText which notifies when text is cut, copied, or pasted.
*/
public class ContextMenuEditText extends AppCompatEditText {
public interface OnContextMenuListener {
Expand Down Expand Up @@ -63,7 +63,7 @@ public boolean onTextContextMenuItem(int id) {
}

/**
* Text cut from WPEditText.
* Text cut from EditText.
*/
public void onCut() {
if (mOnContextMenuListener != null) {
Expand All @@ -72,7 +72,7 @@ public void onCut() {
}

/**
* Text copied from WPEditText.
* Text copied from EditText.
*/
public void onCopy() {
if (mOnContextMenuListener != null) {
Expand All @@ -81,7 +81,7 @@ public void onCopy() {
}

/**
* Text pasted into WPEditText.
* Text pasted into EditText.
*/
public void onPaste() {
if (mOnContextMenuListener != null) {
Expand Down

This file was deleted.

7 changes: 5 additions & 2 deletions WordPress/src/main/res/layout/post_settings_input_dialog.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<org.wordpress.android.util.widgets.WPEditText
<EditText
android:id="@+id/post_settings_input_dialog_edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="6"
android:inputType="text"
android:paddingBottom="@dimen/margin_large"
android:layout_marginEnd="@dimen/post_settings_input_dialog_edit_text_side_margin"
android:layout_marginStart="@dimen/post_settings_input_dialog_edit_text_side_margin" />
android:layout_marginStart="@dimen/post_settings_input_dialog_edit_text_side_margin"
android:importantForAutofill="no"
tools:targetApi="O"/>

<org.wordpress.android.widgets.WPTextView
android:id="@+id/post_settings_input_dialog_hint"
Expand Down
3 changes: 0 additions & 3 deletions WordPress/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1201,9 +1201,6 @@
<string name="reader">Reader</string>

<!-- editor -->
<string name="editor_post_title_placeholder">Post Title</string>
<string name="editor_page_title_placeholder">Page Title</string>
<string name="editor_content_placeholder">Share your story here…</string>
<string name="editor_post_saved_online">Post saved online</string>
<string name="editor_post_saved_locally">Post saved on device</string>
<string name="editor_draft_saved_online">Draft saved online</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,7 @@ public enum Stat {
EDITOR_SESSION_END,
EDITOR_PUBLISHED_POST,
EDITOR_SAVED_DRAFT,
EDITOR_DISCARDED_CHANGES,
EDITOR_DISCARDED_CHANGES_UNDO,
EDITOR_EDITED_IMAGE, // Visual editor only
EDITOR_HYBRID_ENABLED, // Visual editor only
EDITOR_HYBRID_TOGGLED_OFF, // Visual editor only
EDITOR_HYBRID_TOGGLED_ON, // Visual editor only
EDITOR_UPLOAD_MEDIA_FAILED, // Visual editor only
EDITOR_UPLOAD_MEDIA_RETRIED, // Visual editor only
EDITOR_TAPPED_BLOCKQUOTE,
Expand All @@ -183,7 +178,6 @@ public enum Stat {
EDITOR_TAPPED_IMAGE,
EDITOR_TAPPED_ITALIC,
EDITOR_TAPPED_LINK_ADDED,
EDITOR_TAPPED_LINK_REMOVED, // Visual editor only
EDITOR_TAPPED_LIST,
EDITOR_TAPPED_LIST_ORDERED, // Visual editor only
EDITOR_TAPPED_LIST_UNORDERED, // Visual editor only
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,6 @@ public void track(AnalyticsTracker.Stat stat, Map<String, ?> properties) {
case EDITOR_TAPPED_LINK_ADDED:
predefinedEventProperties.put("button", "link");
break;
case EDITOR_TAPPED_LINK_REMOVED:
predefinedEventProperties.put("button", "unlink");
break;
case EDITOR_TAPPED_LIST:
predefinedEventProperties.put("button", "list");
break;
Expand Down Expand Up @@ -708,18 +705,8 @@ public static String getEventNameForStat(AnalyticsTracker.Stat stat) {
return "editor_post_created";
case EDITOR_SAVED_DRAFT:
return "editor_draft_saved";
case EDITOR_DISCARDED_CHANGES:
return "editor_discarded_changes";
case EDITOR_DISCARDED_CHANGES_UNDO:
return "editor_discarded_changes_undo";
case EDITOR_EDITED_IMAGE:
return "editor_image_edited";
case EDITOR_HYBRID_ENABLED:
return "editor_hybrid_enabled";
case EDITOR_HYBRID_TOGGLED_OFF:
return "editor_hybrid_toggled_off";
case EDITOR_HYBRID_TOGGLED_ON:
return "editor_hybrid_toggled_on";
case EDITOR_AZTEC_ENABLED:
return "editor_aztec_enabled";
case EDITOR_AZTEC_TOGGLED_OFF:
Expand Down Expand Up @@ -834,8 +821,6 @@ public static String getEventNameForStat(AnalyticsTracker.Stat stat) {
return "editor_button_tapped";
case EDITOR_TAPPED_LIST_ORDERED:
return "editor_button_tapped";
case EDITOR_TAPPED_LINK_REMOVED:
return "editor_button_tapped";
case EDITOR_TAPPED_LIST_UNORDERED:
return "editor_button_tapped";
case EDITOR_TAPPED_ALIGN_LEFT:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1155,14 +1155,6 @@ public void removeMedia(String mediaId) {
mContent.removeMedia(MediaPredicate.getLocalMediaIdPredicate(mediaId));
}

@Override
public void setTitlePlaceholder(CharSequence placeholderText) {
}

@Override
public void setContentPlaceholder(CharSequence placeholderText) {
}

@Override
public boolean showSavingProgressDialogIfNeeded() {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ public class EditorFragmentNotAddedException extends Exception {
// This was required since Aztec Visual->HTML can slightly change the content of the HTML. See #692 for details.
public abstract void removeAllFailedMediaUploads();
public abstract void removeMedia(String mediaId);
public abstract void setTitlePlaceholder(CharSequence text);
public abstract void setContentPlaceholder(CharSequence text);
public abstract boolean showSavingProgressDialogIfNeeded();
public abstract boolean hideSavingProgressDialog();

Expand Down Expand Up @@ -216,7 +214,6 @@ public enum TrackableEvent {
IMAGE_EDITED,
ITALIC_BUTTON_TAPPED,
LINK_ADDED_BUTTON_TAPPED,
LINK_REMOVED_BUTTON_TAPPED,
LIST_BUTTON_TAPPED,
LIST_ORDERED_BUTTON_TAPPED,
LIST_UNORDERED_BUTTON_TAPPED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -712,14 +712,6 @@ public void removeAllFailedMediaUploads() {
public void removeMedia(String mediaId) {
}

@Override
public void setTitlePlaceholder(CharSequence placeholderText) {
}

@Override
public void setContentPlaceholder(CharSequence placeholderText) {
}

// Getting the content from the HTML editor can take time and the UI seems to be unresponsive.
// Show a progress dialog for now. Ref: https://github.com/wordpress-mobile/gutenberg-mobile/issues/713
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@ public void removeMedia(String mediaId) {

}

@Override
public void setTitlePlaceholder(CharSequence text) {

}

@Override
public LiveData<Editable> getTitleOrContentChanged() {
return null;
Expand All @@ -120,10 +115,5 @@ public boolean showSavingProgressDialogIfNeeded() {
public boolean hideSavingProgressDialog() {
return false;
}

@Override
public void setContentPlaceholder(CharSequence text) {

}
}
}

This file was deleted.