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

Gutenberg/inject css on both page visible and page started and show correct title in web view #13122

Merged
Show file tree
Hide file tree
Changes from 2 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 @@ -24,7 +24,7 @@ public class WPGutenbergWebViewActivity extends GutenbergWebViewActivity {

public static final String ARG_USER_ID = "authenticated_user_id";
public static final String ARG_BLOCK_ID = "block_id";
public static final String ARG_BLOCK_NAME = "block_name";
public static final String ARG_BLOCK_TITLE = "block_title";
public static final String ARG_BLOCK_CONTENT = "block_content";

private boolean mIsJetpackSsoEnabled;
Expand Down Expand Up @@ -73,9 +73,9 @@ && getIntent().getExtras() != null) {

@Override
protected String getToolbarTitle() {
String blockName = getIntent().getExtras().getString(ARG_BLOCK_NAME);
if (blockName != null) {
return String.format(getString(R.string.menu_toolbar_title), blockName);
String blockTitle = getIntent().getExtras().getString(ARG_BLOCK_TITLE);
if (blockTitle != null) {
return String.format(getString(R.string.menu_toolbar_title), blockTitle);
}
return "";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,8 @@ public void gutenbergDidRequestUnsupportedBlockFallback(UnsupportedBlock unsuppo
openGutenbergWebViewActivity(
unsupportedBlock.getContent(),
unsupportedBlock.getId(),
unsupportedBlock.getName()
unsupportedBlock.getName(),
unsupportedBlock.getTitle()
);
}
},
Expand Down Expand Up @@ -357,7 +358,7 @@ public void run() {
return view;
}

private void openGutenbergWebViewActivity(String content, String blockId, String blockName) {
private void openGutenbergWebViewActivity(String content, String blockId, String blockName, String blockTitle) {
GutenbergWebViewAuthorizationData gutenbergWebViewAuthData =
getArguments().getParcelable(ARG_GUTENBERG_WEB_VIEW_AUTH_DATA);

Expand All @@ -367,7 +368,7 @@ private void openGutenbergWebViewActivity(String content, String blockId, String

Intent intent = new Intent(getActivity(), WPGutenbergWebViewActivity.class);
intent.putExtra(WPGutenbergWebViewActivity.ARG_BLOCK_ID, blockId);
intent.putExtra(WPGutenbergWebViewActivity.ARG_BLOCK_NAME, blockName);
intent.putExtra(WPGutenbergWebViewActivity.ARG_BLOCK_TITLE, blockTitle);
intent.putExtra(WPGutenbergWebViewActivity.ARG_BLOCK_CONTENT, content);
intent.putExtra(WPGutenbergWebViewActivity.ARG_GUTENBERG_WEB_VIEW_AUTH_DATA, gutenbergWebViewAuthData);

Expand Down